agim-cli 1.2.126 → 1.2.128

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 (170) hide show
  1. package/CHANGELOG.md +99 -1
  2. package/dist/core/llm/web-dispatcher.d.ts +9 -1
  3. package/dist/core/llm/web-dispatcher.d.ts.map +1 -1
  4. package/dist/core/llm/web-dispatcher.js +11 -3
  5. package/dist/core/llm/web-dispatcher.js.map +1 -1
  6. package/dist/web/public/assets/{a2a-DGmlA1kI.js → a2a-CbxNgf9H.js} +2 -2
  7. package/dist/web/public/assets/{a2a-DGmlA1kI.js.map → a2a-CbxNgf9H.js.map} +1 -1
  8. package/dist/web/public/assets/{activity-s8eXJqQ-.js → activity-C6r508cN.js} +2 -2
  9. package/dist/web/public/assets/{activity-s8eXJqQ-.js.map → activity-C6r508cN.js.map} +1 -1
  10. package/dist/web/public/assets/{admins-BSDr-HXb.js → admins-C0BJw6X9.js} +2 -2
  11. package/dist/web/public/assets/{admins-BSDr-HXb.js.map → admins-C0BJw6X9.js.map} +1 -1
  12. package/dist/web/public/assets/{agents-Dp4swPPC.js → agents-DOW1_NGT.js} +2 -2
  13. package/dist/web/public/assets/{agents-Dp4swPPC.js.map → agents-DOW1_NGT.js.map} +1 -1
  14. package/dist/web/public/assets/{approvals-BzShPdMC.js → approvals-CyPhYcGG.js} +2 -2
  15. package/dist/web/public/assets/{approvals-BzShPdMC.js.map → approvals-CyPhYcGG.js.map} +1 -1
  16. package/dist/web/public/assets/{arrow-up-B0EZtRDW.js → arrow-up-CZr2LH5e.js} +2 -2
  17. package/dist/web/public/assets/{arrow-up-B0EZtRDW.js.map → arrow-up-CZr2LH5e.js.map} +1 -1
  18. package/dist/web/public/assets/{asks-BQtIx6ky.js → asks-B6L3PSml.js} +2 -2
  19. package/dist/web/public/assets/{asks-BQtIx6ky.js.map → asks-B6L3PSml.js.map} +1 -1
  20. package/dist/web/public/assets/{audit-BDIEW7z9.js → audit-CCGCdw6P.js} +2 -2
  21. package/dist/web/public/assets/{audit-BDIEW7z9.js.map → audit-CCGCdw6P.js.map} +1 -1
  22. package/dist/web/public/assets/{bell-Dw3rtAnD.js → bell-OiL3Thk2.js} +2 -2
  23. package/dist/web/public/assets/{bell-Dw3rtAnD.js.map → bell-OiL3Thk2.js.map} +1 -1
  24. package/dist/web/public/assets/{bgjobs-DEQOeNl0.js → bgjobs-vhVtnLSx.js} +2 -2
  25. package/dist/web/public/assets/{bgjobs-DEQOeNl0.js.map → bgjobs-vhVtnLSx.js.map} +1 -1
  26. package/dist/web/public/assets/{brain-BqR8-Zwv.js → brain-n56pZ1TQ.js} +2 -2
  27. package/dist/web/public/assets/{brain-BqR8-Zwv.js.map → brain-n56pZ1TQ.js.map} +1 -1
  28. package/dist/web/public/assets/{briefcase-_b-XDwyU.js → briefcase-BscVfAjp.js} +2 -2
  29. package/dist/web/public/assets/{briefcase-_b-XDwyU.js.map → briefcase-BscVfAjp.js.map} +1 -1
  30. package/dist/web/public/assets/{chevron-right-DkURvNIb.js → chevron-right-trO6yoBr.js} +2 -2
  31. package/dist/web/public/assets/{chevron-right-DkURvNIb.js.map → chevron-right-trO6yoBr.js.map} +1 -1
  32. package/dist/web/public/assets/{circle-check-D0tRr1mi.js → circle-check-B_d7dBl5.js} +2 -2
  33. package/dist/web/public/assets/{circle-check-D0tRr1mi.js.map → circle-check-B_d7dBl5.js.map} +1 -1
  34. package/dist/web/public/assets/{circle-check-big-C737-DM7.js → circle-check-big-D6TvCoDM.js} +2 -2
  35. package/dist/web/public/assets/{circle-check-big-C737-DM7.js.map → circle-check-big-D6TvCoDM.js.map} +1 -1
  36. package/dist/web/public/assets/{circle-x-KWl9wiZn.js → circle-x-OcRzGLRb.js} +2 -2
  37. package/dist/web/public/assets/{circle-x-KWl9wiZn.js.map → circle-x-OcRzGLRb.js.map} +1 -1
  38. package/dist/web/public/assets/{confirm-dialog-CyTBb_Dj.js → confirm-dialog-DD1ZW1XE.js} +2 -2
  39. package/dist/web/public/assets/{confirm-dialog-CyTBb_Dj.js.map → confirm-dialog-DD1ZW1XE.js.map} +1 -1
  40. package/dist/web/public/assets/{data-table-Br_AhsiO.js → data-table-bhqK389v.js} +2 -2
  41. package/dist/web/public/assets/{data-table-Br_AhsiO.js.map → data-table-bhqK389v.js.map} +1 -1
  42. package/dist/web/public/assets/{dialog-ChaF-Zu5.js → dialog-D5BsJN2q.js} +2 -2
  43. package/dist/web/public/assets/{dialog-ChaF-Zu5.js.map → dialog-D5BsJN2q.js.map} +1 -1
  44. package/dist/web/public/assets/{download-B7FO0Y5B.js → download-CcO4RAuC.js} +2 -2
  45. package/dist/web/public/assets/{download-B7FO0Y5B.js.map → download-CcO4RAuC.js.map} +1 -1
  46. package/dist/web/public/assets/{email-DIEmIapc.js → email-Dy3UoyzF.js} +2 -2
  47. package/dist/web/public/assets/{email-DIEmIapc.js.map → email-Dy3UoyzF.js.map} +1 -1
  48. package/dist/web/public/assets/{empty-state-CP9D3-8U.js → empty-state-CwUKG8xX.js} +2 -2
  49. package/dist/web/public/assets/{empty-state-CP9D3-8U.js.map → empty-state-CwUKG8xX.js.map} +1 -1
  50. package/dist/web/public/assets/{external-link-Ba2-bs-3.js → external-link-wf5VhNXd.js} +2 -2
  51. package/dist/web/public/assets/{external-link-Ba2-bs-3.js.map → external-link-wf5VhNXd.js.map} +1 -1
  52. package/dist/web/public/assets/{eye-CcL-RUbp.js → eye-8lKlwbZE.js} +2 -2
  53. package/dist/web/public/assets/{eye-CcL-RUbp.js.map → eye-8lKlwbZE.js.map} +1 -1
  54. package/dist/web/public/assets/{facts-DqwcWab7.js → facts-Cfu6Lg3H.js} +2 -2
  55. package/dist/web/public/assets/{facts-DqwcWab7.js.map → facts-Cfu6Lg3H.js.map} +1 -1
  56. package/dist/web/public/assets/{goals-DBghjX3s.js → goals-BQkhal_h.js} +2 -2
  57. package/dist/web/public/assets/{goals-DBghjX3s.js.map → goals-BQkhal_h.js.map} +1 -1
  58. package/dist/web/public/assets/{health-DV_mII-T.js → health-BObMAngj.js} +2 -2
  59. package/dist/web/public/assets/{health-DV_mII-T.js.map → health-BObMAngj.js.map} +1 -1
  60. package/dist/web/public/assets/{heart-pulse-C3TFU_Th.js → heart-pulse-DI33Rxyr.js} +2 -2
  61. package/dist/web/public/assets/{heart-pulse-C3TFU_Th.js.map → heart-pulse-DI33Rxyr.js.map} +1 -1
  62. package/dist/web/public/assets/{heartbeat-NRTRObLx.js → heartbeat-Bc4SZawQ.js} +2 -2
  63. package/dist/web/public/assets/{heartbeat-NRTRObLx.js.map → heartbeat-Bc4SZawQ.js.map} +1 -1
  64. package/dist/web/public/assets/{hot-BNH34Amf.js → hot-BXYotT26.js} +2 -2
  65. package/dist/web/public/assets/{hot-BNH34Amf.js.map → hot-BXYotT26.js.map} +1 -1
  66. package/dist/web/public/assets/{index-igqJknUt.js → index-CGaI-i4K.js} +31 -31
  67. package/dist/web/public/assets/index-CGaI-i4K.js.map +1 -0
  68. package/dist/web/public/assets/{installed-B2goeV3S.js → installed-DswmDcea.js} +2 -2
  69. package/dist/web/public/assets/{installed-B2goeV3S.js.map → installed-DswmDcea.js.map} +1 -1
  70. package/dist/web/public/assets/{jobs-CZSLi1IN.js → jobs-DWBDqKx-.js} +2 -2
  71. package/dist/web/public/assets/{jobs-CZSLi1IN.js.map → jobs-DWBDqKx-.js.map} +1 -1
  72. package/dist/web/public/assets/{layout-BOtnmIxG.js → layout-B5rK_h6Q.js} +2 -2
  73. package/dist/web/public/assets/{layout-BOtnmIxG.js.map → layout-B5rK_h6Q.js.map} +1 -1
  74. package/dist/web/public/assets/{layout-CBbV3YNj.js → layout-ByUY6XZQ.js} +2 -2
  75. package/dist/web/public/assets/{layout-CBbV3YNj.js.map → layout-ByUY6XZQ.js.map} +1 -1
  76. package/dist/web/public/assets/{layout-CsScgPAG.js → layout-CX3nXpWb.js} +2 -2
  77. package/dist/web/public/assets/{layout-CsScgPAG.js.map → layout-CX3nXpWb.js.map} +1 -1
  78. package/dist/web/public/assets/{layout-BboemGJs.js → layout-D7gNMUDZ.js} +2 -2
  79. package/dist/web/public/assets/{layout-BboemGJs.js.map → layout-D7gNMUDZ.js.map} +1 -1
  80. package/dist/web/public/assets/{layout-D8Kes1e7.js → layout-DJKxW33x.js} +2 -2
  81. package/dist/web/public/assets/{layout-D8Kes1e7.js.map → layout-DJKxW33x.js.map} +1 -1
  82. package/dist/web/public/assets/{llm-78WCRfgL.js → llm-CPOd98Hy.js} +2 -2
  83. package/dist/web/public/assets/{llm-78WCRfgL.js.map → llm-CPOd98Hy.js.map} +1 -1
  84. package/dist/web/public/assets/{loader-circle-BMJKoafx.js → loader-circle-BBIfyATA.js} +2 -2
  85. package/dist/web/public/assets/{loader-circle-BMJKoafx.js.map → loader-circle-BBIfyATA.js.map} +1 -1
  86. package/dist/web/public/assets/{map-pin-QiHcQUfd.js → map-pin-Bg7JuU7F.js} +2 -2
  87. package/dist/web/public/assets/{map-pin-QiHcQUfd.js.map → map-pin-Bg7JuU7F.js.map} +1 -1
  88. package/dist/web/public/assets/{mcp-oeRvo7Aw.js → mcp-DGxGN2iX.js} +2 -2
  89. package/dist/web/public/assets/{mcp-oeRvo7Aw.js.map → mcp-DGxGN2iX.js.map} +1 -1
  90. package/dist/web/public/assets/{memos-D7RJn57X.js → memos-LpUpTmYL.js} +2 -2
  91. package/dist/web/public/assets/{memos-D7RJn57X.js.map → memos-LpUpTmYL.js.map} +1 -1
  92. package/dist/web/public/assets/{messengers-BORNy_SW.js → messengers-CWMsJz1e.js} +2 -2
  93. package/dist/web/public/assets/{messengers-BORNy_SW.js.map → messengers-CWMsJz1e.js.map} +1 -1
  94. package/dist/web/public/assets/native-agent-CPkYGY3I.js +22 -0
  95. package/dist/web/public/assets/native-agent-CPkYGY3I.js.map +1 -0
  96. package/dist/web/public/assets/{network-D--kF74M.js → network-DHrX3RcZ.js} +2 -2
  97. package/dist/web/public/assets/{network-D--kF74M.js.map → network-DHrX3RcZ.js.map} +1 -1
  98. package/dist/web/public/assets/{outbox-BvhcDpdc.js → outbox-T3NnYmK0.js} +2 -2
  99. package/dist/web/public/assets/{outbox-BvhcDpdc.js.map → outbox-T3NnYmK0.js.map} +1 -1
  100. package/dist/web/public/assets/{pagination-Dl8k4a91.js → pagination-ANxQzaRV.js} +2 -2
  101. package/dist/web/public/assets/{pagination-Dl8k4a91.js.map → pagination-ANxQzaRV.js.map} +1 -1
  102. package/dist/web/public/assets/{persona-Dy-fuCBR.js → persona-CHz80XDk.js} +2 -2
  103. package/dist/web/public/assets/{persona-Dy-fuCBR.js.map → persona-CHz80XDk.js.map} +1 -1
  104. package/dist/web/public/assets/{play-C0gIFP8e.js → play-BNtSkb5l.js} +2 -2
  105. package/dist/web/public/assets/{play-C0gIFP8e.js.map → play-BNtSkb5l.js.map} +1 -1
  106. package/dist/web/public/assets/{plus-DW6xBDJv.js → plus-CYsjCf6w.js} +2 -2
  107. package/dist/web/public/assets/{plus-DW6xBDJv.js.map → plus-CYsjCf6w.js.map} +1 -1
  108. package/dist/web/public/assets/{policy-DW_kZo8b.js → policy-CtKRzual.js} +2 -2
  109. package/dist/web/public/assets/{policy-DW_kZo8b.js.map → policy-CtKRzual.js.map} +1 -1
  110. package/dist/web/public/assets/{refresh-ccw-D6fZ_xYR.js → refresh-ccw-DpPWcwTg.js} +2 -2
  111. package/dist/web/public/assets/{refresh-ccw-D6fZ_xYR.js.map → refresh-ccw-DpPWcwTg.js.map} +1 -1
  112. package/dist/web/public/assets/{reminders-1V1_6Rij.js → reminders-R14lWHEJ.js} +2 -2
  113. package/dist/web/public/assets/{reminders-1V1_6Rij.js.map → reminders-R14lWHEJ.js.map} +1 -1
  114. package/dist/web/public/assets/{save-S79SG1Qr.js → save-beGooRNy.js} +2 -2
  115. package/dist/web/public/assets/{save-S79SG1Qr.js.map → save-beGooRNy.js.map} +1 -1
  116. package/dist/web/public/assets/{schedules-BsknKkCe.js → schedules-fxKnDnxp.js} +2 -2
  117. package/dist/web/public/assets/{schedules-BsknKkCe.js.map → schedules-fxKnDnxp.js.map} +1 -1
  118. package/dist/web/public/assets/{search-CKf3g91u.js → search-BzOAg0Rb.js} +2 -2
  119. package/dist/web/public/assets/{search-CKf3g91u.js.map → search-BzOAg0Rb.js.map} +1 -1
  120. package/dist/web/public/assets/{search-HQWlCBKK.js → search-DzgimpPy.js} +2 -2
  121. package/dist/web/public/assets/{search-HQWlCBKK.js.map → search-DzgimpPy.js.map} +1 -1
  122. package/dist/web/public/assets/security-Dw1mh68G.js +2 -0
  123. package/dist/web/public/assets/security-Dw1mh68G.js.map +1 -0
  124. package/dist/web/public/assets/{service-CB-aBmLS.js → service-CB55xtmh.js} +2 -2
  125. package/dist/web/public/assets/{service-CB-aBmLS.js.map → service-CB55xtmh.js.map} +1 -1
  126. package/dist/web/public/assets/shield-alert-C2IO43co.js +7 -0
  127. package/dist/web/public/assets/shield-alert-C2IO43co.js.map +1 -0
  128. package/dist/web/public/assets/{status-badge-BYFw2Sxd.js → status-badge-wL5IXJx_.js} +2 -2
  129. package/dist/web/public/assets/{status-badge-BYFw2Sxd.js.map → status-badge-wL5IXJx_.js.map} +1 -1
  130. package/dist/web/public/assets/{subtasks-CBrBqNyr.js → subtasks-CbLAkygG.js} +2 -2
  131. package/dist/web/public/assets/{subtasks-CBrBqNyr.js.map → subtasks-CbLAkygG.js.map} +1 -1
  132. package/dist/web/public/assets/{table-D5hzEZ1F.js → table-9FRavyyI.js} +2 -2
  133. package/dist/web/public/assets/{table-D5hzEZ1F.js.map → table-9FRavyyI.js.map} +1 -1
  134. package/dist/web/public/assets/{topn-7_FUU4Zs.js → topn-BE7RU5cV.js} +2 -2
  135. package/dist/web/public/assets/{topn-7_FUU4Zs.js.map → topn-BE7RU5cV.js.map} +1 -1
  136. package/dist/web/public/assets/{trash-2-BkaJ1KrC.js → trash-2-DL2FAuYX.js} +2 -2
  137. package/dist/web/public/assets/{trash-2-BkaJ1KrC.js.map → trash-2-DL2FAuYX.js.map} +1 -1
  138. package/dist/web/public/assets/{use-background-tasks-Crs1dlm6.js → use-background-tasks-XHuIYwrT.js} +2 -2
  139. package/dist/web/public/assets/{use-background-tasks-Crs1dlm6.js.map → use-background-tasks-XHuIYwrT.js.map} +1 -1
  140. package/dist/web/public/assets/{use-llm-admin-CQ3lbm_y.js → use-llm-admin-Dm8PcjN-.js} +2 -2
  141. package/dist/web/public/assets/{use-llm-admin-CQ3lbm_y.js.map → use-llm-admin-Dm8PcjN-.js.map} +1 -1
  142. package/dist/web/public/assets/{use-memory-CMOa52NU.js → use-memory-C3GgMqiJ.js} +2 -2
  143. package/dist/web/public/assets/{use-memory-CMOa52NU.js.map → use-memory-C3GgMqiJ.js.map} +1 -1
  144. package/dist/web/public/assets/{use-observability-BTRXt3kO.js → use-observability-BQa4b0Uk.js} +2 -2
  145. package/dist/web/public/assets/{use-observability-BTRXt3kO.js.map → use-observability-BQa4b0Uk.js.map} +1 -1
  146. package/dist/web/public/assets/{use-settings-D2TsP4vN.js → use-settings-CrkXdLrr.js} +2 -2
  147. package/dist/web/public/assets/{use-settings-D2TsP4vN.js.map → use-settings-CrkXdLrr.js.map} +1 -1
  148. package/dist/web/public/assets/{use-workspace-BobEMtXw.js → use-workspace-Csq4sxlY.js} +2 -2
  149. package/dist/web/public/assets/{use-workspace-BobEMtXw.js.map → use-workspace-Csq4sxlY.js.map} +1 -1
  150. package/dist/web/public/assets/{useQuery-B6dy499I.js → useQuery-ByZlZXlw.js} +2 -2
  151. package/dist/web/public/assets/{useQuery-B6dy499I.js.map → useQuery-ByZlZXlw.js.map} +1 -1
  152. package/dist/web/public/assets/{vector-v7xjphrN.js → vector-BmpvJTWt.js} +2 -2
  153. package/dist/web/public/assets/{vector-v7xjphrN.js.map → vector-BmpvJTWt.js.map} +1 -1
  154. package/dist/web/public/assets/{viewer-BSC-2Lhp.js → viewer-BOSX-lUS.js} +2 -2
  155. package/dist/web/public/assets/{viewer-BSC-2Lhp.js.map → viewer-BOSX-lUS.js.map} +1 -1
  156. package/dist/web/public/assets/{workspace-BtGPH9Sx.js → workspace-DTbEdEyD.js} +2 -2
  157. package/dist/web/public/assets/{workspace-BtGPH9Sx.js.map → workspace-DTbEdEyD.js.map} +1 -1
  158. package/dist/web/public/assets/{workspaces-_PTrUhIq.js → workspaces-BIZGVK8F.js} +2 -2
  159. package/dist/web/public/assets/{workspaces-_PTrUhIq.js.map → workspaces-BIZGVK8F.js.map} +1 -1
  160. package/dist/web/public/assets/{x-BHW436CN.js → x-BLllJ8d_.js} +2 -2
  161. package/dist/web/public/assets/{x-BHW436CN.js.map → x-BLllJ8d_.js.map} +1 -1
  162. package/dist/web/public/index.html +1 -1
  163. package/dist/web/server.js +25 -0
  164. package/dist/web/server.js.map +1 -1
  165. package/package.json +1 -1
  166. package/dist/web/public/assets/index-igqJknUt.js.map +0 -1
  167. package/dist/web/public/assets/native-agent-CNPVWQ9T.js +0 -12
  168. package/dist/web/public/assets/native-agent-CNPVWQ9T.js.map +0 -1
  169. package/dist/web/public/assets/security-B8sBUf6e.js +0 -7
  170. package/dist/web/public/assets/security-B8sBUf6e.js.map +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/layout-BOtnmIxG.js","assets/react-C9F3QeMB.js","assets/jobs-CZSLi1IN.js","assets/data-table-Br_AhsiO.js","assets/table-D5hzEZ1F.js","assets/empty-state-CP9D3-8U.js","assets/arrow-up-B0EZtRDW.js","assets/status-badge-BYFw2Sxd.js","assets/pagination-Dl8k4a91.js","assets/chevron-right-DkURvNIb.js","assets/confirm-dialog-CyTBb_Dj.js","assets/dialog-ChaF-Zu5.js","assets/x-BHW436CN.js","assets/useQuery-B6dy499I.js","assets/use-event-stream-BGeFcayX.js","assets/loader-circle-BMJKoafx.js","assets/refresh-ccw-D6fZ_xYR.js","assets/circle-x-KWl9wiZn.js","assets/briefcase-_b-XDwyU.js","assets/subtasks-CBrBqNyr.js","assets/bgjobs-DEQOeNl0.js","assets/schedules-BsknKkCe.js","assets/outbox-BvhcDpdc.js","assets/a2a-DGmlA1kI.js","assets/heartbeat-NRTRObLx.js","assets/use-background-tasks-Crs1dlm6.js","assets/heart-pulse-C3TFU_Th.js","assets/play-C0gIFP8e.js","assets/goals-DBghjX3s.js","assets/circle-check-D0tRr1mi.js","assets/asks-BQtIx6ky.js","assets/approvals-BzShPdMC.js","assets/reminders-1V1_6Rij.js","assets/bell-Dw3rtAnD.js","assets/memos-D7RJn57X.js","assets/trash-2-BkaJ1KrC.js","assets/search-CKf3g91u.js","assets/map-pin-QiHcQUfd.js","assets/layout-BboemGJs.js","assets/use-memory-CMOa52NU.js","assets/facts-DqwcWab7.js","assets/brain-BqR8-Zwv.js","assets/persona-Dy-fuCBR.js","assets/circle-check-big-C737-DM7.js","assets/vector-v7xjphrN.js","assets/use-settings-D2TsP4vN.js","assets/save-S79SG1Qr.js","assets/eye-CcL-RUbp.js","assets/download-B7FO0Y5B.js","assets/workspace-BtGPH9Sx.js","assets/use-workspace-BobEMtXw.js","assets/layout-D8Kes1e7.js","assets/health-DV_mII-T.js","assets/use-observability-BTRXt3kO.js","assets/activity-s8eXJqQ-.js","assets/topn-7_FUU4Zs.js","assets/audit-BDIEW7z9.js","assets/layout-CsScgPAG.js","assets/messengers-BORNy_SW.js","assets/email-DIEmIapc.js","assets/viewer-BSC-2Lhp.js","assets/external-link-Ba2-bs-3.js","assets/agents-Dp4swPPC.js","assets/network-D--kF74M.js","assets/plus-DW6xBDJv.js","assets/policy-DW_kZo8b.js","assets/security-B8sBUf6e.js","assets/service-CB-aBmLS.js","assets/admins-BSDr-HXb.js","assets/workspaces-_PTrUhIq.js","assets/llm-78WCRfgL.js","assets/use-llm-admin-CQ3lbm_y.js","assets/mcp-oeRvo7Aw.js","assets/native-agent-CNPVWQ9T.js","assets/search-HQWlCBKK.js","assets/layout-CBbV3YNj.js","assets/installed-B2goeV3S.js","assets/hot-BNH34Amf.js","assets/browser-ponyfill-BOcGq8h9.js"])))=>i.map(i=>d[i]);
2
- import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./react-C9F3QeMB.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Eu={exports:{}},to={};/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/layout-B5rK_h6Q.js","assets/react-C9F3QeMB.js","assets/jobs-DWBDqKx-.js","assets/data-table-bhqK389v.js","assets/table-9FRavyyI.js","assets/empty-state-CwUKG8xX.js","assets/arrow-up-CZr2LH5e.js","assets/status-badge-wL5IXJx_.js","assets/pagination-ANxQzaRV.js","assets/chevron-right-trO6yoBr.js","assets/confirm-dialog-DD1ZW1XE.js","assets/dialog-D5BsJN2q.js","assets/x-BLllJ8d_.js","assets/useQuery-ByZlZXlw.js","assets/use-event-stream-BGeFcayX.js","assets/loader-circle-BBIfyATA.js","assets/refresh-ccw-DpPWcwTg.js","assets/circle-x-OcRzGLRb.js","assets/briefcase-BscVfAjp.js","assets/subtasks-CbLAkygG.js","assets/bgjobs-vhVtnLSx.js","assets/schedules-fxKnDnxp.js","assets/outbox-T3NnYmK0.js","assets/a2a-CbxNgf9H.js","assets/heartbeat-Bc4SZawQ.js","assets/use-background-tasks-XHuIYwrT.js","assets/heart-pulse-DI33Rxyr.js","assets/play-BNtSkb5l.js","assets/goals-BQkhal_h.js","assets/circle-check-B_d7dBl5.js","assets/asks-B6L3PSml.js","assets/approvals-CyPhYcGG.js","assets/reminders-R14lWHEJ.js","assets/bell-OiL3Thk2.js","assets/memos-LpUpTmYL.js","assets/trash-2-DL2FAuYX.js","assets/search-BzOAg0Rb.js","assets/map-pin-Bg7JuU7F.js","assets/layout-D7gNMUDZ.js","assets/use-memory-C3GgMqiJ.js","assets/facts-Cfu6Lg3H.js","assets/brain-n56pZ1TQ.js","assets/persona-CHz80XDk.js","assets/circle-check-big-D6TvCoDM.js","assets/vector-BmpvJTWt.js","assets/use-settings-CrkXdLrr.js","assets/save-beGooRNy.js","assets/eye-8lKlwbZE.js","assets/download-CcO4RAuC.js","assets/workspace-DTbEdEyD.js","assets/use-workspace-Csq4sxlY.js","assets/layout-DJKxW33x.js","assets/health-BObMAngj.js","assets/use-observability-BQa4b0Uk.js","assets/activity-C6r508cN.js","assets/topn-BE7RU5cV.js","assets/audit-CCGCdw6P.js","assets/layout-CX3nXpWb.js","assets/messengers-CWMsJz1e.js","assets/email-Dy3UoyzF.js","assets/viewer-BOSX-lUS.js","assets/external-link-wf5VhNXd.js","assets/agents-DOW1_NGT.js","assets/network-DHrX3RcZ.js","assets/plus-CYsjCf6w.js","assets/policy-CtKRzual.js","assets/security-Dw1mh68G.js","assets/shield-alert-C2IO43co.js","assets/service-CB55xtmh.js","assets/admins-C0BJw6X9.js","assets/workspaces-BIZGVK8F.js","assets/llm-CPOd98Hy.js","assets/use-llm-admin-Dm8PcjN-.js","assets/mcp-DGxGN2iX.js","assets/native-agent-CPkYGY3I.js","assets/search-DzgimpPy.js","assets/layout-ByUY6XZQ.js","assets/installed-DswmDcea.js","assets/hot-BXYotT26.js","assets/browser-ponyfill-BOcGq8h9.js"])))=>i.map(i=>d[i]);
2
+ import{e as g,r as Jr,R as eo,b as Sp,a as z,c as Su,d as Ii,g as ku}from"./react-C9F3QeMB.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Eu={exports:{}},to={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.min.js
5
5
  *
@@ -7,7 +7,7 @@ import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./reac
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var Sp=g,Ep=Symbol.for("react.element"),Cp=Symbol.for("react.fragment"),Ap=Object.prototype.hasOwnProperty,Tp=Sp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Rp={key:!0,ref:!0,__self:!0,__source:!0};function Cu(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Ap.call(t,r)&&!Rp.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Ep,type:e,key:o,ref:a,props:i,_owner:Tp.current}}to.Fragment=Cp;to.jsx=Cu;to.jsxs=Cu;Eu.exports=to;var b=Eu.exports,ia={},Bs=Jr;ia.createRoot=Bs.createRoot,ia.hydrateRoot=Bs.hydrateRoot;const Pp="modulepreload",Ip=function(e){return"/"+e},Us={},be=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(n.map(l=>{if(l=Ip(l),l in Us)return;Us[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":Pp,c||(d.as="script"),d.crossOrigin="",d.href=l,s&&d.setAttribute("nonce",s),document.head.appendChild(d),c)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return i.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};/**
10
+ */var kp=g,Ep=Symbol.for("react.element"),Cp=Symbol.for("react.fragment"),Ap=Object.prototype.hasOwnProperty,Tp=kp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Rp={key:!0,ref:!0,__self:!0,__source:!0};function Cu(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Ap.call(t,r)&&!Rp.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Ep,type:e,key:o,ref:a,props:i,_owner:Tp.current}}to.Fragment=Cp;to.jsx=Cu;to.jsxs=Cu;Eu.exports=to;var v=Eu.exports,ia={},Bs=Jr;ia.createRoot=Bs.createRoot,ia.hydrateRoot=Bs.hydrateRoot;const Pp="modulepreload",Ip=function(e){return"/"+e},Hs={},ve=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(n.map(l=>{if(l=Ip(l),l in Hs)return;Hs[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":Pp,c||(d.as="script"),d.crossOrigin="",d.href=l,s&&d.setAttribute("nonce",s),document.head.appendChild(d),c)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return i.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};/**
11
11
  * @remix-run/router v1.23.3
12
12
  *
13
13
  * Copyright (c) Remix Software Inc.
@@ -16,8 +16,8 @@ import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./reac
16
16
  * LICENSE.md file in the root directory of this source tree.
17
17
  *
18
18
  * @license MIT
19
- */function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(null,arguments)}var Ge;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ge||(Ge={}));const Hs="popstate";function Lp(e){e===void 0&&(e={});function t(r,i){let{pathname:o,search:a,hash:s}=r.location;return Vr("",{pathname:o,search:a,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Bn(i)}return Np(t,n,null,e)}function xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Fn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Op(){return Math.random().toString(36).substr(2,8)}function zs(e,t){return{usr:e.state,key:e.key,idx:t}}function Vr(e,t,n,r){return n===void 0&&(n=null),Ue({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?xn(t):t,{state:n,key:t&&t.key||r||Op()})}function Bn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function xn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Np(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Ge.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(Ue({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=Ge.Pop;let y=u(),v=y==null?null:y-c;c=y,l&&l({action:s,location:p.location,delta:v})}function h(y,v){s=Ge.Push;let x=Vr(p.location,y,v);c=u()+1;let w=zs(x,c),R=p.createHref(x);try{a.pushState(w,"",R)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(R)}o&&l&&l({action:s,location:p.location,delta:1})}function f(y,v){s=Ge.Replace;let x=Vr(p.location,y,v);c=u();let w=zs(x,c),R=p.createHref(x);a.replaceState(w,"",R),o&&l&&l({action:s,location:p.location,delta:0})}function m(y){let v=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof y=="string"?y:Bn(y);return x=x.replace(/ $/,"%20"),xe(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let p={get action(){return s},get location(){return e(i,a)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Hs,d),l=y,()=>{i.removeEventListener(Hs,d),l=null}},createHref(y){return t(i,y)},createURL:m,encodeLocation(y){let v=m(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:f,go(y){return a.go(y)}};return p}var Ne;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ne||(Ne={}));const Dp=new Set(["lazy","caseSensitive","path","id","index","children"]);function _p(e){return e.index===!0}function Li(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,String(o)],s=typeof i.id=="string"?i.id:a.join("-");if(xe(i.index!==!0||!i.children,"Cannot specify children on an index route"),xe(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),_p(i)){let l=Ue({},i,t(i),{id:s});return r[s]=l,l}else{let l=Ue({},i,t(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=Li(i.children,t,a,r)),l}})}function On(e,t,n){return n===void 0&&(n="/"),Ei(e,t,n,!1)}function Ei(e,t,n,r){let i=typeof t=="string"?xn(t):t,o=tn(i.pathname||"/",n);if(o==null)return null;let a=Au(e);jp(a);let s=null,l=Gp(o);for(let c=0;s==null&&c<a.length;++c)s=Kp(a[c],l,r);return s}function Mp(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Au(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,a,s)=>{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(xe(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 c=en([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(xe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Au(o.children,t,u,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:Vp(c,o.index),routesMeta:u})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of Tu(o.path))i(o,a,l)}),t}function Tu(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=Tu(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function jp(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Wp(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Fp=/^:[\w-]+$/,Bp=3,Up=2,Hp=1,zp=10,$p=-2,$s=e=>e==="*";function Vp(e,t){let n=e.split("/"),r=n.length;return n.some($s)&&(r+=$p),t&&(r+=Up),n.filter(i=>!$s(i)).reduce((i,o)=>i+(Fp.test(o)?Bp:o===""?Hp:zp),r)}function Wp(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Kp(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=Oi({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Oi({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:en([o,d.pathname]),pathnameBase:Jp(en([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=en([o,d.pathnameBase]))}return a}function Oi(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=qp(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:h,isOptional:f}=u;if(h==="*"){let p=s[d]||"";a=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const m=s[d];return f&&!m?c[h]=void 0:c[h]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:e}}function qp(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Fn(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,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Gp(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function tn(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)||"/"}const Yp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qp=e=>Yp.test(e);function Xp(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?xn(e):e,o;if(n)if(Qp(n))o=n;else{if(n.includes("//")){let a=n;n=Ya(n),Fn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?o=Vs(n.substring(1),"/"):o=Vs(n,t)}else o=t;return{pathname:o,search:Zp(r),hash:em(i)}}function Vs(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function To(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 Ru(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function no(e,t){let n=Ru(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ro(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=xn(e):(i=Ue({},e),xe(!i.pathname||!i.pathname.includes("?"),To("?","pathname","search",i)),xe(!i.pathname||!i.pathname.includes("#"),To("#","pathname","hash",i)),xe(!i.search||!i.search.includes("#"),To("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=Xp(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ya=e=>e.replace(/\/\/+/g,"/"),en=e=>Ya(e.join("/")),Jp=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Zp=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,em=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Ni{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Wr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Pu=["post","put","patch","delete"],tm=new Set(Pu),nm=["get",...Pu],rm=new Set(nm),im=new Set([301,302,303,307,308]),om=new Set([307,308]),Ro={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},am={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Qa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sm=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Iu="remix-router-transitions";function lm(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;xe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let A=e.detectErrorBoundary;i=P=>({hasErrorBoundary:A(P)})}else i=sm;let o={},a=Li(e.routes,i,void 0,o),s,l=e.basename||"/",c=e.dataStrategy||fm,u=e.patchRoutesOnNavigation,d=Ue({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,f=new Set,m=null,p=null,y=null,v=e.hydrationData!=null,x=On(a,e.history.location,l),w=!1,R=null;if(x==null&&!u){let A=dt(404,{pathname:e.history.location.pathname}),{matches:P,route:O}=tl(a);x=P,R={[O.id]:A}}x&&!e.hydrationData&&Oe(x,a,e.history.location.pathname).active&&(x=null);let I;if(x)if(x.some(A=>A.route.lazy))I=!1;else if(!x.some(A=>A.route.loader))I=!0;else if(d.v7_partialHydration){let A=e.hydrationData?e.hydrationData.loaderData:null,P=e.hydrationData?e.hydrationData.errors:null;if(P){let O=x.findIndex(M=>P[M.route.id]!==void 0);I=x.slice(0,O+1).every(M=>!aa(M.route,A,P))}else I=x.every(O=>!aa(O.route,A,P))}else I=e.hydrationData!=null;else if(I=!1,x=[],d.v7_partialHydration){let A=Oe(null,a,e.history.location.pathname);A.active&&A.matches&&(w=!0,x=A.matches)}let C,k={historyAction:e.history.action,location:e.history.location,matches:x,initialized:I,navigation:Ro,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||R,fetchers:new Map,blockers:new Map},D=Ge.Pop,j=!1,T,_=!1,L=new Map,K=null,B=!1,V=!1,q=[],Q=new Set,$=new Map,F=0,S=-1,se=new Map,te=new Set,E=new Map,oe=new Map,fe=new Set,ge=new Map,W=new Map,ye;function Le(){if(h=e.history.listen(A=>{let{action:P,location:O,delta:M}=A;if(ye){ye(),ye=void 0;return}Fn(W.size===0||M!=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 G=Sr({currentLocation:k.location,nextLocation:O,historyAction:P});if(G&&M!=null){let re=new Promise(le=>{ye=le});e.history.go(M*-1),Tn(G,{state:"blocked",location:O,proceed(){Tn(G,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),re.then(()=>e.history.go(M))},reset(){let le=new Map(k.blockers);le.set(G,Rr),de({blockers:le})}});return}return Je(P,O)}),n){Am(t,L);let A=()=>Tm(t,L);t.addEventListener("pagehide",A),K=()=>t.removeEventListener("pagehide",A)}return k.initialized||Je(Ge.Pop,k.location,{initialHydration:!0}),C}function ve(){h&&h(),K&&K(),f.clear(),T&&T.abort(),k.fetchers.forEach((A,P)=>Qe(P)),k.blockers.forEach((A,P)=>ct(P))}function we(A){return f.add(A),()=>f.delete(A)}function de(A,P){P===void 0&&(P={}),k=Ue({},k,A);let O=[],M=[];d.v7_fetcherPersist&&k.fetchers.forEach((G,re)=>{G.state==="idle"&&(fe.has(re)?M.push(re):O.push(re))}),fe.forEach(G=>{!k.fetchers.has(G)&&!$.has(G)&&M.push(G)}),[...f].forEach(G=>G(k,{deletedFetchers:M,viewTransitionOpts:P.viewTransitionOpts,flushSync:P.flushSync===!0})),d.v7_fetcherPersist?(O.forEach(G=>k.fetchers.delete(G)),M.forEach(G=>Qe(G))):M.forEach(G=>fe.delete(G))}function Be(A,P,O){var M,G;let{flushSync:re}=O===void 0?{}:O,le=k.actionData!=null&&k.navigation.formMethod!=null&&Lt(k.navigation.formMethod)&&k.navigation.state==="loading"&&((M=A.state)==null?void 0:M._isRedirect)!==!0,J;P.actionData?Object.keys(P.actionData).length>0?J=P.actionData:J=null:le?J=k.actionData:J=null;let Z=P.loaderData?Zs(k.loaderData,P.loaderData,P.matches||[],P.errors):k.loaderData,X=k.blockers;X.size>0&&(X=new Map(X),X.forEach((Ee,Ze)=>X.set(Ze,Rr)));let ee=j===!0||k.navigation.formMethod!=null&&Lt(k.navigation.formMethod)&&((G=A.state)==null?void 0:G._isRedirect)!==!0;s&&(a=s,s=void 0),B||D===Ge.Pop||(D===Ge.Push?e.history.push(A,A.state):D===Ge.Replace&&e.history.replace(A,A.state));let he;if(D===Ge.Pop){let Ee=L.get(k.location.pathname);Ee&&Ee.has(A.pathname)?he={currentLocation:k.location,nextLocation:A}:L.has(A.pathname)&&(he={currentLocation:A,nextLocation:k.location})}else if(_){let Ee=L.get(k.location.pathname);Ee?Ee.add(A.pathname):(Ee=new Set([A.pathname]),L.set(k.location.pathname,Ee)),he={currentLocation:k.location,nextLocation:A}}de(Ue({},P,{actionData:J,loaderData:Z,historyAction:D,location:A,initialized:!0,navigation:Ro,revalidation:"idle",restoreScrollPosition:Te(A,P.matches||k.matches),preventScrollReset:ee,blockers:X}),{viewTransitionOpts:he,flushSync:re===!0}),D=Ge.Pop,j=!1,_=!1,B=!1,V=!1,q=[]}async function lt(A,P){if(typeof A=="number"){e.history.go(A);return}let O=oa(k.location,k.matches,l,d.v7_prependBasename,A,d.v7_relativeSplatPath,P?.fromRouteId,P?.relative),{path:M,submission:G,error:re}=Ws(d.v7_normalizeFormMethod,!1,O,P),le=k.location,J=Vr(k.location,M,P&&P.state);J=Ue({},J,e.history.encodeLocation(J));let Z=P&&P.replace!=null?P.replace:void 0,X=Ge.Push;Z===!0?X=Ge.Replace:Z===!1||G!=null&&Lt(G.formMethod)&&G.formAction===k.location.pathname+k.location.search&&(X=Ge.Replace);let ee=P&&"preventScrollReset"in P?P.preventScrollReset===!0:void 0,he=(P&&P.flushSync)===!0,Ee=Sr({currentLocation:le,nextLocation:J,historyAction:X});if(Ee){Tn(Ee,{state:"blocked",location:J,proceed(){Tn(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),lt(A,P)},reset(){let Ze=new Map(k.blockers);Ze.set(Ee,Rr),de({blockers:Ze})}});return}return await Je(X,J,{submission:G,pendingError:re,preventScrollReset:ee,replace:P&&P.replace,enableViewTransition:P&&P.viewTransition,flushSync:he})}function Mt(){if(H(),de({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){Je(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}Je(D||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation,enableViewTransition:_===!0})}}async function Je(A,P,O){T&&T.abort(),T=null,D=A,B=(O&&O.startUninterruptedRevalidation)===!0,ce(k.location,k.matches),j=(O&&O.preventScrollReset)===!0,_=(O&&O.enableViewTransition)===!0;let M=s||a,G=O&&O.overrideNavigation,re=O!=null&&O.initialHydration&&k.matches&&k.matches.length>0&&!w?k.matches:On(M,P,l),le=(O&&O.flushSync)===!0;if(re&&k.initialized&&!V&&bm(k.location,P)&&!(O&&O.submission&&Lt(O.submission.formMethod))){Be(P,{matches:re},{flushSync:le});return}let J=Oe(re,M,P.pathname);if(J.active&&J.matches&&(re=J.matches),!re){let{error:_e,notFoundMatches:Re,route:$e}=Er(P.pathname);Be(P,{matches:Re,loaderData:{},errors:{[$e.id]:_e}},{flushSync:le});return}T=new AbortController;let Z=Jn(e.history,P,T.signal,O&&O.submission),X;if(O&&O.pendingError)X=[Nn(re).route.id,{type:Ne.error,error:O.pendingError}];else if(O&&O.submission&&Lt(O.submission.formMethod)){let _e=await jt(Z,P,O.submission,re,J.active,{replace:O.replace,flushSync:le});if(_e.shortCircuited)return;if(_e.pendingActionResult){let[Re,$e]=_e.pendingActionResult;if(yt($e)&&Wr($e.error)&&$e.error.status===404){T=null,Be(P,{matches:_e.matches,loaderData:{},errors:{[Re]:$e.error}});return}}re=_e.matches||re,X=_e.pendingActionResult,G=Po(P,O.submission),le=!1,J.active=!1,Z=Jn(e.history,Z.url,Z.signal)}let{shortCircuited:ee,matches:he,loaderData:Ee,errors:Ze}=await En(Z,P,re,J.active,G,O&&O.submission,O&&O.fetcherSubmission,O&&O.replace,O&&O.initialHydration===!0,le,X);ee||(T=null,Be(P,Ue({matches:he||re},el(X),{loaderData:Ee,errors:Ze})))}async function jt(A,P,O,M,G,re){re===void 0&&(re={}),H();let le=Em(P,O);if(de({navigation:le},{flushSync:re.flushSync===!0}),G){let X=await tt(M,P.pathname,A.signal);if(X.type==="aborted")return{shortCircuited:!0};if(X.type==="error"){let ee=Nn(X.partialMatches).route.id;return{matches:X.partialMatches,pendingActionResult:[ee,{type:Ne.error,error:X.error}]}}else if(X.matches)M=X.matches;else{let{notFoundMatches:ee,error:he,route:Ee}=Er(P.pathname);return{matches:ee,pendingActionResult:[Ee.id,{type:Ne.error,error:he}]}}}let J,Z=Fr(M,P);if(!Z.route.action&&!Z.route.lazy)J={type:Ne.error,error:dt(405,{method:A.method,pathname:P.pathname,routeId:Z.route.id})};else if(J=(await Xt("action",k,A,[Z],M,null))[Z.route.id],A.signal.aborted)return{shortCircuited:!0};if(Mn(J)){let X;return re&&re.replace!=null?X=re.replace:X=Qs(J.response.headers.get("Location"),new URL(A.url),l,e.history)===k.location.pathname+k.location.search,await Tt(A,J,!0,{submission:O,replace:X}),{shortCircuited:!0}}if(gn(J))throw dt(400,{type:"defer-action"});if(yt(J)){let X=Nn(M,Z.route.id);return(re&&re.replace)!==!0&&(D=Ge.Push),{matches:M,pendingActionResult:[X.route.id,J]}}return{matches:M,pendingActionResult:[Z.route.id,J]}}async function En(A,P,O,M,G,re,le,J,Z,X,ee){let he=G||Po(P,re),Ee=re||le||rl(he),Ze=!B&&(!d.v7_partialHydration||!Z);if(M){if(Ze){let Ve=Cn(ee);de(Ue({navigation:he},Ve!==void 0?{actionData:Ve}:{}),{flushSync:X})}let Ae=await tt(O,P.pathname,A.signal);if(Ae.type==="aborted")return{shortCircuited:!0};if(Ae.type==="error"){let Ve=Nn(Ae.partialMatches).route.id;return{matches:Ae.partialMatches,loaderData:{},errors:{[Ve]:Ae.error}}}else if(Ae.matches)O=Ae.matches;else{let{error:Ve,notFoundMatches:Qn,route:Tr}=Er(P.pathname);return{matches:Qn,loaderData:{},errors:{[Tr.id]:Ve}}}}let _e=s||a,[Re,$e]=qs(e.history,k,O,Ee,P,d.v7_partialHydration&&Z===!0,d.v7_skipActionErrorRevalidation,V,q,Q,fe,E,te,_e,l,ee);if(Rn(Ae=>!(O&&O.some(Ve=>Ve.route.id===Ae))||Re&&Re.some(Ve=>Ve.route.id===Ae)),S=++F,Re.length===0&&$e.length===0){let Ae=Rt();return Be(P,Ue({matches:O,loaderData:{},errors:ee&&yt(ee[1])?{[ee[0]]:ee[1].error}:null},el(ee),Ae?{fetchers:new Map(k.fetchers)}:{}),{flushSync:X}),{shortCircuited:!0}}if(Ze){let Ae={};if(!M){Ae.navigation=he;let Ve=Cn(ee);Ve!==void 0&&(Ae.actionData=Ve)}$e.length>0&&(Ae.fetchers=An($e)),de(Ae,{flushSync:X})}$e.forEach(Ae=>{ze(Ae.key),Ae.controller&&$.set(Ae.key,Ae.controller)});let Yn=()=>$e.forEach(Ae=>ze(Ae.key));T&&T.signal.addEventListener("abort",Yn);let{loaderResults:Cr,fetcherResults:Jt}=await N(k,O,Re,$e,A);if(A.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",Yn),$e.forEach(Ae=>$.delete(Ae.key));let Ht=ci(Cr);if(Ht)return await Tt(A,Ht.result,!0,{replace:J}),{shortCircuited:!0};if(Ht=ci(Jt),Ht)return te.add(Ht.key),await Tt(A,Ht.result,!0,{replace:J}),{shortCircuited:!0};let{loaderData:Ao,errors:Ar}=Js(k,O,Cr,ee,$e,Jt,ge);ge.forEach((Ae,Ve)=>{Ae.subscribe(Qn=>{(Qn||Ae.done)&&ge.delete(Ve)})}),d.v7_partialHydration&&Z&&k.errors&&(Ar=Ue({},k.errors,Ar));let Pn=Rt(),si=He(S),li=Pn||si||$e.length>0;return Ue({matches:O,loaderData:Ao,errors:Ar},li?{fetchers:new Map(k.fetchers)}:{})}function Cn(A){if(A&&!yt(A[1]))return{[A[0]]:A[1].data};if(k.actionData)return Object.keys(k.actionData).length===0?null:k.actionData}function An(A){return A.forEach(P=>{let O=k.fetchers.get(P.key),M=Pr(void 0,O?O.data:void 0);k.fetchers.set(P.key,M)}),new Map(k.fetchers)}function Qt(A,P,O,M){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ze(A);let G=(M&&M.flushSync)===!0,re=s||a,le=oa(k.location,k.matches,l,d.v7_prependBasename,O,d.v7_relativeSplatPath,P,M?.relative),J=On(re,le,l),Z=Oe(J,re,le);if(Z.active&&Z.matches&&(J=Z.matches),!J){ae(A,P,dt(404,{pathname:le}),{flushSync:G});return}let{path:X,submission:ee,error:he}=Ws(d.v7_normalizeFormMethod,!0,le,M);if(he){ae(A,P,he,{flushSync:G});return}let Ee=Fr(J,X),Ze=(M&&M.preventScrollReset)===!0;if(ee&&Lt(ee.formMethod)){Gn(A,P,X,Ee,J,Z.active,G,Ze,ee);return}E.set(A,{routeId:P,path:X}),At(A,P,X,Ee,J,Z.active,G,Ze,ee)}async function Gn(A,P,O,M,G,re,le,J,Z){H(),E.delete(A);function X(Ke){if(!Ke.route.action&&!Ke.route.lazy){let Xn=dt(405,{method:Z.formMethod,pathname:O,routeId:P});return ae(A,P,Xn,{flushSync:le}),!0}return!1}if(!re&&X(M))return;let ee=k.fetchers.get(A);ne(A,Cm(Z,ee),{flushSync:le});let he=new AbortController,Ee=Jn(e.history,O,he.signal,Z);if(re){let Ke=await tt(G,new URL(Ee.url).pathname,Ee.signal,A);if(Ke.type==="aborted")return;if(Ke.type==="error"){ae(A,P,Ke.error,{flushSync:le});return}else if(Ke.matches){if(G=Ke.matches,M=Fr(G,O),X(M))return}else{ae(A,P,dt(404,{pathname:O}),{flushSync:le});return}}$.set(A,he);let Ze=F,Re=(await Xt("action",k,Ee,[M],G,A))[M.route.id];if(Ee.signal.aborted){$.get(A)===he&&$.delete(A);return}if(d.v7_fetcherPersist&&fe.has(A)){if(Mn(Re)||yt(Re)){ne(A,pn(void 0));return}}else{if(Mn(Re))if($.delete(A),S>Ze){ne(A,pn(void 0));return}else return te.add(A),ne(A,Pr(Z)),Tt(Ee,Re,!1,{fetcherSubmission:Z,preventScrollReset:J});if(yt(Re)){ae(A,P,Re.error);return}}if(gn(Re))throw dt(400,{type:"defer-action"});let $e=k.navigation.location||k.location,Yn=Jn(e.history,$e,he.signal),Cr=s||a,Jt=k.navigation.state!=="idle"?On(Cr,k.navigation.location,l):k.matches;xe(Jt,"Didn't find any matches after fetcher action");let Ht=++F;se.set(A,Ht);let Ao=Pr(Z,Re.data);k.fetchers.set(A,Ao);let[Ar,Pn]=qs(e.history,k,Jt,Z,$e,!1,d.v7_skipActionErrorRevalidation,V,q,Q,fe,E,te,Cr,l,[M.route.id,Re]);Pn.filter(Ke=>Ke.key!==A).forEach(Ke=>{let Xn=Ke.key,Fs=k.fetchers.get(Xn),wp=Pr(void 0,Fs?Fs.data:void 0);k.fetchers.set(Xn,wp),ze(Xn),Ke.controller&&$.set(Xn,Ke.controller)}),de({fetchers:new Map(k.fetchers)});let si=()=>Pn.forEach(Ke=>ze(Ke.key));he.signal.addEventListener("abort",si);let{loaderResults:li,fetcherResults:Ae}=await N(k,Jt,Ar,Pn,Yn);if(he.signal.aborted)return;he.signal.removeEventListener("abort",si),se.delete(A),$.delete(A),Pn.forEach(Ke=>$.delete(Ke.key));let Ve=ci(li);if(Ve)return Tt(Yn,Ve.result,!1,{preventScrollReset:J});if(Ve=ci(Ae),Ve)return te.add(Ve.key),Tt(Yn,Ve.result,!1,{preventScrollReset:J});let{loaderData:Qn,errors:Tr}=Js(k,Jt,li,void 0,Pn,Ae,ge);if(k.fetchers.has(A)){let Ke=pn(Re.data);k.fetchers.set(A,Ke)}He(Ht),k.navigation.state==="loading"&&Ht>S?(xe(D,"Expected pending action"),T&&T.abort(),Be(k.navigation.location,{matches:Jt,loaderData:Qn,errors:Tr,fetchers:new Map(k.fetchers)})):(de({errors:Tr,loaderData:Zs(k.loaderData,Qn,Jt,Tr),fetchers:new Map(k.fetchers)}),V=!1)}async function At(A,P,O,M,G,re,le,J,Z){let X=k.fetchers.get(A);ne(A,Pr(Z,X?X.data:void 0),{flushSync:le});let ee=new AbortController,he=Jn(e.history,O,ee.signal);if(re){let Re=await tt(G,new URL(he.url).pathname,he.signal,A);if(Re.type==="aborted")return;if(Re.type==="error"){ae(A,P,Re.error,{flushSync:le});return}else if(Re.matches)G=Re.matches,M=Fr(G,O);else{ae(A,P,dt(404,{pathname:O}),{flushSync:le});return}}$.set(A,ee);let Ee=F,_e=(await Xt("loader",k,he,[M],G,A))[M.route.id];if(gn(_e)&&(_e=await Xa(_e,he.signal,!0)||_e),$.get(A)===ee&&$.delete(A),!he.signal.aborted){if(fe.has(A)){ne(A,pn(void 0));return}if(Mn(_e))if(S>Ee){ne(A,pn(void 0));return}else{te.add(A),await Tt(he,_e,!1,{preventScrollReset:J});return}if(yt(_e)){ae(A,P,_e.error);return}xe(!gn(_e),"Unhandled fetcher deferred data"),ne(A,pn(_e.data))}}async function Tt(A,P,O,M){let{submission:G,fetcherSubmission:re,preventScrollReset:le,replace:J}=M===void 0?{}:M;P.response.headers.has("X-Remix-Revalidate")&&(V=!0);let Z=P.response.headers.get("Location");xe(Z,"Expected a Location header on the redirect Response"),Z=Qs(Z,new URL(A.url),l,e.history);let X=Vr(k.location,Z,{_isRedirect:!0});if(n){let Re=!1;if(P.response.headers.has("X-Remix-Reload-Document"))Re=!0;else if(Qa.test(Z)){const $e=e.history.createURL(Z);Re=$e.origin!==t.location.origin||tn($e.pathname,l)==null}if(Re){J?t.location.replace(Z):t.location.assign(Z);return}}T=null;let ee=J===!0||P.response.headers.has("X-Remix-Replace")?Ge.Replace:Ge.Push,{formMethod:he,formAction:Ee,formEncType:Ze}=k.navigation;!G&&!re&&he&&Ee&&Ze&&(G=rl(k.navigation));let _e=G||re;if(om.has(P.response.status)&&_e&&Lt(_e.formMethod))await Je(ee,X,{submission:Ue({},_e,{formAction:Z}),preventScrollReset:le||j,enableViewTransition:O?_:void 0});else{let Re=Po(X,G);await Je(ee,X,{overrideNavigation:Re,fetcherSubmission:re,preventScrollReset:le||j,enableViewTransition:O?_:void 0})}}async function Xt(A,P,O,M,G,re){let le,J={};try{le=await hm(c,A,P,O,M,G,re,o,i)}catch(Z){return M.forEach(X=>{J[X.route.id]={type:Ne.error,error:Z}}),J}for(let[Z,X]of Object.entries(le))if(vm(X)){let ee=X.result;J[Z]={type:Ne.redirect,response:gm(ee,O,Z,G,l,d.v7_relativeSplatPath)}}else J[Z]=await mm(X);return J}async function N(A,P,O,M,G){let re=A.matches,le=Xt("loader",A,G,O,P,null),J=Promise.all(M.map(async ee=>{if(ee.matches&&ee.match&&ee.controller){let Ee=(await Xt("loader",A,Jn(e.history,ee.path,ee.controller.signal),[ee.match],ee.matches,ee.key))[ee.match.route.id];return{[ee.key]:Ee}}else return Promise.resolve({[ee.key]:{type:Ne.error,error:dt(404,{pathname:ee.path})}})})),Z=await le,X=(await J).reduce((ee,he)=>Object.assign(ee,he),{});return await Promise.all([km(P,Z,G.signal,re,A.loaderData),Sm(P,X,M)]),{loaderResults:Z,fetcherResults:X}}function H(){V=!0,q.push(...Rn()),E.forEach((A,P)=>{$.has(P)&&Q.add(P),ze(P)})}function ne(A,P,O){O===void 0&&(O={}),k.fetchers.set(A,P),de({fetchers:new Map(k.fetchers)},{flushSync:(O&&O.flushSync)===!0})}function ae(A,P,O,M){M===void 0&&(M={});let G=Nn(k.matches,P);Qe(A),de({errors:{[G.route.id]:O},fetchers:new Map(k.fetchers)},{flushSync:(M&&M.flushSync)===!0})}function Se(A){return oe.set(A,(oe.get(A)||0)+1),fe.has(A)&&fe.delete(A),k.fetchers.get(A)||am}function Qe(A){let P=k.fetchers.get(A);$.has(A)&&!(P&&P.state==="loading"&&se.has(A))&&ze(A),E.delete(A),se.delete(A),te.delete(A),d.v7_fetcherPersist&&fe.delete(A),Q.delete(A),k.fetchers.delete(A)}function St(A){let P=(oe.get(A)||0)-1;P<=0?(oe.delete(A),fe.add(A),d.v7_fetcherPersist||Qe(A)):oe.set(A,P),de({fetchers:new Map(k.fetchers)})}function ze(A){let P=$.get(A);P&&(P.abort(),$.delete(A))}function ot(A){for(let P of A){let O=Se(P),M=pn(O.data);k.fetchers.set(P,M)}}function Rt(){let A=[],P=!1;for(let O of te){let M=k.fetchers.get(O);xe(M,"Expected fetcher: "+O),M.state==="loading"&&(te.delete(O),A.push(O),P=!0)}return ot(A),P}function He(A){let P=[];for(let[O,M]of se)if(M<A){let G=k.fetchers.get(O);xe(G,"Expected fetcher: "+O),G.state==="loading"&&(ze(O),se.delete(O),P.push(O))}return ot(P),P.length>0}function Ft(A,P){let O=k.blockers.get(A)||Rr;return W.get(A)!==P&&W.set(A,P),O}function ct(A){k.blockers.delete(A),W.delete(A)}function Tn(A,P){let O=k.blockers.get(A)||Rr;xe(O.state==="unblocked"&&P.state==="blocked"||O.state==="blocked"&&P.state==="blocked"||O.state==="blocked"&&P.state==="proceeding"||O.state==="blocked"&&P.state==="unblocked"||O.state==="proceeding"&&P.state==="unblocked","Invalid blocker state transition: "+O.state+" -> "+P.state);let M=new Map(k.blockers);M.set(A,P),de({blockers:M})}function Sr(A){let{currentLocation:P,nextLocation:O,historyAction:M}=A;if(W.size===0)return;W.size>1&&Fn(!1,"A router only supports one blocker at a time");let G=Array.from(W.entries()),[re,le]=G[G.length-1],J=k.blockers.get(re);if(!(J&&J.state==="proceeding")&&le({currentLocation:P,nextLocation:O,historyAction:M}))return re}function Er(A){let P=dt(404,{pathname:A}),O=s||a,{matches:M,route:G}=tl(O);return Rn(),{notFoundMatches:M,route:G,error:P}}function Rn(A){let P=[];return ge.forEach((O,M)=>{(!A||A(M))&&(O.cancel(),P.push(M),ge.delete(M))}),P}function Bt(A,P,O){if(m=A,y=P,p=O||null,!v&&k.navigation===Ro){v=!0;let M=Te(k.location,k.matches);M!=null&&de({restoreScrollPosition:M})}return()=>{m=null,y=null,p=null}}function ai(A,P){return p&&p(A,P.map(M=>Mp(M,k.loaderData)))||A.key}function ce(A,P){if(m&&y){let O=ai(A,P);m[O]=y()}}function Te(A,P){if(m){let O=ai(A,P),M=m[O];if(typeof M=="number")return M}return null}function Oe(A,P,O){if(u)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Ei(P,O,l,!0)}}else return{active:!0,matches:Ei(P,O,l,!0)||[]};return{active:!1,matches:null}}async function tt(A,P,O,M){if(!u)return{type:"success",matches:A};let G=A;for(;;){let re=s==null,le=s||a,J=o;try{await u({signal:O,path:P,matches:G,fetcherKey:M,patch:(ee,he)=>{O.aborted||Ys(ee,he,le,J,i)}})}catch(ee){return{type:"error",error:ee,partialMatches:G}}finally{re&&!O.aborted&&(a=[...a])}if(O.aborted)return{type:"aborted"};let Z=On(le,P,l);if(Z)return{type:"success",matches:Z};let X=Ei(le,P,l,!0);if(!X||G.length===X.length&&G.every((ee,he)=>ee.route.id===X[he].route.id))return{type:"success",matches:null};G=X}}function mt(A){o={},s=Li(A,i,void 0,o)}function Ut(A,P){let O=s==null;Ys(A,P,s||a,o,i),O&&(a=[...a],de({}))}return C={get basename(){return l},get future(){return d},get state(){return k},get routes(){return a},get window(){return t},initialize:Le,subscribe:we,enableScrollRestoration:Bt,navigate:lt,fetch:Qt,revalidate:Mt,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Se,deleteFetcher:St,dispose:ve,getBlocker:Ft,deleteBlocker:ct,patchRoutes:Ut,_internalFetchControllers:$,_internalActiveDeferreds:ge,_internalSetRoutes:mt},C}function cm(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function oa(e,t,n,r,i,o,a,s){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let u=ro(i||".",no(l,o),tn(e.pathname,n)||e.pathname,s==="path");if(i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&c){let d=Ja(u.search);if(c.route.index&&!d)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let h=new URLSearchParams(u.search),f=h.getAll("index");h.delete("index"),f.filter(p=>p).forEach(p=>h.append("index",p));let m=h.toString();u.search=m?"?"+m:""}}return r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:en([n,u.pathname])),Bn(u)}function Ws(e,t,n,r){if(!r||!cm(r))return{path:n};if(r.formMethod&&!wm(r.formMethod))return{path:n,error:dt(405,{method:r.formMethod})};let i=()=>({path:n,error:dt(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=Nu(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Lt(a))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,m)=>{let[p,y]=m;return""+f+p+"="+y+`
20
- `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Lt(a))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}xe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=sa(r.formData),c=r.formData;else if(r.body instanceof FormData)l=sa(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=Xs(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=Xs(l)}catch{return i()}let u={formMethod:a,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Lt(u.formMethod))return{path:n,submission:u};let d=xn(n);return t&&d.search&&Ja(d.search)&&l.append("index",""),d.search="?"+l,{path:Bn(d),submission:u}}function Ks(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function qs(e,t,n,r,i,o,a,s,l,c,u,d,h,f,m,p){let y=p?yt(p[1])?p[1].error:p[1].data:void 0,v=e.createURL(t.location),x=e.createURL(i),w=n;o&&t.errors?w=Ks(n,Object.keys(t.errors)[0],!0):p&&yt(p[1])&&(w=Ks(n,p[0]));let R=p?p[1].statusCode:void 0,I=a&&R&&R>=400,C=w.filter((D,j)=>{let{route:T}=D;if(T.lazy)return!0;if(T.loader==null)return!1;if(o)return aa(T,t.loaderData,t.errors);if(um(t.loaderData,t.matches[j],D)||l.some(K=>K===D.route.id))return!0;let _=t.matches[j],L=D;return Gs(D,Ue({currentUrl:v,currentParams:_.params,nextUrl:x,nextParams:L.params},r,{actionResult:y,actionStatus:R,defaultShouldRevalidate:I?!1:s||v.pathname+v.search===x.pathname+x.search||v.search!==x.search||Lu(_,L)}))}),k=[];return d.forEach((D,j)=>{if(o||!n.some(B=>B.route.id===D.routeId)||u.has(j))return;let T=On(f,D.path,m);if(!T){k.push({key:j,routeId:D.routeId,path:D.path,matches:null,match:null,controller:null});return}let _=t.fetchers.get(j),L=Fr(T,D.path),K=!1;h.has(j)?K=!1:c.has(j)?(c.delete(j),K=!0):_&&_.state!=="idle"&&_.data===void 0?K=s:K=Gs(L,Ue({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:y,actionStatus:R,defaultShouldRevalidate:I?!1:s})),K&&k.push({key:j,routeId:D.routeId,path:D.path,matches:T,match:L,controller:new AbortController})}),[C,k]}function aa(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function um(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Lu(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Gs(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Ys(e,t,n,r,i){var o;let a;if(e){let c=r[e];xe(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let s=t.filter(c=>!a.some(u=>Ou(c,u))),l=Li(s,i,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...l)}function Ou(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?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>Ou(n,o))}):!1}async function dm(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];xe(i,"No route found in manifest");let o={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Fn(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!Dp.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,Ue({},t(i),{lazy:void 0}))}async function fm(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,o,a)=>Object.assign(i,{[n[a].route.id]:o}),{})}async function hm(e,t,n,r,i,o,a,s,l,c){let u=o.map(f=>f.route.lazy?dm(f.route,l,s):void 0),d=o.map((f,m)=>{let p=u[m],y=i.some(x=>x.route.id===f.route.id);return Ue({},f,{shouldLoad:y,resolve:async x=>(x&&r.method==="GET"&&(f.route.lazy||f.route.loader)&&(y=!0),y?pm(t,r,f,p,x,c):Promise.resolve({type:Ne.data,result:void 0}))})}),h=await e({matches:d,request:r,params:o[0].params,fetcherKey:a,context:c});try{await Promise.all(u)}catch{}return h}async function pm(e,t,n,r,i,o){let a,s,l=c=>{let u,d=new Promise((m,p)=>u=p);s=()=>u(),t.signal.addEventListener("abort",s);let h=m=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:o},...m!==void 0?[m]:[]),f=(async()=>{try{return{type:"data",result:await(i?i(p=>h(p)):h())}}catch(m){return{type:"error",result:m}}})();return Promise.race([f,d])};try{let c=n.route[e];if(r)if(c){let u,[d]=await Promise.all([l(c).catch(h=>{u=h}),r]);if(u!==void 0)throw u;a=d}else if(await r,c=n.route[e],c)a=await l(c);else if(e==="action"){let u=new URL(t.url),d=u.pathname+u.search;throw dt(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:Ne.data,result:void 0};else if(c)a=await l(c);else{let u=new URL(t.url),d=u.pathname+u.search;throw dt(404,{pathname:d})}xe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Ne.error,result:c}}finally{s&&t.signal.removeEventListener("abort",s)}return a}async function mm(e){let{result:t,type:n}=e;if(Du(t)){let d;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?d=null:d=await t.json():d=await t.text()}catch(h){return{type:Ne.error,error:h}}return n===Ne.error?{type:Ne.error,error:new Ni(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:Ne.data,data:d,statusCode:t.status,headers:t.headers}}if(n===Ne.error){if(nl(t)){var r,i;if(t.data instanceof Error){var o,a;return{type:Ne.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:Ne.error,error:new Ni(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:Wr(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:Ne.error,error:t,statusCode:Wr(t)?t.status:void 0}}if(xm(t)){var s,l;return{type:Ne.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(nl(t)){var c,u;return{type:Ne.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Ne.data,data:t}}function gm(e,t,n,r,i,o){let a=e.headers.get("Location");if(xe(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Qa.test(a)){let s=r.slice(0,r.findIndex(l=>l.route.id===n)+1);a=oa(new URL(t.url),s,i,!0,a,o),e.headers.set("Location",a)}return e}function Qs(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Qa.test(e)){let o=e,a=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(i.includes(a.protocol))throw new Error("Invalid redirect location");let s=tn(a.pathname,n)!=null;if(a.origin===t.origin&&s)return Ya(a.pathname)+a.search+a.hash}try{let o=r.createURL(e);if(i.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Jn(e,t,n,r){let i=e.createURL(Nu(t)).toString(),o={signal:n};if(r&&Lt(r.formMethod)){let{formMethod:a,formEncType:s}=r;o.method=a.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=sa(r.formData):o.body=r.formData}return new Request(i,o)}function sa(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Xs(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function ym(e,t,n,r,i){let o={},a=null,s,l=!1,c={},u=n&&yt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let h=d.route.id,f=t[h];if(xe(!Mn(f),"Cannot handle redirect results in processLoaderData"),yt(f)){let m=f.error;u!==void 0&&(m=u,u=void 0),a=a||{};{let p=Nn(e,h);a[p.route.id]==null&&(a[p.route.id]=m)}o[h]=void 0,l||(l=!0,s=Wr(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else gn(f)?(r.set(h,f.deferredData),o[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers)):(o[h]=f.data,f.statusCode&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers))}),u!==void 0&&n&&(a={[n[0]]:u},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:c}}function Js(e,t,n,r,i,o,a){let{loaderData:s,errors:l}=ym(t,n,r,a);return i.forEach(c=>{let{key:u,match:d,controller:h}=c,f=o[u];if(xe(f,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(yt(f)){let m=Nn(e.matches,d?.route.id);l&&l[m.route.id]||(l=Ue({},l,{[m.route.id]:f.error})),e.fetchers.delete(u)}else if(Mn(f))xe(!1,"Unhandled fetcher revalidation redirect");else if(gn(f))xe(!1,"Unhandled fetcher deferred data");else{let m=pn(f.data);e.fetchers.set(u,m)}}),{loaderData:s,errors:l}}function Zs(e,t,n,r){let i=Ue({},t);for(let o of n){let a=o.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&o.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function el(e){return e?yt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Nn(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function tl(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function dt(e,t){let{pathname:n,routeId:r,method:i,type:o,message:a}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Ni(e||500,s,new Error(l),!0)}function ci(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Mn(i))return{key:r,result:i}}}function Nu(e){let t=typeof e=="string"?xn(e):e;return Bn(Ue({},t,{hash:""}))}function bm(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function vm(e){return Du(e.result)&&im.has(e.result.status)}function gn(e){return e.type===Ne.deferred}function yt(e){return e.type===Ne.error}function Mn(e){return(e&&e.type)===Ne.redirect}function nl(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function xm(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Du(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function wm(e){return rm.has(e.toLowerCase())}function Lt(e){return tm.has(e.toLowerCase())}async function km(e,t,n,r,i){let o=Object.entries(t);for(let a=0;a<o.length;a++){let[s,l]=o[a],c=e.find(h=>h?.route.id===s);if(!c)continue;let u=r.find(h=>h.route.id===c.route.id),d=u!=null&&!Lu(u,c)&&(i&&i[c.route.id])!==void 0;gn(l)&&d&&await Xa(l,n,!1).then(h=>{h&&(t[s]=h)})}}async function Sm(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:o,controller:a}=n[r],s=t[i];e.find(c=>c?.route.id===o)&&gn(s)&&(xe(a,"Expected an AbortController for revalidating fetcher deferred result"),await Xa(s,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function Xa(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Ne.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Ne.error,error:i}}return{type:Ne.data,data:e.deferredData.data}}}function Ja(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Fr(e,t){let n=typeof t=="string"?xn(t).search:t.search;if(e[e.length-1].route.index&&Ja(n||""))return e[e.length-1];let r=Ru(e);return r[r.length-1]}function rl(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Po(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Em(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Pr(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 Cm(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 pn(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 Am(e,t){try{let n=e.sessionStorage.getItem(Iu);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function Tm(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Iu,JSON.stringify(n))}catch(r){Fn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
19
+ */function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},He.apply(null,arguments)}var Ge;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ge||(Ge={}));const Us="popstate";function Lp(e){e===void 0&&(e={});function t(r,i){let{pathname:o,search:a,hash:s}=r.location;return Vr("",{pathname:o,search:a,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Bn(i)}return _p(t,n,null,e)}function xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Fn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Op(){return Math.random().toString(36).substr(2,8)}function zs(e,t){return{usr:e.state,key:e.key,idx:t}}function Vr(e,t,n,r){return n===void 0&&(n=null),He({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?xn(t):t,{state:n,key:t&&t.key||r||Op()})}function Bn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function xn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function _p(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,s=Ge.Pop,l=null,c=u();c==null&&(c=0,a.replaceState(He({},a.state,{idx:c}),""));function u(){return(a.state||{idx:null}).idx}function d(){s=Ge.Pop;let y=u(),b=y==null?null:y-c;c=y,l&&l({action:s,location:p.location,delta:b})}function h(y,b){s=Ge.Push;let x=Vr(p.location,y,b);c=u()+1;let w=zs(x,c),R=p.createHref(x);try{a.pushState(w,"",R)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(R)}o&&l&&l({action:s,location:p.location,delta:1})}function f(y,b){s=Ge.Replace;let x=Vr(p.location,y,b);c=u();let w=zs(x,c),R=p.createHref(x);a.replaceState(w,"",R),o&&l&&l({action:s,location:p.location,delta:0})}function m(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,x=typeof y=="string"?y:Bn(y);return x=x.replace(/ $/,"%20"),xe(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let p={get action(){return s},get location(){return e(i,a)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Us,d),l=y,()=>{i.removeEventListener(Us,d),l=null}},createHref(y){return t(i,y)},createURL:m,encodeLocation(y){let b=m(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:f,go(y){return a.go(y)}};return p}var _e;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_e||(_e={}));const Np=new Set(["lazy","caseSensitive","path","id","index","children"]);function Dp(e){return e.index===!0}function Li(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,String(o)],s=typeof i.id=="string"?i.id:a.join("-");if(xe(i.index!==!0||!i.children,"Cannot specify children on an index route"),xe(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Dp(i)){let l=He({},i,t(i),{id:s});return r[s]=l,l}else{let l=He({},i,t(i),{id:s,children:void 0});return r[s]=l,i.children&&(l.children=Li(i.children,t,a,r)),l}})}function On(e,t,n){return n===void 0&&(n="/"),Ei(e,t,n,!1)}function Ei(e,t,n,r){let i=typeof t=="string"?xn(t):t,o=tn(i.pathname||"/",n);if(o==null)return null;let a=Au(e);jp(a);let s=null,l=Gp(o);for(let c=0;s==null&&c<a.length;++c)s=Kp(a[c],l,r);return s}function Mp(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Au(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,a,s)=>{let l={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};l.relativePath.startsWith("/")&&(xe(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 c=en([r,l.relativePath]),u=n.concat(l);o.children&&o.children.length>0&&(xe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Au(o.children,t,u,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:Vp(c,o.index),routesMeta:u})};return e.forEach((o,a)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,a);else for(let l of Tu(o.path))i(o,a,l)}),t}function Tu(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=Tu(r.join("/")),s=[];return s.push(...a.map(l=>l===""?o:[o,l].join("/"))),i&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function jp(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Wp(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Fp=/^:[\w-]+$/,Bp=3,Hp=2,Up=1,zp=10,$p=-2,$s=e=>e==="*";function Vp(e,t){let n=e.split("/"),r=n.length;return n.some($s)&&(r+=$p),t&&(r+=Hp),n.filter(i=>!$s(i)).reduce((i,o)=>i+(Fp.test(o)?Bp:o===""?Up:zp),r)}function Wp(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Kp(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=Oi({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Oi({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(i,d.params),a.push({params:i,pathname:en([o,d.pathname]),pathnameBase:Jp(en([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=en([o,d.pathnameBase]))}return a}function Oi(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=qp(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:h,isOptional:f}=u;if(h==="*"){let p=s[d]||"";a=o.slice(0,o.length-p.length).replace(/(.)\/+$/,"$1")}const m=s[d];return f&&!m?c[h]=void 0:c[h]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:a,pattern:e}}function qp(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Fn(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,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Gp(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function tn(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)||"/"}const Yp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qp=e=>Yp.test(e);function Xp(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?xn(e):e,o;if(n)if(Qp(n))o=n;else{if(n.includes("//")){let a=n;n=Ya(n),Fn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?o=Vs(n.substring(1),"/"):o=Vs(n,t)}else o=t;return{pathname:o,search:Zp(r),hash:em(i)}}function Vs(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function To(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 Ru(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function no(e,t){let n=Ru(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ro(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=xn(e):(i=He({},e),xe(!i.pathname||!i.pathname.includes("?"),To("?","pathname","search",i)),xe(!i.pathname||!i.pathname.includes("#"),To("#","pathname","hash",i)),xe(!i.search||!i.search.includes("#"),To("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,s;if(a==null)s=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=Xp(i,s),c=a&&a!=="/"&&a.endsWith("/"),u=(o||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const Ya=e=>e.replace(/\/\/+/g,"/"),en=e=>Ya(e.join("/")),Jp=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Zp=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,em=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class _i{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Wr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Pu=["post","put","patch","delete"],tm=new Set(Pu),nm=["get",...Pu],rm=new Set(nm),im=new Set([301,302,303,307,308]),om=new Set([307,308]),Ro={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},am={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Qa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sm=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Iu="remix-router-transitions";function lm(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;xe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let A=e.detectErrorBoundary;i=P=>({hasErrorBoundary:A(P)})}else i=sm;let o={},a=Li(e.routes,i,void 0,o),s,l=e.basename||"/",c=e.dataStrategy||fm,u=e.patchRoutesOnNavigation,d=He({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,f=new Set,m=null,p=null,y=null,b=e.hydrationData!=null,x=On(a,e.history.location,l),w=!1,R=null;if(x==null&&!u){let A=dt(404,{pathname:e.history.location.pathname}),{matches:P,route:O}=tl(a);x=P,R={[O.id]:A}}x&&!e.hydrationData&&Oe(x,a,e.history.location.pathname).active&&(x=null);let I;if(x)if(x.some(A=>A.route.lazy))I=!1;else if(!x.some(A=>A.route.loader))I=!0;else if(d.v7_partialHydration){let A=e.hydrationData?e.hydrationData.loaderData:null,P=e.hydrationData?e.hydrationData.errors:null;if(P){let O=x.findIndex(M=>P[M.route.id]!==void 0);I=x.slice(0,O+1).every(M=>!aa(M.route,A,P))}else I=x.every(O=>!aa(O.route,A,P))}else I=e.hydrationData!=null;else if(I=!1,x=[],d.v7_partialHydration){let A=Oe(null,a,e.history.location.pathname);A.active&&A.matches&&(w=!0,x=A.matches)}let C,S={historyAction:e.history.action,location:e.history.location,matches:x,initialized:I,navigation:Ro,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||R,fetchers:new Map,blockers:new Map},N=Ge.Pop,j=!1,T,D=!1,L=new Map,K=null,B=!1,V=!1,q=[],Q=new Set,$=new Map,F=0,k=-1,se=new Map,te=new Set,E=new Map,oe=new Map,fe=new Set,ge=new Map,W=new Map,ye;function Le(){if(h=e.history.listen(A=>{let{action:P,location:O,delta:M}=A;if(ye){ye(),ye=void 0;return}Fn(W.size===0||M!=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 G=kr({currentLocation:S.location,nextLocation:O,historyAction:P});if(G&&M!=null){let re=new Promise(le=>{ye=le});e.history.go(M*-1),Tn(G,{state:"blocked",location:O,proceed(){Tn(G,{state:"proceeding",proceed:void 0,reset:void 0,location:O}),re.then(()=>e.history.go(M))},reset(){let le=new Map(S.blockers);le.set(G,Rr),de({blockers:le})}});return}return Je(P,O)}),n){Am(t,L);let A=()=>Tm(t,L);t.addEventListener("pagehide",A),K=()=>t.removeEventListener("pagehide",A)}return S.initialized||Je(Ge.Pop,S.location,{initialHydration:!0}),C}function be(){h&&h(),K&&K(),f.clear(),T&&T.abort(),S.fetchers.forEach((A,P)=>Qe(P)),S.blockers.forEach((A,P)=>ct(P))}function we(A){return f.add(A),()=>f.delete(A)}function de(A,P){P===void 0&&(P={}),S=He({},S,A);let O=[],M=[];d.v7_fetcherPersist&&S.fetchers.forEach((G,re)=>{G.state==="idle"&&(fe.has(re)?M.push(re):O.push(re))}),fe.forEach(G=>{!S.fetchers.has(G)&&!$.has(G)&&M.push(G)}),[...f].forEach(G=>G(S,{deletedFetchers:M,viewTransitionOpts:P.viewTransitionOpts,flushSync:P.flushSync===!0})),d.v7_fetcherPersist?(O.forEach(G=>S.fetchers.delete(G)),M.forEach(G=>Qe(G))):M.forEach(G=>fe.delete(G))}function Be(A,P,O){var M,G;let{flushSync:re}=O===void 0?{}:O,le=S.actionData!=null&&S.navigation.formMethod!=null&&Lt(S.navigation.formMethod)&&S.navigation.state==="loading"&&((M=A.state)==null?void 0:M._isRedirect)!==!0,J;P.actionData?Object.keys(P.actionData).length>0?J=P.actionData:J=null:le?J=S.actionData:J=null;let Z=P.loaderData?Zs(S.loaderData,P.loaderData,P.matches||[],P.errors):S.loaderData,X=S.blockers;X.size>0&&(X=new Map(X),X.forEach((Ee,Ze)=>X.set(Ze,Rr)));let ee=j===!0||S.navigation.formMethod!=null&&Lt(S.navigation.formMethod)&&((G=A.state)==null?void 0:G._isRedirect)!==!0;s&&(a=s,s=void 0),B||N===Ge.Pop||(N===Ge.Push?e.history.push(A,A.state):N===Ge.Replace&&e.history.replace(A,A.state));let he;if(N===Ge.Pop){let Ee=L.get(S.location.pathname);Ee&&Ee.has(A.pathname)?he={currentLocation:S.location,nextLocation:A}:L.has(A.pathname)&&(he={currentLocation:A,nextLocation:S.location})}else if(D){let Ee=L.get(S.location.pathname);Ee?Ee.add(A.pathname):(Ee=new Set([A.pathname]),L.set(S.location.pathname,Ee)),he={currentLocation:S.location,nextLocation:A}}de(He({},P,{actionData:J,loaderData:Z,historyAction:N,location:A,initialized:!0,navigation:Ro,revalidation:"idle",restoreScrollPosition:Te(A,P.matches||S.matches),preventScrollReset:ee,blockers:X}),{viewTransitionOpts:he,flushSync:re===!0}),N=Ge.Pop,j=!1,D=!1,B=!1,V=!1,q=[]}async function lt(A,P){if(typeof A=="number"){e.history.go(A);return}let O=oa(S.location,S.matches,l,d.v7_prependBasename,A,d.v7_relativeSplatPath,P?.fromRouteId,P?.relative),{path:M,submission:G,error:re}=Ws(d.v7_normalizeFormMethod,!1,O,P),le=S.location,J=Vr(S.location,M,P&&P.state);J=He({},J,e.history.encodeLocation(J));let Z=P&&P.replace!=null?P.replace:void 0,X=Ge.Push;Z===!0?X=Ge.Replace:Z===!1||G!=null&&Lt(G.formMethod)&&G.formAction===S.location.pathname+S.location.search&&(X=Ge.Replace);let ee=P&&"preventScrollReset"in P?P.preventScrollReset===!0:void 0,he=(P&&P.flushSync)===!0,Ee=kr({currentLocation:le,nextLocation:J,historyAction:X});if(Ee){Tn(Ee,{state:"blocked",location:J,proceed(){Tn(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),lt(A,P)},reset(){let Ze=new Map(S.blockers);Ze.set(Ee,Rr),de({blockers:Ze})}});return}return await Je(X,J,{submission:G,pendingError:re,preventScrollReset:ee,replace:P&&P.replace,enableViewTransition:P&&P.viewTransition,flushSync:he})}function Mt(){if(U(),de({revalidation:"loading"}),S.navigation.state!=="submitting"){if(S.navigation.state==="idle"){Je(S.historyAction,S.location,{startUninterruptedRevalidation:!0});return}Je(N||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:D===!0})}}async function Je(A,P,O){T&&T.abort(),T=null,N=A,B=(O&&O.startUninterruptedRevalidation)===!0,ce(S.location,S.matches),j=(O&&O.preventScrollReset)===!0,D=(O&&O.enableViewTransition)===!0;let M=s||a,G=O&&O.overrideNavigation,re=O!=null&&O.initialHydration&&S.matches&&S.matches.length>0&&!w?S.matches:On(M,P,l),le=(O&&O.flushSync)===!0;if(re&&S.initialized&&!V&&vm(S.location,P)&&!(O&&O.submission&&Lt(O.submission.formMethod))){Be(P,{matches:re},{flushSync:le});return}let J=Oe(re,M,P.pathname);if(J.active&&J.matches&&(re=J.matches),!re){let{error:De,notFoundMatches:Re,route:$e}=Er(P.pathname);Be(P,{matches:Re,loaderData:{},errors:{[$e.id]:De}},{flushSync:le});return}T=new AbortController;let Z=Jn(e.history,P,T.signal,O&&O.submission),X;if(O&&O.pendingError)X=[_n(re).route.id,{type:_e.error,error:O.pendingError}];else if(O&&O.submission&&Lt(O.submission.formMethod)){let De=await jt(Z,P,O.submission,re,J.active,{replace:O.replace,flushSync:le});if(De.shortCircuited)return;if(De.pendingActionResult){let[Re,$e]=De.pendingActionResult;if(yt($e)&&Wr($e.error)&&$e.error.status===404){T=null,Be(P,{matches:De.matches,loaderData:{},errors:{[Re]:$e.error}});return}}re=De.matches||re,X=De.pendingActionResult,G=Po(P,O.submission),le=!1,J.active=!1,Z=Jn(e.history,Z.url,Z.signal)}let{shortCircuited:ee,matches:he,loaderData:Ee,errors:Ze}=await En(Z,P,re,J.active,G,O&&O.submission,O&&O.fetcherSubmission,O&&O.replace,O&&O.initialHydration===!0,le,X);ee||(T=null,Be(P,He({matches:he||re},el(X),{loaderData:Ee,errors:Ze})))}async function jt(A,P,O,M,G,re){re===void 0&&(re={}),U();let le=Em(P,O);if(de({navigation:le},{flushSync:re.flushSync===!0}),G){let X=await tt(M,P.pathname,A.signal);if(X.type==="aborted")return{shortCircuited:!0};if(X.type==="error"){let ee=_n(X.partialMatches).route.id;return{matches:X.partialMatches,pendingActionResult:[ee,{type:_e.error,error:X.error}]}}else if(X.matches)M=X.matches;else{let{notFoundMatches:ee,error:he,route:Ee}=Er(P.pathname);return{matches:ee,pendingActionResult:[Ee.id,{type:_e.error,error:he}]}}}let J,Z=Fr(M,P);if(!Z.route.action&&!Z.route.lazy)J={type:_e.error,error:dt(405,{method:A.method,pathname:P.pathname,routeId:Z.route.id})};else if(J=(await Xt("action",S,A,[Z],M,null))[Z.route.id],A.signal.aborted)return{shortCircuited:!0};if(Mn(J)){let X;return re&&re.replace!=null?X=re.replace:X=Qs(J.response.headers.get("Location"),new URL(A.url),l,e.history)===S.location.pathname+S.location.search,await Tt(A,J,!0,{submission:O,replace:X}),{shortCircuited:!0}}if(gn(J))throw dt(400,{type:"defer-action"});if(yt(J)){let X=_n(M,Z.route.id);return(re&&re.replace)!==!0&&(N=Ge.Push),{matches:M,pendingActionResult:[X.route.id,J]}}return{matches:M,pendingActionResult:[Z.route.id,J]}}async function En(A,P,O,M,G,re,le,J,Z,X,ee){let he=G||Po(P,re),Ee=re||le||rl(he),Ze=!B&&(!d.v7_partialHydration||!Z);if(M){if(Ze){let Ve=Cn(ee);de(He({navigation:he},Ve!==void 0?{actionData:Ve}:{}),{flushSync:X})}let Ae=await tt(O,P.pathname,A.signal);if(Ae.type==="aborted")return{shortCircuited:!0};if(Ae.type==="error"){let Ve=_n(Ae.partialMatches).route.id;return{matches:Ae.partialMatches,loaderData:{},errors:{[Ve]:Ae.error}}}else if(Ae.matches)O=Ae.matches;else{let{error:Ve,notFoundMatches:Qn,route:Tr}=Er(P.pathname);return{matches:Qn,loaderData:{},errors:{[Tr.id]:Ve}}}}let De=s||a,[Re,$e]=qs(e.history,S,O,Ee,P,d.v7_partialHydration&&Z===!0,d.v7_skipActionErrorRevalidation,V,q,Q,fe,E,te,De,l,ee);if(Rn(Ae=>!(O&&O.some(Ve=>Ve.route.id===Ae))||Re&&Re.some(Ve=>Ve.route.id===Ae)),k=++F,Re.length===0&&$e.length===0){let Ae=Rt();return Be(P,He({matches:O,loaderData:{},errors:ee&&yt(ee[1])?{[ee[0]]:ee[1].error}:null},el(ee),Ae?{fetchers:new Map(S.fetchers)}:{}),{flushSync:X}),{shortCircuited:!0}}if(Ze){let Ae={};if(!M){Ae.navigation=he;let Ve=Cn(ee);Ve!==void 0&&(Ae.actionData=Ve)}$e.length>0&&(Ae.fetchers=An($e)),de(Ae,{flushSync:X})}$e.forEach(Ae=>{ze(Ae.key),Ae.controller&&$.set(Ae.key,Ae.controller)});let Yn=()=>$e.forEach(Ae=>ze(Ae.key));T&&T.signal.addEventListener("abort",Yn);let{loaderResults:Cr,fetcherResults:Jt}=await _(S,O,Re,$e,A);if(A.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",Yn),$e.forEach(Ae=>$.delete(Ae.key));let Ut=ci(Cr);if(Ut)return await Tt(A,Ut.result,!0,{replace:J}),{shortCircuited:!0};if(Ut=ci(Jt),Ut)return te.add(Ut.key),await Tt(A,Ut.result,!0,{replace:J}),{shortCircuited:!0};let{loaderData:Ao,errors:Ar}=Js(S,O,Cr,ee,$e,Jt,ge);ge.forEach((Ae,Ve)=>{Ae.subscribe(Qn=>{(Qn||Ae.done)&&ge.delete(Ve)})}),d.v7_partialHydration&&Z&&S.errors&&(Ar=He({},S.errors,Ar));let Pn=Rt(),si=Ue(k),li=Pn||si||$e.length>0;return He({matches:O,loaderData:Ao,errors:Ar},li?{fetchers:new Map(S.fetchers)}:{})}function Cn(A){if(A&&!yt(A[1]))return{[A[0]]:A[1].data};if(S.actionData)return Object.keys(S.actionData).length===0?null:S.actionData}function An(A){return A.forEach(P=>{let O=S.fetchers.get(P.key),M=Pr(void 0,O?O.data:void 0);S.fetchers.set(P.key,M)}),new Map(S.fetchers)}function Qt(A,P,O,M){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ze(A);let G=(M&&M.flushSync)===!0,re=s||a,le=oa(S.location,S.matches,l,d.v7_prependBasename,O,d.v7_relativeSplatPath,P,M?.relative),J=On(re,le,l),Z=Oe(J,re,le);if(Z.active&&Z.matches&&(J=Z.matches),!J){ae(A,P,dt(404,{pathname:le}),{flushSync:G});return}let{path:X,submission:ee,error:he}=Ws(d.v7_normalizeFormMethod,!0,le,M);if(he){ae(A,P,he,{flushSync:G});return}let Ee=Fr(J,X),Ze=(M&&M.preventScrollReset)===!0;if(ee&&Lt(ee.formMethod)){Gn(A,P,X,Ee,J,Z.active,G,Ze,ee);return}E.set(A,{routeId:P,path:X}),At(A,P,X,Ee,J,Z.active,G,Ze,ee)}async function Gn(A,P,O,M,G,re,le,J,Z){U(),E.delete(A);function X(Ke){if(!Ke.route.action&&!Ke.route.lazy){let Xn=dt(405,{method:Z.formMethod,pathname:O,routeId:P});return ae(A,P,Xn,{flushSync:le}),!0}return!1}if(!re&&X(M))return;let ee=S.fetchers.get(A);ne(A,Cm(Z,ee),{flushSync:le});let he=new AbortController,Ee=Jn(e.history,O,he.signal,Z);if(re){let Ke=await tt(G,new URL(Ee.url).pathname,Ee.signal,A);if(Ke.type==="aborted")return;if(Ke.type==="error"){ae(A,P,Ke.error,{flushSync:le});return}else if(Ke.matches){if(G=Ke.matches,M=Fr(G,O),X(M))return}else{ae(A,P,dt(404,{pathname:O}),{flushSync:le});return}}$.set(A,he);let Ze=F,Re=(await Xt("action",S,Ee,[M],G,A))[M.route.id];if(Ee.signal.aborted){$.get(A)===he&&$.delete(A);return}if(d.v7_fetcherPersist&&fe.has(A)){if(Mn(Re)||yt(Re)){ne(A,pn(void 0));return}}else{if(Mn(Re))if($.delete(A),k>Ze){ne(A,pn(void 0));return}else return te.add(A),ne(A,Pr(Z)),Tt(Ee,Re,!1,{fetcherSubmission:Z,preventScrollReset:J});if(yt(Re)){ae(A,P,Re.error);return}}if(gn(Re))throw dt(400,{type:"defer-action"});let $e=S.navigation.location||S.location,Yn=Jn(e.history,$e,he.signal),Cr=s||a,Jt=S.navigation.state!=="idle"?On(Cr,S.navigation.location,l):S.matches;xe(Jt,"Didn't find any matches after fetcher action");let Ut=++F;se.set(A,Ut);let Ao=Pr(Z,Re.data);S.fetchers.set(A,Ao);let[Ar,Pn]=qs(e.history,S,Jt,Z,$e,!1,d.v7_skipActionErrorRevalidation,V,q,Q,fe,E,te,Cr,l,[M.route.id,Re]);Pn.filter(Ke=>Ke.key!==A).forEach(Ke=>{let Xn=Ke.key,Fs=S.fetchers.get(Xn),wp=Pr(void 0,Fs?Fs.data:void 0);S.fetchers.set(Xn,wp),ze(Xn),Ke.controller&&$.set(Xn,Ke.controller)}),de({fetchers:new Map(S.fetchers)});let si=()=>Pn.forEach(Ke=>ze(Ke.key));he.signal.addEventListener("abort",si);let{loaderResults:li,fetcherResults:Ae}=await _(S,Jt,Ar,Pn,Yn);if(he.signal.aborted)return;he.signal.removeEventListener("abort",si),se.delete(A),$.delete(A),Pn.forEach(Ke=>$.delete(Ke.key));let Ve=ci(li);if(Ve)return Tt(Yn,Ve.result,!1,{preventScrollReset:J});if(Ve=ci(Ae),Ve)return te.add(Ve.key),Tt(Yn,Ve.result,!1,{preventScrollReset:J});let{loaderData:Qn,errors:Tr}=Js(S,Jt,li,void 0,Pn,Ae,ge);if(S.fetchers.has(A)){let Ke=pn(Re.data);S.fetchers.set(A,Ke)}Ue(Ut),S.navigation.state==="loading"&&Ut>k?(xe(N,"Expected pending action"),T&&T.abort(),Be(S.navigation.location,{matches:Jt,loaderData:Qn,errors:Tr,fetchers:new Map(S.fetchers)})):(de({errors:Tr,loaderData:Zs(S.loaderData,Qn,Jt,Tr),fetchers:new Map(S.fetchers)}),V=!1)}async function At(A,P,O,M,G,re,le,J,Z){let X=S.fetchers.get(A);ne(A,Pr(Z,X?X.data:void 0),{flushSync:le});let ee=new AbortController,he=Jn(e.history,O,ee.signal);if(re){let Re=await tt(G,new URL(he.url).pathname,he.signal,A);if(Re.type==="aborted")return;if(Re.type==="error"){ae(A,P,Re.error,{flushSync:le});return}else if(Re.matches)G=Re.matches,M=Fr(G,O);else{ae(A,P,dt(404,{pathname:O}),{flushSync:le});return}}$.set(A,ee);let Ee=F,De=(await Xt("loader",S,he,[M],G,A))[M.route.id];if(gn(De)&&(De=await Xa(De,he.signal,!0)||De),$.get(A)===ee&&$.delete(A),!he.signal.aborted){if(fe.has(A)){ne(A,pn(void 0));return}if(Mn(De))if(k>Ee){ne(A,pn(void 0));return}else{te.add(A),await Tt(he,De,!1,{preventScrollReset:J});return}if(yt(De)){ae(A,P,De.error);return}xe(!gn(De),"Unhandled fetcher deferred data"),ne(A,pn(De.data))}}async function Tt(A,P,O,M){let{submission:G,fetcherSubmission:re,preventScrollReset:le,replace:J}=M===void 0?{}:M;P.response.headers.has("X-Remix-Revalidate")&&(V=!0);let Z=P.response.headers.get("Location");xe(Z,"Expected a Location header on the redirect Response"),Z=Qs(Z,new URL(A.url),l,e.history);let X=Vr(S.location,Z,{_isRedirect:!0});if(n){let Re=!1;if(P.response.headers.has("X-Remix-Reload-Document"))Re=!0;else if(Qa.test(Z)){const $e=e.history.createURL(Z);Re=$e.origin!==t.location.origin||tn($e.pathname,l)==null}if(Re){J?t.location.replace(Z):t.location.assign(Z);return}}T=null;let ee=J===!0||P.response.headers.has("X-Remix-Replace")?Ge.Replace:Ge.Push,{formMethod:he,formAction:Ee,formEncType:Ze}=S.navigation;!G&&!re&&he&&Ee&&Ze&&(G=rl(S.navigation));let De=G||re;if(om.has(P.response.status)&&De&&Lt(De.formMethod))await Je(ee,X,{submission:He({},De,{formAction:Z}),preventScrollReset:le||j,enableViewTransition:O?D:void 0});else{let Re=Po(X,G);await Je(ee,X,{overrideNavigation:Re,fetcherSubmission:re,preventScrollReset:le||j,enableViewTransition:O?D:void 0})}}async function Xt(A,P,O,M,G,re){let le,J={};try{le=await hm(c,A,P,O,M,G,re,o,i)}catch(Z){return M.forEach(X=>{J[X.route.id]={type:_e.error,error:Z}}),J}for(let[Z,X]of Object.entries(le))if(bm(X)){let ee=X.result;J[Z]={type:_e.redirect,response:gm(ee,O,Z,G,l,d.v7_relativeSplatPath)}}else J[Z]=await mm(X);return J}async function _(A,P,O,M,G){let re=A.matches,le=Xt("loader",A,G,O,P,null),J=Promise.all(M.map(async ee=>{if(ee.matches&&ee.match&&ee.controller){let Ee=(await Xt("loader",A,Jn(e.history,ee.path,ee.controller.signal),[ee.match],ee.matches,ee.key))[ee.match.route.id];return{[ee.key]:Ee}}else return Promise.resolve({[ee.key]:{type:_e.error,error:dt(404,{pathname:ee.path})}})})),Z=await le,X=(await J).reduce((ee,he)=>Object.assign(ee,he),{});return await Promise.all([Sm(P,Z,G.signal,re,A.loaderData),km(P,X,M)]),{loaderResults:Z,fetcherResults:X}}function U(){V=!0,q.push(...Rn()),E.forEach((A,P)=>{$.has(P)&&Q.add(P),ze(P)})}function ne(A,P,O){O===void 0&&(O={}),S.fetchers.set(A,P),de({fetchers:new Map(S.fetchers)},{flushSync:(O&&O.flushSync)===!0})}function ae(A,P,O,M){M===void 0&&(M={});let G=_n(S.matches,P);Qe(A),de({errors:{[G.route.id]:O},fetchers:new Map(S.fetchers)},{flushSync:(M&&M.flushSync)===!0})}function ke(A){return oe.set(A,(oe.get(A)||0)+1),fe.has(A)&&fe.delete(A),S.fetchers.get(A)||am}function Qe(A){let P=S.fetchers.get(A);$.has(A)&&!(P&&P.state==="loading"&&se.has(A))&&ze(A),E.delete(A),se.delete(A),te.delete(A),d.v7_fetcherPersist&&fe.delete(A),Q.delete(A),S.fetchers.delete(A)}function kt(A){let P=(oe.get(A)||0)-1;P<=0?(oe.delete(A),fe.add(A),d.v7_fetcherPersist||Qe(A)):oe.set(A,P),de({fetchers:new Map(S.fetchers)})}function ze(A){let P=$.get(A);P&&(P.abort(),$.delete(A))}function ot(A){for(let P of A){let O=ke(P),M=pn(O.data);S.fetchers.set(P,M)}}function Rt(){let A=[],P=!1;for(let O of te){let M=S.fetchers.get(O);xe(M,"Expected fetcher: "+O),M.state==="loading"&&(te.delete(O),A.push(O),P=!0)}return ot(A),P}function Ue(A){let P=[];for(let[O,M]of se)if(M<A){let G=S.fetchers.get(O);xe(G,"Expected fetcher: "+O),G.state==="loading"&&(ze(O),se.delete(O),P.push(O))}return ot(P),P.length>0}function Ft(A,P){let O=S.blockers.get(A)||Rr;return W.get(A)!==P&&W.set(A,P),O}function ct(A){S.blockers.delete(A),W.delete(A)}function Tn(A,P){let O=S.blockers.get(A)||Rr;xe(O.state==="unblocked"&&P.state==="blocked"||O.state==="blocked"&&P.state==="blocked"||O.state==="blocked"&&P.state==="proceeding"||O.state==="blocked"&&P.state==="unblocked"||O.state==="proceeding"&&P.state==="unblocked","Invalid blocker state transition: "+O.state+" -> "+P.state);let M=new Map(S.blockers);M.set(A,P),de({blockers:M})}function kr(A){let{currentLocation:P,nextLocation:O,historyAction:M}=A;if(W.size===0)return;W.size>1&&Fn(!1,"A router only supports one blocker at a time");let G=Array.from(W.entries()),[re,le]=G[G.length-1],J=S.blockers.get(re);if(!(J&&J.state==="proceeding")&&le({currentLocation:P,nextLocation:O,historyAction:M}))return re}function Er(A){let P=dt(404,{pathname:A}),O=s||a,{matches:M,route:G}=tl(O);return Rn(),{notFoundMatches:M,route:G,error:P}}function Rn(A){let P=[];return ge.forEach((O,M)=>{(!A||A(M))&&(O.cancel(),P.push(M),ge.delete(M))}),P}function Bt(A,P,O){if(m=A,y=P,p=O||null,!b&&S.navigation===Ro){b=!0;let M=Te(S.location,S.matches);M!=null&&de({restoreScrollPosition:M})}return()=>{m=null,y=null,p=null}}function ai(A,P){return p&&p(A,P.map(M=>Mp(M,S.loaderData)))||A.key}function ce(A,P){if(m&&y){let O=ai(A,P);m[O]=y()}}function Te(A,P){if(m){let O=ai(A,P),M=m[O];if(typeof M=="number")return M}return null}function Oe(A,P,O){if(u)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Ei(P,O,l,!0)}}else return{active:!0,matches:Ei(P,O,l,!0)||[]};return{active:!1,matches:null}}async function tt(A,P,O,M){if(!u)return{type:"success",matches:A};let G=A;for(;;){let re=s==null,le=s||a,J=o;try{await u({signal:O,path:P,matches:G,fetcherKey:M,patch:(ee,he)=>{O.aborted||Ys(ee,he,le,J,i)}})}catch(ee){return{type:"error",error:ee,partialMatches:G}}finally{re&&!O.aborted&&(a=[...a])}if(O.aborted)return{type:"aborted"};let Z=On(le,P,l);if(Z)return{type:"success",matches:Z};let X=Ei(le,P,l,!0);if(!X||G.length===X.length&&G.every((ee,he)=>ee.route.id===X[he].route.id))return{type:"success",matches:null};G=X}}function mt(A){o={},s=Li(A,i,void 0,o)}function Ht(A,P){let O=s==null;Ys(A,P,s||a,o,i),O&&(a=[...a],de({}))}return C={get basename(){return l},get future(){return d},get state(){return S},get routes(){return a},get window(){return t},initialize:Le,subscribe:we,enableScrollRestoration:Bt,navigate:lt,fetch:Qt,revalidate:Mt,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:ke,deleteFetcher:kt,dispose:be,getBlocker:Ft,deleteBlocker:ct,patchRoutes:Ht,_internalFetchControllers:$,_internalActiveDeferreds:ge,_internalSetRoutes:mt},C}function cm(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function oa(e,t,n,r,i,o,a,s){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let u=ro(i||".",no(l,o),tn(e.pathname,n)||e.pathname,s==="path");if(i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&c){let d=Ja(u.search);if(c.route.index&&!d)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let h=new URLSearchParams(u.search),f=h.getAll("index");h.delete("index"),f.filter(p=>p).forEach(p=>h.append("index",p));let m=h.toString();u.search=m?"?"+m:""}}return r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:en([n,u.pathname])),Bn(u)}function Ws(e,t,n,r){if(!r||!cm(r))return{path:n};if(r.formMethod&&!wm(r.formMethod))return{path:n,error:dt(405,{method:r.formMethod})};let i=()=>({path:n,error:dt(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),s=_u(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Lt(a))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((f,m)=>{let[p,y]=m;return""+f+p+"="+y+`
20
+ `},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Lt(a))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:s,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}xe(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=sa(r.formData),c=r.formData;else if(r.body instanceof FormData)l=sa(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=Xs(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=Xs(l)}catch{return i()}let u={formMethod:a,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Lt(u.formMethod))return{path:n,submission:u};let d=xn(n);return t&&d.search&&Ja(d.search)&&l.append("index",""),d.search="?"+l,{path:Bn(d),submission:u}}function Ks(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function qs(e,t,n,r,i,o,a,s,l,c,u,d,h,f,m,p){let y=p?yt(p[1])?p[1].error:p[1].data:void 0,b=e.createURL(t.location),x=e.createURL(i),w=n;o&&t.errors?w=Ks(n,Object.keys(t.errors)[0],!0):p&&yt(p[1])&&(w=Ks(n,p[0]));let R=p?p[1].statusCode:void 0,I=a&&R&&R>=400,C=w.filter((N,j)=>{let{route:T}=N;if(T.lazy)return!0;if(T.loader==null)return!1;if(o)return aa(T,t.loaderData,t.errors);if(um(t.loaderData,t.matches[j],N)||l.some(K=>K===N.route.id))return!0;let D=t.matches[j],L=N;return Gs(N,He({currentUrl:b,currentParams:D.params,nextUrl:x,nextParams:L.params},r,{actionResult:y,actionStatus:R,defaultShouldRevalidate:I?!1:s||b.pathname+b.search===x.pathname+x.search||b.search!==x.search||Lu(D,L)}))}),S=[];return d.forEach((N,j)=>{if(o||!n.some(B=>B.route.id===N.routeId)||u.has(j))return;let T=On(f,N.path,m);if(!T){S.push({key:j,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let D=t.fetchers.get(j),L=Fr(T,N.path),K=!1;h.has(j)?K=!1:c.has(j)?(c.delete(j),K=!0):D&&D.state!=="idle"&&D.data===void 0?K=s:K=Gs(L,He({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:y,actionStatus:R,defaultShouldRevalidate:I?!1:s})),K&&S.push({key:j,routeId:N.routeId,path:N.path,matches:T,match:L,controller:new AbortController})}),[C,S]}function aa(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function um(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Lu(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Gs(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Ys(e,t,n,r,i){var o;let a;if(e){let c=r[e];xe(c,"No route found to patch children into: routeId = "+e),c.children||(c.children=[]),a=c.children}else a=n;let s=t.filter(c=>!a.some(u=>Ou(c,u))),l=Li(s,i,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...l)}function Ou(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?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>Ou(n,o))}):!1}async function dm(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];xe(i,"No route found in manifest");let o={};for(let a in r){let l=i[a]!==void 0&&a!=="hasErrorBoundary";Fn(!l,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!l&&!Np.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,He({},t(i),{lazy:void 0}))}async function fm(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,o,a)=>Object.assign(i,{[n[a].route.id]:o}),{})}async function hm(e,t,n,r,i,o,a,s,l,c){let u=o.map(f=>f.route.lazy?dm(f.route,l,s):void 0),d=o.map((f,m)=>{let p=u[m],y=i.some(x=>x.route.id===f.route.id);return He({},f,{shouldLoad:y,resolve:async x=>(x&&r.method==="GET"&&(f.route.lazy||f.route.loader)&&(y=!0),y?pm(t,r,f,p,x,c):Promise.resolve({type:_e.data,result:void 0}))})}),h=await e({matches:d,request:r,params:o[0].params,fetcherKey:a,context:c});try{await Promise.all(u)}catch{}return h}async function pm(e,t,n,r,i,o){let a,s,l=c=>{let u,d=new Promise((m,p)=>u=p);s=()=>u(),t.signal.addEventListener("abort",s);let h=m=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):c({request:t,params:n.params,context:o},...m!==void 0?[m]:[]),f=(async()=>{try{return{type:"data",result:await(i?i(p=>h(p)):h())}}catch(m){return{type:"error",result:m}}})();return Promise.race([f,d])};try{let c=n.route[e];if(r)if(c){let u,[d]=await Promise.all([l(c).catch(h=>{u=h}),r]);if(u!==void 0)throw u;a=d}else if(await r,c=n.route[e],c)a=await l(c);else if(e==="action"){let u=new URL(t.url),d=u.pathname+u.search;throw dt(405,{method:t.method,pathname:d,routeId:n.route.id})}else return{type:_e.data,result:void 0};else if(c)a=await l(c);else{let u=new URL(t.url),d=u.pathname+u.search;throw dt(404,{pathname:d})}xe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:_e.error,result:c}}finally{s&&t.signal.removeEventListener("abort",s)}return a}async function mm(e){let{result:t,type:n}=e;if(Nu(t)){let d;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?d=null:d=await t.json():d=await t.text()}catch(h){return{type:_e.error,error:h}}return n===_e.error?{type:_e.error,error:new _i(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:_e.data,data:d,statusCode:t.status,headers:t.headers}}if(n===_e.error){if(nl(t)){var r,i;if(t.data instanceof Error){var o,a;return{type:_e.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:_e.error,error:new _i(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:Wr(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:_e.error,error:t,statusCode:Wr(t)?t.status:void 0}}if(xm(t)){var s,l;return{type:_e.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(nl(t)){var c,u;return{type:_e.data,data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:_e.data,data:t}}function gm(e,t,n,r,i,o){let a=e.headers.get("Location");if(xe(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Qa.test(a)){let s=r.slice(0,r.findIndex(l=>l.route.id===n)+1);a=oa(new URL(t.url),s,i,!0,a,o),e.headers.set("Location",a)}return e}function Qs(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Qa.test(e)){let o=e,a=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(i.includes(a.protocol))throw new Error("Invalid redirect location");let s=tn(a.pathname,n)!=null;if(a.origin===t.origin&&s)return Ya(a.pathname)+a.search+a.hash}try{let o=r.createURL(e);if(i.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Jn(e,t,n,r){let i=e.createURL(_u(t)).toString(),o={signal:n};if(r&&Lt(r.formMethod)){let{formMethod:a,formEncType:s}=r;o.method=a.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=sa(r.formData):o.body=r.formData}return new Request(i,o)}function sa(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Xs(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function ym(e,t,n,r,i){let o={},a=null,s,l=!1,c={},u=n&&yt(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let h=d.route.id,f=t[h];if(xe(!Mn(f),"Cannot handle redirect results in processLoaderData"),yt(f)){let m=f.error;u!==void 0&&(m=u,u=void 0),a=a||{};{let p=_n(e,h);a[p.route.id]==null&&(a[p.route.id]=m)}o[h]=void 0,l||(l=!0,s=Wr(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else gn(f)?(r.set(h,f.deferredData),o[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers)):(o[h]=f.data,f.statusCode&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers))}),u!==void 0&&n&&(a={[n[0]]:u},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:s||200,loaderHeaders:c}}function Js(e,t,n,r,i,o,a){let{loaderData:s,errors:l}=ym(t,n,r,a);return i.forEach(c=>{let{key:u,match:d,controller:h}=c,f=o[u];if(xe(f,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(yt(f)){let m=_n(e.matches,d?.route.id);l&&l[m.route.id]||(l=He({},l,{[m.route.id]:f.error})),e.fetchers.delete(u)}else if(Mn(f))xe(!1,"Unhandled fetcher revalidation redirect");else if(gn(f))xe(!1,"Unhandled fetcher deferred data");else{let m=pn(f.data);e.fetchers.set(u,m)}}),{loaderData:s,errors:l}}function Zs(e,t,n,r){let i=He({},t);for(let o of n){let a=o.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&o.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function el(e){return e?yt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function _n(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function tl(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function dt(e,t){let{pathname:n,routeId:r,method:i,type:o,message:a}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new _i(e||500,s,new Error(l),!0)}function ci(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Mn(i))return{key:r,result:i}}}function _u(e){let t=typeof e=="string"?xn(e):e;return Bn(He({},t,{hash:""}))}function vm(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function bm(e){return Nu(e.result)&&im.has(e.result.status)}function gn(e){return e.type===_e.deferred}function yt(e){return e.type===_e.error}function Mn(e){return(e&&e.type)===_e.redirect}function nl(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function xm(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Nu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function wm(e){return rm.has(e.toLowerCase())}function Lt(e){return tm.has(e.toLowerCase())}async function Sm(e,t,n,r,i){let o=Object.entries(t);for(let a=0;a<o.length;a++){let[s,l]=o[a],c=e.find(h=>h?.route.id===s);if(!c)continue;let u=r.find(h=>h.route.id===c.route.id),d=u!=null&&!Lu(u,c)&&(i&&i[c.route.id])!==void 0;gn(l)&&d&&await Xa(l,n,!1).then(h=>{h&&(t[s]=h)})}}async function km(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:o,controller:a}=n[r],s=t[i];e.find(c=>c?.route.id===o)&&gn(s)&&(xe(a,"Expected an AbortController for revalidating fetcher deferred result"),await Xa(s,a.signal,!0).then(c=>{c&&(t[i]=c)}))}}async function Xa(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:_e.data,data:e.deferredData.unwrappedData}}catch(i){return{type:_e.error,error:i}}return{type:_e.data,data:e.deferredData.data}}}function Ja(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Fr(e,t){let n=typeof t=="string"?xn(t).search:t.search;if(e[e.length-1].route.index&&Ja(n||""))return e[e.length-1];let r=Ru(e);return r[r.length-1]}function rl(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Po(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Em(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Pr(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 Cm(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 pn(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 Am(e,t){try{let n=e.sessionStorage.getItem(Iu);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function Tm(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Iu,JSON.stringify(n))}catch(r){Fn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
21
21
  * React Router v6.30.4
22
22
  *
23
23
  * Copyright (c) Remix Software Inc.
@@ -26,7 +26,7 @@ import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./reac
26
26
  * LICENSE.md file in the root directory of this source tree.
27
27
  *
28
28
  * @license MIT
29
- */function Di(){return Di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Di.apply(null,arguments)}const Zr=g.createContext(null),Za=g.createContext(null),on=g.createContext(null),es=g.createContext(null),an=g.createContext({outlet:null,matches:[],isDataRoute:!1}),_u=g.createContext(null);function Rm(e,t){let{relative:n}=t===void 0?{}:t;gr()||xe(!1);let{basename:r,navigator:i}=g.useContext(on),{hash:o,pathname:a,search:s}=oo(e,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:en([r,a])),i.createHref({pathname:l,search:s,hash:o})}function gr(){return g.useContext(es)!=null}function sn(){return gr()||xe(!1),g.useContext(es).location}function Mu(e){g.useContext(on).static||g.useLayoutEffect(e)}function io(){let{isDataRoute:e}=g.useContext(an);return e?zm():Pm()}function Pm(){gr()||xe(!1);let e=g.useContext(Zr),{basename:t,future:n,navigator:r}=g.useContext(on),{matches:i}=g.useContext(an),{pathname:o}=sn(),a=JSON.stringify(no(i,n.v7_relativeSplatPath)),s=g.useRef(!1);return Mu(()=>{s.current=!0}),g.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=ro(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:en([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,a,o,e])}const Im=g.createContext(null);function Lm(e){let t=g.useContext(an).outlet;return t&&g.createElement(Im.Provider,{value:e},t)}function oo(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(on),{matches:i}=g.useContext(an),{pathname:o}=sn(),a=JSON.stringify(no(i,r.v7_relativeSplatPath));return g.useMemo(()=>ro(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function Om(e,t,n,r){gr()||xe(!1);let{navigator:i}=g.useContext(on),{matches:o}=g.useContext(an),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=sn(),u;u=c;let d=u.pathname||"/",h=d;if(l!=="/"){let p=l.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(p.length).join("/")}let f=On(e,{pathname:h});return jm(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},s,p.params),pathname:en([l,i.encodeLocation?i.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?l:en([l,i.encodeLocation?i.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,r)}function Nm(){let e=Hm(),t=Wr(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const Dm=g.createElement(Nm,null);class _m extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(an.Provider,{value:this.props.routeContext},g.createElement(_u.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Mm(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(Zr);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(an.Provider,{value:t},r)}function jm(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&s?.[d.route.id]!==void 0);u>=0||xe(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<a.length;u++){let d=a[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:h,errors:f}=n,m=d.route.loader&&h[d.route.id]===void 0&&(!f||f[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,h)=>{let f,m=!1,p=null,y=null;n&&(f=s&&d.route.id?s[d.route.id]:void 0,p=d.route.errorElement||Dm,l&&(c<0&&h===0?($m("route-fallback"),m=!0,y=null):c===h&&(m=!0,y=d.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,h+1)),x=()=>{let w;return f?w=p:m?w=y:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,g.createElement(Mm,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?g.createElement(_m,{location:n.location,revalidation:n.revalidation,component:p,error:f,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var ju=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ju||{}),Fu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Fu||{});function Fm(e){let t=g.useContext(Zr);return t||xe(!1),t}function Bm(e){let t=g.useContext(Za);return t||xe(!1),t}function Um(e){let t=g.useContext(an);return t||xe(!1),t}function Bu(e){let t=Um(),n=t.matches[t.matches.length-1];return n.route.id||xe(!1),n.route.id}function Hm(){var e;let t=g.useContext(_u),n=Bm(),r=Bu();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function zm(){let{router:e}=Fm(ju.UseNavigateStable),t=Bu(Fu.UseNavigateStable),n=g.useRef(!1);return Mu(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Di({fromRouteId:t},o)))},[e,t])}const il={};function $m(e,t,n){il[e]||(il[e]=!0)}function Vm(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function zt(e){let{to:t,replace:n,state:r,relative:i}=e;gr()||xe(!1);let{future:o,static:a}=g.useContext(on),{matches:s}=g.useContext(an),{pathname:l}=sn(),c=io(),u=ro(t,no(s,o.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(u);return g.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:i}),[c,d,i,n,r]),null}function PD(e){return Lm(e.context)}function Wm(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ge.Pop,navigator:o,static:a=!1,future:s}=e;gr()&&xe(!1);let l=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:o,static:a,future:Di({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=xn(r));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=r,p=g.useMemo(()=>{let y=tn(u,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:f,key:m},navigationType:i}},[l,u,d,h,f,m,i]);return p==null?null:g.createElement(on.Provider,{value:c},g.createElement(es.Provider,{children:n,value:p}))}new Promise(()=>{});function Km(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
29
+ */function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ni.apply(null,arguments)}const Zr=g.createContext(null),Za=g.createContext(null),on=g.createContext(null),es=g.createContext(null),an=g.createContext({outlet:null,matches:[],isDataRoute:!1}),Du=g.createContext(null);function Rm(e,t){let{relative:n}=t===void 0?{}:t;gr()||xe(!1);let{basename:r,navigator:i}=g.useContext(on),{hash:o,pathname:a,search:s}=oo(e,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:en([r,a])),i.createHref({pathname:l,search:s,hash:o})}function gr(){return g.useContext(es)!=null}function sn(){return gr()||xe(!1),g.useContext(es).location}function Mu(e){g.useContext(on).static||g.useLayoutEffect(e)}function io(){let{isDataRoute:e}=g.useContext(an);return e?zm():Pm()}function Pm(){gr()||xe(!1);let e=g.useContext(Zr),{basename:t,future:n,navigator:r}=g.useContext(on),{matches:i}=g.useContext(an),{pathname:o}=sn(),a=JSON.stringify(no(i,n.v7_relativeSplatPath)),s=g.useRef(!1);return Mu(()=>{s.current=!0}),g.useCallback(function(c,u){if(u===void 0&&(u={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=ro(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:en([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,a,o,e])}const Im=g.createContext(null);function Lm(e){let t=g.useContext(an).outlet;return t&&g.createElement(Im.Provider,{value:e},t)}function oo(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(on),{matches:i}=g.useContext(an),{pathname:o}=sn(),a=JSON.stringify(no(i,r.v7_relativeSplatPath));return g.useMemo(()=>ro(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function Om(e,t,n,r){gr()||xe(!1);let{navigator:i}=g.useContext(on),{matches:o}=g.useContext(an),a=o[o.length-1],s=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=sn(),u;u=c;let d=u.pathname||"/",h=d;if(l!=="/"){let p=l.replace(/^\//,"").split("/");h="/"+d.replace(/^\//,"").split("/").slice(p.length).join("/")}let f=On(e,{pathname:h});return jm(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},s,p.params),pathname:en([l,i.encodeLocation?i.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?l:en([l,i.encodeLocation?i.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,n,r)}function _m(){let e=Um(),t=Wr(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const Nm=g.createElement(_m,null);class Dm extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(an.Provider,{value:this.props.routeContext},g.createElement(Du.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Mm(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(Zr);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(an.Provider,{value:t},r)}function jm(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let u=a.findIndex(d=>d.route.id&&s?.[d.route.id]!==void 0);u>=0||xe(!1),a=a.slice(0,Math.min(a.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<a.length;u++){let d=a[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:h,errors:f}=n,m=d.route.loader&&h[d.route.id]===void 0&&(!f||f[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((u,d,h)=>{let f,m=!1,p=null,y=null;n&&(f=s&&d.route.id?s[d.route.id]:void 0,p=d.route.errorElement||Nm,l&&(c<0&&h===0?($m("route-fallback"),m=!0,y=null):c===h&&(m=!0,y=d.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,h+1)),x=()=>{let w;return f?w=p:m?w=y:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,g.createElement(Mm,{match:d,routeContext:{outlet:u,matches:b,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?g.createElement(Dm,{location:n.location,revalidation:n.revalidation,component:p,error:f,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var ju=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ju||{}),Fu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Fu||{});function Fm(e){let t=g.useContext(Zr);return t||xe(!1),t}function Bm(e){let t=g.useContext(Za);return t||xe(!1),t}function Hm(e){let t=g.useContext(an);return t||xe(!1),t}function Bu(e){let t=Hm(),n=t.matches[t.matches.length-1];return n.route.id||xe(!1),n.route.id}function Um(){var e;let t=g.useContext(Du),n=Bm(),r=Bu();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function zm(){let{router:e}=Fm(ju.UseNavigateStable),t=Bu(Fu.UseNavigateStable),n=g.useRef(!1);return Mu(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ni({fromRouteId:t},o)))},[e,t])}const il={};function $m(e,t,n){il[e]||(il[e]=!0)}function Vm(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function zt(e){let{to:t,replace:n,state:r,relative:i}=e;gr()||xe(!1);let{future:o,static:a}=g.useContext(on),{matches:s}=g.useContext(an),{pathname:l}=sn(),c=io(),u=ro(t,no(s,o.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(u);return g.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:i}),[c,d,i,n,r]),null}function PN(e){return Lm(e.context)}function Wm(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ge.Pop,navigator:o,static:a=!1,future:s}=e;gr()&&xe(!1);let l=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:o,static:a,future:Ni({v7_relativeSplatPath:!1},s)}),[l,s,o,a]);typeof r=="string"&&(r=xn(r));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:m="default"}=r,p=g.useMemo(()=>{let y=tn(u,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:f,key:m},navigationType:i}},[l,u,d,h,f,m,i]);return p==null?null:g.createElement(on.Provider,{value:c},g.createElement(es.Provider,{children:n,value:p}))}new Promise(()=>{});function Km(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:g.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
30
30
  * React Router DOM v6.30.4
31
31
  *
32
32
  * Copyright (c) Remix Software Inc.
@@ -35,7 +35,7 @@ import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./reac
35
35
  * LICENSE.md file in the root directory of this source tree.
36
36
  *
37
37
  * @license MIT
38
- */function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dr.apply(null,arguments)}function Uu(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gm(e,t){return e.button===0&&(!t||t==="_self")&&!qm(e)}function la(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Ym(e,t){let n=la(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const Qm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Xm=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Jm="6";try{window.__reactRouterVersion=Jm}catch{}function Zm(e,t){return lm({basename:void 0,future:dr({},void 0,{v7_prependBasename:!0}),history:Lp({window:void 0}),hydrationData:eg(),routes:e,mapRouteProperties:Km,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function eg(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=dr({},t,{errors:tg(t.errors)})),t}function tg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Ni(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}const Hu=g.createContext({isTransitioning:!1}),ng=g.createContext(new Map),rg="startTransition",ol=eo[rg],ig="flushSync",al=kp[ig];function og(e){ol?ol(e):e()}function Ir(e){al?al(e):e()}class ag{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function sg(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=g.useState(n.state),[a,s]=g.useState(),[l,c]=g.useState({isTransitioning:!1}),[u,d]=g.useState(),[h,f]=g.useState(),[m,p]=g.useState(),y=g.useRef(new Map),{v7_startTransition:v}=r||{},x=g.useCallback(D=>{v?og(D):D()},[v]),w=g.useCallback((D,j)=>{let{deletedFetchers:T,flushSync:_,viewTransitionOpts:L}=j;D.fetchers.forEach((B,V)=>{B.data!==void 0&&y.current.set(V,B.data)}),T.forEach(B=>y.current.delete(B));let K=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||K){_?Ir(()=>o(D)):x(()=>o(D));return}if(_){Ir(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let B=n.window.document.startViewTransition(()=>{Ir(()=>o(D))});B.finished.finally(()=>{Ir(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})})}),Ir(()=>f(B));return}h?(u&&u.resolve(),h.skipTransition(),p({state:D,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(D),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,y,x]);g.useLayoutEffect(()=>n.subscribe(w),[n,w]),g.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new ag)},[l]),g.useEffect(()=>{if(u&&a&&n.window){let D=a,j=u.promise,T=n.window.document.startViewTransition(async()=>{x(()=>o(D)),await j});T.finished.finally(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})}),f(T)}},[x,a,u,n.window]),g.useEffect(()=>{u&&a&&i.location.key===a.location.key&&u.resolve()},[u,h,i.location,a]),g.useEffect(()=>{!l.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),p(void 0))},[l.isTransitioning,m]),g.useEffect(()=>{},[]);let R=g.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:D=>n.navigate(D),push:(D,j,T)=>n.navigate(D,{state:j,preventScrollReset:T?.preventScrollReset}),replace:(D,j,T)=>n.navigate(D,{replace:!0,state:j,preventScrollReset:T?.preventScrollReset})}),[n]),I=n.basename||"/",C=g.useMemo(()=>({router:n,navigator:R,static:!1,basename:I}),[n,R,I]),k=g.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return g.useEffect(()=>Vm(r,n.future),[r,n.future]),g.createElement(g.Fragment,null,g.createElement(Zr.Provider,{value:C},g.createElement(Za.Provider,{value:i},g.createElement(ng.Provider,{value:y.current},g.createElement(Hu.Provider,{value:l},g.createElement(Wm,{basename:I,location:i.location,navigationType:i.historyAction,navigator:R,future:k},i.initialized||n.future.v7_partialHydration?g.createElement(lg,{routes:n.routes,future:n.future,state:i}):t))))),null)}const lg=g.memo(cg);function cg(e){let{routes:t,future:n,state:r}=e;return Om(t,void 0,r,n)}const ug=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ts=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:d}=t,h=Uu(t,Qm),{basename:f}=g.useContext(on),m,p=!1;if(typeof c=="string"&&dg.test(c)&&(m=c,ug))try{let w=new URL(window.location.href),R=c.startsWith("//")?new URL(w.protocol+c):new URL(c),I=tn(R.pathname,f);R.origin===w.origin&&I!=null?c=I+R.search+R.hash:p=!0}catch{}let y=Rm(c,{relative:i}),v=hg(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i,viewTransition:d});function x(w){r&&r(w),w.defaultPrevented||v(w)}return g.createElement("a",dr({},h,{href:m||y,onClick:p||o?r:x,ref:n,target:l}))}),sl=g.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:l,viewTransition:c,children:u}=t,d=Uu(t,Xm),h=oo(l,{relative:d.relative}),f=sn(),m=g.useContext(Za),{navigator:p,basename:y}=g.useContext(on),v=m!=null&&mg(h)&&c===!0,x=p.encodeLocation?p.encodeLocation(h).pathname:h.pathname,w=f.pathname,R=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(w=w.toLowerCase(),R=R?R.toLowerCase():null,x=x.toLowerCase()),R&&y&&(R=tn(R,y)||R);const I=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=w===x||!a&&w.startsWith(x)&&w.charAt(I)==="/",k=R!=null&&(R===x||!a&&R.startsWith(x)&&R.charAt(x.length)==="/"),D={isActive:C,isPending:k,isTransitioning:v},j=C?r:void 0,T;typeof o=="function"?T=o(D):T=[o,C?"active":null,k?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let _=typeof s=="function"?s(D):s;return g.createElement(ts,dr({},d,{"aria-current":j,className:T,ref:n,style:_,to:l,viewTransition:c}),typeof u=="function"?u(D):u)});var ca;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ca||(ca={}));var ll;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ll||(ll={}));function fg(e){let t=g.useContext(Zr);return t||xe(!1),t}function hg(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,l=io(),c=sn(),u=oo(e,{relative:a});return g.useCallback(d=>{if(Gm(d,n)){d.preventDefault();let h=r!==void 0?r:Bn(c)===Bn(u);l(e,{replace:h,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[c,l,u,r,i,n,e,o,a,s])}function pg(e){let t=g.useRef(la(e)),n=g.useRef(!1),r=sn(),i=g.useMemo(()=>Ym(r.search,n.current?null:t.current),[r.search]),o=io(),a=g.useCallback((s,l)=>{const c=la(typeof s=="function"?s(i):s);n.current=!0,o("?"+c,l)},[o,i]);return[i,a]}function mg(e,t){t===void 0&&(t={});let n=g.useContext(Hu);n==null&&xe(!1);let{basename:r}=fg(ca.useViewTransitionState),i=oo(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=tn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=tn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Oi(i.pathname,a)!=null||Oi(i.pathname,o)!=null}const cl=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,i,s);return s},gg=e=>e?cl(e):cl,yg=e=>e;function bg(e,t=yg){const n=z.useSyncExternalStore(e.subscribe,z.useCallback(()=>t(e.getState()),[e,t]),z.useCallback(()=>t(e.getInitialState()),[e,t]));return z.useDebugValue(n),n}const ul=e=>{const t=gg(e),n=r=>bg(t,r);return Object.assign(n,t),n},zu=e=>e?ul(e):ul,_i="agim_token";function vg(){try{return localStorage.getItem(_i)}catch{return null}}function dl(e){try{e?localStorage.setItem(_i,e):localStorage.removeItem(_i)}catch{}}const fl=vg(),ns=zu(e=>({token:fl,signedIn:!!fl,setToken:t=>{dl(t),e({token:t,signedIn:!!t})},clear:()=>{dl(null),e({token:null,signedIn:!1})}}));function xg(){function e(t){if(t.key!==_i)return;const n=t.newValue;ns.setState({token:n,signedIn:!!n})}return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}function $u({children:e}){const t=ns(r=>r.signedIn),n=sn();if(!t){const r=encodeURIComponent(n.pathname+n.search);return b.jsx(zt,{to:`/login?next=${r}`,replace:!0})}return b.jsx(b.Fragment,{children:e})}const wg=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);jn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},hl={},ua=(e,t,n,r)=>{jn(n)&&hl[n]||(jn(n)&&(hl[n]=new Date),wg(e,t,n,r))},Vu=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},da=(e,t,n)=>{e.loadNamespaces(t,Vu(e,n))},pl=(e,t,n,r)=>{if(jn(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return da(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Vu(e,r))},kg=(e,t,n={})=>!t.languages||!t.languages.length?(ua(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),jn=e=>typeof e=="string",Sg=e=>typeof e=="object"&&e!==null,Eg=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Cg={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ag=e=>Cg[e],Tg=e=>e.replace(Eg,Ag);let fa={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Tg};const Rg=(e={})=>{fa={...fa,...e}},Pg=()=>fa;let Wu;const Ig=e=>{Wu=e},Lg=()=>Wu,Og={type:"3rdParty",init(e){Rg(e.options.react),Ig(e)}},Ng=g.createContext();class Dg{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const _g=(e,t)=>{const n=g.useRef();return g.useEffect(()=>{n.current=e},[e,t]),n.current},Ku=(e,t,n,r)=>e.getFixedT(t,n,r),Mg=(e,t,n,r)=>g.useCallback(Ku(e,t,n,r),[e,t,n,r]),kt=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=g.useContext(Ng)||{},o=n||r||Lg();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Dg),!o){ua(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const R=(C,k)=>jn(k)?k:Sg(k)&&jn(k.defaultValue)?k.defaultValue:Array.isArray(C)?C[C.length-1]:C,I=[R,{},!1];return I.t=R,I.i18n={},I.ready=!1,I}o.options.react?.wait&&ua(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Pg(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=e||i||o.options?.defaultNS;c=jn(c)?[c]:c||["translation"],o.reportNamespaces.addUsedNamespaces?.(c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(R=>kg(R,o,a)),d=Mg(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),h=()=>d,f=()=>Ku(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[m,p]=g.useState(h);let y=c.join();t.lng&&(y=`${t.lng}${y}`);const v=_g(y),x=g.useRef(!0);g.useEffect(()=>{const{bindI18n:R,bindI18nStore:I}=a;x.current=!0,!u&&!s&&(t.lng?pl(o,t.lng,c,()=>{x.current&&p(f)}):da(o,c,()=>{x.current&&p(f)})),u&&v&&v!==y&&x.current&&p(f);const C=()=>{x.current&&p(f)};return R&&o?.on(R,C),I&&o?.store.on(I,C),()=>{x.current=!1,o&&R&&R?.split(" ").forEach(k=>o.off(k,C)),I&&o&&I.split(" ").forEach(k=>o.store.off(k,C))}},[o,y]),g.useEffect(()=>{x.current&&u&&p(h)},[o,l,u]);const w=[m,o,u];if(w.t=m,w.i18n=o,w.ready=u,u||!u&&!s)return w;throw new Promise(R=>{t.lng?pl(o,t.lng,c,()=>R()):da(o,c,()=>R())})};/**
38
+ */function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dr.apply(null,arguments)}function Hu(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gm(e,t){return e.button===0&&(!t||t==="_self")&&!qm(e)}function la(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Ym(e,t){let n=la(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}const Qm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Xm=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Jm="6";try{window.__reactRouterVersion=Jm}catch{}function Zm(e,t){return lm({basename:void 0,future:dr({},void 0,{v7_prependBasename:!0}),history:Lp({window:void 0}),hydrationData:eg(),routes:e,mapRouteProperties:Km,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function eg(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=dr({},t,{errors:tg(t.errors)})),t}function tg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new _i(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}const Uu=g.createContext({isTransitioning:!1}),ng=g.createContext(new Map),rg="startTransition",ol=eo[rg],ig="flushSync",al=Sp[ig];function og(e){ol?ol(e):e()}function Ir(e){al?al(e):e()}class ag{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function sg(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=g.useState(n.state),[a,s]=g.useState(),[l,c]=g.useState({isTransitioning:!1}),[u,d]=g.useState(),[h,f]=g.useState(),[m,p]=g.useState(),y=g.useRef(new Map),{v7_startTransition:b}=r||{},x=g.useCallback(N=>{b?og(N):N()},[b]),w=g.useCallback((N,j)=>{let{deletedFetchers:T,flushSync:D,viewTransitionOpts:L}=j;N.fetchers.forEach((B,V)=>{B.data!==void 0&&y.current.set(V,B.data)}),T.forEach(B=>y.current.delete(B));let K=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||K){D?Ir(()=>o(N)):x(()=>o(N));return}if(D){Ir(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let B=n.window.document.startViewTransition(()=>{Ir(()=>o(N))});B.finished.finally(()=>{Ir(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})})}),Ir(()=>f(B));return}h?(u&&u.resolve(),h.skipTransition(),p({state:N,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(N),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,y,x]);g.useLayoutEffect(()=>n.subscribe(w),[n,w]),g.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new ag)},[l]),g.useEffect(()=>{if(u&&a&&n.window){let N=a,j=u.promise,T=n.window.document.startViewTransition(async()=>{x(()=>o(N)),await j});T.finished.finally(()=>{d(void 0),f(void 0),s(void 0),c({isTransitioning:!1})}),f(T)}},[x,a,u,n.window]),g.useEffect(()=>{u&&a&&i.location.key===a.location.key&&u.resolve()},[u,h,i.location,a]),g.useEffect(()=>{!l.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),p(void 0))},[l.isTransitioning,m]),g.useEffect(()=>{},[]);let R=g.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:N=>n.navigate(N),push:(N,j,T)=>n.navigate(N,{state:j,preventScrollReset:T?.preventScrollReset}),replace:(N,j,T)=>n.navigate(N,{replace:!0,state:j,preventScrollReset:T?.preventScrollReset})}),[n]),I=n.basename||"/",C=g.useMemo(()=>({router:n,navigator:R,static:!1,basename:I}),[n,R,I]),S=g.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return g.useEffect(()=>Vm(r,n.future),[r,n.future]),g.createElement(g.Fragment,null,g.createElement(Zr.Provider,{value:C},g.createElement(Za.Provider,{value:i},g.createElement(ng.Provider,{value:y.current},g.createElement(Uu.Provider,{value:l},g.createElement(Wm,{basename:I,location:i.location,navigationType:i.historyAction,navigator:R,future:S},i.initialized||n.future.v7_partialHydration?g.createElement(lg,{routes:n.routes,future:n.future,state:i}):t))))),null)}const lg=g.memo(cg);function cg(e){let{routes:t,future:n,state:r}=e;return Om(t,void 0,r,n)}const ug=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ts=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:d}=t,h=Hu(t,Qm),{basename:f}=g.useContext(on),m,p=!1;if(typeof c=="string"&&dg.test(c)&&(m=c,ug))try{let w=new URL(window.location.href),R=c.startsWith("//")?new URL(w.protocol+c):new URL(c),I=tn(R.pathname,f);R.origin===w.origin&&I!=null?c=I+R.search+R.hash:p=!0}catch{}let y=Rm(c,{relative:i}),b=hg(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:i,viewTransition:d});function x(w){r&&r(w),w.defaultPrevented||b(w)}return g.createElement("a",dr({},h,{href:m||y,onClick:p||o?r:x,ref:n,target:l}))}),sl=g.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:a=!1,style:s,to:l,viewTransition:c,children:u}=t,d=Hu(t,Xm),h=oo(l,{relative:d.relative}),f=sn(),m=g.useContext(Za),{navigator:p,basename:y}=g.useContext(on),b=m!=null&&mg(h)&&c===!0,x=p.encodeLocation?p.encodeLocation(h).pathname:h.pathname,w=f.pathname,R=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;i||(w=w.toLowerCase(),R=R?R.toLowerCase():null,x=x.toLowerCase()),R&&y&&(R=tn(R,y)||R);const I=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=w===x||!a&&w.startsWith(x)&&w.charAt(I)==="/",S=R!=null&&(R===x||!a&&R.startsWith(x)&&R.charAt(x.length)==="/"),N={isActive:C,isPending:S,isTransitioning:b},j=C?r:void 0,T;typeof o=="function"?T=o(N):T=[o,C?"active":null,S?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let D=typeof s=="function"?s(N):s;return g.createElement(ts,dr({},d,{"aria-current":j,className:T,ref:n,style:D,to:l,viewTransition:c}),typeof u=="function"?u(N):u)});var ca;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ca||(ca={}));var ll;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ll||(ll={}));function fg(e){let t=g.useContext(Zr);return t||xe(!1),t}function hg(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:s}=t===void 0?{}:t,l=io(),c=sn(),u=oo(e,{relative:a});return g.useCallback(d=>{if(Gm(d,n)){d.preventDefault();let h=r!==void 0?r:Bn(c)===Bn(u);l(e,{replace:h,state:i,preventScrollReset:o,relative:a,viewTransition:s})}},[c,l,u,r,i,n,e,o,a,s])}function pg(e){let t=g.useRef(la(e)),n=g.useRef(!1),r=sn(),i=g.useMemo(()=>Ym(r.search,n.current?null:t.current),[r.search]),o=io(),a=g.useCallback((s,l)=>{const c=la(typeof s=="function"?s(i):s);n.current=!0,o("?"+c,l)},[o,i]);return[i,a]}function mg(e,t){t===void 0&&(t={});let n=g.useContext(Uu);n==null&&xe(!1);let{basename:r}=fg(ca.useViewTransitionState),i=oo(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=tn(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=tn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Oi(i.pathname,a)!=null||Oi(i.pathname,o)!=null}const cl=e=>{let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,i,s);return s},gg=e=>e?cl(e):cl,yg=e=>e;function vg(e,t=yg){const n=z.useSyncExternalStore(e.subscribe,z.useCallback(()=>t(e.getState()),[e,t]),z.useCallback(()=>t(e.getInitialState()),[e,t]));return z.useDebugValue(n),n}const ul=e=>{const t=gg(e),n=r=>vg(t,r);return Object.assign(n,t),n},zu=e=>e?ul(e):ul,Di="agim_token";function bg(){try{return localStorage.getItem(Di)}catch{return null}}function dl(e){try{e?localStorage.setItem(Di,e):localStorage.removeItem(Di)}catch{}}const fl=bg(),ns=zu(e=>({token:fl,signedIn:!!fl,setToken:t=>{dl(t),e({token:t,signedIn:!!t})},clear:()=>{dl(null),e({token:null,signedIn:!1})}}));function xg(){function e(t){if(t.key!==Di)return;const n=t.newValue;ns.setState({token:n,signedIn:!!n})}return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}function $u({children:e}){const t=ns(r=>r.signedIn),n=sn();if(!t){const r=encodeURIComponent(n.pathname+n.search);return v.jsx(zt,{to:`/login?next=${r}`,replace:!0})}return v.jsx(v.Fragment,{children:e})}const wg=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);jn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},hl={},ua=(e,t,n,r)=>{jn(n)&&hl[n]||(jn(n)&&(hl[n]=new Date),wg(e,t,n,r))},Vu=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},da=(e,t,n)=>{e.loadNamespaces(t,Vu(e,n))},pl=(e,t,n,r)=>{if(jn(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return da(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,Vu(e,r))},Sg=(e,t,n={})=>!t.languages||!t.languages.length?(ua(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),jn=e=>typeof e=="string",kg=e=>typeof e=="object"&&e!==null,Eg=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Cg={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ag=e=>Cg[e],Tg=e=>e.replace(Eg,Ag);let fa={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Tg};const Rg=(e={})=>{fa={...fa,...e}},Pg=()=>fa;let Wu;const Ig=e=>{Wu=e},Lg=()=>Wu,Og={type:"3rdParty",init(e){Rg(e.options.react),Ig(e)}},_g=g.createContext();class Ng{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Dg=(e,t)=>{const n=g.useRef();return g.useEffect(()=>{n.current=e},[e,t]),n.current},Ku=(e,t,n,r)=>e.getFixedT(t,n,r),Mg=(e,t,n,r)=>g.useCallback(Ku(e,t,n,r),[e,t,n,r]),St=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=g.useContext(_g)||{},o=n||r||Lg();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Ng),!o){ua(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const R=(C,S)=>jn(S)?S:kg(S)&&jn(S.defaultValue)?S.defaultValue:Array.isArray(C)?C[C.length-1]:C,I=[R,{},!1];return I.t=R,I.i18n={},I.ready=!1,I}o.options.react?.wait&&ua(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Pg(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let c=e||i||o.options?.defaultNS;c=jn(c)?[c]:c||["translation"],o.reportNamespaces.addUsedNamespaces?.(c);const u=(o.isInitialized||o.initializedStoreOnce)&&c.every(R=>Sg(R,o,a)),d=Mg(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),h=()=>d,f=()=>Ku(o,t.lng||null,a.nsMode==="fallback"?c:c[0],l),[m,p]=g.useState(h);let y=c.join();t.lng&&(y=`${t.lng}${y}`);const b=Dg(y),x=g.useRef(!0);g.useEffect(()=>{const{bindI18n:R,bindI18nStore:I}=a;x.current=!0,!u&&!s&&(t.lng?pl(o,t.lng,c,()=>{x.current&&p(f)}):da(o,c,()=>{x.current&&p(f)})),u&&b&&b!==y&&x.current&&p(f);const C=()=>{x.current&&p(f)};return R&&o?.on(R,C),I&&o?.store.on(I,C),()=>{x.current=!1,o&&R&&R?.split(" ").forEach(S=>o.off(S,C)),I&&o&&I.split(" ").forEach(S=>o.store.off(S,C))}},[o,y]),g.useEffect(()=>{x.current&&u&&p(h)},[o,l,u]);const w=[m,o,u];if(w.t=m,w.i18n=o,w.ready=u,u||!u&&!s)return w;throw new Promise(R=>{t.lng?pl(o,t.lng,c,()=>R()):da(o,c,()=>R())})};/**
39
39
  * @license lucide-react v0.469.0 - ISC
40
40
  *
41
41
  * This source code is licensed under the ISC license.
@@ -60,7 +60,7 @@ import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./reac
60
60
  *
61
61
  * This source code is licensed under the ISC license.
62
62
  * See the LICENSE file in the root directory of this source tree.
63
- */const Ug=ht("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
63
+ */const Hg=ht("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
64
64
  * @license lucide-react v0.469.0 - ISC
65
65
  *
66
66
  * This source code is licensed under the ISC license.
@@ -70,7 +70,7 @@ import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./reac
70
70
  *
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
- */const Hg=ht("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
73
+ */const Ug=ht("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
74
74
  * @license lucide-react v0.469.0 - ISC
75
75
  *
76
76
  * This source code is licensed under the ISC license.
@@ -125,36 +125,36 @@ import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./reac
125
125
  *
126
126
  * This source code is licensed under the ISC license.
127
127
  * See the LICENSE file in the root directory of this source tree.
128
- */const Jg=ht("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function ml(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ei(...e){return t=>{let n=!1;const r=e.map(i=>{const o=ml(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():ml(e[i],null)}}}}function Ye(...e){return g.useCallback(ei(...e),e)}var Zg=Symbol.for("react.lazy"),Mi=eo[" use ".trim().toString()];function ey(e){return typeof e=="object"&&e!==null&&"then"in e}function Yu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Zg&&"_payload"in e&&ey(e._payload)}function Qu(e){const t=ny(e),n=g.forwardRef((r,i)=>{let{children:o,...a}=r;Yu(o)&&typeof Mi=="function"&&(o=Mi(o._payload));const s=g.Children.toArray(o),l=s.find(iy);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return b.jsx(t,{...a,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return b.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var ty=Qu("Slot");function ny(e){const t=g.forwardRef((n,r)=>{let{children:i,...o}=n;if(Yu(i)&&typeof Mi=="function"&&(i=Mi(i._payload)),g.isValidElement(i)){const a=ay(i),s=oy(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ei(r,a):a),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ry=Symbol("radix.slottable");function iy(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ry}function oy(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ay(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Xu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Xu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ju(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Xu(e))&&(r&&(r+=" "),r+=t);return r}const gl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yl=Ju,rs=(e,t)=>n=>{var r;if(t?.variants==null)return yl(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(c=>{const u=n?.[c],d=o?.[c];if(u===null)return null;const h=gl(u)||gl(d);return i[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...o,...s}[p]):{...o,...s}[p]===y})?[...c,d,h]:c},[]);return yl(e,a,l,n?.class,n?.className)},is="-",sy=e=>{const t=cy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(is);return s[0]===""&&s.length!==1&&s.shift(),Zu(s,t)||ly(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},Zu=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Zu(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(is);return t.validators.find(({validator:a})=>a(o))?.classGroupId},bl=/^\[(.+)\]$/,ly=e=>{if(bl.test(e)){const t=bl.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},cy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return dy(Object.entries(e.classGroups),n).forEach(([o,a])=>{ha(a,r,o,t)}),r},ha=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:vl(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(uy(i)){ha(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{ha(a,vl(t,o),n,r)})})},vl=(e,t)=>{let n=e;return t.split(is).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},uy=e=>e.isThemeGetter,dy=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,fy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},ed="!",hy=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let c=0,u=0,d;for(let y=0;y<s.length;y++){let v=s[y];if(c===0){if(v===i&&(r||s.slice(y,y+o)===t)){l.push(s.slice(u,y)),u=y+o;continue}if(v==="/"){d=y;continue}}v==="["?c++:v==="]"&&c--}const h=l.length===0?s:s.substring(u),f=h.startsWith(ed),m=f?h.substring(1):h,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:a}):a},py=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},my=e=>({cache:fy(e.cacheSize),parseClassName:hy(e),...sy(e)}),gy=/\s+/,yy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(gy);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(c);let m=!!f,p=r(m?h.substring(0,f):h);if(!p){if(!m){s=c+(s.length>0?" "+s:s);continue}if(p=r(h),!p){s=c+(s.length>0?" "+s:s);continue}m=!1}const y=py(u).join(":"),v=d?y+ed:y,x=v+p;if(o.includes(x))continue;o.push(x);const w=i(p,m);for(let R=0;R<w.length;++R){const I=w[R];o.push(v+I)}s=c+(s.length>0?" "+s:s)}return s};function by(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=td(t))&&(r&&(r+=" "),r+=n);return r}const td=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=td(e[r]))&&(n&&(n+=" "),n+=t);return n};function vy(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=my(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=yy(l,n);return i(l,u),u}return function(){return o(by.apply(null,arguments))}}const Fe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},nd=/^\[(?:([a-z-]+):)?(.+)\]$/i,xy=/^\d+\/\d+$/,wy=new Set(["px","full","screen"]),ky=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ey=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Cy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ay=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zt=e=>sr(e)||wy.has(e)||xy.test(e),un=e=>yr(e,"length",Dy),sr=e=>!!e&&!Number.isNaN(Number(e)),Io=e=>yr(e,"number",sr),Lr=e=>!!e&&Number.isInteger(Number(e)),Ty=e=>e.endsWith("%")&&sr(e.slice(0,-1)),pe=e=>nd.test(e),dn=e=>ky.test(e),Ry=new Set(["length","size","percentage"]),Py=e=>yr(e,Ry,rd),Iy=e=>yr(e,"position",rd),Ly=new Set(["image","url"]),Oy=e=>yr(e,Ly,My),Ny=e=>yr(e,"",_y),Or=()=>!0,yr=(e,t,n)=>{const r=nd.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Dy=e=>Sy.test(e)&&!Ey.test(e),rd=()=>!1,_y=e=>Cy.test(e),My=e=>Ay.test(e),jy=()=>{const e=Fe("colors"),t=Fe("spacing"),n=Fe("blur"),r=Fe("brightness"),i=Fe("borderColor"),o=Fe("borderRadius"),a=Fe("borderSpacing"),s=Fe("borderWidth"),l=Fe("contrast"),c=Fe("grayscale"),u=Fe("hueRotate"),d=Fe("invert"),h=Fe("gap"),f=Fe("gradientColorStops"),m=Fe("gradientColorStopPositions"),p=Fe("inset"),y=Fe("margin"),v=Fe("opacity"),x=Fe("padding"),w=Fe("saturate"),R=Fe("scale"),I=Fe("sepia"),C=Fe("skew"),k=Fe("space"),D=Fe("translate"),j=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",pe,t],L=()=>[pe,t],K=()=>["",Zt,un],B=()=>["auto",sr,pe],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",pe],S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>[sr,pe];return{cacheSize:500,separator:":",theme:{colors:[Or],spacing:[Zt,un],blur:["none","",dn,pe],brightness:se(),borderColor:[e],borderRadius:["none","","full",dn,pe],borderSpacing:L(),borderWidth:K(),contrast:se(),grayscale:F(),hueRotate:se(),invert:F(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Ty,un],inset:_(),margin:_(),opacity:se(),padding:L(),saturate:se(),scale:se(),sepia:F(),skew:se(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[dn]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),pe]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Lr,pe]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pe]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Lr,pe]}],"grid-cols":[{"grid-cols":[Or]}],"col-start-end":[{col:["auto",{span:["full",Lr,pe]},pe]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Or]}],"row-start-end":[{row:["auto",{span:[Lr,pe]},pe]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pe,t]}],"min-w":[{"min-w":[pe,t,"min","max","fit"]}],"max-w":[{"max-w":[pe,t,"none","full","min","max","fit","prose",{screen:[dn]},dn]}],h:[{h:[pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",dn,un]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Io]}],"font-family":[{font:[Or]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",pe]}],"line-clamp":[{"line-clamp":["none",sr,Io]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zt,pe]}],"list-image":[{"list-image":["none",pe]}],"list-style-type":[{list:["none","disc","decimal",pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zt,un]}],"underline-offset":[{"underline-offset":["auto",Zt,pe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),Iy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Py]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Oy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[Zt,pe]}],"outline-w":[{outline:[Zt,un]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Zt,un]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",dn,Ny]}],"shadow-color":[{shadow:[Or]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",dn,pe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pe]}],duration:[{duration:se()}],ease:[{ease:["linear","in","out","in-out",pe]}],delay:[{delay:se()}],animate:[{animate:["none","spin","ping","pulse","bounce",pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[Lr,pe]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zt,un,Io]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Fy=vy(jy);function Ie(...e){return Fy(Ju(e))}const By=rs(["inline-flex items-center justify-center gap-2","whitespace-nowrap rounded-md text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg","disabled:pointer-events-none disabled:opacity-55","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"].join(" "),{variants:{variant:{default:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface-2 text-text hover:bg-surface-hover border border-border",outline:"bg-surface text-text border border-border hover:bg-surface-hover hover:border-border-strong",ghost:"bg-transparent text-text-dim hover:bg-surface-hover hover:text-text",destructive:"bg-surface text-danger border border-danger hover:bg-danger hover:text-white",link:"bg-transparent text-accent underline-offset-4 hover:underline px-0 h-auto"},size:{default:"h-8 px-3 py-1 text-sm",sm:"h-7 px-2.5 py-1 text-xs",lg:"h-9 px-5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),vt=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const a=r?ty:"button";return b.jsx(a,{className:Ie(By({variant:t,size:n,className:e})),ref:o,...i})});vt.displayName="Button";class Uy extends g.Component{state={error:null,info:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.setState({info:n})}handleReset=()=>{this.setState({error:null,info:null})};render(){return this.state.error?b.jsx(Hy,{error:this.state.error,info:this.state.info,onReset:this.handleReset}):this.props.children}}function Hy({error:e,info:t,onReset:n}){const{t:r}=kt("common"),i=typeof import.meta<"u"&&!1;return b.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8",children:b.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-xl",children:[b.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger-bg text-danger",children:b.jsx(Jg,{className:"h-6 w-6"})}),b.jsx("h1",{className:"text-xl font-semibold",children:r("errorBoundary.title",{defaultValue:"Something went wrong."})}),b.jsx("p",{className:"text-sm text-text-dim",children:r("errorBoundary.description",{defaultValue:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it."})}),b.jsxs("pre",{className:"w-full max-w-lg overflow-auto rounded-md bg-surface-2 px-3 py-2 text-left text-xs leading-5 text-text-dim",children:[e.name,": ",e.message]}),i&&t?.componentStack&&b.jsxs("details",{className:"w-full max-w-lg text-left text-xs",children:[b.jsx("summary",{className:"cursor-pointer text-text-dim",children:"component stack (dev)"}),b.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-text-muted",children:t.componentStack})]}),b.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[b.jsxs(vt,{type:"button",variant:"default",onClick:()=>{n(),typeof window<"u"&&window.location.reload()},children:[b.jsx(Gg,{className:"h-4 w-4"}),r("errorBoundary.reload",{defaultValue:"Reload"})]}),b.jsx(vt,{type:"button",variant:"secondary",asChild:!0,children:b.jsxs(ts,{to:"/",onClick:n,children:[b.jsx(Vg,{className:"h-4 w-4"}),r("errorBoundary.home",{defaultValue:"Home"})]})})]})]})})}var ti=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},zy=class extends ti{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},id=new zy,$y={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Vy=class{#e=$y;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},pa=new Vy;function Wy(e){setTimeout(e,0)}var Ky=typeof window>"u"||"Deno"in globalThis;function Et(){}function qy(e,t){return typeof e=="function"?e(t):e}function Gy(e){return typeof e=="number"&&e>=0&&e!==1/0}function Yy(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ma(e,t){return typeof e=="function"?e(t):e}function Qy(e,t){return typeof e=="function"?e(t):e}function xl(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==os(a,t.options))return!1}else if(!Kr(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function wl(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Un(t.options.mutationKey)!==Un(o))return!1}else if(!Kr(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function os(e,t){return(t?.queryKeyHashFn||Un)(e)}function Un(e){return JSON.stringify(e,(t,n)=>ga(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Kr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Kr(e[n],t[n])):!1}var Xy=Object.prototype.hasOwnProperty;function od(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=kl(e)&&kl(t);if(!r&&!(ga(e)&&ga(t)))return t;const o=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),s=a.length,l=r?new Array(s):{};let c=0;for(let u=0;u<s;u++){const d=r?u:a[u],h=e[d],f=t[d];if(h===f){l[d]=h,(r?u<o:Xy.call(e,d))&&c++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){l[d]=f;continue}const m=od(h,f,n+1);l[d]=m,m===h&&c++}return o===s&&c===o?e:l}function Jy(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function kl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ga(e){if(!Sl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Sl(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Sl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zy(e){return new Promise(t=>{pa.setTimeout(t,e)})}function eb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?od(e,t):t}function tb(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nb(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var as=Symbol();function ad(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===as?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rb(e,t){return typeof e=="function"?e(...t):!!e}function ib(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var sd=(()=>{let e=()=>Ky;return{isServer(){return e()},setIsServer(t){e=t}}})();function ob(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var ab=Wy;function sb(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=ab;const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var et=sb(),lb=class extends ti{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ji=new lb;function cb(e){return Math.min(1e3*2**e,3e4)}function ld(e){return(e??"online")==="online"?ji.isOnline():!0}var ya=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function cd(e){let t=!1,n=0,r;const i=ob(),o=()=>i.status!=="pending",a=p=>{if(!o()){const y=new ya(p);h(y),e.onCancel?.(y)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>id.isFocused()&&(e.networkMode==="always"||ji.isOnline())&&e.canRun(),u=()=>ld(e.networkMode)&&e.canRun(),d=p=>{o()||(r?.(),i.resolve(p))},h=p=>{o()||(r?.(),i.reject(p))},f=()=>new Promise(p=>{r=y=>{(o()||c())&&p(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let p;const y=n===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(v){p=Promise.reject(v)}Promise.resolve(p).then(d).catch(v=>{if(o())return;const x=e.retry??(sd.isServer()?0:3),w=e.retryDelay??cb,R=typeof w=="function"?w(n,v):w,I=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,v);if(t||!I){h(v);return}n++,e.onFail?.(n,v),Zy(R).then(()=>c()?void 0:f()).then(()=>{t?h(v):m()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?m():f().then(m),i)}}var ud=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gy(this.gcTime)&&(this.#e=pa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sd.isServer()?1/0:5*60*1e3))}clearGcTimeout(){this.#e!==void 0&&(pa.clearTimeout(this.#e),this.#e=void 0)}};function ub(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=m=>{ib(m,()=>t.signal,()=>u=!0)},h=ad(t.options,t.fetchOptions),f=async(m,p,y)=>{if(u)return Promise.reject(t.signal.reason);if(p==null&&m.pages.length)return Promise.resolve(m);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:p,direction:y?"backward":"forward",meta:t.options.meta};return d(C),C})(),w=await h(x),{maxPages:R}=t.options,I=y?nb:tb;return{pages:I(m.pages,w,R),pageParams:I(m.pageParams,p,R)}};if(i&&o.length){const m=i==="backward",p=m?db:El,y={pages:o,pageParams:a},v=p(r,y);s=await f(y,v,m)}else{const m=e??o.length;do{const p=l===0?a[0]??r.initialPageParam:El(r,s);if(l>0&&p==null)break;s=await f(s,p),l++}while(l<m)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function El(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function db(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var fb=class extends ud{#e;#t;#n;#r;#o;#i;#l;#a;constructor(e){super(),this.#a=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Al(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Al(this.options);t.data!==void 0&&(this.setState(Cl(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=eb(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#s({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Qy(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===as||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ma(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Yy(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#a||this.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const l=ad(this.options,t),u=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#a=!1,this.options.persister?this.options.persister(l,u,this):l(u)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:i};return r(l),l})();(this.#e==="infinite"?ub(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=cd({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof ya&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#s({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof ya){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#s({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...hb(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Cl(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),et.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function hb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ld(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Cl(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Al(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var pb=class extends ud{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||dd(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=cd({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#o({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#o({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),et.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function dd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mb=class extends ti{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new pb({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=ui(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ui(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ui(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=ui(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){et.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>wl(t,n))}findAll(e={}){return this.getAll().filter(t=>wl(e,t))}notify(e){et.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return et.batch(()=>Promise.all(e.map(t=>t.continue().catch(Et))))}};function ui(e){return e.options.scope?.id}var gb=class extends ti{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Jy(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Un(n.mutationKey)!==Un(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??dd();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){et.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},yb=class extends ti{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??os(r,t);let o=this.get(i);return o||(o=new fb({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){et.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>xl(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>xl(e,n)):t}notify(e){et.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){et.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){et.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},bb=class{#e;#t;#n;#r;#o;#i;#l;#a;constructor(e={}){this.#e=e.queryCache||new yb,this.#t=e.mutationCache||new mb,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#l=id.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=ji.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#l?.(),this.#l=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ma(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=qy(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return et.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;et.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return et.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=et.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Et).catch(Et)}invalidateQueries(e,t={}){return et.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=et.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Et)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Et)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(ma(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Et).catch(Et)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Et).catch(Et)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ji.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Un(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Kr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(Un(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Kr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=os(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===as&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},fd=g.createContext(void 0),vb=e=>{const t=g.useContext(fd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},xb=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(fd.Provider,{value:e,children:t}));function wb(e,t){const n=vb(),[r]=g.useState(()=>new gb(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(a=>r.subscribe(et.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=g.useCallback((a,s)=>{r.mutate(a,s).catch(Et)},[r]);if(i.error&&rb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var kb=e=>{switch(e){case"success":return Cb;case"info":return Tb;case"warning":return Ab;case"error":return Rb;default:return null}},Sb=Array(12).fill(0),Eb=({visible:e,className:t})=>z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},z.createElement("div",{className:"sonner-spinner"},Sb.map((n,r)=>z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Cb=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ab=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Tb=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Rb=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Pb=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ib=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},ba=1,Lb=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:ba++,o=this.toasts.find(s=>s.id===i),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:n}),{...s,...e,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],z.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(Nb(l)&&!l.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||ba++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ft=new Lb,Ob=(e,t)=>{let n=t?.id||ba++;return ft.addToast({title:e,...t,id:n}),n},Nb=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Db=Ob,_b=()=>ft.toasts,Mb=()=>ft.getActiveToasts(),Ot=Object.assign(Db,{success:ft.success,info:ft.info,warning:ft.warning,error:ft.error,custom:ft.custom,message:ft.message,promise:ft.promise,dismiss:ft.dismiss,loading:ft.loading},{getHistory:_b,getToasts:Mb});function jb(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}jb(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
129
- `);function di(e){return e.label!==void 0}var Fb=3,Bb="32px",Ub="16px",Tl=4e3,Hb=356,zb=14,$b=20,Vb=200;function Pt(...e){return e.filter(Boolean).join(" ")}function Wb(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Kb=e=>{var t,n,r,i,o,a,s,l,c,u,d;let{invert:h,toast:f,unstyled:m,interacting:p,setHeights:y,visibleToasts:v,heights:x,index:w,toasts:R,expanded:I,removeToast:C,defaultRichColors:k,closeButton:D,style:j,cancelButtonStyle:T,actionButtonStyle:_,className:L="",descriptionClassName:K="",duration:B,position:V,gap:q,loadingIcon:Q,expandByDefault:$,classNames:F,icons:S,closeButtonAriaLabel:se="Close toast",pauseWhenPageIsHidden:te}=e,[E,oe]=z.useState(null),[fe,ge]=z.useState(null),[W,ye]=z.useState(!1),[Le,ve]=z.useState(!1),[we,de]=z.useState(!1),[Be,lt]=z.useState(!1),[Mt,Je]=z.useState(!1),[jt,En]=z.useState(0),[Cn,An]=z.useState(0),Qt=z.useRef(f.duration||B||Tl),Gn=z.useRef(null),At=z.useRef(null),Tt=w===0,Xt=w+1<=v,N=f.type,H=f.dismissible!==!1,ne=f.className||"",ae=f.descriptionClassName||"",Se=z.useMemo(()=>x.findIndex(ce=>ce.toastId===f.id)||0,[x,f.id]),Qe=z.useMemo(()=>{var ce;return(ce=f.closeButton)!=null?ce:D},[f.closeButton,D]),St=z.useMemo(()=>f.duration||B||Tl,[f.duration,B]),ze=z.useRef(0),ot=z.useRef(0),Rt=z.useRef(0),He=z.useRef(null),[Ft,ct]=V.split("-"),Tn=z.useMemo(()=>x.reduce((ce,Te,Oe)=>Oe>=Se?ce:ce+Te.height,0),[x,Se]),Sr=Ib(),Er=f.invert||h,Rn=N==="loading";ot.current=z.useMemo(()=>Se*q+Tn,[Se,Tn]),z.useEffect(()=>{Qt.current=St},[St]),z.useEffect(()=>{ye(!0)},[]),z.useEffect(()=>{let ce=At.current;if(ce){let Te=ce.getBoundingClientRect().height;return An(Te),y(Oe=>[{toastId:f.id,height:Te,position:f.position},...Oe]),()=>y(Oe=>Oe.filter(tt=>tt.toastId!==f.id))}},[y,f.id]),z.useLayoutEffect(()=>{if(!W)return;let ce=At.current,Te=ce.style.height;ce.style.height="auto";let Oe=ce.getBoundingClientRect().height;ce.style.height=Te,An(Oe),y(tt=>tt.find(mt=>mt.toastId===f.id)?tt.map(mt=>mt.toastId===f.id?{...mt,height:Oe}:mt):[{toastId:f.id,height:Oe,position:f.position},...tt])},[W,f.title,f.description,y,f.id]);let Bt=z.useCallback(()=>{ve(!0),En(ot.current),y(ce=>ce.filter(Te=>Te.toastId!==f.id)),setTimeout(()=>{C(f)},Vb)},[f,C,y,ot]);z.useEffect(()=>{if(f.promise&&N==="loading"||f.duration===1/0||f.type==="loading")return;let ce;return I||p||te&&Sr?(()=>{if(Rt.current<ze.current){let Te=new Date().getTime()-ze.current;Qt.current=Qt.current-Te}Rt.current=new Date().getTime()})():Qt.current!==1/0&&(ze.current=new Date().getTime(),ce=setTimeout(()=>{var Te;(Te=f.onAutoClose)==null||Te.call(f,f),Bt()},Qt.current)),()=>clearTimeout(ce)},[I,p,f,N,te,Sr,Bt]),z.useEffect(()=>{f.delete&&Bt()},[Bt,f.delete]);function ai(){var ce,Te,Oe;return S!=null&&S.loading?z.createElement("div",{className:Pt(F?.loader,(ce=f?.classNames)==null?void 0:ce.loader,"sonner-loader"),"data-visible":N==="loading"},S.loading):Q?z.createElement("div",{className:Pt(F?.loader,(Te=f?.classNames)==null?void 0:Te.loader,"sonner-loader"),"data-visible":N==="loading"},Q):z.createElement(Eb,{className:Pt(F?.loader,(Oe=f?.classNames)==null?void 0:Oe.loader),visible:N==="loading"})}return z.createElement("li",{tabIndex:0,ref:At,className:Pt(L,ne,F?.toast,(t=f?.classNames)==null?void 0:t.toast,F?.default,F?.[N],(n=f?.classNames)==null?void 0:n[N]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:k,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":W,"data-promise":!!f.promise,"data-swiped":Mt,"data-removed":Le,"data-visible":Xt,"data-y-position":Ft,"data-x-position":ct,"data-index":w,"data-front":Tt,"data-swiping":we,"data-dismissible":H,"data-type":N,"data-invert":Er,"data-swipe-out":Be,"data-swipe-direction":fe,"data-expanded":!!(I||$&&W),style:{"--index":w,"--toasts-before":w,"--z-index":R.length-w,"--offset":`${Le?jt:ot.current}px`,"--initial-height":$?"auto":`${Cn}px`,...j,...f.style},onDragEnd:()=>{de(!1),oe(null),He.current=null},onPointerDown:ce=>{Rn||!H||(Gn.current=new Date,En(ot.current),ce.target.setPointerCapture(ce.pointerId),ce.target.tagName!=="BUTTON"&&(de(!0),He.current={x:ce.clientX,y:ce.clientY}))},onPointerUp:()=>{var ce,Te,Oe,tt;if(Be||!H)return;He.current=null;let mt=Number(((ce=At.current)==null?void 0:ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ut=Number(((Te=At.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),A=new Date().getTime()-((Oe=Gn.current)==null?void 0:Oe.getTime()),P=E==="x"?mt:Ut,O=Math.abs(P)/A;if(Math.abs(P)>=$b||O>.11){En(ot.current),(tt=f.onDismiss)==null||tt.call(f,f),ge(E==="x"?mt>0?"right":"left":Ut>0?"down":"up"),Bt(),lt(!0),Je(!1);return}de(!1),oe(null)},onPointerMove:ce=>{var Te,Oe,tt,mt;if(!He.current||!H||((Te=window.getSelection())==null?void 0:Te.toString().length)>0)return;let Ut=ce.clientY-He.current.y,A=ce.clientX-He.current.x,P=(Oe=e.swipeDirections)!=null?Oe:Wb(V);!E&&(Math.abs(A)>1||Math.abs(Ut)>1)&&oe(Math.abs(A)>Math.abs(Ut)?"x":"y");let O={x:0,y:0};E==="y"?(P.includes("top")||P.includes("bottom"))&&(P.includes("top")&&Ut<0||P.includes("bottom")&&Ut>0)&&(O.y=Ut):E==="x"&&(P.includes("left")||P.includes("right"))&&(P.includes("left")&&A<0||P.includes("right")&&A>0)&&(O.x=A),(Math.abs(O.x)>0||Math.abs(O.y)>0)&&Je(!0),(tt=At.current)==null||tt.style.setProperty("--swipe-amount-x",`${O.x}px`),(mt=At.current)==null||mt.style.setProperty("--swipe-amount-y",`${O.y}px`)}},Qe&&!f.jsx?z.createElement("button",{"aria-label":se,"data-disabled":Rn,"data-close-button":!0,onClick:Rn||!H?()=>{}:()=>{var ce;Bt(),(ce=f.onDismiss)==null||ce.call(f,f)},className:Pt(F?.closeButton,(i=f?.classNames)==null?void 0:i.closeButton)},(o=S?.close)!=null?o:Pb):null,f.jsx||g.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:z.createElement(z.Fragment,null,N||f.icon||f.promise?z.createElement("div",{"data-icon":"",className:Pt(F?.icon,(a=f?.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ai():null,f.type!=="loading"?f.icon||S?.[N]||kb(N):null):null,z.createElement("div",{"data-content":"",className:Pt(F?.content,(s=f?.classNames)==null?void 0:s.content)},z.createElement("div",{"data-title":"",className:Pt(F?.title,(l=f?.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?z.createElement("div",{"data-description":"",className:Pt(K,ae,F?.description,(c=f?.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),g.isValidElement(f.cancel)?f.cancel:f.cancel&&di(f.cancel)?z.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||T,onClick:ce=>{var Te,Oe;di(f.cancel)&&H&&((Oe=(Te=f.cancel).onClick)==null||Oe.call(Te,ce),Bt())},className:Pt(F?.cancelButton,(u=f?.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,g.isValidElement(f.action)?f.action:f.action&&di(f.action)?z.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||_,onClick:ce=>{var Te,Oe;di(f.action)&&((Oe=(Te=f.action).onClick)==null||Oe.call(Te,ce),!ce.defaultPrevented&&Bt())},className:Pt(F?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function Rl(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function qb(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?Ub:Bb;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}var Gb=g.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:h,style:f,visibleToasts:m=Fb,toastOptions:p,dir:y=Rl(),gap:v=zb,loadingIcon:x,icons:w,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:I}=e,[C,k]=z.useState([]),D=z.useMemo(()=>Array.from(new Set([r].concat(C.filter(te=>te.position).map(te=>te.position)))),[C,r]),[j,T]=z.useState([]),[_,L]=z.useState(!1),[K,B]=z.useState(!1),[V,q]=z.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=z.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=z.useRef(null),S=z.useRef(!1),se=z.useCallback(te=>{k(E=>{var oe;return(oe=E.find(fe=>fe.id===te.id))!=null&&oe.delete||ft.dismiss(te.id),E.filter(({id:fe})=>fe!==te.id)})},[]);return z.useEffect(()=>ft.subscribe(te=>{if(te.dismiss){k(E=>E.map(oe=>oe.id===te.id?{...oe,delete:!0}:oe));return}setTimeout(()=>{ku.flushSync(()=>{k(E=>{let oe=E.findIndex(fe=>fe.id===te.id);return oe!==-1?[...E.slice(0,oe),{...E[oe],...te},...E.slice(oe+1)]:[te,...E]})})})}),[]),z.useEffect(()=>{if(u!=="system"){q(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:E})=>{q(E?"dark":"light")})}catch{te.addListener(({matches:oe})=>{try{q(oe?"dark":"light")}catch(fe){console.error(fe)}})}},[u]),z.useEffect(()=>{C.length<=1&&L(!1)},[C]),z.useEffect(()=>{let te=E=>{var oe,fe;i.every(ge=>E[ge]||E.code===ge)&&(L(!0),(oe=Q.current)==null||oe.focus()),E.code==="Escape"&&(document.activeElement===Q.current||(fe=Q.current)!=null&&fe.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[i]),z.useEffect(()=>{if(Q.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,S.current=!1)}},[Q.current]),z.createElement("section",{ref:t,"aria-label":`${R} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((te,E)=>{var oe;let[fe,ge]=te.split("-");return C.length?z.createElement("ol",{key:te,dir:y==="auto"?Rl():y,tabIndex:-1,ref:Q,className:s,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":fe,"data-lifted":_&&C.length>1&&!o,"data-x-position":ge,style:{"--front-toast-height":`${((oe=j[0])==null?void 0:oe.height)||0}px`,"--width":`${Hb}px`,"--gap":`${v}px`,...f,...qb(l,c)},onBlur:W=>{S.current&&!W.currentTarget.contains(W.relatedTarget)&&(S.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||S.current||(S.current=!0,F.current=W.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{K||L(!1)},onDragEnd:()=>L(!1),onPointerDown:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},C.filter(W=>!W.position&&E===0||W.position===te).map((W,ye)=>{var Le,ve;return z.createElement(Kb,{key:W.id,icons:w,index:ye,toast:W,defaultRichColors:d,duration:(Le=p?.duration)!=null?Le:h,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:n,visibleToasts:m,closeButton:(ve=p?.closeButton)!=null?ve:a,interacting:K,position:te,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:se,toasts:C.filter(we=>we.position==W.position),heights:j.filter(we=>we.position==W.position),setHeights:T,expandByDefault:o,gap:v,loadingIcon:x,expanded:_,pauseWhenPageIsHidden:I,swipeDirections:e.swipeDirections})})):null}))});const hd="agim_token";function Yb(e){if(!e)return"";const t=[];for(const[n,r]of Object.entries(e))if(!(r==null||r==="")){if(typeof r=="boolean"){t.push(`${encodeURIComponent(n)}=${r?"1":"0"}`);continue}t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}return t.length?`?${t.join("&")}`:""}function Qb(){try{return localStorage.getItem(hd)}catch{return null}}async function Nr(e,t,n={}){const r=t+Yb(n.query),i={...n.headers??{}},o=Qb();o&&!i.Authorization&&(i.Authorization=`Bearer ${o}`);let a;n.body!==void 0&&n.body!==null&&(n.body instanceof FormData||typeof n.body=="string"?a=n.body:(i["Content-Type"]=i["Content-Type"]??"application/json",a=JSON.stringify(n.body)));let s;try{s=await fetch(r,{method:e,headers:i,body:a,credentials:"same-origin",signal:n.signal})}catch(u){const d=u instanceof Error?u.message:String(u);throw new va({code:"NETWORK",message:d,status:0})}if(s.status===204)return;const c=(s.headers.get("content-type")||"").includes("application/json");if(!s.ok){let u=`HTTP_${s.status}`,d=s.statusText,h=!1;if(c)try{const f=await s.json();f.error&&(d=f.error),f.code&&(u=f.code,h=!0)}catch{}if(h||(s.status===401&&(u="AUTH_INVALID"),s.status===403&&(u="FORBIDDEN"),s.status===404&&(u="NOT_FOUND"),s.status===413&&(u="PAYLOAD_TOO_LARGE")),s.status===401&&!t.startsWith("/api/auth/")){try{localStorage.removeItem(hd)}catch{}const f=encodeURIComponent(location.pathname+location.search);location.pathname.startsWith("/login")||(location.href=`/login?next=${f}`)}throw new va({code:u,message:d,status:s.status})}return c?await s.json():await s.text()}class va extends Error{code;status;constructor(t){super(t.message),this.name="ApiClientError",this.code=t.code,this.status=t.status}}const Y={get:(e,t)=>Nr("GET",e,t),post:(e,t)=>Nr("POST",e,t),put:(e,t)=>Nr("PUT",e,t),patch:(e,t)=>Nr("PATCH",e,t),delete:(e,t)=>Nr("DELETE",e,t)},Xb={getA2ARecent:e=>Y.get("/api/a2a/recent",{query:e}),getA2AStats:()=>Y.get("/api/a2a/stats"),removeAdminAllowlist:e=>Y.delete("/api/admin-allowlist",{body:e}),listAdminAllowlist:()=>Y.get("/api/admin-allowlist"),addAdminAllowlist:e=>Y.post("/api/admin-allowlist",{body:e}),getAgentHealth:e=>Y.get("/api/agent-health",e),discoverAcpAgents:e=>Y.post("/api/agents/acp/discover",{body:e}),testAcpAgent:e=>Y.post("/api/agents/acp/test",{body:e}),testEmail:()=>Y.post("/api/messengers/email/test"),getSearchProviders:()=>Y.get("/api/search/providers"),testSearchProvider:e=>Y.post("/api/search/test",{body:e}),getAgentsStatus:()=>Y.get("/api/agents/status"),listApprovals:()=>Y.get("/api/approvals"),resolveApproval:(e,t)=>Y.post(`/api/approvals/${encodeURIComponent(e)}/resolve`,{body:t}),getAudit:e=>Y.get("/api/audit",{query:e}),login:e=>Y.post("/api/auth/login",{body:e}),logout:e=>Y.post("/api/auth/logout",e),listBgJobs:e=>Y.get("/api/bgjobs",{query:e}),getConfig:()=>Y.get("/api/config"),updateConfig:e=>Y.put("/api/config",{body:e}),listWorkspacesFull:()=>Y.get("/api/workspaces",{query:{full:!0}}),upsertWorkspace:e=>Y.post("/api/workspaces",{body:e}),startWechatQr:()=>Y.post("/api/messengers/wechat/qr-start"),getWechatQrStatus:e=>Y.get("/api/messengers/wechat/qr-status",{query:e}),getEnv:e=>Y.get("/api/env",{query:e}),updateEnv:e=>Y.put("/api/env",{body:e}),getHealth:e=>Y.get("/api/health",e),getHealthSummary:e=>Y.get("/api/health/summary",{query:e}),getHealthTopN:e=>Y.get("/api/health/topn",{query:e}),invoke:e=>Y.post("/api/invoke",e),listJobs:e=>Y.get("/api/jobs",{query:e}),createJob:e=>Y.post("/api/jobs",{body:e}),batchCancelJobs:e=>Y.post("/api/jobs/batch-cancel",{body:e}),batchRunJobs:e=>Y.post("/api/jobs/batch-run",{body:e}),submitLoc:e=>Y.post("/api/loc",e),getLocInfo:e=>Y.get("/api/loc/info",e),consolidateMemory:()=>Y.post("/api/memory/consolidate"),getMemoryConsolidateStatus:()=>Y.get("/api/memory/consolidate/status"),exportMemory:e=>Y.get("/api/memory/export",e),deleteMemoryFacts:(e,t)=>Y.delete("/api/memory/facts",{query:e,body:t}),deleteMemoryFactById:(e,t)=>Y.delete(`/api/memory/facts/${e}`,{query:t}),listMemoryFacts:e=>Y.get("/api/memory/facts",{query:e}),deleteMemoryPersona:e=>Y.delete("/api/memory/persona",{query:e}),getMemoryPersona:e=>Y.get("/api/memory/persona",{query:e}),updateMemoryPersona:(e,t)=>Y.put("/api/memory/persona",{query:e,body:t}),listMemoryUsers:()=>Y.get("/api/memory/users"),backfillMemoryVector:(e,t)=>Y.post("/api/memory/vector/backfill",{query:e,body:t}),clearMemoryVector:e=>Y.post("/api/memory/vector/clear",{query:e}),downloadMemoryVector:()=>Y.post("/api/memory/vector/download"),getMemoryVectorStatus:e=>Y.get("/api/memory/vector/status",{query:e}),testMemoryVector:()=>Y.post("/api/memory/vector/test"),listMemos:e=>Y.get("/api/memos",{query:e}),deleteMemo:e=>Y.delete(`/api/memos/${e}`),getMetrics:e=>Y.get("/api/metrics",e),notify:e=>Y.post("/api/notify",e),listOutbox:e=>Y.get("/api/outbox",{query:e}),getOutboxStats:()=>Y.get("/api/outbox/stats"),retryOutbox:e=>Y.post(`/api/outbox/${e}/retry`),listReminders:e=>Y.get("/api/reminders",{query:e}),cancelReminder:e=>Y.post(`/api/reminders/${e}/cancel`),snoozeReminder:(e,t)=>Y.post(`/api/reminders/${e}/snooze`,{body:t}),listSchedules:e=>Y.get("/api/schedules",{query:e}),restartService:()=>Y.post("/api/service/restart"),startService:()=>Y.post("/api/service/start"),getServiceStatus:()=>Y.get("/api/service/status"),stopService:()=>Y.post("/api/service/stop"),listSkills:()=>Y.get("/api/skills"),getSkillDetail:e=>Y.get(`/api/skills/${encodeURIComponent(e)}`),getSkillsRemoteHot:()=>Y.get("/api/skills/remote/hot"),listSubtasks:e=>Y.get("/api/subtasks",{query:e}),listViewerPastes:e=>Y.get("/api/viewer",e),getViewerTunnel:()=>Y.get("/api/viewer/tunnel"),getWorkspaceFiles:e=>Y.get("/api/workspace-files",{query:e}),writeWorkspaceFile:(e,t)=>Y.put("/api/workspace-files",{query:e,body:t})};function Jb(e,t){if(e instanceof va){const n=t("errors:UNKNOWN",{code:e.code,detail:e.message,defaultValue:e.message}),r=t(`errors:${e.code}`,{defaultValue:n,detail:e.message});return{code:e.code,message:r}}return e instanceof Error?{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:e.name,defaultValue:e.message})}:{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:"UNKNOWN",defaultValue:String(e)})}}const pd=g.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ie("rounded-lg border border-border bg-surface text-text shadow-sm",e),...t}));pd.displayName="Card";const md=g.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ie("flex flex-col space-y-1 p-3 sm:p-4",e),...t}));md.displayName="CardHeader";const gd=g.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ie("text-md font-semibold leading-tight",e),...t}));gd.displayName="CardTitle";const yd=g.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ie("text-sm text-text-dim",e),...t}));yd.displayName="CardDescription";const bd=g.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ie("p-3 pt-0 sm:p-4 sm:pt-0",e),...t}));bd.displayName="CardContent";const vd=g.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:Ie("flex items-center p-5 pt-0 sm:p-6 sm:pt-0 gap-2",e),...t}));vd.displayName="CardFooter";const xd=g.forwardRef(({className:e,type:t,...n},r)=>b.jsx("input",{type:t,className:Ie("flex h-8 w-full rounded-md border border-border bg-surface","px-3 py-1 text-sm shadow-sm","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-text-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55",e),ref:r,...n}));xd.displayName="Input";var Zb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ev=Zb.reduce((e,t)=>{const n=Qu(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),tv="Label",wd=g.forwardRef((e,t)=>b.jsx(ev.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));wd.displayName=tv;var kd=wd;const nv=rs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Sd=g.forwardRef(({className:e,...t},n)=>b.jsx(kd,{ref:n,className:Ie(nv(),e),...t}));Sd.displayName=kd.displayName;function rv(e){if(!e)return"/";try{const t=decodeURIComponent(e);if(t.startsWith("/")&&!t.startsWith("//"))return t}catch{}return"/"}function iv(){const{t:e}=kt(),t=io(),[n]=pg(),r=ns(c=>c.setToken),[i,o]=g.useState(""),a=rv(n.get("next")),s=wb({mutationFn:c=>Xb.login({token:c}),onSuccess:()=>{r(i.trim()),Ot.success(e("states.saved")),t(a,{replace:!0})},onError:c=>{const{message:u}=Jb(c,e);Ot.error(u)}});function l(c){c.preventDefault();const u=i.trim();u&&s.mutate(u)}return b.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8 pt-safe",children:b.jsxs(pd,{className:"w-full max-w-md",children:[b.jsxs(md,{children:[b.jsxs(gd,{className:"text-xl",children:[b.jsx("span",{className:"mr-2",children:"🤖"}),e("appName")]}),b.jsx(yd,{children:e("login.intro",{defaultValue:"Paste your access token from ~/.agim/tokens.json or `agim token list`."})})]}),b.jsx(bd,{children:b.jsxs("form",{onSubmit:l,className:"flex flex-col gap-4",children:[b.jsxs("div",{className:"flex flex-col gap-2",children:[b.jsx(Sd,{htmlFor:"token",children:e("login.tokenLabel",{defaultValue:"Access token"})}),b.jsx(xd,{id:"token",type:"password",value:i,onChange:c=>o(c.target.value),placeholder:"agim_••••••••",autoComplete:"off",autoFocus:!0,required:!0})]}),b.jsx(vt,{type:"submit",size:"lg",disabled:s.isPending||i.trim().length===0,children:s.isPending?e("states.loading"):e("login.submit",{defaultValue:"Sign in"})})]})}),b.jsx(vd,{className:"block text-xs text-text-muted",children:e("login.hint",{defaultValue:"Loopback (127.0.0.1) requests bypass this check; you only see this page when accessing agim from another host or with IMHUB_TRUST_LOOPBACK=off."})})]})})}const Pl=[1e3,2e3,5e3,1e4,3e4];function ov(e){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${e}`}let Dr=null;function av(){if(Dr)return Dr;let e=null,t="connecting",n=0,r=null,i=!1;const o=new Set;function a(y){t=y;for(const v of o)v.type==="status"&&v.fn(y)}function s(y){for(const v of o)v.type==="message"&&v.fn(y)}function l(){r!=null&&(clearTimeout(r),r=null)}function c(){if(i)return;l();const y=Pl[Math.min(n,Pl.length-1)]??3e4;n+=1,r=setTimeout(()=>u(),y)}function u(){l(),a("connecting");try{e=new WebSocket(ov("/ws"))}catch(y){a("error"),console.warn("[ws] construct failed",y),c();return}e.addEventListener("open",()=>{n=0,a("open")}),e.addEventListener("message",y=>{let v;try{v=JSON.parse(y.data)}catch{console.warn("[ws] bad json",y.data?.slice?.(0,200));return}s(v)}),e.addEventListener("close",()=>{a("closed"),i||c()}),e.addEventListener("error",()=>{a("error")})}function d(y){if(!e||e.readyState!==WebSocket.OPEN)return!1;try{return e.send(JSON.stringify(y)),!0}catch{return!1}}function h(y){return o.add(y),y.type==="status"&&y.fn(t),()=>{o.delete(y)}}function f(){i=!0,l();try{e?.close()}catch{}e=null,Dr=null}function m(){document.visibilityState==="visible"&&(!e||e.readyState===WebSocket.CLOSED)&&(n=0,u())}function p(){n=0,(!e||e.readyState!==WebSocket.OPEN)&&u()}return document.addEventListener("visibilitychange",m),window.addEventListener("online",p),u(),Dr={send:d,subscribe:h,status:()=>t,close:()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("online",p),f()}},Dr}const sv=1200,lv={messages:[],pendingApprovals:[],agents:[],agent:"",status:"connecting",currentReplyId:null,error:null};function cv(e,t){switch(t.kind){case"WS_STATUS":return{...e,status:t.status};case"INIT":return{...e,agents:t.agents,agent:e.agent||t.defaultAgent};case"HISTORY":return{...e,messages:t.messages,agent:t.agent};case"AGENTS":return{...e,agents:t.agents};case"AGENT_SWITCHED":return{...e,agent:t.agent};case"SEND_USER":return{...e,messages:[...e.messages,t.message,t.placeholder],currentReplyId:t.placeholder.id,error:null};case"CHUNK":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return e;const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:i.content+t.text}),{...e,messages:r}}case"DONE":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return{...e,currentReplyId:null};const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:t.finalText||i.content}),{...e,messages:r,currentReplyId:null}}case"ERROR":return{...e,error:t.message,currentReplyId:null};case"APPROVAL_CARD":return e.pendingApprovals.some(n=>n.messageId===t.messageId)?e:{...e,pendingApprovals:[...e.pendingApprovals,{messageId:t.messageId,prompt:t.prompt}]};case"APPROVAL_TEXT":return e;case"APPROVAL_EDIT":{const n=e.pendingApprovals.findIndex(o=>o.messageId===t.messageId);if(n<0)return e;const r=[...e.pendingApprovals],i=r[n];return i&&(r[n]={...i,outcome:t.outcome,resolvedAt:Date.now()}),{...e,pendingApprovals:r}}case"APPROVAL_DISMISS":return{...e,pendingApprovals:e.pendingApprovals.filter(n=>n.messageId!==t.messageId)};case"RESET_CONVERSATION":return{...e,messages:[],pendingApprovals:[],currentReplyId:null,error:null};case"CLEAR_ERROR":return{...e,error:null}}}function uv(e){switch(e.decision){case"allowed":Ot.success("已批准");return;case"allowed-pinned":Ot.success("已批准 · 后续同类自动放行");return;case"denied":Ot.error("已拒绝");return;case"denied-revoked":Ot.error("已拒绝 · 撤销自动放行规则");return;case"expired":Ot.warning("已过期");return}}let Il=0;function Ll(e){return Il+=1,`${e}-${Date.now()}-${Il}`}function dv(){const[e,t]=g.useReducer(cv,lv),n=g.useRef(av()),r=g.useRef(new Map),i=g.useRef(!1),o=g.useRef(null);g.useEffect(()=>{o.current=e.currentReplyId},[e.currentReplyId]),g.useEffect(()=>{const f=n.current,m=f.subscribe({type:"status",fn:R=>t({kind:"WS_STATUS",status:R})}),p=f.subscribe({type:"message",fn:R=>a(R)});function y(){try{const I=localStorage.getItem("agim-web-thread-id");if(I&&/^web-[A-Za-z0-9_-]{4,64}$/.test(I))return I}catch{}const R=`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{localStorage.setItem("agim-web-thread-id",R)}catch{}return R}const v=y();function x(){f.send({type:"get-history",threadId:v}),f.send({type:"get-agents"})}let w=()=>{};return f.status()==="open"?x():w=f.subscribe({type:"status",fn:R=>{R==="open"&&(x(),w())}}),()=>{m(),p(),w()}},[]);function a(f){switch(f.type){case"init":t({kind:"INIT",agents:f.agents,defaultAgent:f.defaultAgent});return;case"history":t({kind:"HISTORY",agent:f.agent,messages:f.messages.map((m,p)=>({id:`hist-${p}`,role:m.role,content:m.content,agent:m.agent,timestamp:m.timestamp?Date.parse(m.timestamp):Date.now()-p*1e3}))});return;case"agents":t({kind:"AGENTS",agents:f.agents});return;case"agent-switched":t({kind:"AGENT_SWITCHED",agent:f.agent});return;case"chunk":s(f.text);return;case"done":l(),t({kind:"DONE",replyId:o.current??"",finalText:f.text});return;case"error":l(),t({kind:"ERROR",message:f.message});return;case"approval-card":t({kind:"APPROVAL_CARD",messageId:f.messageId,prompt:f.prompt});return;case"approval-card-edit":t({kind:"APPROVAL_EDIT",messageId:f.messageId,outcome:f.outcome}),uv(f.outcome),window.setTimeout(()=>{t({kind:"APPROVAL_DISMISS",messageId:f.messageId})},sv);return;case"approval-text":Ot.info(f.text);return;case"metrics":return;default:return}}function s(f){const m=o.current;if(!m)return;const p=r.current.get(m)??"";r.current.set(m,p+f),!i.current&&(i.current=!0,requestAnimationFrame(()=>{i.current=!1,l()}))}function l(){for(const[f,m]of r.current.entries())m&&t({kind:"CHUNK",replyId:f,text:m});r.current.clear()}function c(f){const m=f.trim();if(!m)return;const p=n.current,y=Ll("u"),v=Ll("a");t({kind:"SEND_USER",message:{id:y,role:"user",content:m,timestamp:Date.now()},placeholder:{id:v,role:"assistant",content:"",agent:e.agent,timestamp:Date.now()}}),p.send({type:"message",text:m,agent:e.agent})||t({kind:"ERROR",message:"Not connected. Reconnecting…"})}function u(f){n.current.send({type:"switch-agent",agent:f})}function d(f,m,p){const y=n.current.send({type:"approval-action",data:`apv:${m}:${p}`,messageId:f});return y||t({kind:"ERROR",message:"Not connected. Reconnecting — try clicking again in a moment."}),y}function h(){t({kind:"RESET_CONVERSATION"}),n.current.send({type:"new-conversation"})}return{state:e,send:c,switchAgent:u,approvalClick:d,newConversation:h,clearError:()=>t({kind:"CLEAR_ERROR"})}}const fv=rs(["inline-flex items-center gap-1","rounded-full border px-2 py-0.5","text-xs font-semibold uppercase tracking-wide leading-5","transition-colors"].join(" "),{variants:{variant:{default:"bg-surface-2 text-text-dim border-transparent",secondary:"bg-surface-2 text-text border-border",outline:"bg-transparent text-text-dim border-border",success:"bg-success-bg text-success border-transparent",warning:"bg-warning-bg text-warning border-transparent",danger:"bg-danger-bg text-danger border-transparent",info:"bg-info-bg text-info border-transparent",accent:"bg-accent-bg text-accent border-transparent"}},defaultVariants:{variant:"default"}});function at({className:e,variant:t,...n}){return b.jsx("span",{className:Ie(fv({variant:t}),e),...n})}function hv(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gv={};function Ol(e,t){return(gv.jsx?mv:pv).test(e)}const yv=/[ \t\n\f\r]/g;function bv(e){return typeof e=="object"?e.type==="text"?Nl(e.value):!1:Nl(e)}function Nl(e){return e.replace(yv,"")===""}class ni{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ni.prototype.normal={};ni.prototype.property={};ni.prototype.space=void 0;function Ed(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ni(n,r,t)}function xa(e){return e.toLowerCase()}class pt{constructor(t,n){this.attribute=n,this.property=t}}pt.prototype.attribute="";pt.prototype.booleanish=!1;pt.prototype.boolean=!1;pt.prototype.commaOrSpaceSeparated=!1;pt.prototype.commaSeparated=!1;pt.prototype.defined=!1;pt.prototype.mustUseProperty=!1;pt.prototype.number=!1;pt.prototype.overloadedBoolean=!1;pt.prototype.property="";pt.prototype.spaceSeparated=!1;pt.prototype.space=void 0;let vv=0;const me=qn(),qe=qn(),wa=qn(),U=qn(),Me=qn(),lr=qn(),gt=qn();function qn(){return 2**++vv}const ka=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:qe,commaOrSpaceSeparated:gt,commaSeparated:lr,number:U,overloadedBoolean:wa,spaceSeparated:Me},Symbol.toStringTag,{value:"Module"})),Lo=Object.keys(ka);class ss extends pt{constructor(t,n,r,i){let o=-1;if(super(t,n),Dl(this,"space",i),typeof r=="number")for(;++o<Lo.length;){const a=Lo[o];Dl(this,Lo[o],(r&ka[a])===ka[a])}}}ss.prototype.defined=!0;function Dl(e,t,n){n&&(e[t]=n)}function br(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new ss(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[xa(r)]=r,n[xa(o.attribute)]=r}return new ni(t,n,e.space)}const Cd=br({properties:{ariaActiveDescendant:null,ariaAtomic:qe,ariaAutoComplete:null,ariaBusy:qe,ariaChecked:qe,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:Me,ariaCurrent:null,ariaDescribedBy:Me,ariaDetails:null,ariaDisabled:qe,ariaDropEffect:Me,ariaErrorMessage:null,ariaExpanded:qe,ariaFlowTo:Me,ariaGrabbed:qe,ariaHasPopup:null,ariaHidden:qe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Me,ariaLevel:U,ariaLive:null,ariaModal:qe,ariaMultiLine:qe,ariaMultiSelectable:qe,ariaOrientation:null,ariaOwns:Me,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:qe,ariaReadOnly:qe,ariaRelevant:null,ariaRequired:qe,ariaRoleDescription:Me,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:qe,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ad(e,t){return t in e?e[t]:t}function Td(e,t){return Ad(e,t.toLowerCase())}const xv=br({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:lr,acceptCharset:Me,accessKey:Me,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Me,autoFocus:me,autoPlay:me,blocking:Me,capture:null,charSet:null,checked:me,cite:null,className:Me,cols:U,colSpan:null,content:null,contentEditable:qe,controls:me,controlsList:Me,coords:U|lr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:wa,draggable:qe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Me,height:U,hidden:wa,high:U,href:null,hrefLang:null,htmlFor:Me,httpEquiv:Me,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Me,itemRef:Me,itemScope:me,itemType:Me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:me,optimum:U,pattern:null,ping:Me,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Me,required:me,reversed:me,rows:U,rowSpan:U,sandbox:Me,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:qe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:qe,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Me,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:qe,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:me,disableRemotePlayback:me,prefix:null,property:null,results:U,security:null,unselectable:null},space:"html",transform:Td}),wv=br({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:gt,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:Me,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:lr,g2:lr,glyphName:lr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:gt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:U,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:gt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:gt,rev:gt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:gt,requiredFeatures:gt,requiredFonts:gt,requiredFormats:gt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:gt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:gt,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:gt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ad}),Rd=br({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Pd=br({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Td}),Id=br({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),kv={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Sv=/[A-Z]/g,_l=/-[a-z]/g,Ev=/^data[-\w.:]+$/i;function Cv(e,t){const n=xa(t);let r=t,i=pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ev.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(_l,Tv);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!_l.test(o)){let a=o.replace(Sv,Av);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=ss}return new i(r,t)}function Av(e){return"-"+e.toLowerCase()}function Tv(e){return e.charAt(1).toUpperCase()}const Rv=Ed([Cd,xv,Rd,Pd,Id],"html"),ls=Ed([Cd,wv,Rd,Pd,Id],"svg");function Pv(e){return e.join(" ").trim()}var cs={},Ml=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Iv=/\n/g,Lv=/^\s*/,Ov=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Nv=/^:\s*/,Dv=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,_v=/^[;\s]*/,Mv=/^\s+|\s+$/g,jv=`
130
- `,jl="/",Fl="*",Dn="",Fv="comment",Bv="declaration";function Uv(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var p=m.match(Iv);p&&(n+=p.length);var y=m.lastIndexOf(jv);r=~y?m.length-y:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new a(m),c(),p}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var y=p[0];return i(y),e=e.slice(y.length),p}}function c(){l(Lv)}function u(m){var p;for(m=m||[];p=d();)p!==!1&&m.push(p);return m}function d(){var m=o();if(!(jl!=e.charAt(0)||Fl!=e.charAt(1))){for(var p=2;Dn!=e.charAt(p)&&(Fl!=e.charAt(p)||jl!=e.charAt(p+1));)++p;if(p+=2,Dn===e.charAt(p-1))return s("End of comment missing");var y=e.slice(2,p-2);return r+=2,i(y),e=e.slice(p),r+=2,m({type:Fv,comment:y})}}function h(){var m=o(),p=l(Ov);if(p){if(d(),!l(Nv))return s("property missing ':'");var y=l(Dv),v=m({type:Bv,property:Bl(p[0].replace(Ml,Dn)),value:y?Bl(y[0].replace(Ml,Dn)):Dn});return l(_v),v}}function f(){var m=[];u(m);for(var p;p=h();)p!==!1&&(m.push(p),u(m));return m}return c(),f()}function Bl(e){return e?e.replace(Mv,Dn):Dn}var Hv=Uv,zv=Ii&&Ii.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.default=Vv;const $v=zv(Hv);function Vv(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,$v.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.camelCase=void 0;var Wv=/^--[a-zA-Z0-9_-]+$/,Kv=/-([a-z])/g,qv=/^[^-]+$/,Gv=/^-(webkit|moz|ms|o|khtml)-/,Yv=/^-(ms)-/,Qv=function(e){return!e||qv.test(e)||Wv.test(e)},Xv=function(e,t){return t.toUpperCase()},Ul=function(e,t){return"".concat(t,"-")},Jv=function(e,t){return t===void 0&&(t={}),Qv(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Yv,Ul):e=e.replace(Gv,Ul),e.replace(Kv,Xv))};ao.camelCase=Jv;var Zv=Ii&&Ii.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ex=Zv(cs),tx=ao;function Sa(e,t){var n={};return!e||typeof e!="string"||(0,ex.default)(e,function(r,i){r&&i&&(n[(0,tx.camelCase)(r,t)]=i)}),n}Sa.default=Sa;var nx=Sa;const rx=Su(nx),Ld=Od("end"),us=Od("start");function Od(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ix(e){const t=us(e),n=Ld(e);if(t&&n)return{start:t,end:n}}function Ur(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hl(e.position):"start"in e||"end"in e?Hl(e):"line"in e||"column"in e?Ea(e):""}function Ea(e){return zl(e&&e.line)+":"+zl(e&&e.column)}function Hl(e){return Ea(e&&e.start)+"-"+Ea(e&&e.end)}function zl(e){return e&&typeof e=="number"?e:1}class it extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Ur(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}it.prototype.file="";it.prototype.name="";it.prototype.reason="";it.prototype.message="";it.prototype.stack="";it.prototype.column=void 0;it.prototype.line=void 0;it.prototype.ancestors=void 0;it.prototype.cause=void 0;it.prototype.fatal=void 0;it.prototype.place=void 0;it.prototype.ruleId=void 0;it.prototype.source=void 0;const ds={}.hasOwnProperty,ox=new Map,ax=/[A-Z]/g,sx=new Set(["table","tbody","thead","tfoot","tr"]),lx=new Set(["td","th"]),Nd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cx(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=yx(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=gx(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ls:Rv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Dd(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Dd(e,t,n){if(t.type==="element")return ux(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return dx(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return hx(e,t,n);if(t.type==="mdxjsEsm")return fx(e,t);if(t.type==="root")return px(e,t,n);if(t.type==="text")return mx(e,t)}function ux(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ls,e.schema=i),e.ancestors.push(t);const o=Md(e,t.tagName,!1),a=bx(e,t);let s=hs(e,t);return sx.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!bv(l):!0})),_d(e,a,o,t),fs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function dx(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}qr(e,t.position)}function fx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qr(e,t.position)}function hx(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ls,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Md(e,t.name,!0),a=vx(e,t),s=hs(e,t);return _d(e,a,o,t),fs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function px(e,t,n){const r={};return fs(r,hs(e,t)),e.create(t,e.Fragment,r,n)}function mx(e,t){return t.value}function _d(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function gx(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function yx(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=us(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function bx(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ds.call(t.properties,i)){const o=xx(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&lx.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vx(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else qr(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else qr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function hs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ox;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=Dd(e,o,a);s!==void 0&&n.push(s)}return n}function xx(e,t,n){const r=Cv(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?hv(n):Pv(n)),r.property==="style"){let i=typeof n=="object"?n:wx(e,String(n));return e.stylePropertyNameCase==="css"&&(i=kx(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?kv[r.property]||r.property:r.attribute,n]}}function wx(e,t){try{return rx(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new it("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Nd+"#cannot-parse-style-attribute",i}}function Md(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Ol(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Ol(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ds.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);qr(e)}function qr(e,t){const n=new it("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Nd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function kx(e){const t={};let n;for(n in e)ds.call(e,n)&&(t[Sx(n)]=e[n]);return t}function Sx(e){let t=e.replace(ax,Ex);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ex(e){return"-"+e.toLowerCase()}const Oo={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Cx={};function ps(e,t){const n=Cx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return jd(e,r,i)}function jd(e,t,n){if(Ax(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $l(e.children,t,n)}return Array.isArray(e)?$l(e,t,n):""}function $l(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=jd(e[i],t,n);return r.join("")}function Ax(e){return!!(e&&typeof e=="object")}const Vl=document.createElement("i");function ms(e){const t="&"+e+";";Vl.innerHTML=t;const n=Vl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xt(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Ct(e,t){return e.length>0?(xt(e,e.length,0,t),e):t}const Wl={}.hasOwnProperty;function Fd(e){const t={};let n=-1;for(;++n<e.length;)Tx(t,e[n]);return t}function Tx(e,t){let n;for(n in t){const i=(Wl.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){Wl.call(i,a)||(i[a]=[]);const s=o[a];Rx(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Rx(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xt(e,0,0,r)}function Bd(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Nt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const st=wn(/[A-Za-z]/),nt=wn(/[\dA-Za-z]/),Px=wn(/[#-'*+\--9=?A-Z^-~]/);function Fi(e){return e!==null&&(e<32||e===127)}const Ca=wn(/\d/),Ix=wn(/[\dA-Fa-f]/),Lx=wn(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function ke(e){return e===-2||e===-1||e===32}const so=wn(/\p{P}|\p{S}/u),Hn=wn(/\s/);function wn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function vr(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&nt(e.charCodeAt(n+1))&&nt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return ke(l)?(e.enter(n),s(l)):t(l)}function s(l){return ke(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const Ox={tokenize:Nx};function Nx(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ce(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ie(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const Dx={tokenize:_x},Kl={tokenize:Mx};function _x(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const R=t.events.length;let I=R,C;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){C=t.events[I][1].end;break}v(r);let k=R;for(;k<t.events.length;)t.events[k][1].end={...C},k++;return xt(t.events,I+1,0,t.events.slice(R)),t.events.length=k,c(w)}return s(w)}function c(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Kl,u,d)(w)}function u(w){return i&&x(),v(r),h(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Kl,f,m)(w)}function f(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&x(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return ie(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),p)}function y(w,R){const I=t.sliceStream(w);if(R&&I.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(I),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const k=t.events.length;let D=k,j,T;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(j){T=t.events[D][1].end;break}j=!0}for(v(r),C=k;C<t.events.length;)t.events[C][1].end={...T},C++;xt(t.events,D+1,0,t.events.slice(k)),t.events.length=C}}function v(w){let R=n.length;for(;R-- >w;){const I=n[R];t.containerState=I[1],I[0].exit.call(t,e)}n.length=w}function x(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mx(e,t,n){return Ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fr(e){if(e===null||De(e)||Hn(e))return 1;if(so(e))return 2}function lo(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Aa={name:"attention",resolveAll:jx,tokenize:Fx};function jx(e,t){let n=-1,r,i,o,a,s,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};ql(d,-l),ql(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ct(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ct(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=Ct(c,lo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ct(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Ct(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,xt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Fx(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=fr(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),u=fr(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(u||!d)),t(l)}}function ql(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Bx={name:"autolink",tokenize:Ux};function Ux(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return st(f)?(e.consume(f),a):f===64?n(f):c(f)}function a(f){return f===43||f===45||f===46||nt(f)?(r=1,s(f)):c(f)}function s(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||nt(f))&&r++<32?(e.consume(f),s):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Fi(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):Px(f)?(e.consume(f),c):n(f)}function u(f){return nt(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||nt(f))&&r++<63){const m=f===45?h:d;return e.consume(f),m}return n(f)}}const ri={partial:!0,tokenize:Hx};function Hx(e,t,n){return r;function r(o){return ke(o)?Ce(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ie(o)?t(o):n(o)}}const Ud={continuation:{tokenize:$x},exit:Vx,name:"blockQuote",tokenize:zx};function zx(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return ke(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function $x(e,t,n){const r=this;return i;function i(a){return ke(a)?Ce(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Ud,t,n)(a)}}function Vx(e){e.exit("blockQuote")}const Hd={name:"characterEscape",tokenize:Wx};function Wx(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Lx(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const zd={name:"characterReference",tokenize:Kx};function Kx(e,t,n){const r=this;let i=0,o,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=nt,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Ix,u):(e.enter("characterReferenceValue"),o=7,a=Ca,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return a===nt&&!ms(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<o?(e.consume(d),u):n(d)}}const Gl={partial:!0,tokenize:Gx},Yl={concrete:!0,name:"codeFenced",tokenize:qx};function qx(e,t,n){const r=this,i={partial:!0,tokenize:I};let o=0,a=0,s;return l;function l(C){return c(C)}function c(C){const k=r.events[r.events.length-1];return o=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===s?(a++,e.consume(C),u):a<3?n(C):(e.exit("codeFencedFenceSequence"),ke(C)?Ce(e,d,"whitespace")(C):d(C))}function d(C){return C===null||ie(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Gl,p,R)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):ke(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ce(e,f,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),h)}function f(C){return C===null||ie(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===s?n(C):(e.consume(C),m)}function p(C){return e.attempt(i,R,y)(C)}function y(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),v}function v(C){return o>0&&ke(C)?Ce(e,x,"linePrefix",o+1)(C):x(C)}function x(C){return C===null||ie(C)?e.check(Gl,p,R)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ie(C)?(e.exit("codeFlowValue"),x(C)):(e.consume(C),w)}function R(C){return e.exit("codeFenced"),t(C)}function I(C,k,D){let j=0;return T;function T(V){return C.enter("lineEnding"),C.consume(V),C.exit("lineEnding"),_}function _(V){return C.enter("codeFencedFence"),ke(V)?Ce(C,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):L(V)}function L(V){return V===s?(C.enter("codeFencedFenceSequence"),K(V)):D(V)}function K(V){return V===s?(j++,C.consume(V),K):j>=a?(C.exit("codeFencedFenceSequence"),ke(V)?Ce(C,B,"whitespace")(V):B(V)):D(V)}function B(V){return V===null||ie(V)?(C.exit("codeFencedFence"),k(V)):D(V)}}}function Gx(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const No={name:"codeIndented",tokenize:Qx},Yx={partial:!0,tokenize:Xx};function Qx(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ce(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):ie(c)?e.attempt(Yx,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||ie(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function Xx(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Ce(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ie(a)?i(a):n(a)}}const Jx={name:"codeText",previous:ew,resolve:Zx,tokenize:tw};function Zx(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ew(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tw(e,t,n){let r=0,i,o;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):ie(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ie(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class nw{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&_r(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),_r(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_r(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);_r(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_r(this.left,n.reverse())}}}function _r(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $d(e){const t={};let n=-1,r,i,o,a,s,l,c;const u=new nw(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,rw(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=u.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return xt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function rw(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,h=-1,f=n,m=0,p=0;const y=[p];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(p=h+1,y.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),h=y.length;h--;){const v=s.slice(y[h],y[h+1]),x=o.pop();l.push([x,x+v.length-1]),e.splice(x,2,v)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const iw={resolve:aw,tokenize:sw},ow={partial:!0,tokenize:lw};function aw(e){return $d(e),e}function sw(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):ie(s)?e.check(ow,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function lw(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ce(e,o,"linePrefix")}function o(a){if(a===null||ie(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Vd(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),h):v===null||v===32||v===41||Fi(v)?n(v):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(s),h(v)):v===null||v===60||ie(v)?n(v):(e.consume(v),v===92?m:f)}function m(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function p(v){return!u&&(v===null||v===41||De(v))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,p):v===41?(e.consume(v),u--,p):v===null||v===32||v===40||Fi(v)?n(v):(e.consume(v),v===92?y:p)}function y(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function Wd(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return s>999||f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||ie(f)||s++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!ke(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}}function Kd(e,t,n,r,i,o){let a;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===a?(e.exit(o),l(a)):h===null?n(h):ie(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ce(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===a||h===null||ie(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===a||h===92?(e.consume(h),u):u(h)}}function Hr(e,t){let n;return r;function r(i){return ie(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ke(i)?Ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const cw={name:"definition",tokenize:dw},uw={partial:!0,tokenize:fw};function dw(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),a(f)}function a(f){return Wd.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=Nt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return De(f)?Hr(e,c)(f):c(f)}function c(f){return Vd(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(uw,d,d)(f)}function d(f){return ke(f)?Ce(e,h,"whitespace")(f):h(f)}function h(f){return f===null||ie(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function fw(e,t,n){return r;function r(s){return De(s)?Hr(e,i)(s):n(s)}function i(s){return Kd(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ke(s)?Ce(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ie(s)?t(s):n(s)}}const hw={name:"hardBreakEscape",tokenize:pw};function pw(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ie(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const mw={name:"headingAtx",resolve:gw,tokenize:yw};function gw(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},xt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function yw(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||De(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ie(u)?(e.exit("atxHeading"),t(u)):ke(u)?Ce(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||De(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const bw=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ql=["pre","script","style","textarea"],vw={concrete:!0,name:"htmlFlow",resolveTo:kw,tokenize:Sw},xw={partial:!0,tokenize:Cw},ww={partial:!0,tokenize:Ew};function kw(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Sw(e,t,n){const r=this;let i,o,a,s,l;return c;function c(E){return u(E)}function u(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),o=!0,p):E===63?(e.consume(E),i=3,r.interrupt?t:S):st(E)?(e.consume(E),a=String.fromCharCode(E),y):n(E)}function h(E){return E===45?(e.consume(E),i=2,f):E===91?(e.consume(E),i=5,s=0,m):st(E)?(e.consume(E),i=4,r.interrupt?t:S):n(E)}function f(E){return E===45?(e.consume(E),r.interrupt?t:S):n(E)}function m(E){const oe="CDATA[";return E===oe.charCodeAt(s++)?(e.consume(E),s===oe.length?r.interrupt?t:L:m):n(E)}function p(E){return st(E)?(e.consume(E),a=String.fromCharCode(E),y):n(E)}function y(E){if(E===null||E===47||E===62||De(E)){const oe=E===47,fe=a.toLowerCase();return!oe&&!o&&Ql.includes(fe)?(i=1,r.interrupt?t(E):L(E)):bw.includes(a.toLowerCase())?(i=6,oe?(e.consume(E),v):r.interrupt?t(E):L(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?x(E):w(E))}return E===45||nt(E)?(e.consume(E),a+=String.fromCharCode(E),y):n(E)}function v(E){return E===62?(e.consume(E),r.interrupt?t:L):n(E)}function x(E){return ke(E)?(e.consume(E),x):T(E)}function w(E){return E===47?(e.consume(E),T):E===58||E===95||st(E)?(e.consume(E),R):ke(E)?(e.consume(E),w):T(E)}function R(E){return E===45||E===46||E===58||E===95||nt(E)?(e.consume(E),R):I(E)}function I(E){return E===61?(e.consume(E),C):ke(E)?(e.consume(E),I):w(E)}function C(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,k):ke(E)?(e.consume(E),C):D(E)}function k(E){return E===l?(e.consume(E),l=null,j):E===null||ie(E)?n(E):(e.consume(E),k)}function D(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||De(E)?I(E):(e.consume(E),D)}function j(E){return E===47||E===62||ke(E)?w(E):n(E)}function T(E){return E===62?(e.consume(E),_):n(E)}function _(E){return E===null||ie(E)?L(E):ke(E)?(e.consume(E),_):n(E)}function L(E){return E===45&&i===2?(e.consume(E),q):E===60&&i===1?(e.consume(E),Q):E===62&&i===4?(e.consume(E),se):E===63&&i===3?(e.consume(E),S):E===93&&i===5?(e.consume(E),F):ie(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xw,te,K)(E)):E===null||ie(E)?(e.exit("htmlFlowData"),K(E)):(e.consume(E),L)}function K(E){return e.check(ww,B,te)(E)}function B(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),V}function V(E){return E===null||ie(E)?K(E):(e.enter("htmlFlowData"),L(E))}function q(E){return E===45?(e.consume(E),S):L(E)}function Q(E){return E===47?(e.consume(E),a="",$):L(E)}function $(E){if(E===62){const oe=a.toLowerCase();return Ql.includes(oe)?(e.consume(E),se):L(E)}return st(E)&&a.length<8?(e.consume(E),a+=String.fromCharCode(E),$):L(E)}function F(E){return E===93?(e.consume(E),S):L(E)}function S(E){return E===62?(e.consume(E),se):E===45&&i===2?(e.consume(E),S):L(E)}function se(E){return E===null||ie(E)?(e.exit("htmlFlowData"),te(E)):(e.consume(E),se)}function te(E){return e.exit("htmlFlow"),t(E)}}function Ew(e,t,n){const r=this;return i;function i(a){return ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Cw(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ri,t,n)}}const Aw={name:"htmlText",tokenize:Tw};function Tw(e,t,n){const r=this;let i,o,a;return s;function s(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),I):S===63?(e.consume(S),w):st(S)?(e.consume(S),D):n(S)}function c(S){return S===45?(e.consume(S),u):S===91?(e.consume(S),o=0,m):st(S)?(e.consume(S),x):n(S)}function u(S){return S===45?(e.consume(S),f):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),h):ie(S)?(a=d,Q(S)):(e.consume(S),d)}function h(S){return S===45?(e.consume(S),f):d(S)}function f(S){return S===62?q(S):S===45?h(S):d(S)}function m(S){const se="CDATA[";return S===se.charCodeAt(o++)?(e.consume(S),o===se.length?p:m):n(S)}function p(S){return S===null?n(S):S===93?(e.consume(S),y):ie(S)?(a=p,Q(S)):(e.consume(S),p)}function y(S){return S===93?(e.consume(S),v):p(S)}function v(S){return S===62?q(S):S===93?(e.consume(S),v):p(S)}function x(S){return S===null||S===62?q(S):ie(S)?(a=x,Q(S)):(e.consume(S),x)}function w(S){return S===null?n(S):S===63?(e.consume(S),R):ie(S)?(a=w,Q(S)):(e.consume(S),w)}function R(S){return S===62?q(S):w(S)}function I(S){return st(S)?(e.consume(S),C):n(S)}function C(S){return S===45||nt(S)?(e.consume(S),C):k(S)}function k(S){return ie(S)?(a=k,Q(S)):ke(S)?(e.consume(S),k):q(S)}function D(S){return S===45||nt(S)?(e.consume(S),D):S===47||S===62||De(S)?j(S):n(S)}function j(S){return S===47?(e.consume(S),q):S===58||S===95||st(S)?(e.consume(S),T):ie(S)?(a=j,Q(S)):ke(S)?(e.consume(S),j):q(S)}function T(S){return S===45||S===46||S===58||S===95||nt(S)?(e.consume(S),T):_(S)}function _(S){return S===61?(e.consume(S),L):ie(S)?(a=_,Q(S)):ke(S)?(e.consume(S),_):j(S)}function L(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,K):ie(S)?(a=L,Q(S)):ke(S)?(e.consume(S),L):(e.consume(S),B)}function K(S){return S===i?(e.consume(S),i=void 0,V):S===null?n(S):ie(S)?(a=K,Q(S)):(e.consume(S),K)}function B(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||De(S)?j(S):(e.consume(S),B)}function V(S){return S===47||S===62||De(S)?j(S):n(S)}function q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function Q(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),$}function $(S){return ke(S)?Ce(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):F(S)}function F(S){return e.enter("htmlTextData"),a(S)}}const gs={name:"labelEnd",resolveAll:Lw,resolveTo:Ow,tokenize:Nw},Rw={tokenize:Dw},Pw={tokenize:_w},Iw={tokenize:Mw};function Lw(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&xt(e,0,e.length,n),e}function Ow(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=Ct(s,e.slice(o+1,o+r+3)),s=Ct(s,[["enter",u,t]]),s=Ct(s,lo(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=Ct(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Ct(s,e.slice(a+1)),s=Ct(s,[["exit",l,t]]),xt(e,o,e.length,s),e}function Nw(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(h){return o?o._inactive?d(h):(a=r.parser.defined.includes(Nt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Rw,u,a?u:d)(h):h===91?e.attempt(Pw,u,a?c:d)(h):a?u(h):d(h)}function c(h){return e.attempt(Iw,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function Dw(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return De(d)?Hr(e,o)(d):o(d)}function o(d){return d===41?u(d):Vd(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return De(d)?Hr(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?Kd(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return De(d)?Hr(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function _w(e,t,n){const r=this;return i;function i(s){return Wd.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Nt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function Mw(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const jw={name:"labelStartImage",resolveAll:gs.resolveAll,tokenize:Fw};function Fw(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Bw={name:"labelStartLink",resolveAll:gs.resolveAll,tokenize:Uw};function Uw(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Do={name:"lineEnding",tokenize:Hw};function Hw(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ce(e,t,"linePrefix")}}const Ci={name:"thematicBreak",tokenize:zw};function zw(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ie(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ke(c)?Ce(e,s,"whitespace")(c):s(c))}}const ut={continuation:{tokenize:Kw},exit:Gw,name:"list",tokenize:Ww},$w={partial:!0,tokenize:Yw},Vw={partial:!0,tokenize:qw};function Ww(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ca(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Ci,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Ca(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(ri,r.interrupt?n:u,e.attempt($w,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return ke(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Kw(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ri,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ke(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Vw,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(e,e.attempt(ut,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function qw(e,t,n){const r=this;return Ce(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Gw(e){e.exit(this.containerState.type)}function Yw(e,t,n){const r=this;return Ce(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!ke(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Xl={name:"setextUnderline",resolveTo:Qw,tokenize:Xw};function Qw(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Xw(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),ke(c)?Ce(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ie(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Jw={tokenize:Zw};function Zw(e){const t=this,n=e.attempt(ri,r,e.attempt(this.parser.constructs.flowInitial,i,Ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iw,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const e0={resolveAll:Gd()},t0=qd("string"),n0=qd("text");function qd(e){return{resolveAll:Gd(e==="text"?r0:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Gd(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function r0(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const i0={42:ut,43:ut,45:ut,48:ut,49:ut,50:ut,51:ut,52:ut,53:ut,54:ut,55:ut,56:ut,57:ut,62:Ud},o0={91:cw},a0={[-2]:No,[-1]:No,32:No},s0={35:mw,42:Ci,45:[Xl,Ci],60:vw,61:Xl,95:Ci,96:Yl,126:Yl},l0={38:zd,92:Hd},c0={[-5]:Do,[-4]:Do,[-3]:Do,33:jw,38:zd,42:Aa,60:[Bx,Aw],91:Bw,92:[hw,Hd],93:gs,95:Aa,96:Jx},u0={null:[Aa,e0]},d0={null:[42,95]},f0={null:[]},h0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:d0,contentInitial:o0,disable:f0,document:i0,flow:s0,flowInitial:a0,insideSpan:u0,string:l0,text:c0},Symbol.toStringTag,{value:"Module"}));function p0(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:k(I),check:k(C),consume:x,enter:w,exit:R,interrupt:k(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(_){return a=Ct(a,_),y(),a[a.length-1]!==null?[]:(D(t,0),c.events=lo(o,c.events,c),c.events)}function h(_,L){return g0(f(_),L)}function f(_){return m0(a,_)}function m(){const{_bufferIndex:_,_index:L,line:K,column:B,offset:V}=r;return{_bufferIndex:_,_index:L,line:K,column:B,offset:V}}function p(_){i[_.line]=_.column,T()}function y(){let _;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<L.length;)v(L.charCodeAt(r._bufferIndex));else v(L)}}function v(_){u=u(_)}function x(_){ie(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,T()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=_}function w(_,L){const K=L||{};return K.type=_,K.start=m(),c.events.push(["enter",K,c]),s.push(K),K}function R(_){const L=s.pop();return L.end=m(),c.events.push(["exit",L,c]),L}function I(_,L){D(_,L.from)}function C(_,L){L.restore()}function k(_,L){return K;function K(B,V,q){let Q,$,F,S;return Array.isArray(B)?te(B):"tokenize"in B?te([B]):se(B);function se(ge){return W;function W(ye){const Le=ye!==null&&ge[ye],ve=ye!==null&&ge.null,we=[...Array.isArray(Le)?Le:Le?[Le]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return te(we)(ye)}}function te(ge){return Q=ge,$=0,ge.length===0?q:E(ge[$])}function E(ge){return W;function W(ye){return S=j(),F=ge,ge.partial||(c.currentConstruct=ge),ge.name&&c.parser.constructs.disable.null.includes(ge.name)?fe():ge.tokenize.call(L?Object.assign(Object.create(c),L):c,l,oe,fe)(ye)}}function oe(ge){return _(F,S),V}function fe(ge){return S.restore(),++$<Q.length?E(Q[$]):q}}}function D(_,L){_.resolveAll&&!o.includes(_)&&o.push(_),_.resolve&&xt(c.events,L,c.events.length-L,_.resolve(c.events.slice(L),c)),_.resolveTo&&(c.events=_.resolveTo(c.events,c))}function j(){const _=m(),L=c.previous,K=c.currentConstruct,B=c.events.length,V=Array.from(s);return{from:B,restore:q};function q(){r=_,c.previous=L,c.currentConstruct=K,c.events.length=B,s=V,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function m0(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function g0(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
128
+ */const Jg=ht("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function ml(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ei(...e){return t=>{let n=!1;const r=e.map(i=>{const o=ml(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():ml(e[i],null)}}}}function Ye(...e){return g.useCallback(ei(...e),e)}var Zg=Symbol.for("react.lazy"),Mi=eo[" use ".trim().toString()];function ey(e){return typeof e=="object"&&e!==null&&"then"in e}function Yu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Zg&&"_payload"in e&&ey(e._payload)}function Qu(e){const t=ny(e),n=g.forwardRef((r,i)=>{let{children:o,...a}=r;Yu(o)&&typeof Mi=="function"&&(o=Mi(o._payload));const s=g.Children.toArray(o),l=s.find(iy);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return v.jsx(t,{...a,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return v.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var ty=Qu("Slot");function ny(e){const t=g.forwardRef((n,r)=>{let{children:i,...o}=n;if(Yu(i)&&typeof Mi=="function"&&(i=Mi(i._payload)),g.isValidElement(i)){const a=ay(i),s=oy(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ei(r,a):a),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ry=Symbol("radix.slottable");function iy(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ry}function oy(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ay(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Xu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Xu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ju(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Xu(e))&&(r&&(r+=" "),r+=t);return r}const gl=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yl=Ju,rs=(e,t)=>n=>{var r;if(t?.variants==null)return yl(e,n?.class,n?.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(c=>{const u=n?.[c],d=o?.[c];if(u===null)return null;const h=gl(u)||gl(d);return i[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(m=>{let[p,y]=m;return Array.isArray(y)?y.includes({...o,...s}[p]):{...o,...s}[p]===y})?[...c,d,h]:c},[]);return yl(e,a,l,n?.class,n?.className)},is="-",sy=e=>{const t=cy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const s=a.split(is);return s[0]===""&&s.length!==1&&s.shift(),Zu(s,t)||ly(a)},getConflictingClassGroupIds:(a,s)=>{const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}}},Zu=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Zu(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(is);return t.validators.find(({validator:a})=>a(o))?.classGroupId},vl=/^\[(.+)\]$/,ly=e=>{if(vl.test(e)){const t=vl.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},cy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return dy(Object.entries(e.classGroups),n).forEach(([o,a])=>{ha(a,r,o,t)}),r},ha=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:bl(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(uy(i)){ha(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{ha(a,bl(t,o),n,r)})})},bl=(e,t)=>{let n=e;return t.split(is).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},uy=e=>e.isThemeGetter,dy=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e,fy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,a)=>{n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}},ed="!",hy=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let c=0,u=0,d;for(let y=0;y<s.length;y++){let b=s[y];if(c===0){if(b===i&&(r||s.slice(y,y+o)===t)){l.push(s.slice(u,y)),u=y+o;continue}if(b==="/"){d=y;continue}}b==="["?c++:b==="]"&&c--}const h=l.length===0?s:s.substring(u),f=h.startsWith(ed),m=f?h.substring(1):h,p=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:p}};return n?s=>n({className:s,parseClassName:a}):a},py=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},my=e=>({cache:fy(e.cacheSize),parseClassName:hy(e),...sy(e)}),gy=/\s+/,yy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(gy);let s="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=n(c);let m=!!f,p=r(m?h.substring(0,f):h);if(!p){if(!m){s=c+(s.length>0?" "+s:s);continue}if(p=r(h),!p){s=c+(s.length>0?" "+s:s);continue}m=!1}const y=py(u).join(":"),b=d?y+ed:y,x=b+p;if(o.includes(x))continue;o.push(x);const w=i(p,m);for(let R=0;R<w.length;++R){const I=w[R];o.push(b+I)}s=c+(s.length>0?" "+s:s)}return s};function vy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=td(t))&&(r&&(r+=" "),r+=n);return r}const td=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=td(e[r]))&&(n&&(n+=" "),n+=t);return n};function by(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((u,d)=>d(u),e());return n=my(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const u=yy(l,n);return i(l,u),u}return function(){return o(vy.apply(null,arguments))}}const Fe=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},nd=/^\[(?:([a-z-]+):)?(.+)\]$/i,xy=/^\d+\/\d+$/,wy=new Set(["px","full","screen"]),Sy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ky=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ey=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Cy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ay=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zt=e=>sr(e)||wy.has(e)||xy.test(e),un=e=>yr(e,"length",Ny),sr=e=>!!e&&!Number.isNaN(Number(e)),Io=e=>yr(e,"number",sr),Lr=e=>!!e&&Number.isInteger(Number(e)),Ty=e=>e.endsWith("%")&&sr(e.slice(0,-1)),pe=e=>nd.test(e),dn=e=>Sy.test(e),Ry=new Set(["length","size","percentage"]),Py=e=>yr(e,Ry,rd),Iy=e=>yr(e,"position",rd),Ly=new Set(["image","url"]),Oy=e=>yr(e,Ly,My),_y=e=>yr(e,"",Dy),Or=()=>!0,yr=(e,t,n)=>{const r=nd.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Ny=e=>ky.test(e)&&!Ey.test(e),rd=()=>!1,Dy=e=>Cy.test(e),My=e=>Ay.test(e),jy=()=>{const e=Fe("colors"),t=Fe("spacing"),n=Fe("blur"),r=Fe("brightness"),i=Fe("borderColor"),o=Fe("borderRadius"),a=Fe("borderSpacing"),s=Fe("borderWidth"),l=Fe("contrast"),c=Fe("grayscale"),u=Fe("hueRotate"),d=Fe("invert"),h=Fe("gap"),f=Fe("gradientColorStops"),m=Fe("gradientColorStopPositions"),p=Fe("inset"),y=Fe("margin"),b=Fe("opacity"),x=Fe("padding"),w=Fe("saturate"),R=Fe("scale"),I=Fe("sepia"),C=Fe("skew"),S=Fe("space"),N=Fe("translate"),j=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",pe,t],L=()=>[pe,t],K=()=>["",Zt,un],B=()=>["auto",sr,pe],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",pe],k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>[sr,pe];return{cacheSize:500,separator:":",theme:{colors:[Or],spacing:[Zt,un],blur:["none","",dn,pe],brightness:se(),borderColor:[e],borderRadius:["none","","full",dn,pe],borderSpacing:L(),borderWidth:K(),contrast:se(),grayscale:F(),hueRotate:se(),invert:F(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Ty,un],inset:D(),margin:D(),opacity:se(),padding:L(),saturate:se(),scale:se(),sepia:F(),skew:se(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[dn]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),pe]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Lr,pe]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pe]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Lr,pe]}],"grid-cols":[{"grid-cols":[Or]}],"col-start-end":[{col:["auto",{span:["full",Lr,pe]},pe]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Or]}],"row-start-end":[{row:["auto",{span:[Lr,pe]},pe]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pe,t]}],"min-w":[{"min-w":[pe,t,"min","max","fit"]}],"max-w":[{"max-w":[pe,t,"none","full","min","max","fit","prose",{screen:[dn]},dn]}],h:[{h:[pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",dn,un]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Io]}],"font-family":[{font:[Or]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",pe]}],"line-clamp":[{"line-clamp":["none",sr,Io]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zt,pe]}],"list-image":[{"list-image":["none",pe]}],"list-style-type":[{list:["none","disc","decimal",pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zt,un]}],"underline-offset":[{"underline-offset":["auto",Zt,pe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),Iy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Py]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Oy]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...q(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:q()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...q()]}],"outline-offset":[{"outline-offset":[Zt,pe]}],"outline-w":[{outline:[Zt,un]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Zt,un]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",dn,_y]}],"shadow-color":[{shadow:[Or]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",dn,pe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[I]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pe]}],duration:[{duration:se()}],ease:[{ease:["linear","in","out","in-out",pe]}],delay:[{delay:se()}],animate:[{animate:["none","spin","ping","pulse","bounce",pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[Lr,pe]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zt,un,Io]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Fy=by(jy);function Ie(...e){return Fy(Ju(e))}const By=rs(["inline-flex items-center justify-center gap-2","whitespace-nowrap rounded-md text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg","disabled:pointer-events-none disabled:opacity-55","[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"].join(" "),{variants:{variant:{default:"bg-accent text-accent-fg hover:bg-accent-hover",secondary:"bg-surface-2 text-text hover:bg-surface-hover border border-border",outline:"bg-surface text-text border border-border hover:bg-surface-hover hover:border-border-strong",ghost:"bg-transparent text-text-dim hover:bg-surface-hover hover:text-text",destructive:"bg-surface text-danger border border-danger hover:bg-danger hover:text-white",link:"bg-transparent text-accent underline-offset-4 hover:underline px-0 h-auto"},size:{default:"h-8 px-3 py-1 text-sm",sm:"h-7 px-2.5 py-1 text-xs",lg:"h-9 px-5",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),bt=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const a=r?ty:"button";return v.jsx(a,{className:Ie(By({variant:t,size:n,className:e})),ref:o,...i})});bt.displayName="Button";class Hy extends g.Component{state={error:null,info:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.setState({info:n})}handleReset=()=>{this.setState({error:null,info:null})};render(){return this.state.error?v.jsx(Uy,{error:this.state.error,info:this.state.info,onReset:this.handleReset}):this.props.children}}function Uy({error:e,info:t,onReset:n}){const{t:r}=St("common"),i=typeof import.meta<"u"&&!1;return v.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8",children:v.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-xl",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-danger-bg text-danger",children:v.jsx(Jg,{className:"h-6 w-6"})}),v.jsx("h1",{className:"text-xl font-semibold",children:r("errorBoundary.title",{defaultValue:"Something went wrong."})}),v.jsx("p",{className:"text-sm text-text-dim",children:r("errorBoundary.description",{defaultValue:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it."})}),v.jsxs("pre",{className:"w-full max-w-lg overflow-auto rounded-md bg-surface-2 px-3 py-2 text-left text-xs leading-5 text-text-dim",children:[e.name,": ",e.message]}),i&&t?.componentStack&&v.jsxs("details",{className:"w-full max-w-lg text-left text-xs",children:[v.jsx("summary",{className:"cursor-pointer text-text-dim",children:"component stack (dev)"}),v.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-text-muted",children:t.componentStack})]}),v.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-center gap-2",children:[v.jsxs(bt,{type:"button",variant:"default",onClick:()=>{n(),typeof window<"u"&&window.location.reload()},children:[v.jsx(Gg,{className:"h-4 w-4"}),r("errorBoundary.reload",{defaultValue:"Reload"})]}),v.jsx(bt,{type:"button",variant:"secondary",asChild:!0,children:v.jsxs(ts,{to:"/",onClick:n,children:[v.jsx(Vg,{className:"h-4 w-4"}),r("errorBoundary.home",{defaultValue:"Home"})]})})]})]})})}var ti=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},zy=class extends ti{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},id=new zy,$y={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Vy=class{#e=$y;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},pa=new Vy;function Wy(e){setTimeout(e,0)}var Ky=typeof window>"u"||"Deno"in globalThis;function Et(){}function qy(e,t){return typeof e=="function"?e(t):e}function Gy(e){return typeof e=="number"&&e>=0&&e!==1/0}function Yy(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ma(e,t){return typeof e=="function"?e(t):e}function Qy(e,t){return typeof e=="function"?e(t):e}function xl(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==os(a,t.options))return!1}else if(!Kr(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function wl(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Hn(t.options.mutationKey)!==Hn(o))return!1}else if(!Kr(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function os(e,t){return(t?.queryKeyHashFn||Hn)(e)}function Hn(e){return JSON.stringify(e,(t,n)=>ga(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Kr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Kr(e[n],t[n])):!1}var Xy=Object.prototype.hasOwnProperty;function od(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Sl(e)&&Sl(t);if(!r&&!(ga(e)&&ga(t)))return t;const o=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),s=a.length,l=r?new Array(s):{};let c=0;for(let u=0;u<s;u++){const d=r?u:a[u],h=e[d],f=t[d];if(h===f){l[d]=h,(r?u<o:Xy.call(e,d))&&c++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){l[d]=f;continue}const m=od(h,f,n+1);l[d]=m,m===h&&c++}return o===s&&c===o?e:l}function Jy(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Sl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ga(e){if(!kl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!kl(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function kl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zy(e){return new Promise(t=>{pa.setTimeout(t,e)})}function ev(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?od(e,t):t}function tv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nv(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var as=Symbol();function ad(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===as?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rv(e,t){return typeof e=="function"?e(...t):!!e}function iv(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var sd=(()=>{let e=()=>Ky;return{isServer(){return e()},setIsServer(t){e=t}}})();function ov(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var av=Wy;function sv(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=av;const o=s=>{t?e.push(s):i(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var et=sv(),lv=class extends ti{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ji=new lv;function cv(e){return Math.min(1e3*2**e,3e4)}function ld(e){return(e??"online")==="online"?ji.isOnline():!0}var ya=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function cd(e){let t=!1,n=0,r;const i=ov(),o=()=>i.status!=="pending",a=p=>{if(!o()){const y=new ya(p);h(y),e.onCancel?.(y)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>id.isFocused()&&(e.networkMode==="always"||ji.isOnline())&&e.canRun(),u=()=>ld(e.networkMode)&&e.canRun(),d=p=>{o()||(r?.(),i.resolve(p))},h=p=>{o()||(r?.(),i.reject(p))},f=()=>new Promise(p=>{r=y=>{(o()||c())&&p(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let p;const y=n===0?e.initialPromise:void 0;try{p=y??e.fn()}catch(b){p=Promise.reject(b)}Promise.resolve(p).then(d).catch(b=>{if(o())return;const x=e.retry??(sd.isServer()?0:3),w=e.retryDelay??cv,R=typeof w=="function"?w(n,b):w,I=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!I){h(b);return}n++,e.onFail?.(n,b),Zy(R).then(()=>c()?void 0:f()).then(()=>{t?h(b):m()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?m():f().then(m),i)}}var ud=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gy(this.gcTime)&&(this.#e=pa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sd.isServer()?1/0:5*60*1e3))}clearGcTimeout(){this.#e!==void 0&&(pa.clearTimeout(this.#e),this.#e=void 0)}};function uv(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=m=>{iv(m,()=>t.signal,()=>u=!0)},h=ad(t.options,t.fetchOptions),f=async(m,p,y)=>{if(u)return Promise.reject(t.signal.reason);if(p==null&&m.pages.length)return Promise.resolve(m);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:p,direction:y?"backward":"forward",meta:t.options.meta};return d(C),C})(),w=await h(x),{maxPages:R}=t.options,I=y?nv:tv;return{pages:I(m.pages,w,R),pageParams:I(m.pageParams,p,R)}};if(i&&o.length){const m=i==="backward",p=m?dv:El,y={pages:o,pageParams:a},b=p(r,y);s=await f(y,b,m)}else{const m=e??o.length;do{const p=l===0?a[0]??r.initialPageParam:El(r,s);if(l>0&&p==null)break;s=await f(s,p),l++}while(l<m)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function El(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function dv(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var fv=class extends ud{#e;#t;#n;#r;#o;#i;#l;#a;constructor(e){super(),this.#a=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#r=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Al(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Al(this.options);t.data!==void 0&&(this.setState(Cl(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=ev(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#s({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Qy(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===as||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ma(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Yy(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#a||this.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const l=ad(this.options,t),u=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#a=!1,this.options.persister?this.options.persister(l,u,this):l(u)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:i};return r(l),l})();(this.#e==="infinite"?uv(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:"fetch",meta:a.fetchOptions?.meta}),this.#i=cd({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof ya&&l.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(l,c)=>{this.#s({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#i.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#r.config.onSuccess?.(l,this),this.#r.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof ya){if(l.silent)return this.#i.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#s({type:"error",error:l}),this.#r.config.onError?.(l,this),this.#r.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...hv(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Cl(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),et.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function hv(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ld(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Cl(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Al(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var pv=class extends ud{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||dd(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#o({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=cd({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#o({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#o({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#o({type:"success",data:o}),o}catch(o){try{await this.#n.config.onError?.(o,e,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(a){Promise.reject(a)}try{await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(a){Promise.reject(a)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(a){Promise.reject(a)}throw this.#o({type:"error",error:o}),o}finally{this.#n.runNext(this)}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),et.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function dd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mv=class extends ti{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new pv({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=ui(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ui(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ui(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=ui(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){et.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>wl(t,n))}findAll(e={}){return this.getAll().filter(t=>wl(e,t))}notify(e){et.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return et.batch(()=>Promise.all(e.map(t=>t.continue().catch(Et))))}};function ui(e){return e.options.scope?.id}var gv=class extends ti{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Jy(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Hn(n.mutationKey)!==Hn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??dd();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){et.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(t.data,null,n,r,i)}catch(o){Promise.reject(o)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,i)}catch(o){Promise.reject(o)}try{this.#r.onSettled?.(void 0,t.error,n,r,i)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},yv=class extends ti{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??os(r,t);let o=this.get(i);return o||(o=new fv({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){et.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>xl(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>xl(e,n)):t}notify(e){et.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){et.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){et.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},vv=class{#e;#t;#n;#r;#o;#i;#l;#a;constructor(e={}){this.#e=e.queryCache||new yv,this.#t=e.mutationCache||new mv,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#l=id.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=ji.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#l?.(),this.#l=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ma(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=qy(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return et.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;et.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return et.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=et.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Et).catch(Et)}invalidateQueries(e,t={}){return et.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=et.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Et)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Et)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(ma(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Et).catch(Et)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Et).catch(Et)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ji.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Hn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Kr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(Hn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Kr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=os(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===as&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},fd=g.createContext(void 0),bv=e=>{const t=g.useContext(fd);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},xv=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(fd.Provider,{value:e,children:t}));function wv(e,t){const n=bv(),[r]=g.useState(()=>new gv(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(a=>r.subscribe(et.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=g.useCallback((a,s)=>{r.mutate(a,s).catch(Et)},[r]);if(i.error&&rv(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var Sv=e=>{switch(e){case"success":return Cv;case"info":return Tv;case"warning":return Av;case"error":return Rv;default:return null}},kv=Array(12).fill(0),Ev=({visible:e,className:t})=>z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},z.createElement("div",{className:"sonner-spinner"},kv.map((n,r)=>z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Cv=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Av=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Tv=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Rv=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Pv=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Iv=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},va=1,Lv=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:va++,o=this.toasts.find(s=>s.id===i),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:n}),{...s,...e,id:i,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,a=r.then(async l=>{if(o=["resolve",l],z.isValidElement(l))i=!1,this.create({id:n,type:"default",message:l});else if(_v(l)&&!l.ok){i=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){i=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){i=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;i&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),s=()=>new Promise((l,c)=>a.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||va++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ft=new Lv,Ov=(e,t)=>{let n=t?.id||va++;return ft.addToast({title:e,...t,id:n}),n},_v=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Nv=Ov,Dv=()=>ft.toasts,Mv=()=>ft.getActiveToasts(),Ot=Object.assign(Nv,{success:ft.success,info:ft.info,warning:ft.warning,error:ft.error,custom:ft.custom,message:ft.message,promise:ft.promise,dismiss:ft.dismiss,loading:ft.loading},{getHistory:Dv,getToasts:Mv});function jv(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}jv(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
129
+ `);function di(e){return e.label!==void 0}var Fv=3,Bv="32px",Hv="16px",Tl=4e3,Uv=356,zv=14,$v=20,Vv=200;function Pt(...e){return e.filter(Boolean).join(" ")}function Wv(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Kv=e=>{var t,n,r,i,o,a,s,l,c,u,d;let{invert:h,toast:f,unstyled:m,interacting:p,setHeights:y,visibleToasts:b,heights:x,index:w,toasts:R,expanded:I,removeToast:C,defaultRichColors:S,closeButton:N,style:j,cancelButtonStyle:T,actionButtonStyle:D,className:L="",descriptionClassName:K="",duration:B,position:V,gap:q,loadingIcon:Q,expandByDefault:$,classNames:F,icons:k,closeButtonAriaLabel:se="Close toast",pauseWhenPageIsHidden:te}=e,[E,oe]=z.useState(null),[fe,ge]=z.useState(null),[W,ye]=z.useState(!1),[Le,be]=z.useState(!1),[we,de]=z.useState(!1),[Be,lt]=z.useState(!1),[Mt,Je]=z.useState(!1),[jt,En]=z.useState(0),[Cn,An]=z.useState(0),Qt=z.useRef(f.duration||B||Tl),Gn=z.useRef(null),At=z.useRef(null),Tt=w===0,Xt=w+1<=b,_=f.type,U=f.dismissible!==!1,ne=f.className||"",ae=f.descriptionClassName||"",ke=z.useMemo(()=>x.findIndex(ce=>ce.toastId===f.id)||0,[x,f.id]),Qe=z.useMemo(()=>{var ce;return(ce=f.closeButton)!=null?ce:N},[f.closeButton,N]),kt=z.useMemo(()=>f.duration||B||Tl,[f.duration,B]),ze=z.useRef(0),ot=z.useRef(0),Rt=z.useRef(0),Ue=z.useRef(null),[Ft,ct]=V.split("-"),Tn=z.useMemo(()=>x.reduce((ce,Te,Oe)=>Oe>=ke?ce:ce+Te.height,0),[x,ke]),kr=Iv(),Er=f.invert||h,Rn=_==="loading";ot.current=z.useMemo(()=>ke*q+Tn,[ke,Tn]),z.useEffect(()=>{Qt.current=kt},[kt]),z.useEffect(()=>{ye(!0)},[]),z.useEffect(()=>{let ce=At.current;if(ce){let Te=ce.getBoundingClientRect().height;return An(Te),y(Oe=>[{toastId:f.id,height:Te,position:f.position},...Oe]),()=>y(Oe=>Oe.filter(tt=>tt.toastId!==f.id))}},[y,f.id]),z.useLayoutEffect(()=>{if(!W)return;let ce=At.current,Te=ce.style.height;ce.style.height="auto";let Oe=ce.getBoundingClientRect().height;ce.style.height=Te,An(Oe),y(tt=>tt.find(mt=>mt.toastId===f.id)?tt.map(mt=>mt.toastId===f.id?{...mt,height:Oe}:mt):[{toastId:f.id,height:Oe,position:f.position},...tt])},[W,f.title,f.description,y,f.id]);let Bt=z.useCallback(()=>{be(!0),En(ot.current),y(ce=>ce.filter(Te=>Te.toastId!==f.id)),setTimeout(()=>{C(f)},Vv)},[f,C,y,ot]);z.useEffect(()=>{if(f.promise&&_==="loading"||f.duration===1/0||f.type==="loading")return;let ce;return I||p||te&&kr?(()=>{if(Rt.current<ze.current){let Te=new Date().getTime()-ze.current;Qt.current=Qt.current-Te}Rt.current=new Date().getTime()})():Qt.current!==1/0&&(ze.current=new Date().getTime(),ce=setTimeout(()=>{var Te;(Te=f.onAutoClose)==null||Te.call(f,f),Bt()},Qt.current)),()=>clearTimeout(ce)},[I,p,f,_,te,kr,Bt]),z.useEffect(()=>{f.delete&&Bt()},[Bt,f.delete]);function ai(){var ce,Te,Oe;return k!=null&&k.loading?z.createElement("div",{className:Pt(F?.loader,(ce=f?.classNames)==null?void 0:ce.loader,"sonner-loader"),"data-visible":_==="loading"},k.loading):Q?z.createElement("div",{className:Pt(F?.loader,(Te=f?.classNames)==null?void 0:Te.loader,"sonner-loader"),"data-visible":_==="loading"},Q):z.createElement(Ev,{className:Pt(F?.loader,(Oe=f?.classNames)==null?void 0:Oe.loader),visible:_==="loading"})}return z.createElement("li",{tabIndex:0,ref:At,className:Pt(L,ne,F?.toast,(t=f?.classNames)==null?void 0:t.toast,F?.default,F?.[_],(n=f?.classNames)==null?void 0:n[_]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:S,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":W,"data-promise":!!f.promise,"data-swiped":Mt,"data-removed":Le,"data-visible":Xt,"data-y-position":Ft,"data-x-position":ct,"data-index":w,"data-front":Tt,"data-swiping":we,"data-dismissible":U,"data-type":_,"data-invert":Er,"data-swipe-out":Be,"data-swipe-direction":fe,"data-expanded":!!(I||$&&W),style:{"--index":w,"--toasts-before":w,"--z-index":R.length-w,"--offset":`${Le?jt:ot.current}px`,"--initial-height":$?"auto":`${Cn}px`,...j,...f.style},onDragEnd:()=>{de(!1),oe(null),Ue.current=null},onPointerDown:ce=>{Rn||!U||(Gn.current=new Date,En(ot.current),ce.target.setPointerCapture(ce.pointerId),ce.target.tagName!=="BUTTON"&&(de(!0),Ue.current={x:ce.clientX,y:ce.clientY}))},onPointerUp:()=>{var ce,Te,Oe,tt;if(Be||!U)return;Ue.current=null;let mt=Number(((ce=At.current)==null?void 0:ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ht=Number(((Te=At.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),A=new Date().getTime()-((Oe=Gn.current)==null?void 0:Oe.getTime()),P=E==="x"?mt:Ht,O=Math.abs(P)/A;if(Math.abs(P)>=$v||O>.11){En(ot.current),(tt=f.onDismiss)==null||tt.call(f,f),ge(E==="x"?mt>0?"right":"left":Ht>0?"down":"up"),Bt(),lt(!0),Je(!1);return}de(!1),oe(null)},onPointerMove:ce=>{var Te,Oe,tt,mt;if(!Ue.current||!U||((Te=window.getSelection())==null?void 0:Te.toString().length)>0)return;let Ht=ce.clientY-Ue.current.y,A=ce.clientX-Ue.current.x,P=(Oe=e.swipeDirections)!=null?Oe:Wv(V);!E&&(Math.abs(A)>1||Math.abs(Ht)>1)&&oe(Math.abs(A)>Math.abs(Ht)?"x":"y");let O={x:0,y:0};E==="y"?(P.includes("top")||P.includes("bottom"))&&(P.includes("top")&&Ht<0||P.includes("bottom")&&Ht>0)&&(O.y=Ht):E==="x"&&(P.includes("left")||P.includes("right"))&&(P.includes("left")&&A<0||P.includes("right")&&A>0)&&(O.x=A),(Math.abs(O.x)>0||Math.abs(O.y)>0)&&Je(!0),(tt=At.current)==null||tt.style.setProperty("--swipe-amount-x",`${O.x}px`),(mt=At.current)==null||mt.style.setProperty("--swipe-amount-y",`${O.y}px`)}},Qe&&!f.jsx?z.createElement("button",{"aria-label":se,"data-disabled":Rn,"data-close-button":!0,onClick:Rn||!U?()=>{}:()=>{var ce;Bt(),(ce=f.onDismiss)==null||ce.call(f,f)},className:Pt(F?.closeButton,(i=f?.classNames)==null?void 0:i.closeButton)},(o=k?.close)!=null?o:Pv):null,f.jsx||g.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:z.createElement(z.Fragment,null,_||f.icon||f.promise?z.createElement("div",{"data-icon":"",className:Pt(F?.icon,(a=f?.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ai():null,f.type!=="loading"?f.icon||k?.[_]||Sv(_):null):null,z.createElement("div",{"data-content":"",className:Pt(F?.content,(s=f?.classNames)==null?void 0:s.content)},z.createElement("div",{"data-title":"",className:Pt(F?.title,(l=f?.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?z.createElement("div",{"data-description":"",className:Pt(K,ae,F?.description,(c=f?.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),g.isValidElement(f.cancel)?f.cancel:f.cancel&&di(f.cancel)?z.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||T,onClick:ce=>{var Te,Oe;di(f.cancel)&&U&&((Oe=(Te=f.cancel).onClick)==null||Oe.call(Te,ce),Bt())},className:Pt(F?.cancelButton,(u=f?.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,g.isValidElement(f.action)?f.action:f.action&&di(f.action)?z.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||D,onClick:ce=>{var Te,Oe;di(f.action)&&((Oe=(Te=f.action).onClick)==null||Oe.call(Te,ce),!ce.defaultPrevented&&Bt())},className:Pt(F?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function Rl(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function qv(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,a=o?"--mobile-offset":"--offset",s=o?Hv:Bv;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${a}-${c}`]=s:n[`${a}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}var Gv=g.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:a,className:s,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:h,style:f,visibleToasts:m=Fv,toastOptions:p,dir:y=Rl(),gap:b=zv,loadingIcon:x,icons:w,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:I}=e,[C,S]=z.useState([]),N=z.useMemo(()=>Array.from(new Set([r].concat(C.filter(te=>te.position).map(te=>te.position)))),[C,r]),[j,T]=z.useState([]),[D,L]=z.useState(!1),[K,B]=z.useState(!1),[V,q]=z.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=z.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=z.useRef(null),k=z.useRef(!1),se=z.useCallback(te=>{S(E=>{var oe;return(oe=E.find(fe=>fe.id===te.id))!=null&&oe.delete||ft.dismiss(te.id),E.filter(({id:fe})=>fe!==te.id)})},[]);return z.useEffect(()=>ft.subscribe(te=>{if(te.dismiss){S(E=>E.map(oe=>oe.id===te.id?{...oe,delete:!0}:oe));return}setTimeout(()=>{Su.flushSync(()=>{S(E=>{let oe=E.findIndex(fe=>fe.id===te.id);return oe!==-1?[...E.slice(0,oe),{...E[oe],...te},...E.slice(oe+1)]:[te,...E]})})})}),[]),z.useEffect(()=>{if(u!=="system"){q(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let te=window.matchMedia("(prefers-color-scheme: dark)");try{te.addEventListener("change",({matches:E})=>{q(E?"dark":"light")})}catch{te.addListener(({matches:oe})=>{try{q(oe?"dark":"light")}catch(fe){console.error(fe)}})}},[u]),z.useEffect(()=>{C.length<=1&&L(!1)},[C]),z.useEffect(()=>{let te=E=>{var oe,fe;i.every(ge=>E[ge]||E.code===ge)&&(L(!0),(oe=Q.current)==null||oe.focus()),E.code==="Escape"&&(document.activeElement===Q.current||(fe=Q.current)!=null&&fe.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[i]),z.useEffect(()=>{if(Q.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,k.current=!1)}},[Q.current]),z.createElement("section",{ref:t,"aria-label":`${R} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},N.map((te,E)=>{var oe;let[fe,ge]=te.split("-");return C.length?z.createElement("ol",{key:te,dir:y==="auto"?Rl():y,tabIndex:-1,ref:Q,className:s,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":fe,"data-lifted":D&&C.length>1&&!o,"data-x-position":ge,style:{"--front-toast-height":`${((oe=j[0])==null?void 0:oe.height)||0}px`,"--width":`${Uv}px`,"--gap":`${b}px`,...f,...qv(l,c)},onBlur:W=>{k.current&&!W.currentTarget.contains(W.relatedTarget)&&(k.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||k.current||(k.current=!0,F.current=W.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{K||L(!1)},onDragEnd:()=>L(!1),onPointerDown:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},C.filter(W=>!W.position&&E===0||W.position===te).map((W,ye)=>{var Le,be;return z.createElement(Kv,{key:W.id,icons:w,index:ye,toast:W,defaultRichColors:d,duration:(Le=p?.duration)!=null?Le:h,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:n,visibleToasts:m,closeButton:(be=p?.closeButton)!=null?be:a,interacting:K,position:te,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:se,toasts:C.filter(we=>we.position==W.position),heights:j.filter(we=>we.position==W.position),setHeights:T,expandByDefault:o,gap:b,loadingIcon:x,expanded:D,pauseWhenPageIsHidden:I,swipeDirections:e.swipeDirections})})):null}))});const hd="agim_token";function Yv(e){if(!e)return"";const t=[];for(const[n,r]of Object.entries(e))if(!(r==null||r==="")){if(typeof r=="boolean"){t.push(`${encodeURIComponent(n)}=${r?"1":"0"}`);continue}t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}return t.length?`?${t.join("&")}`:""}function Qv(){try{return localStorage.getItem(hd)}catch{return null}}async function _r(e,t,n={}){const r=t+Yv(n.query),i={...n.headers??{}},o=Qv();o&&!i.Authorization&&(i.Authorization=`Bearer ${o}`);let a;n.body!==void 0&&n.body!==null&&(n.body instanceof FormData||typeof n.body=="string"?a=n.body:(i["Content-Type"]=i["Content-Type"]??"application/json",a=JSON.stringify(n.body)));let s;try{s=await fetch(r,{method:e,headers:i,body:a,credentials:"same-origin",signal:n.signal})}catch(u){const d=u instanceof Error?u.message:String(u);throw new ba({code:"NETWORK",message:d,status:0})}if(s.status===204)return;const c=(s.headers.get("content-type")||"").includes("application/json");if(!s.ok){let u=`HTTP_${s.status}`,d=s.statusText,h=!1;if(c)try{const f=await s.json();f.error&&(d=f.error),f.code&&(u=f.code,h=!0)}catch{}if(h||(s.status===401&&(u="AUTH_INVALID"),s.status===403&&(u="FORBIDDEN"),s.status===404&&(u="NOT_FOUND"),s.status===413&&(u="PAYLOAD_TOO_LARGE")),s.status===401&&!t.startsWith("/api/auth/")){try{localStorage.removeItem(hd)}catch{}const f=encodeURIComponent(location.pathname+location.search);location.pathname.startsWith("/login")||(location.href=`/login?next=${f}`)}throw new ba({code:u,message:d,status:s.status})}return c?await s.json():await s.text()}class ba extends Error{code;status;constructor(t){super(t.message),this.name="ApiClientError",this.code=t.code,this.status=t.status}}const Y={get:(e,t)=>_r("GET",e,t),post:(e,t)=>_r("POST",e,t),put:(e,t)=>_r("PUT",e,t),patch:(e,t)=>_r("PATCH",e,t),delete:(e,t)=>_r("DELETE",e,t)},Xv={getA2ARecent:e=>Y.get("/api/a2a/recent",{query:e}),getA2AStats:()=>Y.get("/api/a2a/stats"),removeAdminAllowlist:e=>Y.delete("/api/admin-allowlist",{body:e}),listAdminAllowlist:()=>Y.get("/api/admin-allowlist"),addAdminAllowlist:e=>Y.post("/api/admin-allowlist",{body:e}),getAgentHealth:e=>Y.get("/api/agent-health",e),discoverAcpAgents:e=>Y.post("/api/agents/acp/discover",{body:e}),testAcpAgent:e=>Y.post("/api/agents/acp/test",{body:e}),testEmail:()=>Y.post("/api/messengers/email/test"),getSearchProviders:()=>Y.get("/api/search/providers"),testSearchProvider:e=>Y.post("/api/search/test",{body:e}),getAgentsStatus:()=>Y.get("/api/agents/status"),listApprovals:()=>Y.get("/api/approvals"),resolveApproval:(e,t)=>Y.post(`/api/approvals/${encodeURIComponent(e)}/resolve`,{body:t}),getAudit:e=>Y.get("/api/audit",{query:e}),login:e=>Y.post("/api/auth/login",{body:e}),logout:e=>Y.post("/api/auth/logout",e),listBgJobs:e=>Y.get("/api/bgjobs",{query:e}),getConfig:()=>Y.get("/api/config"),updateConfig:e=>Y.put("/api/config",{body:e}),listWorkspacesFull:()=>Y.get("/api/workspaces",{query:{full:!0}}),upsertWorkspace:e=>Y.post("/api/workspaces",{body:e}),startWechatQr:()=>Y.post("/api/messengers/wechat/qr-start"),getWechatQrStatus:e=>Y.get("/api/messengers/wechat/qr-status",{query:e}),getEnv:e=>Y.get("/api/env",{query:e}),updateEnv:e=>Y.put("/api/env",{body:e}),getHealth:e=>Y.get("/api/health",e),getHealthSummary:e=>Y.get("/api/health/summary",{query:e}),getHealthTopN:e=>Y.get("/api/health/topn",{query:e}),invoke:e=>Y.post("/api/invoke",e),listJobs:e=>Y.get("/api/jobs",{query:e}),createJob:e=>Y.post("/api/jobs",{body:e}),batchCancelJobs:e=>Y.post("/api/jobs/batch-cancel",{body:e}),batchRunJobs:e=>Y.post("/api/jobs/batch-run",{body:e}),submitLoc:e=>Y.post("/api/loc",e),getLocInfo:e=>Y.get("/api/loc/info",e),consolidateMemory:()=>Y.post("/api/memory/consolidate"),getMemoryConsolidateStatus:()=>Y.get("/api/memory/consolidate/status"),exportMemory:e=>Y.get("/api/memory/export",e),deleteMemoryFacts:(e,t)=>Y.delete("/api/memory/facts",{query:e,body:t}),deleteMemoryFactById:(e,t)=>Y.delete(`/api/memory/facts/${e}`,{query:t}),listMemoryFacts:e=>Y.get("/api/memory/facts",{query:e}),deleteMemoryPersona:e=>Y.delete("/api/memory/persona",{query:e}),getMemoryPersona:e=>Y.get("/api/memory/persona",{query:e}),updateMemoryPersona:(e,t)=>Y.put("/api/memory/persona",{query:e,body:t}),listMemoryUsers:()=>Y.get("/api/memory/users"),backfillMemoryVector:(e,t)=>Y.post("/api/memory/vector/backfill",{query:e,body:t}),clearMemoryVector:e=>Y.post("/api/memory/vector/clear",{query:e}),downloadMemoryVector:()=>Y.post("/api/memory/vector/download"),getMemoryVectorStatus:e=>Y.get("/api/memory/vector/status",{query:e}),testMemoryVector:()=>Y.post("/api/memory/vector/test"),listMemos:e=>Y.get("/api/memos",{query:e}),deleteMemo:e=>Y.delete(`/api/memos/${e}`),getMetrics:e=>Y.get("/api/metrics",e),notify:e=>Y.post("/api/notify",e),listOutbox:e=>Y.get("/api/outbox",{query:e}),getOutboxStats:()=>Y.get("/api/outbox/stats"),retryOutbox:e=>Y.post(`/api/outbox/${e}/retry`),listReminders:e=>Y.get("/api/reminders",{query:e}),cancelReminder:e=>Y.post(`/api/reminders/${e}/cancel`),snoozeReminder:(e,t)=>Y.post(`/api/reminders/${e}/snooze`,{body:t}),listSchedules:e=>Y.get("/api/schedules",{query:e}),restartService:()=>Y.post("/api/service/restart"),startService:()=>Y.post("/api/service/start"),getServiceStatus:()=>Y.get("/api/service/status"),stopService:()=>Y.post("/api/service/stop"),listSkills:()=>Y.get("/api/skills"),getSkillDetail:e=>Y.get(`/api/skills/${encodeURIComponent(e)}`),getSkillsRemoteHot:()=>Y.get("/api/skills/remote/hot"),listSubtasks:e=>Y.get("/api/subtasks",{query:e}),listViewerPastes:e=>Y.get("/api/viewer",e),getViewerTunnel:()=>Y.get("/api/viewer/tunnel"),getWorkspaceFiles:e=>Y.get("/api/workspace-files",{query:e}),writeWorkspaceFile:(e,t)=>Y.put("/api/workspace-files",{query:e,body:t})};function Jv(e,t){if(e instanceof ba){const n=t("errors:UNKNOWN",{code:e.code,detail:e.message,defaultValue:e.message}),r=t(`errors:${e.code}`,{defaultValue:n,detail:e.message});return{code:e.code,message:r}}return e instanceof Error?{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:e.name,defaultValue:e.message})}:{code:"UNKNOWN",message:t("errors:UNKNOWN",{code:"UNKNOWN",defaultValue:String(e)})}}const pd=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Ie("rounded-lg border border-border bg-surface text-text shadow-sm",e),...t}));pd.displayName="Card";const md=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Ie("flex flex-col space-y-1 p-3 sm:p-4",e),...t}));md.displayName="CardHeader";const gd=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Ie("text-md font-semibold leading-tight",e),...t}));gd.displayName="CardTitle";const yd=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Ie("text-sm text-text-dim",e),...t}));yd.displayName="CardDescription";const vd=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Ie("p-3 pt-0 sm:p-4 sm:pt-0",e),...t}));vd.displayName="CardContent";const bd=g.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:Ie("flex items-center p-5 pt-0 sm:p-6 sm:pt-0 gap-2",e),...t}));bd.displayName="CardFooter";const xd=g.forwardRef(({className:e,type:t,...n},r)=>v.jsx("input",{type:t,className:Ie("flex h-8 w-full rounded-md border border-border bg-surface","px-3 py-1 text-sm shadow-sm","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-text-muted","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55",e),ref:r,...n}));xd.displayName="Input";var Zv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],eb=Zv.reduce((e,t)=>{const n=Qu(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),tb="Label",wd=g.forwardRef((e,t)=>v.jsx(eb.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));wd.displayName=tb;var Sd=wd;const nb=rs("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),kd=g.forwardRef(({className:e,...t},n)=>v.jsx(Sd,{ref:n,className:Ie(nb(),e),...t}));kd.displayName=Sd.displayName;function rb(e){if(!e)return"/";try{const t=decodeURIComponent(e);if(t.startsWith("/")&&!t.startsWith("//"))return t}catch{}return"/"}function ib(){const{t:e}=St(),t=io(),[n]=pg(),r=ns(c=>c.setToken),[i,o]=g.useState(""),a=rb(n.get("next")),s=wv({mutationFn:c=>Xv.login({token:c}),onSuccess:()=>{r(i.trim()),Ot.success(e("states.saved")),t(a,{replace:!0})},onError:c=>{const{message:u}=Jv(c,e);Ot.error(u)}});function l(c){c.preventDefault();const u=i.trim();u&&s.mutate(u)}return v.jsx("div",{className:"grid min-h-dvh place-items-center bg-bg px-4 py-8 pt-safe",children:v.jsxs(pd,{className:"w-full max-w-md",children:[v.jsxs(md,{children:[v.jsxs(gd,{className:"text-xl",children:[v.jsx("span",{className:"mr-2",children:"🤖"}),e("appName")]}),v.jsx(yd,{children:e("login.intro",{defaultValue:"Paste your access token from ~/.agim/tokens.json or `agim token list`."})})]}),v.jsx(vd,{children:v.jsxs("form",{onSubmit:l,className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(kd,{htmlFor:"token",children:e("login.tokenLabel",{defaultValue:"Access token"})}),v.jsx(xd,{id:"token",type:"password",value:i,onChange:c=>o(c.target.value),placeholder:"agim_••••••••",autoComplete:"off",autoFocus:!0,required:!0})]}),v.jsx(bt,{type:"submit",size:"lg",disabled:s.isPending||i.trim().length===0,children:s.isPending?e("states.loading"):e("login.submit",{defaultValue:"Sign in"})})]})}),v.jsx(bd,{className:"block text-xs text-text-muted",children:e("login.hint",{defaultValue:"Loopback (127.0.0.1) requests bypass this check; you only see this page when accessing agim from another host or with IMHUB_TRUST_LOOPBACK=off."})})]})})}const Pl=[1e3,2e3,5e3,1e4,3e4];function ob(e){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}${e}`}let Nr=null;function ab(){if(Nr)return Nr;let e=null,t="connecting",n=0,r=null,i=!1;const o=new Set;function a(y){t=y;for(const b of o)b.type==="status"&&b.fn(y)}function s(y){for(const b of o)b.type==="message"&&b.fn(y)}function l(){r!=null&&(clearTimeout(r),r=null)}function c(){if(i)return;l();const y=Pl[Math.min(n,Pl.length-1)]??3e4;n+=1,r=setTimeout(()=>u(),y)}function u(){l(),a("connecting");try{e=new WebSocket(ob("/ws"))}catch(y){a("error"),console.warn("[ws] construct failed",y),c();return}e.addEventListener("open",()=>{n=0,a("open")}),e.addEventListener("message",y=>{let b;try{b=JSON.parse(y.data)}catch{console.warn("[ws] bad json",y.data?.slice?.(0,200));return}s(b)}),e.addEventListener("close",()=>{a("closed"),i||c()}),e.addEventListener("error",()=>{a("error")})}function d(y){if(!e||e.readyState!==WebSocket.OPEN)return!1;try{return e.send(JSON.stringify(y)),!0}catch{return!1}}function h(y){return o.add(y),y.type==="status"&&y.fn(t),()=>{o.delete(y)}}function f(){i=!0,l();try{e?.close()}catch{}e=null,Nr=null}function m(){document.visibilityState==="visible"&&(!e||e.readyState===WebSocket.CLOSED)&&(n=0,u())}function p(){n=0,(!e||e.readyState!==WebSocket.OPEN)&&u()}return document.addEventListener("visibilitychange",m),window.addEventListener("online",p),u(),Nr={send:d,subscribe:h,status:()=>t,close:()=>{document.removeEventListener("visibilitychange",m),window.removeEventListener("online",p),f()}},Nr}const sb=1200,lb={messages:[],pendingApprovals:[],agents:[],agent:"",status:"connecting",currentReplyId:null,error:null};function cb(e,t){switch(t.kind){case"WS_STATUS":return{...e,status:t.status};case"INIT":return{...e,agents:t.agents,agent:e.agent||t.defaultAgent};case"HISTORY":return{...e,messages:t.messages,agent:t.agent};case"AGENTS":return{...e,agents:t.agents};case"AGENT_SWITCHED":return{...e,agent:t.agent};case"SEND_USER":return{...e,messages:[...e.messages,t.message,t.placeholder],currentReplyId:t.placeholder.id,error:null};case"CHUNK":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return e;const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:i.content+t.text}),{...e,messages:r}}case"DONE":{const n=e.messages.findIndex(o=>o.id===t.replyId);if(n<0)return{...e,currentReplyId:null};const r=[...e.messages],i=r[n];return i&&(r[n]={...i,content:t.finalText||i.content}),{...e,messages:r,currentReplyId:null}}case"ERROR":return{...e,error:t.message,currentReplyId:null};case"APPROVAL_CARD":return e.pendingApprovals.some(n=>n.messageId===t.messageId)?e:{...e,pendingApprovals:[...e.pendingApprovals,{messageId:t.messageId,prompt:t.prompt}]};case"APPROVAL_TEXT":return e;case"APPROVAL_EDIT":{const n=e.pendingApprovals.findIndex(o=>o.messageId===t.messageId);if(n<0)return e;const r=[...e.pendingApprovals],i=r[n];return i&&(r[n]={...i,outcome:t.outcome,resolvedAt:Date.now()}),{...e,pendingApprovals:r}}case"APPROVAL_DISMISS":return{...e,pendingApprovals:e.pendingApprovals.filter(n=>n.messageId!==t.messageId)};case"RESET_CONVERSATION":return{...e,messages:[],pendingApprovals:[],currentReplyId:null,error:null};case"CLEAR_ERROR":return{...e,error:null}}}function ub(e){switch(e.decision){case"allowed":Ot.success("已批准");return;case"allowed-pinned":Ot.success("已批准 · 后续同类自动放行");return;case"denied":Ot.error("已拒绝");return;case"denied-revoked":Ot.error("已拒绝 · 撤销自动放行规则");return;case"expired":Ot.warning("已过期");return}}let Il=0;function Ll(e){return Il+=1,`${e}-${Date.now()}-${Il}`}function db(){const[e,t]=g.useReducer(cb,lb),n=g.useRef(ab()),r=g.useRef(new Map),i=g.useRef(!1),o=g.useRef(null);g.useEffect(()=>{o.current=e.currentReplyId},[e.currentReplyId]),g.useEffect(()=>{const f=n.current,m=f.subscribe({type:"status",fn:R=>t({kind:"WS_STATUS",status:R})}),p=f.subscribe({type:"message",fn:R=>a(R)});function y(){try{const I=localStorage.getItem("agim-web-thread-id");if(I&&/^web-[A-Za-z0-9_-]{4,64}$/.test(I))return I}catch{}const R=`web-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;try{localStorage.setItem("agim-web-thread-id",R)}catch{}return R}const b=y();function x(){f.send({type:"get-history",threadId:b}),f.send({type:"get-agents"})}let w=()=>{};return f.status()==="open"?x():w=f.subscribe({type:"status",fn:R=>{R==="open"&&(x(),w())}}),()=>{m(),p(),w()}},[]);function a(f){switch(f.type){case"init":t({kind:"INIT",agents:f.agents,defaultAgent:f.defaultAgent});return;case"history":t({kind:"HISTORY",agent:f.agent,messages:f.messages.map((m,p)=>({id:`hist-${p}`,role:m.role,content:m.content,agent:m.agent,timestamp:m.timestamp?Date.parse(m.timestamp):Date.now()-p*1e3}))});return;case"agents":t({kind:"AGENTS",agents:f.agents});return;case"agent-switched":t({kind:"AGENT_SWITCHED",agent:f.agent});return;case"chunk":s(f.text);return;case"done":l(),t({kind:"DONE",replyId:o.current??"",finalText:f.text});return;case"error":l(),t({kind:"ERROR",message:f.message});return;case"approval-card":t({kind:"APPROVAL_CARD",messageId:f.messageId,prompt:f.prompt});return;case"approval-card-edit":t({kind:"APPROVAL_EDIT",messageId:f.messageId,outcome:f.outcome}),ub(f.outcome),window.setTimeout(()=>{t({kind:"APPROVAL_DISMISS",messageId:f.messageId})},sb);return;case"approval-text":Ot.info(f.text);return;case"metrics":return;default:return}}function s(f){const m=o.current;if(!m)return;const p=r.current.get(m)??"";r.current.set(m,p+f),!i.current&&(i.current=!0,requestAnimationFrame(()=>{i.current=!1,l()}))}function l(){for(const[f,m]of r.current.entries())m&&t({kind:"CHUNK",replyId:f,text:m});r.current.clear()}function c(f){const m=f.trim();if(!m)return;const p=n.current,y=Ll("u"),b=Ll("a");t({kind:"SEND_USER",message:{id:y,role:"user",content:m,timestamp:Date.now()},placeholder:{id:b,role:"assistant",content:"",agent:e.agent,timestamp:Date.now()}}),p.send({type:"message",text:m,agent:e.agent})||t({kind:"ERROR",message:"Not connected. Reconnecting…"})}function u(f){n.current.send({type:"switch-agent",agent:f})}function d(f,m,p){const y=n.current.send({type:"approval-action",data:`apv:${m}:${p}`,messageId:f});return y||t({kind:"ERROR",message:"Not connected. Reconnecting — try clicking again in a moment."}),y}function h(){t({kind:"RESET_CONVERSATION"}),n.current.send({type:"new-conversation"})}return{state:e,send:c,switchAgent:u,approvalClick:d,newConversation:h,clearError:()=>t({kind:"CLEAR_ERROR"})}}const fb=rs(["inline-flex items-center gap-1","rounded-full border px-2 py-0.5","text-xs font-semibold uppercase tracking-wide leading-5","transition-colors"].join(" "),{variants:{variant:{default:"bg-surface-2 text-text-dim border-transparent",secondary:"bg-surface-2 text-text border-border",outline:"bg-transparent text-text-dim border-border",success:"bg-success-bg text-success border-transparent",warning:"bg-warning-bg text-warning border-transparent",danger:"bg-danger-bg text-danger border-transparent",info:"bg-info-bg text-info border-transparent",accent:"bg-accent-bg text-accent border-transparent"}},defaultVariants:{variant:"default"}});function at({className:e,variant:t,...n}){return v.jsx("span",{className:Ie(fb({variant:t}),e),...n})}function hb(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gb={};function Ol(e,t){return(gb.jsx?mb:pb).test(e)}const yb=/[ \t\n\f\r]/g;function vb(e){return typeof e=="object"?e.type==="text"?_l(e.value):!1:_l(e)}function _l(e){return e.replace(yb,"")===""}class ni{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ni.prototype.normal={};ni.prototype.property={};ni.prototype.space=void 0;function Ed(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ni(n,r,t)}function xa(e){return e.toLowerCase()}class pt{constructor(t,n){this.attribute=n,this.property=t}}pt.prototype.attribute="";pt.prototype.booleanish=!1;pt.prototype.boolean=!1;pt.prototype.commaOrSpaceSeparated=!1;pt.prototype.commaSeparated=!1;pt.prototype.defined=!1;pt.prototype.mustUseProperty=!1;pt.prototype.number=!1;pt.prototype.overloadedBoolean=!1;pt.prototype.property="";pt.prototype.spaceSeparated=!1;pt.prototype.space=void 0;let bb=0;const me=qn(),qe=qn(),wa=qn(),H=qn(),Me=qn(),lr=qn(),gt=qn();function qn(){return 2**++bb}const Sa=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:qe,commaOrSpaceSeparated:gt,commaSeparated:lr,number:H,overloadedBoolean:wa,spaceSeparated:Me},Symbol.toStringTag,{value:"Module"})),Lo=Object.keys(Sa);class ss extends pt{constructor(t,n,r,i){let o=-1;if(super(t,n),Nl(this,"space",i),typeof r=="number")for(;++o<Lo.length;){const a=Lo[o];Nl(this,Lo[o],(r&Sa[a])===Sa[a])}}}ss.prototype.defined=!0;function Nl(e,t,n){n&&(e[t]=n)}function vr(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new ss(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[xa(r)]=r,n[xa(o.attribute)]=r}return new ni(t,n,e.space)}const Cd=vr({properties:{ariaActiveDescendant:null,ariaAtomic:qe,ariaAutoComplete:null,ariaBusy:qe,ariaChecked:qe,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:Me,ariaCurrent:null,ariaDescribedBy:Me,ariaDetails:null,ariaDisabled:qe,ariaDropEffect:Me,ariaErrorMessage:null,ariaExpanded:qe,ariaFlowTo:Me,ariaGrabbed:qe,ariaHasPopup:null,ariaHidden:qe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Me,ariaLevel:H,ariaLive:null,ariaModal:qe,ariaMultiLine:qe,ariaMultiSelectable:qe,ariaOrientation:null,ariaOwns:Me,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:qe,ariaReadOnly:qe,ariaRelevant:null,ariaRequired:qe,ariaRoleDescription:Me,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:qe,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ad(e,t){return t in e?e[t]:t}function Td(e,t){return Ad(e,t.toLowerCase())}const xb=vr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:lr,acceptCharset:Me,accessKey:Me,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Me,autoFocus:me,autoPlay:me,blocking:Me,capture:null,charSet:null,checked:me,cite:null,className:Me,cols:H,colSpan:null,content:null,contentEditable:qe,controls:me,controlsList:Me,coords:H|lr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:wa,draggable:qe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Me,height:H,hidden:wa,high:H,href:null,hrefLang:null,htmlFor:Me,httpEquiv:Me,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Me,itemRef:Me,itemScope:me,itemType:Me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:me,optimum:H,pattern:null,ping:Me,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Me,required:me,reversed:me,rows:H,rowSpan:H,sandbox:Me,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:qe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:qe,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Me,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:qe,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:me,disableRemotePlayback:me,prefix:null,property:null,results:H,security:null,unselectable:null},space:"html",transform:Td}),wb=vr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:gt,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:Me,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:lr,g2:lr,glyphName:lr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:gt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:gt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:gt,rev:gt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:gt,requiredFeatures:gt,requiredFonts:gt,requiredFormats:gt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:gt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:gt,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:gt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ad}),Rd=vr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Pd=vr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Td}),Id=vr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Sb={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},kb=/[A-Z]/g,Dl=/-[a-z]/g,Eb=/^data[-\w.:]+$/i;function Cb(e,t){const n=xa(t);let r=t,i=pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Eb.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Dl,Tb);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Dl.test(o)){let a=o.replace(kb,Ab);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=ss}return new i(r,t)}function Ab(e){return"-"+e.toLowerCase()}function Tb(e){return e.charAt(1).toUpperCase()}const Rb=Ed([Cd,xb,Rd,Pd,Id],"html"),ls=Ed([Cd,wb,Rd,Pd,Id],"svg");function Pb(e){return e.join(" ").trim()}var cs={},Ml=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ib=/\n/g,Lb=/^\s*/,Ob=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,_b=/^:\s*/,Nb=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Db=/^[;\s]*/,Mb=/^\s+|\s+$/g,jb=`
130
+ `,jl="/",Fl="*",Nn="",Fb="comment",Bb="declaration";function Hb(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var p=m.match(Ib);p&&(n+=p.length);var y=m.lastIndexOf(jb);r=~y?m.length-y:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new a(m),c(),p}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var y=p[0];return i(y),e=e.slice(y.length),p}}function c(){l(Lb)}function u(m){var p;for(m=m||[];p=d();)p!==!1&&m.push(p);return m}function d(){var m=o();if(!(jl!=e.charAt(0)||Fl!=e.charAt(1))){for(var p=2;Nn!=e.charAt(p)&&(Fl!=e.charAt(p)||jl!=e.charAt(p+1));)++p;if(p+=2,Nn===e.charAt(p-1))return s("End of comment missing");var y=e.slice(2,p-2);return r+=2,i(y),e=e.slice(p),r+=2,m({type:Fb,comment:y})}}function h(){var m=o(),p=l(Ob);if(p){if(d(),!l(_b))return s("property missing ':'");var y=l(Nb),b=m({type:Bb,property:Bl(p[0].replace(Ml,Nn)),value:y?Bl(y[0].replace(Ml,Nn)):Nn});return l(Db),b}}function f(){var m=[];u(m);for(var p;p=h();)p!==!1&&(m.push(p),u(m));return m}return c(),f()}function Bl(e){return e?e.replace(Mb,Nn):Nn}var Ub=Hb,zb=Ii&&Ii.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.default=Vb;const $b=zb(Ub);function Vb(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,$b.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:a,value:s}=o;i?t(a,s,o):s&&(n=n||{},n[a]=s)}),n}var ao={};Object.defineProperty(ao,"__esModule",{value:!0});ao.camelCase=void 0;var Wb=/^--[a-zA-Z0-9_-]+$/,Kb=/-([a-z])/g,qb=/^[^-]+$/,Gb=/^-(webkit|moz|ms|o|khtml)-/,Yb=/^-(ms)-/,Qb=function(e){return!e||qb.test(e)||Wb.test(e)},Xb=function(e,t){return t.toUpperCase()},Hl=function(e,t){return"".concat(t,"-")},Jb=function(e,t){return t===void 0&&(t={}),Qb(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Yb,Hl):e=e.replace(Gb,Hl),e.replace(Kb,Xb))};ao.camelCase=Jb;var Zb=Ii&&Ii.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ex=Zb(cs),tx=ao;function ka(e,t){var n={};return!e||typeof e!="string"||(0,ex.default)(e,function(r,i){r&&i&&(n[(0,tx.camelCase)(r,t)]=i)}),n}ka.default=ka;var nx=ka;const rx=ku(nx),Ld=Od("end"),us=Od("start");function Od(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ix(e){const t=us(e),n=Ld(e);if(t&&n)return{start:t,end:n}}function Hr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ul(e.position):"start"in e||"end"in e?Ul(e):"line"in e||"column"in e?Ea(e):""}function Ea(e){return zl(e&&e.line)+":"+zl(e&&e.column)}function Ul(e){return Ea(e&&e.start)+"-"+Ea(e&&e.end)}function zl(e){return e&&typeof e=="number"?e:1}class it extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=Hr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}it.prototype.file="";it.prototype.name="";it.prototype.reason="";it.prototype.message="";it.prototype.stack="";it.prototype.column=void 0;it.prototype.line=void 0;it.prototype.ancestors=void 0;it.prototype.cause=void 0;it.prototype.fatal=void 0;it.prototype.place=void 0;it.prototype.ruleId=void 0;it.prototype.source=void 0;const ds={}.hasOwnProperty,ox=new Map,ax=/[A-Z]/g,sx=new Set(["table","tbody","thead","tfoot","tr"]),lx=new Set(["td","th"]),_d="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cx(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=yx(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=gx(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ls:Rb,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Nd(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Nd(e,t,n){if(t.type==="element")return ux(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return dx(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return hx(e,t,n);if(t.type==="mdxjsEsm")return fx(e,t);if(t.type==="root")return px(e,t,n);if(t.type==="text")return mx(e,t)}function ux(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ls,e.schema=i),e.ancestors.push(t);const o=Md(e,t.tagName,!1),a=vx(e,t);let s=hs(e,t);return sx.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!vb(l):!0})),Dd(e,a,o,t),fs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function dx(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}qr(e,t.position)}function fx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qr(e,t.position)}function hx(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ls,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Md(e,t.name,!0),a=bx(e,t),s=hs(e,t);return Dd(e,a,o,t),fs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function px(e,t,n){const r={};return fs(r,hs(e,t)),e.create(t,e.Fragment,r,n)}function mx(e,t){return t.value}function Dd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function gx(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function yx(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=us(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function vx(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ds.call(t.properties,i)){const o=xx(e,i,t.properties[i]);if(o){const[a,s]=o;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&lx.has(t.tagName)?r=s:n[a]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function bx(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else qr(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else qr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function hs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ox;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const s=Nd(e,o,a);s!==void 0&&n.push(s)}return n}function xx(e,t,n){const r=Cb(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?hb(n):Pb(n)),r.property==="style"){let i=typeof n=="object"?n:wx(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Sx(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Sb[r.property]||r.property:r.attribute,n]}}function wx(e,t){try{return rx(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new it("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=_d+"#cannot-parse-style-attribute",i}}function Md(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const s=Ol(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=a}else r=Ol(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return ds.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);qr(e)}function qr(e,t){const n=new it("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=_d+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Sx(e){const t={};let n;for(n in e)ds.call(e,n)&&(t[kx(n)]=e[n]);return t}function kx(e){let t=e.replace(ax,Ex);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ex(e){return"-"+e.toLowerCase()}const Oo={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Cx={};function ps(e,t){const n=Cx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return jd(e,r,i)}function jd(e,t,n){if(Ax(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $l(e.children,t,n)}return Array.isArray(e)?$l(e,t,n):""}function $l(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=jd(e[i],t,n);return r.join("")}function Ax(e){return!!(e&&typeof e=="object")}const Vl=document.createElement("i");function ms(e){const t="&"+e+";";Vl.innerHTML=t;const n=Vl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xt(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function Ct(e,t){return e.length>0?(xt(e,e.length,0,t),e):t}const Wl={}.hasOwnProperty;function Fd(e){const t={};let n=-1;for(;++n<e.length;)Tx(t,e[n]);return t}function Tx(e,t){let n;for(n in t){const i=(Wl.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){Wl.call(i,a)||(i[a]=[]);const s=o[a];Rx(i[a],Array.isArray(s)?s:s?[s]:[])}}}function Rx(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xt(e,0,0,r)}function Bd(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function _t(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const st=wn(/[A-Za-z]/),nt=wn(/[\dA-Za-z]/),Px=wn(/[#-'*+\--9=?A-Z^-~]/);function Fi(e){return e!==null&&(e<32||e===127)}const Ca=wn(/\d/),Ix=wn(/[\dA-Fa-f]/),Lx=wn(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function Ne(e){return e!==null&&(e<0||e===32)}function Se(e){return e===-2||e===-1||e===32}const so=wn(/\p{P}|\p{S}/u),Un=wn(/\s/);function wn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function br(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&nt(e.charCodeAt(n+1))&&nt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ce(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Se(l)?(e.enter(n),s(l)):t(l)}function s(l){return Se(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const Ox={tokenize:_x};function _x(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ce(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ie(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const Nx={tokenize:Dx},Kl={tokenize:Mx};function Dx(e){const t=this,n=[];let r=0,i,o,a;return s;function s(w){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const R=t.events.length;let I=R,C;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){C=t.events[I][1].end;break}b(r);let S=R;for(;S<t.events.length;)t.events[S][1].end={...C},S++;return xt(t.events,I+1,0,t.events.slice(R)),t.events.length=S,c(w)}return s(w)}function c(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Kl,u,d)(w)}function u(w){return i&&x(),b(r),h(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Kl,f,m)(w)}function f(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&x(),b(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){y(e.exit("chunkFlow"),!0),b(0),e.consume(w);return}return ie(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),p)}function y(w,R){const I=t.sliceStream(w);if(R&&I.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(I),t.parser.lazy[w.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const S=t.events.length;let N=S,j,T;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(j){T=t.events[N][1].end;break}j=!0}for(b(r),C=S;C<t.events.length;)t.events[C][1].end={...T},C++;xt(t.events,N+1,0,t.events.slice(S)),t.events.length=C}}function b(w){let R=n.length;for(;R-- >w;){const I=n[R];t.containerState=I[1],I[0].exit.call(t,e)}n.length=w}function x(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Mx(e,t,n){return Ce(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fr(e){if(e===null||Ne(e)||Un(e))return 1;if(so(e))return 2}function lo(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Aa={name:"attention",resolveAll:jx,tokenize:Fx};function jx(e,t){let n=-1,r,i,o,a,s,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};ql(d,-l),ql(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ct(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Ct(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=Ct(c,lo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Ct(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Ct(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,xt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Fx(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=fr(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),u=fr(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(o===42?d:d&&(i||!h)),c._close=!!(o===42?h:h&&(u||!d)),t(l)}}function ql(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Bx={name:"autolink",tokenize:Hx};function Hx(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return st(f)?(e.consume(f),a):f===64?n(f):c(f)}function a(f){return f===43||f===45||f===46||nt(f)?(r=1,s(f)):c(f)}function s(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||nt(f))&&r++<32?(e.consume(f),s):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Fi(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):Px(f)?(e.consume(f),c):n(f)}function u(f){return nt(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||nt(f))&&r++<63){const m=f===45?h:d;return e.consume(f),m}return n(f)}}const ri={partial:!0,tokenize:Ux};function Ux(e,t,n){return r;function r(o){return Se(o)?Ce(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ie(o)?t(o):n(o)}}const Hd={continuation:{tokenize:$x},exit:Vx,name:"blockQuote",tokenize:zx};function zx(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Se(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function $x(e,t,n){const r=this;return i;function i(a){return Se(a)?Ce(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(Hd,t,n)(a)}}function Vx(e){e.exit("blockQuote")}const Ud={name:"characterEscape",tokenize:Wx};function Wx(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Lx(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const zd={name:"characterReference",tokenize:Kx};function Kx(e,t,n){const r=this;let i=0,o,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=nt,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Ix,u):(e.enter("characterReferenceValue"),o=7,a=Ca,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return a===nt&&!ms(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<o?(e.consume(d),u):n(d)}}const Gl={partial:!0,tokenize:Gx},Yl={concrete:!0,name:"codeFenced",tokenize:qx};function qx(e,t,n){const r=this,i={partial:!0,tokenize:I};let o=0,a=0,s;return l;function l(C){return c(C)}function c(C){const S=r.events[r.events.length-1];return o=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===s?(a++,e.consume(C),u):a<3?n(C):(e.exit("codeFencedFenceSequence"),Se(C)?Ce(e,d,"whitespace")(C):d(C))}function d(C){return C===null||ie(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Gl,p,R)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):Se(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ce(e,f,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),h)}function f(C){return C===null||ie(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ie(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===s?n(C):(e.consume(C),m)}function p(C){return e.attempt(i,R,y)(C)}function y(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),b}function b(C){return o>0&&Se(C)?Ce(e,x,"linePrefix",o+1)(C):x(C)}function x(C){return C===null||ie(C)?e.check(Gl,p,R)(C):(e.enter("codeFlowValue"),w(C))}function w(C){return C===null||ie(C)?(e.exit("codeFlowValue"),x(C)):(e.consume(C),w)}function R(C){return e.exit("codeFenced"),t(C)}function I(C,S,N){let j=0;return T;function T(V){return C.enter("lineEnding"),C.consume(V),C.exit("lineEnding"),D}function D(V){return C.enter("codeFencedFence"),Se(V)?Ce(C,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):L(V)}function L(V){return V===s?(C.enter("codeFencedFenceSequence"),K(V)):N(V)}function K(V){return V===s?(j++,C.consume(V),K):j>=a?(C.exit("codeFencedFenceSequence"),Se(V)?Ce(C,B,"whitespace")(V):B(V)):N(V)}function B(V){return V===null||ie(V)?(C.exit("codeFencedFence"),S(V)):N(V)}}}function Gx(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const _o={name:"codeIndented",tokenize:Qx},Yx={partial:!0,tokenize:Xx};function Qx(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ce(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):ie(c)?e.attempt(Yx,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||ie(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function Xx(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Ce(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ie(a)?i(a):n(a)}}const Jx={name:"codeText",previous:ew,resolve:Zx,tokenize:tw};function Zx(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function ew(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tw(e,t,n){let r=0,i,o;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(o=e.enter("codeTextSequence"),i=0,u(d)):ie(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ie(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",c(d))}}class nw{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Dr(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Dr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Dr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Dr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Dr(this.left,n.reverse())}}}function Dr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $d(e){const t={};let n=-1,r,i,o,a,s,l,c;const u=new nw(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,rw(u,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=u.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return xt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function rw(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,h=-1,f=n,m=0,p=0;const y=[p];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(p=h+1,y.push(p),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),h=y.length;h--;){const b=s.slice(y[h],y[h+1]),x=o.pop();l.push([x,x+b.length-1]),e.splice(x,2,b)}for(l.reverse(),h=-1;++h<l.length;)c[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return c}const iw={resolve:aw,tokenize:sw},ow={partial:!0,tokenize:lw};function aw(e){return $d(e),e}function sw(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):ie(s)?e.check(ow,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function lw(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ce(e,o,"linePrefix")}function o(a){if(a===null||ie(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Vd(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),h):b===null||b===32||b===41||Fi(b)?n(b):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(b))}function h(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(s),h(b)):b===null||b===60||ie(b)?n(b):(e.consume(b),b===92?m:f)}function m(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function p(b){return!u&&(b===null||b===41||Ne(b))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(b)):u<c&&b===40?(e.consume(b),u++,p):b===41?(e.consume(b),u--,p):b===null||b===32||b===40||Fi(b)?n(b):(e.consume(b),b===92?y:p)}function y(b){return b===40||b===41||b===92?(e.consume(b),p):p(b)}}function Wd(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),u}function u(f){return s>999||f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||ie(f)||s++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Se(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}}function Kd(e,t,n,r,i,o){let a;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),c(h))}function c(h){return h===a?(e.exit(o),l(a)):h===null?n(h):ie(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ce(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===a||h===null||ie(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===a||h===92?(e.consume(h),u):u(h)}}function Ur(e,t){let n;return r;function r(i){return ie(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Se(i)?Ce(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const cw={name:"definition",tokenize:dw},uw={partial:!0,tokenize:fw};function dw(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),a(f)}function a(f){return Wd.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=_t(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return Ne(f)?Ur(e,c)(f):c(f)}function c(f){return Vd(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(uw,d,d)(f)}function d(f){return Se(f)?Ce(e,h,"whitespace")(f):h(f)}function h(f){return f===null||ie(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function fw(e,t,n){return r;function r(s){return Ne(s)?Ur(e,i)(s):n(s)}function i(s){return Kd(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Se(s)?Ce(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ie(s)?t(s):n(s)}}const hw={name:"hardBreakEscape",tokenize:pw};function pw(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ie(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const mw={name:"headingAtx",resolve:gw,tokenize:yw};function gw(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},xt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function yw(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||Ne(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ie(u)?(e.exit("atxHeading"),t(u)):Se(u)?Ce(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Ne(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const vw=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ql=["pre","script","style","textarea"],bw={concrete:!0,name:"htmlFlow",resolveTo:Sw,tokenize:kw},xw={partial:!0,tokenize:Cw},ww={partial:!0,tokenize:Ew};function Sw(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function kw(e,t,n){const r=this;let i,o,a,s,l;return c;function c(E){return u(E)}function u(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),o=!0,p):E===63?(e.consume(E),i=3,r.interrupt?t:k):st(E)?(e.consume(E),a=String.fromCharCode(E),y):n(E)}function h(E){return E===45?(e.consume(E),i=2,f):E===91?(e.consume(E),i=5,s=0,m):st(E)?(e.consume(E),i=4,r.interrupt?t:k):n(E)}function f(E){return E===45?(e.consume(E),r.interrupt?t:k):n(E)}function m(E){const oe="CDATA[";return E===oe.charCodeAt(s++)?(e.consume(E),s===oe.length?r.interrupt?t:L:m):n(E)}function p(E){return st(E)?(e.consume(E),a=String.fromCharCode(E),y):n(E)}function y(E){if(E===null||E===47||E===62||Ne(E)){const oe=E===47,fe=a.toLowerCase();return!oe&&!o&&Ql.includes(fe)?(i=1,r.interrupt?t(E):L(E)):vw.includes(a.toLowerCase())?(i=6,oe?(e.consume(E),b):r.interrupt?t(E):L(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?x(E):w(E))}return E===45||nt(E)?(e.consume(E),a+=String.fromCharCode(E),y):n(E)}function b(E){return E===62?(e.consume(E),r.interrupt?t:L):n(E)}function x(E){return Se(E)?(e.consume(E),x):T(E)}function w(E){return E===47?(e.consume(E),T):E===58||E===95||st(E)?(e.consume(E),R):Se(E)?(e.consume(E),w):T(E)}function R(E){return E===45||E===46||E===58||E===95||nt(E)?(e.consume(E),R):I(E)}function I(E){return E===61?(e.consume(E),C):Se(E)?(e.consume(E),I):w(E)}function C(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),l=E,S):Se(E)?(e.consume(E),C):N(E)}function S(E){return E===l?(e.consume(E),l=null,j):E===null||ie(E)?n(E):(e.consume(E),S)}function N(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Ne(E)?I(E):(e.consume(E),N)}function j(E){return E===47||E===62||Se(E)?w(E):n(E)}function T(E){return E===62?(e.consume(E),D):n(E)}function D(E){return E===null||ie(E)?L(E):Se(E)?(e.consume(E),D):n(E)}function L(E){return E===45&&i===2?(e.consume(E),q):E===60&&i===1?(e.consume(E),Q):E===62&&i===4?(e.consume(E),se):E===63&&i===3?(e.consume(E),k):E===93&&i===5?(e.consume(E),F):ie(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xw,te,K)(E)):E===null||ie(E)?(e.exit("htmlFlowData"),K(E)):(e.consume(E),L)}function K(E){return e.check(ww,B,te)(E)}function B(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),V}function V(E){return E===null||ie(E)?K(E):(e.enter("htmlFlowData"),L(E))}function q(E){return E===45?(e.consume(E),k):L(E)}function Q(E){return E===47?(e.consume(E),a="",$):L(E)}function $(E){if(E===62){const oe=a.toLowerCase();return Ql.includes(oe)?(e.consume(E),se):L(E)}return st(E)&&a.length<8?(e.consume(E),a+=String.fromCharCode(E),$):L(E)}function F(E){return E===93?(e.consume(E),k):L(E)}function k(E){return E===62?(e.consume(E),se):E===45&&i===2?(e.consume(E),k):L(E)}function se(E){return E===null||ie(E)?(e.exit("htmlFlowData"),te(E)):(e.consume(E),se)}function te(E){return e.exit("htmlFlow"),t(E)}}function Ew(e,t,n){const r=this;return i;function i(a){return ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Cw(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ri,t,n)}}const Aw={name:"htmlText",tokenize:Tw};function Tw(e,t,n){const r=this;let i,o,a;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),I):k===63?(e.consume(k),w):st(k)?(e.consume(k),N):n(k)}function c(k){return k===45?(e.consume(k),u):k===91?(e.consume(k),o=0,m):st(k)?(e.consume(k),x):n(k)}function u(k){return k===45?(e.consume(k),f):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),h):ie(k)?(a=d,Q(k)):(e.consume(k),d)}function h(k){return k===45?(e.consume(k),f):d(k)}function f(k){return k===62?q(k):k===45?h(k):d(k)}function m(k){const se="CDATA[";return k===se.charCodeAt(o++)?(e.consume(k),o===se.length?p:m):n(k)}function p(k){return k===null?n(k):k===93?(e.consume(k),y):ie(k)?(a=p,Q(k)):(e.consume(k),p)}function y(k){return k===93?(e.consume(k),b):p(k)}function b(k){return k===62?q(k):k===93?(e.consume(k),b):p(k)}function x(k){return k===null||k===62?q(k):ie(k)?(a=x,Q(k)):(e.consume(k),x)}function w(k){return k===null?n(k):k===63?(e.consume(k),R):ie(k)?(a=w,Q(k)):(e.consume(k),w)}function R(k){return k===62?q(k):w(k)}function I(k){return st(k)?(e.consume(k),C):n(k)}function C(k){return k===45||nt(k)?(e.consume(k),C):S(k)}function S(k){return ie(k)?(a=S,Q(k)):Se(k)?(e.consume(k),S):q(k)}function N(k){return k===45||nt(k)?(e.consume(k),N):k===47||k===62||Ne(k)?j(k):n(k)}function j(k){return k===47?(e.consume(k),q):k===58||k===95||st(k)?(e.consume(k),T):ie(k)?(a=j,Q(k)):Se(k)?(e.consume(k),j):q(k)}function T(k){return k===45||k===46||k===58||k===95||nt(k)?(e.consume(k),T):D(k)}function D(k){return k===61?(e.consume(k),L):ie(k)?(a=D,Q(k)):Se(k)?(e.consume(k),D):j(k)}function L(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,K):ie(k)?(a=L,Q(k)):Se(k)?(e.consume(k),L):(e.consume(k),B)}function K(k){return k===i?(e.consume(k),i=void 0,V):k===null?n(k):ie(k)?(a=K,Q(k)):(e.consume(k),K)}function B(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Ne(k)?j(k):(e.consume(k),B)}function V(k){return k===47||k===62||Ne(k)?j(k):n(k)}function q(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Q(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),$}function $(k){return Se(k)?Ce(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):F(k)}function F(k){return e.enter("htmlTextData"),a(k)}}const gs={name:"labelEnd",resolveAll:Lw,resolveTo:Ow,tokenize:_w},Rw={tokenize:Nw},Pw={tokenize:Dw},Iw={tokenize:Mw};function Lw(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&xt(e,0,e.length,n),e}function Ow(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=Ct(s,e.slice(o+1,o+r+3)),s=Ct(s,[["enter",u,t]]),s=Ct(s,lo(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=Ct(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Ct(s,e.slice(a+1)),s=Ct(s,[["exit",l,t]]),xt(e,o,e.length,s),e}function _w(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(h){return o?o._inactive?d(h):(a=r.parser.defined.includes(_t(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(Rw,u,a?u:d)(h):h===91?e.attempt(Pw,u,a?c:d)(h):a?u(h):d(h)}function c(h){return e.attempt(Iw,u,d)(h)}function u(h){return t(h)}function d(h){return o._balanced=!0,n(h)}}function Nw(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Ne(d)?Ur(e,o)(d):o(d)}function o(d){return d===41?u(d):Vd(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Ne(d)?Ur(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?Kd(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Ne(d)?Ur(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Dw(e,t,n){const r=this;return i;function i(s){return Wd.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(_t(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function Mw(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const jw={name:"labelStartImage",resolveAll:gs.resolveAll,tokenize:Fw};function Fw(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Bw={name:"labelStartLink",resolveAll:gs.resolveAll,tokenize:Hw};function Hw(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const No={name:"lineEnding",tokenize:Uw};function Uw(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ce(e,t,"linePrefix")}}const Ci={name:"thematicBreak",tokenize:zw};function zw(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ie(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Se(c)?Ce(e,s,"whitespace")(c):s(c))}}const ut={continuation:{tokenize:Kw},exit:Gw,name:"list",tokenize:Ww},$w={partial:!0,tokenize:Yw},Vw={partial:!0,tokenize:qw};function Ww(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const m=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ca(f)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Ci,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Ca(f)&&++a<10?(e.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(ri,r.interrupt?n:u,e.attempt($w,h,d))}function u(f){return r.containerState.initialBlankLine=!0,o++,h(f)}function d(f){return Se(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Kw(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ri,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Se(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Vw,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(e,e.attempt(ut,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function qw(e,t,n){const r=this;return Ce(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function Gw(e){e.exit(this.containerState.type)}function Yw(e,t,n){const r=this;return Ce(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Se(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Xl={name:"setextUnderline",resolveTo:Qw,tokenize:Xw};function Qw(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Xw(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Se(c)?Ce(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ie(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Jw={tokenize:Zw};function Zw(e){const t=this,n=e.attempt(ri,r,e.attempt(this.parser.constructs.flowInitial,i,Ce(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iw,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const e0={resolveAll:Gd()},t0=qd("string"),n0=qd("text");function qd(e){return{resolveAll:Gd(e==="text"?r0:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(u){return c(u)?o(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Gd(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function r0(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const i0={42:ut,43:ut,45:ut,48:ut,49:ut,50:ut,51:ut,52:ut,53:ut,54:ut,55:ut,56:ut,57:ut,62:Hd},o0={91:cw},a0={[-2]:_o,[-1]:_o,32:_o},s0={35:mw,42:Ci,45:[Xl,Ci],60:bw,61:Xl,95:Ci,96:Yl,126:Yl},l0={38:zd,92:Ud},c0={[-5]:No,[-4]:No,[-3]:No,33:jw,38:zd,42:Aa,60:[Bx,Aw],91:Bw,92:[hw,Ud],93:gs,95:Aa,96:Jx},u0={null:[Aa,e0]},d0={null:[42,95]},f0={null:[]},h0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:d0,contentInitial:o0,disable:f0,document:i0,flow:s0,flowInitial:a0,insideSpan:u0,string:l0,text:c0},Symbol.toStringTag,{value:"Module"}));function p0(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],s=[];const l={attempt:S(I),check:S(C),consume:x,enter:w,exit:R,interrupt:S(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function d(D){return a=Ct(a,D),y(),a[a.length-1]!==null?[]:(N(t,0),c.events=lo(o,c.events,c),c.events)}function h(D,L){return g0(f(D),L)}function f(D){return m0(a,D)}function m(){const{_bufferIndex:D,_index:L,line:K,column:B,offset:V}=r;return{_bufferIndex:D,_index:L,line:K,column:B,offset:V}}function p(D){i[D.line]=D.column,T()}function y(){let D;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)b(L.charCodeAt(r._bufferIndex));else b(L)}}function b(D){u=u(D)}function x(D){ie(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,T()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function w(D,L){const K=L||{};return K.type=D,K.start=m(),c.events.push(["enter",K,c]),s.push(K),K}function R(D){const L=s.pop();return L.end=m(),c.events.push(["exit",L,c]),L}function I(D,L){N(D,L.from)}function C(D,L){L.restore()}function S(D,L){return K;function K(B,V,q){let Q,$,F,k;return Array.isArray(B)?te(B):"tokenize"in B?te([B]):se(B);function se(ge){return W;function W(ye){const Le=ye!==null&&ge[ye],be=ye!==null&&ge.null,we=[...Array.isArray(Le)?Le:Le?[Le]:[],...Array.isArray(be)?be:be?[be]:[]];return te(we)(ye)}}function te(ge){return Q=ge,$=0,ge.length===0?q:E(ge[$])}function E(ge){return W;function W(ye){return k=j(),F=ge,ge.partial||(c.currentConstruct=ge),ge.name&&c.parser.constructs.disable.null.includes(ge.name)?fe():ge.tokenize.call(L?Object.assign(Object.create(c),L):c,l,oe,fe)(ye)}}function oe(ge){return D(F,k),V}function fe(ge){return k.restore(),++$<Q.length?E(Q[$]):q}}}function N(D,L){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&xt(c.events,L,c.events.length-L,D.resolve(c.events.slice(L),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function j(){const D=m(),L=c.previous,K=c.currentConstruct,B=c.events.length,V=Array.from(s);return{from:B,restore:q};function q(){r=D,c.previous=L,c.currentConstruct=K,c.events.length=B,s=V,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function m0(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function g0(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
131
131
  `;break}case-3:{a=`\r
132
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function y0(e){const r={constructs:Fd([h0,...(e||{}).extensions||[]]),content:i(Ox),defined:[],document:i(Dx),flow:i(Jw),lazy:{},string:i(t0),text:i(n0)};return r;function i(o){return a;function a(s){return p0(r,o,s)}}}function b0(e){for(;!$d(e););return e}const Jl=/[\0\t\n\r]/g;function v0(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,u,d,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(Jl.lastIndex=d,c=Jl.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){t=o.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(o.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const x0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function w0(e){return e.replace(x0,k0)}function k0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Bd(n.slice(o?2:1),o?16:10)}return ms(n)||e}const Yd={}.hasOwnProperty;function S0(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),E0(n)(b0(y0(n).document().write(v0()(e,t,!0))))}function E0(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Cn),autolinkProtocol:j,autolinkEmail:j,atxHeading:o(Mt),blockQuote:o(ve),characterEscape:j,characterReference:j,codeFenced:o(we),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(we,a),codeText:o(de,a),codeTextData:j,data:j,codeFlowValue:j,definition:o(Be),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(lt),hardBreakEscape:o(Je),hardBreakTrailing:o(Je),htmlFlow:o(jt,a),htmlFlowData:j,htmlText:o(jt,a),htmlTextData:j,image:o(En),label:a,link:o(Cn),listItem:o(Qt),listItemValue:h,listOrdered:o(An,d),listUnordered:o(An),paragraph:o(Gn),reference:E,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Mt),strong:o(At),thematicBreak:o(Xt)},exit:{atxHeading:l(),atxHeadingSequence:I,autolink:l(),autolinkEmail:Le,autolinkProtocol:ye,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ge,characterReference:W,codeFenced:l(y),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(v),codeText:l(V),codeTextData:T,data:T,definition:l(),definitionDestinationString:R,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(K),htmlFlowData:T,htmlText:l(B),htmlTextData:T,image:l(Q),label:F,labelText:$,lineEnding:_,link:l(q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:S,resourceTitleString:se,resource:te,setextHeading:l(D),setextHeadingLineSequence:k,setextHeadingText:C,strong:l(),thematicBreak:l()}};Qd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(N){let H={type:"root",children:[]};const ne={stack:[H],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},ae=[];let Se=-1;for(;++Se<N.length;)if(N[Se][1].type==="listOrdered"||N[Se][1].type==="listUnordered")if(N[Se][0]==="enter")ae.push(Se);else{const Qe=ae.pop();Se=i(N,Qe,Se)}for(Se=-1;++Se<N.length;){const Qe=t[N[Se][0]];Yd.call(Qe,N[Se][1].type)&&Qe[N[Se][1].type].call(Object.assign({sliceSerialize:N[Se][2].sliceSerialize},ne),N[Se][1])}if(ne.tokenStack.length>0){const Qe=ne.tokenStack[ne.tokenStack.length-1];(Qe[1]||Zl).call(ne,void 0,Qe[0])}for(H.position={start:fn(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:fn(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<t.transforms.length;)H=t.transforms[Se](H)||H;return H}function i(N,H,ne){let ae=H-1,Se=-1,Qe=!1,St,ze,ot,Rt;for(;++ae<=ne;){const He=N[ae];switch(He[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{He[0]==="enter"?Se++:Se--,Rt=void 0;break}case"lineEndingBlank":{He[0]==="enter"&&(St&&!Rt&&!Se&&!ot&&(ot=ae),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!Se&&He[0]==="enter"&&He[1].type==="listItemPrefix"||Se===-1&&He[0]==="exit"&&(He[1].type==="listUnordered"||He[1].type==="listOrdered")){if(St){let Ft=ae;for(ze=void 0;Ft--;){const ct=N[Ft];if(ct[1].type==="lineEnding"||ct[1].type==="lineEndingBlank"){if(ct[0]==="exit")continue;ze&&(N[ze][1].type="lineEndingBlank",Qe=!0),ct[1].type="lineEnding",ze=Ft}else if(!(ct[1].type==="linePrefix"||ct[1].type==="blockQuotePrefix"||ct[1].type==="blockQuotePrefixWhitespace"||ct[1].type==="blockQuoteMarker"||ct[1].type==="listItemIndent"))break}ot&&(!ze||ot<ze)&&(St._spread=!0),St.end=Object.assign({},ze?N[ze][1].start:He[1].end),N.splice(ze||ae,0,["exit",St,He[2]]),ae++,ne++}if(He[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},He[1].start),end:void 0};St=Ft,N.splice(ae,0,["enter",Ft,He[2]]),ae++,ne++,ot=void 0,Rt=!0}}}return N[H][1]._spread=Qe,ne}function o(N,H){return ne;function ne(ae){s.call(this,N(ae),ae),H&&H.call(this,ae)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(N,H,ne){this.stack[this.stack.length-1].children.push(N),this.stack.push(N),this.tokenStack.push([H,ne||void 0]),N.position={start:fn(H.start),end:void 0}}function l(N){return H;function H(ne){N&&N.call(this,ne),c.call(this,ne)}}function c(N,H){const ne=this.stack.pop(),ae=this.tokenStack.pop();if(ae)ae[0].type!==N.type&&(H?H.call(this,N,ae[0]):(ae[1]||Zl).call(this,N,ae[0]));else throw new Error("Cannot close `"+N.type+"` ("+Ur({start:N.start,end:N.end})+"): it’s not open");ne.position.end=fn(N.end)}function u(){return ps(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(N){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(N),10),this.data.expectingFirstListItemValue=void 0}}function f(){const N=this.resume(),H=this.stack[this.stack.length-1];H.lang=N}function m(){const N=this.resume(),H=this.stack[this.stack.length-1];H.meta=N}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const N=this.resume(),H=this.stack[this.stack.length-1];H.value=N.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const N=this.resume(),H=this.stack[this.stack.length-1];H.value=N.replace(/(\r?\n|\r)$/g,"")}function x(N){const H=this.resume(),ne=this.stack[this.stack.length-1];ne.label=H,ne.identifier=Nt(this.sliceSerialize(N)).toLowerCase()}function w(){const N=this.resume(),H=this.stack[this.stack.length-1];H.title=N}function R(){const N=this.resume(),H=this.stack[this.stack.length-1];H.url=N}function I(N){const H=this.stack[this.stack.length-1];if(!H.depth){const ne=this.sliceSerialize(N).length;H.depth=ne}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function k(N){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(N).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function j(N){const ne=this.stack[this.stack.length-1].children;let ae=ne[ne.length-1];(!ae||ae.type!=="text")&&(ae=Tt(),ae.position={start:fn(N.start),end:void 0},ne.push(ae)),this.stack.push(ae)}function T(N){const H=this.stack.pop();H.value+=this.sliceSerialize(N),H.position.end=fn(N.end)}function _(N){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=H.children[H.children.length-1];ne.position.end=fn(N.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&(j.call(this,N),T.call(this,N))}function L(){this.data.atHardBreak=!0}function K(){const N=this.resume(),H=this.stack[this.stack.length-1];H.value=N}function B(){const N=this.resume(),H=this.stack[this.stack.length-1];H.value=N}function V(){const N=this.resume(),H=this.stack[this.stack.length-1];H.value=N}function q(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=H,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function Q(){const N=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=H,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function $(N){const H=this.sliceSerialize(N),ne=this.stack[this.stack.length-2];ne.label=w0(H),ne.identifier=Nt(H).toLowerCase()}function F(){const N=this.stack[this.stack.length-1],H=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const ae=N.children;ne.children=ae}else ne.alt=H}function S(){const N=this.resume(),H=this.stack[this.stack.length-1];H.url=N}function se(){const N=this.resume(),H=this.stack[this.stack.length-1];H.title=N}function te(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function oe(N){const H=this.resume(),ne=this.stack[this.stack.length-1];ne.label=H,ne.identifier=Nt(this.sliceSerialize(N)).toLowerCase(),this.data.referenceType="full"}function fe(N){this.data.characterReferenceType=N.type}function ge(N){const H=this.sliceSerialize(N),ne=this.data.characterReferenceType;let ae;ne?(ae=Bd(H,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ae=ms(H);const Se=this.stack[this.stack.length-1];Se.value+=ae}function W(N){const H=this.stack.pop();H.position.end=fn(N.end)}function ye(N){T.call(this,N);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(N)}function Le(N){T.call(this,N);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(N)}function ve(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function lt(){return{type:"emphasis",children:[]}}function Mt(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function jt(){return{type:"html",value:""}}function En(){return{type:"image",title:null,url:"",alt:null}}function Cn(){return{type:"link",title:null,url:"",children:[]}}function An(N){return{type:"list",ordered:N.type==="listOrdered",start:null,spread:N._spread,children:[]}}function Qt(N){return{type:"listItem",spread:N._spread,checked:null,children:[]}}function Gn(){return{type:"paragraph",children:[]}}function At(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function Xt(){return{type:"thematicBreak"}}}function fn(e){return{line:e.line,column:e.column,offset:e.offset}}function Qd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Qd(e,r):C0(e,r)}}function C0(e,t){let n;for(n in t)if(Yd.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Zl(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ur({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ur({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ur({start:t.start,end:t.end})+") is still open")}function A0(e){const t=this;t.parser=n;function n(r){return S0(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function T0(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function R0(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
132
+ `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function y0(e){const r={constructs:Fd([h0,...(e||{}).extensions||[]]),content:i(Ox),defined:[],document:i(Nx),flow:i(Jw),lazy:{},string:i(t0),text:i(n0)};return r;function i(o){return a;function a(s){return p0(r,o,s)}}}function v0(e){for(;!$d(e););return e}const Jl=/[\0\t\n\r]/g;function b0(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,u,d,h,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(Jl.lastIndex=d,c=Jl.exec(o),h=c&&c.index!==void 0?c.index:o.length,f=o.charCodeAt(h),!c){t=o.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(o.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const x0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function w0(e){return e.replace(x0,S0)}function S0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Bd(n.slice(o?2:1),o?16:10)}return ms(n)||e}const Yd={}.hasOwnProperty;function k0(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),E0(n)(v0(y0(n).document().write(b0()(e,t,!0))))}function E0(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Cn),autolinkProtocol:j,autolinkEmail:j,atxHeading:o(Mt),blockQuote:o(be),characterEscape:j,characterReference:j,codeFenced:o(we),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(we,a),codeText:o(de,a),codeTextData:j,data:j,codeFlowValue:j,definition:o(Be),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(lt),hardBreakEscape:o(Je),hardBreakTrailing:o(Je),htmlFlow:o(jt,a),htmlFlowData:j,htmlText:o(jt,a),htmlTextData:j,image:o(En),label:a,link:o(Cn),listItem:o(Qt),listItemValue:h,listOrdered:o(An,d),listUnordered:o(An),paragraph:o(Gn),reference:E,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(Mt),strong:o(At),thematicBreak:o(Xt)},exit:{atxHeading:l(),atxHeadingSequence:I,autolink:l(),autolinkEmail:Le,autolinkProtocol:ye,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ge,characterReference:W,codeFenced:l(y),codeFencedFence:p,codeFencedFenceInfo:f,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(b),codeText:l(V),codeTextData:T,data:T,definition:l(),definitionDestinationString:R,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(K),htmlFlowData:T,htmlText:l(B),htmlTextData:T,image:l(Q),label:F,labelText:$,lineEnding:D,link:l(q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:k,resourceTitleString:se,resource:te,setextHeading:l(N),setextHeadingLineSequence:S,setextHeadingText:C,strong:l(),thematicBreak:l()}};Qd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let U={type:"root",children:[]};const ne={stack:[U],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},ae=[];let ke=-1;for(;++ke<_.length;)if(_[ke][1].type==="listOrdered"||_[ke][1].type==="listUnordered")if(_[ke][0]==="enter")ae.push(ke);else{const Qe=ae.pop();ke=i(_,Qe,ke)}for(ke=-1;++ke<_.length;){const Qe=t[_[ke][0]];Yd.call(Qe,_[ke][1].type)&&Qe[_[ke][1].type].call(Object.assign({sliceSerialize:_[ke][2].sliceSerialize},ne),_[ke][1])}if(ne.tokenStack.length>0){const Qe=ne.tokenStack[ne.tokenStack.length-1];(Qe[1]||Zl).call(ne,void 0,Qe[0])}for(U.position={start:fn(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:fn(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke<t.transforms.length;)U=t.transforms[ke](U)||U;return U}function i(_,U,ne){let ae=U-1,ke=-1,Qe=!1,kt,ze,ot,Rt;for(;++ae<=ne;){const Ue=_[ae];switch(Ue[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ue[0]==="enter"?ke++:ke--,Rt=void 0;break}case"lineEndingBlank":{Ue[0]==="enter"&&(kt&&!Rt&&!ke&&!ot&&(ot=ae),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!ke&&Ue[0]==="enter"&&Ue[1].type==="listItemPrefix"||ke===-1&&Ue[0]==="exit"&&(Ue[1].type==="listUnordered"||Ue[1].type==="listOrdered")){if(kt){let Ft=ae;for(ze=void 0;Ft--;){const ct=_[Ft];if(ct[1].type==="lineEnding"||ct[1].type==="lineEndingBlank"){if(ct[0]==="exit")continue;ze&&(_[ze][1].type="lineEndingBlank",Qe=!0),ct[1].type="lineEnding",ze=Ft}else if(!(ct[1].type==="linePrefix"||ct[1].type==="blockQuotePrefix"||ct[1].type==="blockQuotePrefixWhitespace"||ct[1].type==="blockQuoteMarker"||ct[1].type==="listItemIndent"))break}ot&&(!ze||ot<ze)&&(kt._spread=!0),kt.end=Object.assign({},ze?_[ze][1].start:Ue[1].end),_.splice(ze||ae,0,["exit",kt,Ue[2]]),ae++,ne++}if(Ue[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},Ue[1].start),end:void 0};kt=Ft,_.splice(ae,0,["enter",Ft,Ue[2]]),ae++,ne++,ot=void 0,Rt=!0}}}return _[U][1]._spread=Qe,ne}function o(_,U){return ne;function ne(ae){s.call(this,_(ae),ae),U&&U.call(this,ae)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(_,U,ne){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([U,ne||void 0]),_.position={start:fn(U.start),end:void 0}}function l(_){return U;function U(ne){_&&_.call(this,ne),c.call(this,ne)}}function c(_,U){const ne=this.stack.pop(),ae=this.tokenStack.pop();if(ae)ae[0].type!==_.type&&(U?U.call(this,_,ae[0]):(ae[1]||Zl).call(this,_,ae[0]));else throw new Error("Cannot close `"+_.type+"` ("+Hr({start:_.start,end:_.end})+"): it’s not open");ne.position.end=fn(_.end)}function u(){return ps(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(_){if(this.data.expectingFirstListItemValue){const U=this.stack[this.stack.length-2];U.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function f(){const _=this.resume(),U=this.stack[this.stack.length-1];U.lang=_}function m(){const _=this.resume(),U=this.stack[this.stack.length-1];U.meta=_}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_.replace(/(\r?\n|\r)$/g,"")}function x(_){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.label=U,ne.identifier=_t(this.sliceSerialize(_)).toLowerCase()}function w(){const _=this.resume(),U=this.stack[this.stack.length-1];U.title=_}function R(){const _=this.resume(),U=this.stack[this.stack.length-1];U.url=_}function I(_){const U=this.stack[this.stack.length-1];if(!U.depth){const ne=this.sliceSerialize(_).length;U.depth=ne}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function S(_){const U=this.stack[this.stack.length-1];U.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function j(_){const ne=this.stack[this.stack.length-1].children;let ae=ne[ne.length-1];(!ae||ae.type!=="text")&&(ae=Tt(),ae.position={start:fn(_.start),end:void 0},ne.push(ae)),this.stack.push(ae)}function T(_){const U=this.stack.pop();U.value+=this.sliceSerialize(_),U.position.end=fn(_.end)}function D(_){const U=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ne=U.children[U.children.length-1];ne.position.end=fn(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(U.type)&&(j.call(this,_),T.call(this,_))}function L(){this.data.atHardBreak=!0}function K(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_}function B(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_}function V(){const _=this.resume(),U=this.stack[this.stack.length-1];U.value=_}function q(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=U,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function Q(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const U=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=U,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function $(_){const U=this.sliceSerialize(_),ne=this.stack[this.stack.length-2];ne.label=w0(U),ne.identifier=_t(U).toLowerCase()}function F(){const _=this.stack[this.stack.length-1],U=this.resume(),ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,ne.type==="link"){const ae=_.children;ne.children=ae}else ne.alt=U}function k(){const _=this.resume(),U=this.stack[this.stack.length-1];U.url=_}function se(){const _=this.resume(),U=this.stack[this.stack.length-1];U.title=_}function te(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function oe(_){const U=this.resume(),ne=this.stack[this.stack.length-1];ne.label=U,ne.identifier=_t(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function fe(_){this.data.characterReferenceType=_.type}function ge(_){const U=this.sliceSerialize(_),ne=this.data.characterReferenceType;let ae;ne?(ae=Bd(U,ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ae=ms(U);const ke=this.stack[this.stack.length-1];ke.value+=ae}function W(_){const U=this.stack.pop();U.position.end=fn(_.end)}function ye(_){T.call(this,_);const U=this.stack[this.stack.length-1];U.url=this.sliceSerialize(_)}function Le(_){T.call(this,_);const U=this.stack[this.stack.length-1];U.url="mailto:"+this.sliceSerialize(_)}function be(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function lt(){return{type:"emphasis",children:[]}}function Mt(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function jt(){return{type:"html",value:""}}function En(){return{type:"image",title:null,url:"",alt:null}}function Cn(){return{type:"link",title:null,url:"",children:[]}}function An(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[]}}function Qt(_){return{type:"listItem",spread:_._spread,checked:null,children:[]}}function Gn(){return{type:"paragraph",children:[]}}function At(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function Xt(){return{type:"thematicBreak"}}}function fn(e){return{line:e.line,column:e.column,offset:e.offset}}function Qd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Qd(e,r):C0(e,r)}}function C0(e,t){let n;for(n in t)if(Yd.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Zl(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Hr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Hr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Hr({start:t.start,end:t.end})+") is still open")}function A0(e){const t=this;t.parser=n;function n(r){return k0(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function T0(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function R0(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
133
133
  `}]}function P0(e,t){const n=t.value?t.value+`
134
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function I0(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L0(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O0(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=vr(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function N0(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D0(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Xd(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function _0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xd(e,t);const i={src:vr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function M0(e,t){const n={src:vr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function j0(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function F0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xd(e,t);const i={href:vr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function B0(e,t){const n={href:vr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function U0(e,t,n){const r=e.all(t),i=n?H0(n):Jd(t),o={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const u=r[s];(i||s!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
134
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function I0(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L0(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O0(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=br(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function _0(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function N0(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Xd(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function D0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xd(e,t);const i={src:br(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function M0(e,t){const n={src:br(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function j0(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function F0(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xd(e,t);const i={href:br(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function B0(e,t){const n={href:br(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function H0(e,t,n){const r=e.all(t),i=n?U0(n):Jd(t),o={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const u=r[s];(i||s!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
135
135
  `}),u.type==="element"&&u.tagName==="p"&&!i?a.push(...u.children):a.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
136
- `});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function H0(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Jd(n[r])}return t}function Jd(e){const t=e.spread;return t??e.children.length>1}function z0(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function $0(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V0(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function W0(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function K0(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=us(t.children[1]),l=Ld(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function q0(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const d=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let m={type:"element",tagName:o,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function G0(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ec=9,tc=32;function Y0(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(nc(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(nc(t.slice(i),i>0,!1)),o.join("")}function nc(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===ec||o===tc;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===ec||o===tc;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Q0(e,t){const n={type:"text",value:Y0(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function X0(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const J0={blockquote:T0,break:R0,code:P0,delete:I0,emphasis:L0,footnoteReference:O0,heading:N0,html:D0,imageReference:_0,image:M0,inlineCode:j0,linkReference:F0,link:B0,listItem:U0,list:z0,paragraph:$0,root:V0,strong:W0,table:K0,tableCell:G0,tableRow:q0,text:Q0,thematicBreak:X0,toml:fi,yaml:fi,definition:fi,footnoteDefinition:fi};function fi(){}const Zd=-1,co=0,zr=1,Bi=2,ys=3,bs=4,vs=5,xs=6,ef=7,tf=8,Z0=typeof self=="object"?self:globalThis,rc=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Z0[e](t)},ek=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case co:case Zd:return n(a,i);case zr:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Bi:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case ys:return n(new Date(a),i);case bs:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case vs:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case xs:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case ef:{const{name:s,message:l}=a;return n(rc(s,l),i)}case tf:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(rc(o,a),i)};return r},ic=e=>ek(new Map,e)(0),Zn="",{toString:tk}={},{keys:nk}=Object,Mr=e=>{const t=typeof e;if(t!=="object"||!e)return[co,t];const n=tk.call(e).slice(8,-1);switch(n){case"Array":return[zr,Zn];case"Object":return[Bi,Zn];case"Date":return[ys,Zn];case"RegExp":return[bs,Zn];case"Map":return[vs,Zn];case"Set":return[xs,Zn];case"DataView":return[zr,n]}return n.includes("Array")?[zr,n]:n.includes("Error")?[ef,n]:[Bi,n]},hi=([e,t])=>e===co&&(t==="function"||t==="symbol"),rk=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=Mr(a);switch(s){case co:{let u=a;switch(l){case"bigint":s=tf,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Zd],a)}return i([s,u],a)}case zr:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const u=[],d=i([s,u],a);for(const h of a)u.push(o(h));return d}case Bi:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const u=[],d=i([s,u],a);for(const h of nk(a))(e||!hi(Mr(a[h])))&&u.push([o(h),o(a[h])]);return d}case ys:return i([s,a.toISOString()],a);case bs:{const{source:u,flags:d}=a;return i([s,{source:u,flags:d}],a)}case vs:{const u=[],d=i([s,u],a);for(const[h,f]of a)(e||!(hi(Mr(h))||hi(Mr(f))))&&u.push([o(h),o(f)]);return d}case xs:{const u=[],d=i([s,u],a);for(const h of a)(e||!hi(Mr(h)))&&u.push(o(h));return d}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},oc=(e,{json:t,lossy:n}={})=>{const r=[];return rk(!(t||n),!!t,new Map,r)(e),r},Ui=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ic(oc(e,t)):structuredClone(e):(e,t)=>ic(oc(e,t));function ik(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function ok(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ak(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ik,r=e.options.footnoteBackLabel||ok,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=vr(d.toLowerCase());let f=0;const m=[],p=e.footnoteCounts.get(d);for(;p!==void 0&&++f<=p;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,f);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else u.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,v),s.push(v)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ui(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
136
+ `});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function U0(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Jd(n[r])}return t}function Jd(e){const t=e.spread;return t??e.children.length>1}function z0(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function $0(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V0(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function W0(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function K0(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=us(t.children[1]),l=Ld(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function q0(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const d=t.children[l],h={},f=a?a[l]:void 0;f&&(h.align=f);let m={type:"element",tagName:o,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function G0(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ec=9,tc=32;function Y0(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(nc(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(nc(t.slice(i),i>0,!1)),o.join("")}function nc(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===ec||o===tc;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===ec||o===tc;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Q0(e,t){const n={type:"text",value:Y0(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function X0(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const J0={blockquote:T0,break:R0,code:P0,delete:I0,emphasis:L0,footnoteReference:O0,heading:_0,html:N0,imageReference:D0,image:M0,inlineCode:j0,linkReference:F0,link:B0,listItem:H0,list:z0,paragraph:$0,root:V0,strong:W0,table:K0,tableCell:G0,tableRow:q0,text:Q0,thematicBreak:X0,toml:fi,yaml:fi,definition:fi,footnoteDefinition:fi};function fi(){}const Zd=-1,co=0,zr=1,Bi=2,ys=3,vs=4,bs=5,xs=6,ef=7,tf=8,Z0=typeof self=="object"?self:globalThis,rc=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Z0[e](t)},eS=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case co:case Zd:return n(a,i);case zr:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Bi:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case ys:return n(new Date(a),i);case vs:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case bs:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case xs:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case ef:{const{name:s,message:l}=a;return n(rc(s,l),i)}case tf:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(rc(o,a),i)};return r},ic=e=>eS(new Map,e)(0),Zn="",{toString:tS}={},{keys:nS}=Object,Mr=e=>{const t=typeof e;if(t!=="object"||!e)return[co,t];const n=tS.call(e).slice(8,-1);switch(n){case"Array":return[zr,Zn];case"Object":return[Bi,Zn];case"Date":return[ys,Zn];case"RegExp":return[vs,Zn];case"Map":return[bs,Zn];case"Set":return[xs,Zn];case"DataView":return[zr,n]}return n.includes("Array")?[zr,n]:n.includes("Error")?[ef,n]:[Bi,n]},hi=([e,t])=>e===co&&(t==="function"||t==="symbol"),rS=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=Mr(a);switch(s){case co:{let u=a;switch(l){case"bigint":s=tf,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([Zd],a)}return i([s,u],a)}case zr:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const u=[],d=i([s,u],a);for(const h of a)u.push(o(h));return d}case Bi:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const u=[],d=i([s,u],a);for(const h of nS(a))(e||!hi(Mr(a[h])))&&u.push([o(h),o(a[h])]);return d}case ys:return i([s,a.toISOString()],a);case vs:{const{source:u,flags:d}=a;return i([s,{source:u,flags:d}],a)}case bs:{const u=[],d=i([s,u],a);for(const[h,f]of a)(e||!(hi(Mr(h))||hi(Mr(f))))&&u.push([o(h),o(f)]);return d}case xs:{const u=[],d=i([s,u],a);for(const h of a)(e||!hi(Mr(h)))&&u.push(o(h));return d}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},oc=(e,{json:t,lossy:n}={})=>{const r=[];return rS(!(t||n),!!t,new Map,r)(e),r},Hi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ic(oc(e,t)):structuredClone(e):(e,t)=>ic(oc(e,t));function iS(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oS(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aS(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||iS,r=e.options.footnoteBackLabel||oS,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=br(d.toLowerCase());let f=0;const m=[],p=e.footnoteCounts.get(d);for(;p!==void 0&&++f<=p;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,f);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else u.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,b),s.push(b)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Hi(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
137
137
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
138
- `}]}}const uo=function(e){if(e==null)return uk;if(typeof e=="function")return fo(e);if(typeof e=="object")return Array.isArray(e)?sk(e):lk(e);if(typeof e=="string")return ck(e);throw new Error("Expected function, string, or object as test")};function sk(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=uo(e[n]);return fo(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function lk(e){const t=e;return fo(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ck(e){return fo(t);function t(n){return n&&n.type===e}}function fo(e){return t;function t(n,r,i){return!!(dk(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function uk(){return!0}function dk(e){return e!==null&&typeof e=="object"&&"type"in e}const nf=[],fk=!0,Ta=!1,hk="skip";function rf(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=uo(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=nf,m,p,y;if((!t||o(l,c,u[u.length-1]||void 0))&&(f=pk(n(l,u)),f[0]===Ta))return f;if("children"in l&&l.children){const v=l;if(v.children&&f[0]!==hk)for(p=(r?v.children.length:-1)+a,y=u.concat(v);p>-1&&p<v.children.length;){const x=v.children[p];if(m=s(x,p,y)(),m[0]===Ta)return m;p=typeof m[1]=="number"?m[1]:p+a}}return f}}}function pk(e){return Array.isArray(e)?e:typeof e=="number"?[fk,e]:e==null?nf:[e]}function ws(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),rf(e,o,s,i);function s(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return a(l,d,u)}}const Ra={}.hasOwnProperty,mk={};function gk(e,t){const n=t||mk,r=new Map,i=new Map,o=new Map,a={...J0,...n.handlers},s={all:c,applyData:bk,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:yk,wrap:xk};return ws(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),s;function l(u,d){const h=u.type,f=s.handlers[h];if(Ra.call(s.handlers,h)&&f)return f(s,u,d);if(s.options.passThrough&&s.options.passThrough.includes(h)){if("children"in u){const{children:p,...y}=u,v=Ui(y);return v.children=s.all(u),v}return Ui(u)}return(s.options.unknownHandler||vk)(s,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const m=s.one(h[f],u);if(m){if(f&&h[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ac(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=ac(p.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function yk(e,t){e.position&&(t.position=ix(e))}function bk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,Ui(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function vk(e,t){const n=t.data||{},r="value"in t&&!(Ra.call(n,"hProperties")||Ra.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
138
+ `}]}}const uo=function(e){if(e==null)return uS;if(typeof e=="function")return fo(e);if(typeof e=="object")return Array.isArray(e)?sS(e):lS(e);if(typeof e=="string")return cS(e);throw new Error("Expected function, string, or object as test")};function sS(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=uo(e[n]);return fo(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function lS(e){const t=e;return fo(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function cS(e){return fo(t);function t(n){return n&&n.type===e}}function fo(e){return t;function t(n,r,i){return!!(dS(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function uS(){return!0}function dS(e){return e!==null&&typeof e=="object"&&"type"in e}const nf=[],fS=!0,Ta=!1,hS="skip";function rf(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=uo(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=nf,m,p,y;if((!t||o(l,c,u[u.length-1]||void 0))&&(f=pS(n(l,u)),f[0]===Ta))return f;if("children"in l&&l.children){const b=l;if(b.children&&f[0]!==hS)for(p=(r?b.children.length:-1)+a,y=u.concat(b);p>-1&&p<b.children.length;){const x=b.children[p];if(m=s(x,p,y)(),m[0]===Ta)return m;p=typeof m[1]=="number"?m[1]:p+a}}return f}}}function pS(e){return Array.isArray(e)?e:typeof e=="number"?[fS,e]:e==null?nf:[e]}function ws(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),rf(e,o,s,i);function s(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return a(l,d,u)}}const Ra={}.hasOwnProperty,mS={};function gS(e,t){const n=t||mS,r=new Map,i=new Map,o=new Map,a={...J0,...n.handlers},s={all:c,applyData:vS,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:yS,wrap:xS};return ws(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),s;function l(u,d){const h=u.type,f=s.handlers[h];if(Ra.call(s.handlers,h)&&f)return f(s,u,d);if(s.options.passThrough&&s.options.passThrough.includes(h)){if("children"in u){const{children:p,...y}=u,b=Hi(y);return b.children=s.all(u),b}return Hi(u)}return(s.options.unknownHandler||bS)(s,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const m=s.one(h[f],u);if(m){if(f&&h[f-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ac(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=ac(p.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function yS(e,t){e.position&&(t.position=ix(e))}function vS(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,Hi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function bS(e,t){const n=t.data||{},r="value"in t&&!(Ra.call(n,"hProperties")||Ra.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xS(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
139
139
  `});++r<e.length;)r&&n.push({type:"text",value:`
140
140
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
141
- `}),n}function ac(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sc(e,t){const n=gk(e,t),r=n.one(e,void 0),i=ak(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
142
- `},i),o}function wk(e,t){return e&&"run"in e?async function(n,r){const i=sc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return sc(n,{file:r,...e||t})}}function lc(e){if(e)throw e}var Ai=Object.prototype.hasOwnProperty,of=Object.prototype.toString,cc=Object.defineProperty,uc=Object.getOwnPropertyDescriptor,dc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):of.call(t)==="[object Array]"},fc=function(t){if(!t||of.call(t)!=="[object Object]")return!1;var n=Ai.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ai.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ai.call(t,i)},hc=function(t,n){cc&&n.name==="__proto__"?cc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},pc=function(t,n){if(n==="__proto__")if(Ai.call(t,n)){if(uc)return uc(t,n).value}else return;return t[n]},kk=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=pc(s,n),i=pc(t,n),s!==i&&(u&&i&&(fc(i)||(o=dc(i)))?(o?(o=!1,a=r&&dc(r)?r:[]):a=r&&fc(r)?r:{},hc(s,{name:n,newValue:e(u,a,i)})):typeof i<"u"&&hc(s,{name:n,newValue:i}));return s};const _o=Su(kk);function Pa(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Sk(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const u=e[++o];let d=-1;if(l){a(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?Ek(u,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Ek(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const $t={basename:Ck,dirname:Ak,extname:Tk,join:Rk,sep:"/"};function Ck(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ii(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Ak(e){if(ii(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Tk(e){ii(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Rk(...e){let t=-1,n;for(;++t<e.length;)ii(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Pk(n)}function Pk(e){ii(e);const t=e.codePointAt(0)===47;let n=Ik(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ik(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function ii(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Lk={cwd:Ok};function Ok(){return"/"}function Ia(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Nk(e){if(typeof e=="string")e=new URL(e);else if(!Ia(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Dk(e)}function Dk(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Mo=["history","path","basename","stem","extname","dirname"];class af{constructor(t){let n;t?Ia(t)?n={path:t}:typeof t=="string"||_k(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Lk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mo.length;){const o=Mo[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Mo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){Fo(t,"basename"),jo(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){mc(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(jo(t,"extname"),mc(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ia(t)&&(t=Nk(t)),Fo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){Fo(t,"stem"),jo(t,"stem"),this.path=$t.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new it(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function jo(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function Fo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _k(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Mk=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},jk={}.hasOwnProperty;class ks extends Mk{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Sk()}copy(){const t=new ks;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(_o(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ho("data",this.frozen),this.namespace[t]=n,this):jk.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ho("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=pi(t),r=this.parser||this.Parser;return Bo("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Bo("process",this.parser||this.Parser),Uo("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=pi(t),l=r.parse(s);r.run(l,s,function(u,d,h){if(u||!d||!h)return c(u);const f=d,m=r.stringify(f,h);Uk(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?a(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Bo("processSync",this.parser||this.Parser),Uo("processSync",this.compiler||this.Compiler),this.process(t,i),yc("processSync","process",n),r;function i(o,a){n=!0,lc(o),r=a}}run(t,n,r){gc(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=pi(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?s(u):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),yc("runSync","run",r),i;function o(a,s){lc(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=pi(n),i=this.compiler||this.Compiler;return Uo("stringify",i),gc(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Ho("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=_o(!0,i.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...m]=u;const p=r[h][1];Pa(p)&&Pa(f)&&(f=_o(!0,p,f)),r[h]=[c,f,...m]}}}}const Fk=new ks().freeze();function Bo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Uo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ho(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gc(e){if(!Pa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function pi(e){return Bk(e)?e:new af(e)}function Bk(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Uk(e){return typeof e=="string"||Hk(e)}function Hk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zk="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bc=[],vc={allowDangerousHtml:!0},$k=/^(https?|ircs?|mailto|xmpp)$/i,Vk=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Wk(e){const t=Kk(e),n=qk(e);return Gk(t.runSync(t.parse(n),n),e)}function Kk(e){const t=e.rehypePlugins||bc,n=e.remarkPlugins||bc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vc}:vc;return Fk().use(A0).use(n).use(wk,r).use(t)}function qk(e){const t=e.children||"",n=new af;return typeof t=="string"&&(n.value=t),n}function Gk(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||Yk;for(const u of Vk)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+zk+u.id,void 0);return ws(e,c),cx(e,{Fragment:b.Fragment,components:i,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return a?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let f;for(f in Oo)if(Object.hasOwn(Oo,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],p=Oo[f];(p===null||p.includes(u.tagName))&&(u.properties[f]=l(String(m||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(u,d,h)),f&&h&&typeof d=="number")return s&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function Yk(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||$k.test(e.slice(0,t))?e:""}function xc(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Qk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Xk(e,t,n){const i=uo((n||{}).ignore||[]),o=Jk(t);let a=-1;for(;++a<o.length;)rf(e,"text",s);function s(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],m=h?h.children:void 0;if(i(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=o[a][0],f=o[a][1];let m=0;const y=d.children.indexOf(c);let v=!1,x=[];h.lastIndex=0;let w=h.exec(c.value);for(;w;){const R=w.index,I={index:w.index,input:w.input,stack:[...u,c]};let C=f(...w,I);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=R+1:(m!==R&&x.push({type:"text",value:c.value.slice(m,R)}),Array.isArray(C)?x.push(...C):C&&x.push(C),m=R+w[0].length,v=!0),!h.global)break;w=h.exec(c.value)}return v?(m<c.value.length&&x.push({type:"text",value:c.value.slice(m)}),d.children.splice(y,1,...x)):x=[c],y+x.length}}function Jk(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([Zk(i[0]),eS(i[1])])}return t}function Zk(e){return typeof e=="string"?new RegExp(Qk(e),"g"):e}function eS(e){return typeof e=="function"?e:function(){return e}}const zo="phrasing",$o=["autolink","link","image","label"];function tS(){return{transforms:[lS],enter:{literalAutolink:rS,literalAutolinkEmail:Vo,literalAutolinkHttp:Vo,literalAutolinkWww:Vo},exit:{literalAutolink:sS,literalAutolinkEmail:aS,literalAutolinkHttp:iS,literalAutolinkWww:oS}}}function nS(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zo,notInConstruct:$o},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zo,notInConstruct:$o},{character:":",before:"[ps]",after:"\\/",inConstruct:zo,notInConstruct:$o}]}}function rS(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vo(e){this.config.enter.autolinkProtocol.call(this,e)}function iS(e){this.config.exit.autolinkProtocol.call(this,e)}function oS(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function aS(e){this.config.exit.autolinkEmail.call(this,e)}function sS(e){this.exit(e)}function lS(e){Xk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cS],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,uS]],{ignore:["link","linkReference"]})}function cS(e,t,n,r,i){let o="";if(!sf(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!dS(n)))return!1;const a=fS(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function uS(e,t,n,r){return!sf(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function dS(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function fS(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=xc(e,"(");let o=xc(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function sf(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Hn(n)||so(n))&&(!t||n!==47)}lf.peek=wS;function hS(){this.buffer()}function pS(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function mS(){this.buffer()}function gS(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function yS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bS(e){this.exit(e)}function vS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xS(e){this.exit(e)}function wS(){return"["}function lf(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function kS(){return{enter:{gfmFootnoteCallString:hS,gfmFootnoteCall:pS,gfmFootnoteDefinitionLabelString:mS,gfmFootnoteDefinition:gS},exit:{gfmFootnoteCallString:yS,gfmFootnoteCall:bS,gfmFootnoteDefinitionLabelString:vS,gfmFootnoteDefinition:xS}}}function SS(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lf},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
143
- `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?cf:ES))),c(),l}}function ES(e,t,n){return t===0?e:cf(e,t,n)}function cf(e,t,n){return(n?"":" ")+e}const CS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uf.peek=IS;function AS(){return{canContainEols:["delete"],enter:{strikethrough:RS},exit:{strikethrough:PS}}}function TS(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:CS}],handlers:{delete:uf}}}function RS(e){this.enter({type:"delete",children:[]},e)}function PS(e){this.exit(e)}function uf(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function IS(){return"~"}function LS(e){return e.length}function OS(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||LS,o=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const p=[],y=[];let v=-1;for(e[u].length>c&&(c=e[u].length);++v<e[u].length;){const x=NS(e[u][v]);if(n.alignDelimiters!==!1){const w=i(x);y[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}p.push(x)}a[u]=p,s[u]=y}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=wc(r[d]);else{const p=wc(r);for(;++d<c;)o[d]=p}d=-1;const h=[],f=[];for(;++d<c;){const p=o[d];let y="",v="";p===99?(y=":",v=":"):p===108?y=":":p===114&&(v=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[d]-y.length-v.length);const w=y+"-".repeat(x)+v;n.alignDelimiters!==!1&&(x=y.length+x+v.length,x>l[d]&&(l[d]=x),f[d]=x),h[d]=w}a.splice(1,0,h),s.splice(1,0,f),u=-1;const m=[];for(;++u<a.length;){const p=a[u],y=s[u];d=-1;const v=[];for(;++d<c;){const x=p[d]||"";let w="",R="";if(n.alignDelimiters!==!1){const I=l[d]-(y[d]||0),C=o[d];C===114?w=" ".repeat(I):C===99?I%2?(w=" ".repeat(I/2+.5),R=" ".repeat(I/2-.5)):(w=" ".repeat(I/2),R=w):R=" ".repeat(I)}n.delimiterStart!==!1&&!d&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(x),n.alignDelimiters!==!1&&v.push(R),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&v.push("|")}m.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return m.join(`
144
- `)}function NS(e){return e==null?"":String(e)}function wc(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function DS(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),_S);return i(),a}function _S(e,t,n){return">"+(n?"":" ")+e}function MS(e,t){return kc(e,t.inConstruct,!0)&&!kc(e,t.notInConstruct,!1)}function kc(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Sc(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
145
- `&&MS(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
146
- `}function jS(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function FS(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function BS(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function US(e,t,n,r){const i=BS(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(FS(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(o,HS);return d(),h}const s=n.createTracker(r),l=i.repeat(Math.max(jS(o,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:`
141
+ `}),n}function ac(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sc(e,t){const n=gS(e,t),r=n.one(e,void 0),i=aS(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
142
+ `},i),o}function wS(e,t){return e&&"run"in e?async function(n,r){const i=sc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return sc(n,{file:r,...e||t})}}function lc(e){if(e)throw e}var Ai=Object.prototype.hasOwnProperty,of=Object.prototype.toString,cc=Object.defineProperty,uc=Object.getOwnPropertyDescriptor,dc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):of.call(t)==="[object Array]"},fc=function(t){if(!t||of.call(t)!=="[object Object]")return!1;var n=Ai.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ai.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ai.call(t,i)},hc=function(t,n){cc&&n.name==="__proto__"?cc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},pc=function(t,n){if(n==="__proto__")if(Ai.call(t,n)){if(uc)return uc(t,n).value}else return;return t[n]},SS=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=pc(s,n),i=pc(t,n),s!==i&&(u&&i&&(fc(i)||(o=dc(i)))?(o?(o=!1,a=r&&dc(r)?r:[]):a=r&&fc(r)?r:{},hc(s,{name:n,newValue:e(u,a,i)})):typeof i<"u"&&hc(s,{name:n,newValue:i}));return s};const Do=ku(SS);function Pa(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function kS(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const u=e[++o];let d=-1;if(l){a(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?ES(u,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function ES(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return i(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const $t={basename:CS,dirname:AS,extname:TS,join:RS,sep:"/"};function CS(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ii(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function AS(e){if(ii(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function TS(e){ii(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function RS(...e){let t=-1,n;for(;++t<e.length;)ii(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PS(n)}function PS(e){ii(e);const t=e.codePointAt(0)===47;let n=IS(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function IS(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function ii(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const LS={cwd:OS};function OS(){return"/"}function Ia(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _S(e){if(typeof e=="string")e=new URL(e);else if(!Ia(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return NS(e)}function NS(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Mo=["history","path","basename","stem","extname","dirname"];class af{constructor(t){let n;t?Ia(t)?n={path:t}:typeof t=="string"||DS(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":LS.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mo.length;){const o=Mo[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Mo.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){Fo(t,"basename"),jo(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){mc(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(jo(t,"extname"),mc(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ia(t)&&(t=_S(t)),Fo(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){Fo(t,"stem"),jo(t,"stem"),this.path=$t.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new it(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function jo(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function Fo(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function DS(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const MS=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},jS={}.hasOwnProperty;class Ss extends MS{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kS()}copy(){const t=new Ss;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Do(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Uo("data",this.frozen),this.namespace[t]=n,this):jS.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Uo("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=pi(t),r=this.parser||this.Parser;return Bo("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Bo("process",this.parser||this.Parser),Ho("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=pi(t),l=r.parse(s);r.run(l,s,function(u,d,h){if(u||!d||!h)return c(u);const f=d,m=r.stringify(f,h);HS(m)?h.value=m:h.result=m,c(u,h)});function c(u,d){u||!d?a(u):o?o(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Bo("processSync",this.parser||this.Parser),Ho("processSync",this.compiler||this.Compiler),this.process(t,i),yc("processSync","process",n),r;function i(o,a){n=!0,lc(o),r=a}}run(t,n,r){gc(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=pi(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?s(u):a?a(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),yc("runSync","run",r),i;function o(a,s){lc(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=pi(n),i=this.compiler||this.Compiler;return Ho("stringify",i),gc(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Uo("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=Do(!0,i.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];o(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...m]=u;const p=r[h][1];Pa(p)&&Pa(f)&&(f=Do(!0,p,f)),r[h]=[c,f,...m]}}}}const FS=new Ss().freeze();function Bo(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ho(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Uo(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gc(e){if(!Pa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function pi(e){return BS(e)?e:new af(e)}function BS(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function HS(e){return typeof e=="string"||US(e)}function US(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zS="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vc=[],bc={allowDangerousHtml:!0},$S=/^(https?|ircs?|mailto|xmpp)$/i,VS=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function WS(e){const t=KS(e),n=qS(e);return GS(t.runSync(t.parse(n),n),e)}function KS(e){const t=e.rehypePlugins||vc,n=e.remarkPlugins||vc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bc}:bc;return FS().use(A0).use(n).use(wS,r).use(t)}function qS(e){const t=e.children||"",n=new af;return typeof t=="string"&&(n.value=t),n}function GS(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||YS;for(const u of VS)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+zS+u.id,void 0);return ws(e,c),cx(e,{Fragment:v.Fragment,components:i,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function c(u,d,h){if(u.type==="raw"&&h&&typeof d=="number")return a?h.children.splice(d,1):h.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let f;for(f in Oo)if(Object.hasOwn(Oo,f)&&Object.hasOwn(u.properties,f)){const m=u.properties[f],p=Oo[f];(p===null||p.includes(u.tagName))&&(u.properties[f]=l(String(m||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):o?o.includes(u.tagName):!1;if(!f&&r&&typeof d=="number"&&(f=!r(u,d,h)),f&&h&&typeof d=="number")return s&&u.children?h.children.splice(d,1,...u.children):h.children.splice(d,1),d}}}function YS(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||$S.test(e.slice(0,t))?e:""}function xc(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function QS(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function XS(e,t,n){const i=uo((n||{}).ignore||[]),o=JS(t);let a=-1;for(;++a<o.length;)rf(e,"text",s);function s(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],m=h?h.children:void 0;if(i(f,m?m.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=o[a][0],f=o[a][1];let m=0;const y=d.children.indexOf(c);let b=!1,x=[];h.lastIndex=0;let w=h.exec(c.value);for(;w;){const R=w.index,I={index:w.index,input:w.input,stack:[...u,c]};let C=f(...w,I);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=R+1:(m!==R&&x.push({type:"text",value:c.value.slice(m,R)}),Array.isArray(C)?x.push(...C):C&&x.push(C),m=R+w[0].length,b=!0),!h.global)break;w=h.exec(c.value)}return b?(m<c.value.length&&x.push({type:"text",value:c.value.slice(m)}),d.children.splice(y,1,...x)):x=[c],y+x.length}}function JS(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([ZS(i[0]),ek(i[1])])}return t}function ZS(e){return typeof e=="string"?new RegExp(QS(e),"g"):e}function ek(e){return typeof e=="function"?e:function(){return e}}const zo="phrasing",$o=["autolink","link","image","label"];function tk(){return{transforms:[lk],enter:{literalAutolink:rk,literalAutolinkEmail:Vo,literalAutolinkHttp:Vo,literalAutolinkWww:Vo},exit:{literalAutolink:sk,literalAutolinkEmail:ak,literalAutolinkHttp:ik,literalAutolinkWww:ok}}}function nk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zo,notInConstruct:$o},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zo,notInConstruct:$o},{character:":",before:"[ps]",after:"\\/",inConstruct:zo,notInConstruct:$o}]}}function rk(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Vo(e){this.config.enter.autolinkProtocol.call(this,e)}function ik(e){this.config.exit.autolinkProtocol.call(this,e)}function ok(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function ak(e){this.config.exit.autolinkEmail.call(this,e)}function sk(e){this.exit(e)}function lk(e){XS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ck],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,uk]],{ignore:["link","linkReference"]})}function ck(e,t,n,r,i){let o="";if(!sf(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!dk(n)))return!1;const a=fk(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function uk(e,t,n,r){return!sf(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function dk(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function fk(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=xc(e,"(");let o=xc(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function sf(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Un(n)||so(n))&&(!t||n!==47)}lf.peek=wk;function hk(){this.buffer()}function pk(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function mk(){this.buffer()}function gk(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function yk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_t(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vk(e){this.exit(e)}function bk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=_t(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xk(e){this.exit(e)}function wk(){return"["}function lf(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),a(),o+=i.move("]"),o}function Sk(){return{enter:{gfmFootnoteCallString:hk,gfmFootnoteCall:pk,gfmFootnoteDefinitionLabelString:mk,gfmFootnoteDefinition:gk},exit:{gfmFootnoteCallString:yk,gfmFootnoteCall:vk,gfmFootnoteDefinitionLabelString:bk,gfmFootnoteDefinition:xk}}}function kk(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lf},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,a){const s=o.createTracker(a);let l=s.move("[^");const c=o.enter("footnoteDefinition"),u=o.enter("label");return l+=s.move(o.safe(o.associationId(r),{before:l,after:"]"})),u(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
143
+ `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?cf:Ek))),c(),l}}function Ek(e,t,n){return t===0?e:cf(e,t,n)}function cf(e,t,n){return(n?"":" ")+e}const Ck=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uf.peek=Ik;function Ak(){return{canContainEols:["delete"],enter:{strikethrough:Rk},exit:{strikethrough:Pk}}}function Tk(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ck}],handlers:{delete:uf}}}function Rk(e){this.enter({type:"delete",children:[]},e)}function Pk(e){this.exit(e)}function uf(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),o(),a}function Ik(){return"~"}function Lk(e){return e.length}function Ok(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Lk,o=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const p=[],y=[];let b=-1;for(e[u].length>c&&(c=e[u].length);++b<e[u].length;){const x=_k(e[u][b]);if(n.alignDelimiters!==!1){const w=i(x);y[b]=w,(l[b]===void 0||w>l[b])&&(l[b]=w)}p.push(x)}a[u]=p,s[u]=y}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)o[d]=wc(r[d]);else{const p=wc(r);for(;++d<c;)o[d]=p}d=-1;const h=[],f=[];for(;++d<c;){const p=o[d];let y="",b="";p===99?(y=":",b=":"):p===108?y=":":p===114&&(b=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[d]-y.length-b.length);const w=y+"-".repeat(x)+b;n.alignDelimiters!==!1&&(x=y.length+x+b.length,x>l[d]&&(l[d]=x),f[d]=x),h[d]=w}a.splice(1,0,h),s.splice(1,0,f),u=-1;const m=[];for(;++u<a.length;){const p=a[u],y=s[u];d=-1;const b=[];for(;++d<c;){const x=p[d]||"";let w="",R="";if(n.alignDelimiters!==!1){const I=l[d]-(y[d]||0),C=o[d];C===114?w=" ".repeat(I):C===99?I%2?(w=" ".repeat(I/2+.5),R=" ".repeat(I/2-.5)):(w=" ".repeat(I/2),R=w):R=" ".repeat(I)}n.delimiterStart!==!1&&!d&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&b.push(" "),n.alignDelimiters!==!1&&b.push(w),b.push(x),n.alignDelimiters!==!1&&b.push(R),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&b.push("|")}m.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
144
+ `)}function _k(e){return e==null?"":String(e)}function wc(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Nk(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),Dk);return i(),a}function Dk(e,t,n){return">"+(n?"":" ")+e}function Mk(e,t){return Sc(e,t.inConstruct,!0)&&!Sc(e,t.notInConstruct,!1)}function Sc(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function kc(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
145
+ `&&Mk(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
146
+ `}function jk(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>a&&(a=o):o=1,i=r+t.length,r=n.indexOf(t,i);return a}function Fk(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Bk(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Hk(e,t,n,r){const i=Bk(n),o=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Fk(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(o,Uk);return d(),h}const s=n.createTracker(r),l=i.repeat(Math.max(jk(o,i)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:`
147
147
  `,encode:["`"],...s.current()})),d()}return u+=s.move(`
148
148
  `),o&&(u+=s.move(o+`
149
- `)),u+=s.move(l),c(),u}function HS(e,t,n){return(n?"":" ")+e}function Ss(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zS(e,t,n,r){const i=Ss(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
150
- `,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c}function $S(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Gr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hi(e,t,n){const r=fr(e),i=fr(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}df.peek=VS;function df(e,t,n,r){const i=$S(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=Hi(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Gr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Hi(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Gr(d));const f=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function VS(e,t,n){return n.options.emphasis||"*"}function WS(e,t){let n=!1;return ws(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ta}),!!((!e.depth||e.depth<3)&&ps(e)&&(t.options.setext||n))}function KS(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(WS(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
149
+ `)),u+=s.move(l),c(),u}function Uk(e,t,n){return(n?"":" ")+e}function ks(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zk(e,t,n,r){const i=ks(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
150
+ `,...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),a(),c}function $k(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Gr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ui(e,t,n){const r=fr(e),i=fr(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}df.peek=Vk;function df(e,t,n,r){const i=$k(n),o=n.enter("emphasis"),a=n.createTracker(r),s=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=Ui(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Gr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Ui(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Gr(d));const f=a.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function Vk(e,t,n){return n.options.emphasis||"*"}function Wk(e,t){let n=!1;return ws(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ta}),!!((!e.depth||e.depth<3)&&ps(e)&&(t.options.setext||n))}function Kk(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(Wk(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
151
151
  `,after:`
152
152
  `});return d(),u(),h+`
153
153
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
154
154
  `))+1))}const a="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");o.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
155
- `,...o.current()});return/^[\t ]/.test(c)&&(c=Gr(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}ff.peek=qS;function ff(e){return e.value||""}function qS(){return"<"}hf.peek=GS;function hf(e,t,n,r){const i=Ss(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function GS(){return"!"}pf.peek=YS;function pf(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function YS(){return"!"}mf.peek=QS;function mf(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function QS(){return"`"}function gf(e,t){const n=ps(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yf.peek=XS;function yf(e,t,n,r){const i=Ss(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(gf(e,n)){const u=n.stack;n.stack=[],s=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),s(),n.stack=u,d}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function XS(e,t,n){return gf(e,n)?"<":"["}bf.peek=JS;function bf(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function JS(){return"["}function Es(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ZS(e){const t=Es(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function e1(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function vf(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function t1(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?e1(n):Es(n);const s=e.ordered?a==="."?")":".":ZS(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),vf(n)===a&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c}function n1(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function r1(e,t,n,r){const i=n1(n);let o=n.bulletCurrent||Es(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),u);return l(),c;function u(d,h,f){return h?(f?"":" ".repeat(a))+d:(f?o:o+" ".repeat(a-o.length))+d}}function i1(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const o1=uo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function a1(e,t,n,r){return(e.children.some(function(a){return o1(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function s1(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}xf.peek=l1;function xf(e,t,n,r){const i=s1(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=Hi(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Gr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Hi(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Gr(d));const f=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function l1(e,t,n){return n.options.strong||"*"}function c1(e,t,n,r){return n.safe(e.value,r)}function u1(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function d1(e,t,n){const r=(vf(n)+(n.options.ruleSpaces?" ":"")).repeat(u1(n));return n.options.ruleSpaces?r.slice(0,-1):r}const wf={blockquote:DS,break:Sc,code:US,definition:zS,emphasis:df,hardBreak:Sc,heading:KS,html:ff,image:hf,imageReference:pf,inlineCode:mf,link:yf,linkReference:bf,list:t1,listItem:r1,paragraph:i1,root:a1,strong:xf,text:c1,thematicBreak:d1};function f1(){return{enter:{table:h1,tableData:Ec,tableHeader:Ec,tableRow:m1},exit:{codeText:g1,table:p1,tableData:Wo,tableHeader:Wo,tableRow:Wo}}}function h1(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function p1(e){this.exit(e),this.data.inTable=void 0}function m1(e){this.enter({type:"tableRow",children:[]},e)}function Wo(e){this.exit(e)}function Ec(e){this.enter({type:"tableCell",children:[]},e)}function g1(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,y1));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function y1(e,t){return t==="|"?t:e}function b1(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
156
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:s}};function a(f,m,p,y){return c(u(f,p,y),f.align)}function s(f,m,p,y){const v=d(f,p,y),x=c([v]);return x.slice(0,x.indexOf(`
157
- `))}function l(f,m,p,y){const v=p.enter("tableCell"),x=p.enter("phrasing"),w=p.containerPhrasing(f,{...y,before:o,after:o});return x(),v(),w}function c(f,m){return OS(f,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(f,m,p){const y=f.children;let v=-1;const x=[],w=m.enter("table");for(;++v<y.length;)x[v]=d(y[v],m,p);return w(),x}function d(f,m,p){const y=f.children;let v=-1;const x=[],w=m.enter("tableRow");for(;++v<y.length;)x[v]=l(y[v],f,m,p);return w(),x}function h(f,m,p){let y=wf.inlineCode(f,m,p);return p.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function v1(){return{exit:{taskListCheckValueChecked:Cc,taskListCheckValueUnchecked:Cc,paragraph:w1}}}function x1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:k1}}}function Cc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function w1(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function k1(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=wf.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+a}}function S1(){return[tS(),kS(),AS(),f1(),v1()]}function E1(e){return{extensions:[nS(),SS(e),TS(),b1(e),x1()]}}const C1={tokenize:L1,partial:!0},kf={tokenize:O1,partial:!0},Sf={tokenize:N1,partial:!0},Ef={tokenize:D1,partial:!0},A1={tokenize:_1,partial:!0},Cf={name:"wwwAutolink",tokenize:P1,previous:Tf},Af={name:"protocolAutolink",tokenize:I1,previous:Rf},ln={name:"emailAutolink",tokenize:R1,previous:Pf},Gt={};function T1(){return{text:Gt}}let In=48;for(;In<123;)Gt[In]=ln,In++,In===58?In=65:In===91&&(In=97);Gt[43]=ln;Gt[45]=ln;Gt[46]=ln;Gt[95]=ln;Gt[72]=[ln,Af];Gt[104]=[ln,Af];Gt[87]=[ln,Cf];Gt[119]=[ln,Cf];function R1(e,t,n){const r=this;let i,o;return a;function a(d){return!La(d)||!Pf.call(r,r.previous)||Cs(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return La(d)?(e.consume(d),s):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(A1,u,c)(d):d===45||d===95||nt(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&st(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function P1(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Tf.call(r,r.previous)||Cs(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(C1,e.attempt(kf,e.attempt(Sf,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function I1(e,t,n){const r=this;let i="",o=!1;return a;function a(d){return(d===72||d===104)&&Rf.call(r,r.previous)&&!Cs(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(st(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||Fi(d)||De(d)||Hn(d)||so(d)?n(d):e.attempt(kf,e.attempt(Sf,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function L1(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function O1(e,t,n){let r,i,o;return a;function a(c){return c===46||c===95?e.check(Ef,l,s)(c):c===null||De(c)||Hn(c)||c!==45&&so(c)?l(c):(o=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function l(c){return i||r||!o?n(c):t(c)}}function N1(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Ef,t,o)(a):a===null||De(a)||Hn(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function D1(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||De(s)||Hn(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||De(s)||Hn(s)?t(s):r(s)}function o(s){return st(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):st(s)?(e.consume(s),a):n(s)}}function _1(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return nt(o)?n(o):t(o)}}function Tf(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function Rf(e){return!st(e)}function Pf(e){return!(e===47||La(e))}function La(e){return e===43||e===45||e===46||e===95||nt(e)}function Cs(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const M1={tokenize:V1,partial:!0};function j1(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:H1,continuation:{tokenize:z1},exit:$1}},text:{91:{name:"gfmFootnoteCall",tokenize:U1},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:F1,resolveTo:B1}}}}function F1(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=Nt(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function B1(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function U1(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!a||d===null||d===91||De(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Nt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return De(d)||(a=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function H1(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(a>999||m===93&&!s||m===null||m===91||De(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Nt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(m)||(s=!0),a++,e.consume(m),m===92?d:u}function d(m){return m===91||m===92||m===93?(e.consume(m),a++,u):u(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),Ce(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function z1(e,t,n){return e.check(ri,t,e.attempt(M1,t,n))}function $1(e){e.exit("gfmFootnoteDefinition")}function V1(e,t,n){const r=this;return Ce(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function W1(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",u,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",d,s]],f=s.parser.constructs.insideSpan.null;f&&xt(h,h.length,0,lo(f,a.slice(c+1,l),s)),xt(h,h.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),xt(a,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const c=this.previous,u=this.events;let d=0;return h;function h(m){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const p=fr(c);if(m===126)return d>1?l(m):(a.consume(m),d++,f);if(d<2&&!n)return l(m);const y=a.exit("strikethroughSequenceTemporary"),v=fr(m);return y._open=!v||v===2&&!!p,y._close=!p||p===2&&!!v,s(m)}}}class K1{constructor(){this.map=[]}add(t,n,r){q1(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function q1(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function G1(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Y1(){return{flow:{null:{name:"table",tokenize:Q1,resolveAll:X1}}}}function Q1(e,t,n){const r=this;let i=0,o=0,a;return s;function s(T){let _=r.events.length-1;for(;_>-1;){const B=r.events[_][1].type;if(B==="lineEnding"||B==="linePrefix")_--;else break}const L=_>-1?r.events[_][1].type:null,K=L==="tableHead"||L==="tableRow"?C:l;return K===C&&r.parser.lazy[r.now().line]?n(T):K(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),c(T)}function c(T){return T===124||(a=!0,o+=1),u(T)}function u(T){return T===null?n(T):ie(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),f):n(T):ke(T)?Ce(e,u,"whitespace")(T):(o+=1,a&&(a=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),a=!0,u):(e.enter("data"),d(T)))}function d(T){return T===null||T===124||De(T)?(e.exit("data"),u(T)):(e.consume(T),T===92?h:d)}function h(T){return T===92||T===124?(e.consume(T),d):d(T)}function f(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),a=!1,ke(T)?Ce(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?y(T):T===124?(a=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):I(T)}function p(T){return ke(T)?Ce(e,y,"whitespace")(T):y(T)}function y(T){return T===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(o+=1,v(T)):T===null||ie(T)?R(T):I(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),x(T)):I(T)}function x(T){return T===45?(e.consume(T),x):T===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ke(T)?Ce(e,R,"whitespace")(T):R(T)}function R(T){return T===124?m(T):T===null||ie(T)?!a||i!==o?I(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):I(T)}function I(T){return n(T)}function C(T){return e.enter("tableRow"),k(T)}function k(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),k):T===null||ie(T)?(e.exit("tableRow"),t(T)):ke(T)?Ce(e,k,"whitespace")(T):(e.enter("data"),D(T))}function D(T){return T===null||T===124||De(T)?(e.exit("data"),k(T)):(e.consume(T),T===92?j:D)}function j(T){return T===92||T===124?(e.consume(T),D):D(T)}}function X1(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,u,d;const h=new K1;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(Ac(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])),i=m.type==="tableDelimiterRow"?2:u?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],d=mi(h,t,o,i,void 0,d),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],d=mi(h,t,o,i,void 0,d)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],d=mi(h,t,o,i,n,d)):a[1]!==0&&(d=mi(h,t,a,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Ac(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=G1(t.events,n))}return e}function mi(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},or(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=or(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=or(t.events,n[2]),u=or(t.events,n[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},or(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Ac(e,t,n,r,i){const o=[],a=or(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function or(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const J1={name:"tasklistCheck",tokenize:eE};function Z1(){return{text:{91:J1}}}function eE(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return De(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return ie(l)?t(l):ke(l)?e.check({tokenize:tE},t,n)(l):n(l)}}function tE(e,t,n){return Ce(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function nE(e){return Fd([T1(),j1(),W1(e),Y1(),Z1()])}const rE={};function iE(e){const t=this,n=e||rE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(nE(n)),o.push(S1()),a.push(E1(n))}const oE={h1:({children:e,...t})=>b.jsx("h2",{className:"mt-2 mb-1 text-base font-semibold",...t,children:e}),h2:({children:e,...t})=>b.jsx("h3",{className:"mt-2 mb-1 text-sm font-semibold",...t,children:e}),h3:({children:e,...t})=>b.jsx("h4",{className:"mt-1.5 mb-1 text-sm font-semibold",...t,children:e}),h4:({children:e,...t})=>b.jsx("h5",{className:"mt-1.5 mb-1 text-xs font-semibold uppercase tracking-wide text-text-muted",...t,children:e}),h5:({children:e,...t})=>b.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-semibold text-text-muted",...t,children:e}),h6:({children:e,...t})=>b.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-medium text-text-muted",...t,children:e}),p:({children:e,...t})=>b.jsx("p",{className:"my-1 leading-relaxed",...t,children:e}),strong:({children:e,...t})=>b.jsx("strong",{className:"font-semibold text-text",...t,children:e}),em:({children:e,...t})=>b.jsx("em",{className:"italic",...t,children:e}),a:({children:e,...t})=>b.jsx("a",{className:"text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent",target:"_blank",rel:"noreferrer",...t,children:e}),ul:({children:e,...t})=>b.jsx("ul",{className:"my-1 ml-5 list-disc space-y-0.5",...t,children:e}),ol:({children:e,...t})=>b.jsx("ol",{className:"my-1 ml-5 list-decimal space-y-0.5",...t,children:e}),li:({children:e,...t})=>b.jsx("li",{className:"leading-relaxed",...t,children:e}),blockquote:({children:e,...t})=>b.jsx("blockquote",{className:"my-2 border-l-2 border-border pl-3 text-text-dim",...t,children:e}),code:({inline:e,className:t,children:n,...r})=>e?b.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.85em]",...r,children:n}):b.jsx("code",{className:Ie("font-mono text-xs",t),...r,children:n}),pre:({children:e,...t})=>b.jsx("pre",{className:"my-2 overflow-x-auto rounded bg-surface-2 p-2 text-xs leading-relaxed",...t,children:e}),table:({children:e,...t})=>b.jsx("div",{className:"my-2 overflow-x-auto",children:b.jsx("table",{className:"w-full border-collapse text-xs",...t,children:e})}),thead:({children:e,...t})=>b.jsx("thead",{className:"border-b border-border bg-surface-2/50",...t,children:e}),tbody:({children:e,...t})=>b.jsx("tbody",{...t,children:e}),tr:({children:e,...t})=>b.jsx("tr",{className:"border-b border-border/40 last:border-b-0",...t,children:e}),th:({children:e,...t})=>b.jsx("th",{className:"px-2 py-1 text-left font-semibold",...t,children:e}),td:({children:e,...t})=>b.jsx("td",{className:"px-2 py-1 align-top",...t,children:e}),hr:e=>b.jsx("hr",{className:"my-2 border-border",...e})};function aE({content:e,className:t}){return b.jsx("div",{className:Ie("text-sm leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),children:b.jsx(Wk,{remarkPlugins:[iE],components:oE,children:e})})}function sE({msg:e,onApprove:t}){if(e.approval)return b.jsx(lE,{approval:e.approval,onApprove:t});const n=e.role==="user";return b.jsx("div",{className:Ie("flex",n?"justify-end":"justify-start"),children:b.jsxs("div",{className:Ie("max-w-[85%] sm:max-w-[75%] rounded-lg px-3 py-2 shadow-sm",n?"bg-accent text-accent-fg":"bg-surface text-text border border-border"),children:[!n&&e.agent&&b.jsx("div",{className:"mb-1 text-xs font-medium text-text-muted",children:e.agent}),!n&&e.content?b.jsx(aE,{content:e.content,className:"break-words"}):b.jsx("div",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:e.content||e.role==="assistant"&&b.jsx("span",{className:"inline-block animate-pulse text-text-dim",children:"…"})})]})})}function lE({approval:e,onApprove:t}){const{t:n}=kt(),{messageId:r,prompt:i,text:o,outcome:a}=e,s=i?.mode==="auto-allow",[l,c]=g.useState(null);g.useEffect(()=>{a&&c(null)},[a]);function u(d){if(l||!i||!t)return;c(d),t(r,i.reqId,d)===!1&&c(null)}return b.jsxs("div",{className:Ie("mx-auto w-full max-w-2xl rounded-lg border p-4",s?"border-warning/60 bg-warning-bg":"border-warning bg-warning-bg",a&&"opacity-90"),children:[b.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[b.jsx(at,{variant:"warning",children:n("chat.approvalTitle",{defaultValue:"🔐 Tool approval"})}),s&&!a&&b.jsx(at,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})})]}),s&&!a&&i&&b.jsx(cE,{graceSeconds:i.graceSeconds??0}),i?b.jsxs("div",{className:"mt-1 flex flex-col gap-2 text-sm",children:[b.jsx(Tc,{label:n("chat.approvalToolLabel",{defaultValue:"Tool"}),children:b.jsx("code",{className:"rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})}),b.jsx(Tc,{label:n("chat.approvalInputLabel",{defaultValue:"Input"}),children:b.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson})})]}):o?b.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm text-text",children:o}):null,a?b.jsx(uE,{outcome:a}):i?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[!s&&b.jsxs(b.Fragment,{children:[b.jsx(vt,{size:"sm",disabled:l!==null,onClick:()=>u("y"),children:n("chat.approvalAllow",{defaultValue:"Allow"})}),b.jsx(vt,{size:"sm",variant:"secondary",disabled:l!==null,onClick:()=>u("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto",{defaultValue:"Auto for similar"})})]}),b.jsx(vt,{size:"sm",variant:"destructive",disabled:l!==null,onClick:()=>u("n"),children:n("chat.approvalDeny",{defaultValue:"Deny"})})]}),l!==null&&b.jsx("p",{className:"mt-2 text-xs text-text-dim",children:n("chat.approvalSubmitting",{defaultValue:"已发送,等待结果…"})})]}):null]})}function Tc({label:e,children:t}){return b.jsxs("div",{className:"flex flex-col gap-0.5",children:[b.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t]})}function cE({graceSeconds:e}){const{t}=kt(),[n,r]=g.useState(Math.max(0,e));return g.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:b.jsx("p",{className:"mb-2 text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function uE({outcome:e}){const{t}=kt(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return b.jsx("div",{className:"mt-3",children:b.jsxs(at,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]})});case"allowed-pinned":return b.jsx("div",{className:"mt-3",children:b.jsxs(at,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]})});case"denied":return b.jsx("div",{className:"mt-3",children:b.jsxs(at,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]})});case"denied-revoked":return b.jsx("div",{className:"mt-3",children:b.jsxs(at,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]})});case"expired":return b.jsx("div",{className:"mt-3",children:b.jsxs(at,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})})}}function dE({approvals:e,onApprove:t}){return e.length===0?null:b.jsx("div",{className:"border-t border-warning/40 bg-warning-bg/40",children:b.jsx("div",{className:"mx-auto max-h-60 w-full max-w-3xl overflow-y-auto px-3 py-2 sm:px-4",children:b.jsx("div",{className:"flex flex-col gap-2",children:e.map(n=>b.jsx(fE,{entry:n,onApprove:t},n.messageId))})})})}function fE({entry:e,onApprove:t}){const{t:n}=kt(),{messageId:r,prompt:i,outcome:o}=e,a=i.mode==="auto-allow",[s,l]=g.useState(null);g.useEffect(()=>{o&&l(null)},[o]);function c(u){if(s||!t)return;l(u),t(r,i.reqId,u)===!1&&l(null)}return b.jsxs("div",{className:Ie("rounded-lg border bg-surface p-3 shadow-sm transition-opacity",o?"border-success/60 opacity-80":"border-warning"),children:[b.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[b.jsxs(at,{variant:"warning",className:"gap-1",children:[b.jsx(Qg,{className:"h-3 w-3"}),n("chat.approvalTitle",{defaultValue:"工具授权"})]}),a&&!o&&b.jsx(at,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})}),a&&!o&&i.graceSeconds!=null&&b.jsx(hE,{graceSeconds:i.graceSeconds}),b.jsx("code",{className:"ml-auto rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})]}),b.jsx("pre",{className:"mb-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson}),o?b.jsx(pE,{outcome:o}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex flex-wrap gap-2",children:[!a&&b.jsxs(b.Fragment,{children:[b.jsx(vt,{size:"sm",disabled:s!==null,onClick:()=>c("y"),children:n("chat.approvalAllow",{defaultValue:"批准"})}),b.jsx(vt,{size:"sm",variant:"secondary",disabled:s!==null,onClick:()=>c("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto",{defaultValue:"本类自动放行"})})]}),b.jsx(vt,{size:"sm",variant:"destructive",disabled:s!==null,onClick:()=>c("n"),children:n("chat.approvalDeny",{defaultValue:"拒绝"})})]}),s!==null&&b.jsx("p",{className:"mt-1.5 text-xs text-text-dim",children:n("chat.approvalSubmitting",{defaultValue:"已发送,等待结果…"})})]})]})}function hE({graceSeconds:e}){const{t}=kt(),[n,r]=g.useState(Math.max(0,e));return g.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:b.jsx("span",{className:"text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function pE({outcome:e}){const{t}=kt(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return b.jsxs(at,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]});case"allowed-pinned":return b.jsxs(at,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]});case"denied":return b.jsxs(at,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]});case"denied-revoked":return b.jsxs(at,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]});case"expired":return b.jsxs(at,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})}}function Rc(e,[t,n]){return Math.min(n,Math.max(t,e))}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function LD(e,t){const n=g.createContext(t),r=o=>{const{children:a,...s}=o,l=g.useMemo(()=>s,Object.values(s));return b.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=g.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function ho(e,t=[]){let n=[];function r(o,a){const s=g.createContext(a),l=n.length;n=[...n,a];const c=d=>{const{scope:h,children:f,...m}=d,p=h?.[e]?.[l]||s,y=g.useMemo(()=>m,Object.values(m));return b.jsx(p.Provider,{value:y,children:f})};c.displayName=o+"Provider";function u(d,h){const f=h?.[e]?.[l]||s,m=g.useContext(f);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>g.createContext(a));return function(s){const l=s?.[e]||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,mE(i,...t)]}function mE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Pc(e){const t=gE(e),n=g.forwardRef((r,i)=>{const{children:o,...a}=r,s=g.Children.toArray(o),l=s.find(bE);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return b.jsx(t,{...a,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return b.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function gE(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const a=xE(i),s=vE(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ei(r,a):a),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yE=Symbol("radix.slottable");function bE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yE}function vE(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function xE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wE(e){const t=e+"CollectionProvider",[n,r]=ho(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:y,children:v}=p,x=z.useRef(null),w=z.useRef(new Map).current;return b.jsx(i,{scope:y,itemMap:w,collectionRef:x,children:v})};a.displayName=t;const s=e+"CollectionSlot",l=Pc(s),c=z.forwardRef((p,y)=>{const{scope:v,children:x}=p,w=o(s,v),R=Ye(y,w.collectionRef);return b.jsx(l,{ref:R,children:x})});c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=Pc(u),f=z.forwardRef((p,y)=>{const{scope:v,children:x,...w}=p,R=z.useRef(null),I=Ye(y,R),C=o(u,v);return z.useEffect(()=>(C.itemMap.set(R,{ref:R,...w}),()=>void C.itemMap.delete(R))),b.jsx(h,{[d]:"",ref:I,children:x})});f.displayName=u;function m(p){const y=o(e+"CollectionConsumer",p);return z.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,k)=>w.indexOf(C.ref.current)-w.indexOf(k.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:c,ItemSlot:f},m,r]}var kE=g.createContext(void 0);function SE(e){const t=g.useContext(kE);return e||t||"ltr"}function EE(e){const t=CE(e),n=g.forwardRef((r,i)=>{const{children:o,...a}=r,s=g.Children.toArray(o),l=s.find(TE);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return b.jsx(t,{...a,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return b.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function CE(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const a=PE(i),s=RE(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ei(r,a):a),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AE=Symbol("radix.slottable");function TE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AE}function RE(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function PE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var IE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=IE.reduce((e,t)=>{const n=EE(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function LE(e,t){e&&Jr.flushSync(()=>e.dispatchEvent(t))}function zn(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}function OE(e,t=globalThis?.document){const n=zn(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var NE="DismissableLayer",Oa="dismissableLayer.update",DE="dismissableLayer.pointerDownOutside",_E="dismissableLayer.focusOutside",Ic,If=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),As=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,c=g.useContext(If),[u,d]=g.useState(null),h=u?.ownerDocument??globalThis?.document,[,f]=g.useState({}),m=Ye(t,k=>d(k)),p=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(y),x=u?p.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,R=x>=v,I=FE(k=>{const D=k.target,j=[...c.branches].some(T=>T.contains(D));!R||j||(i?.(k),a?.(k),k.defaultPrevented||s?.())},h),C=BE(k=>{const D=k.target;[...c.branches].some(T=>T.contains(D))||(o?.(k),a?.(k),k.defaultPrevented||s?.())},h);return OE(k=>{x===c.layers.size-1&&(r?.(k),!k.defaultPrevented&&s&&(k.preventDefault(),s()))},h),g.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ic=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Lc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ic)}},[u,h,n,c]),g.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Lc())},[u,c]),g.useEffect(()=>{const k=()=>f({});return document.addEventListener(Oa,k),()=>document.removeEventListener(Oa,k)},[]),b.jsx(We.div,{...l,ref:m,style:{pointerEvents:w?R?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,C.onFocusCapture),onBlurCapture:je(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,I.onPointerDownCapture)})});As.displayName=NE;var ME="DismissableLayerBranch",jE=g.forwardRef((e,t)=>{const n=g.useContext(If),r=g.useRef(null),i=Ye(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),b.jsx(We.div,{...e,ref:i})});jE.displayName=ME;function FE(e,t=globalThis?.document){const n=zn(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){Lf(DE,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function BE(e,t=globalThis?.document){const n=zn(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Lf(_E,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lc(){const e=new CustomEvent(Oa);document.dispatchEvent(e)}function Lf(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?LE(i,o):i.dispatchEvent(o)}var Ko=0;function UE(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Oc()),document.body.insertAdjacentElement("beforeend",e[1]??Oc()),Ko++,()=>{Ko===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ko--}},[])}function Oc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qo="focusScope.autoFocusOnMount",Go="focusScope.autoFocusOnUnmount",Nc={bubbles:!1,cancelable:!0},HE="FocusScope",Of=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=g.useState(null),c=zn(i),u=zn(o),d=g.useRef(null),h=Ye(t,p=>l(p)),f=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(w){if(f.paused||!s)return;const R=w.target;s.contains(R)?d.current=R:mn(d.current,{select:!0})},y=function(w){if(f.paused||!s)return;const R=w.relatedTarget;R!==null&&(s.contains(R)||mn(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const I of w)I.removedNodes.length>0&&mn(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const x=new MutationObserver(v);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),x.disconnect()}}},[r,s,f.paused]),g.useEffect(()=>{if(s){_c.add(f);const p=document.activeElement;if(!s.contains(p)){const v=new CustomEvent(qo,Nc);s.addEventListener(qo,c),s.dispatchEvent(v),v.defaultPrevented||(zE(qE(Nf(s)),{select:!0}),document.activeElement===p&&mn(s))}return()=>{s.removeEventListener(qo,c),setTimeout(()=>{const v=new CustomEvent(Go,Nc);s.addEventListener(Go,u),s.dispatchEvent(v),v.defaultPrevented||mn(p??document.body,{select:!0}),s.removeEventListener(Go,u),_c.remove(f)},0)}}},[s,c,u,f]);const m=g.useCallback(p=>{if(!n&&!r||f.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(y&&v){const x=p.currentTarget,[w,R]=$E(x);w&&R?!p.shiftKey&&v===R?(p.preventDefault(),n&&mn(w,{select:!0})):p.shiftKey&&v===w&&(p.preventDefault(),n&&mn(R,{select:!0})):v===x&&p.preventDefault()}},[n,r,f.paused]);return b.jsx(We.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});Of.displayName=HE;function zE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mn(r,{select:t}),document.activeElement!==n)return}function $E(e){const t=Nf(e),n=Dc(t,e),r=Dc(t.reverse(),e);return[n,r]}function Nf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Dc(e,t){for(const n of e)if(!VE(n,{upTo:t}))return n}function VE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function WE(e){return e instanceof HTMLInputElement&&"select"in e}function mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WE(e)&&t&&e.select()}}var _c=KE();function KE(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Mc(e,t),e.unshift(t)},remove(t){e=Mc(e,t),e[0]?.resume()}}}function Mc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qE(e){return e.filter(t=>t.tagName!=="A")}var rt=globalThis?.document?g.useLayoutEffect:()=>{},GE=eo[" useId ".trim().toString()]||(()=>{}),YE=0;function Ts(e){const[t,n]=g.useState(GE());return rt(()=>{n(r=>r??String(YE++))},[e]),t?`radix-${t}`:""}const QE=["top","right","bottom","left"],yn=Math.min,bt=Math.max,zi=Math.round,gi=Math.floor,qt=e=>({x:e,y:e}),XE={left:"right",right:"left",bottom:"top",top:"bottom"};function Na(e,t,n){return bt(e,yn(t,n))}function nn(e,t){return typeof e=="function"?e(t):e}function rn(e){return e.split("-")[0]}function xr(e){return e.split("-")[1]}function Rs(e){return e==="x"?"y":"x"}function Ps(e){return e==="y"?"height":"width"}function Wt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Is(e){return Rs(Wt(e))}function JE(e,t,n){n===void 0&&(n=!1);const r=xr(e),i=Is(e),o=Ps(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=$i(a)),[a,$i(a)]}function ZE(e){const t=$i(e);return[Da(e),t,Da(t)]}function Da(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jc=["left","right"],Fc=["right","left"],eC=["top","bottom"],tC=["bottom","top"];function nC(e,t,n){switch(e){case"top":case"bottom":return n?t?Fc:jc:t?jc:Fc;case"left":case"right":return t?eC:tC;default:return[]}}function rC(e,t,n,r){const i=xr(e);let o=nC(rn(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Da)))),o}function $i(e){const t=rn(e);return XE[t]+e.slice(t.length)}function iC(e){return{top:0,right:0,bottom:0,left:0,...e}}function Df(e){return typeof e!="number"?iC(e):{top:e,right:e,bottom:e,left:e}}function Vi(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bc(e,t,n){let{reference:r,floating:i}=e;const o=Wt(t),a=Is(t),s=Ps(a),l=rn(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(xr(t)){case"start":f[a]-=h*(n&&c?-1:1);break;case"end":f[a]+=h*(n&&c?-1:1);break}return f}async function oC(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=nn(t,e),m=Df(f),y=s[h?d==="floating"?"reference":"floating":d],v=Vi(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),R=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},I=Vi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(v.top-I.top+m.top)/R.y,bottom:(I.bottom-v.bottom+m.bottom)/R.y,left:(v.left-I.left+m.left)/R.x,right:(I.right-v.right+m.right)/R.x}}const aC=50,sC=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:oC},l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bc(c,r,l),h=r,f=0;const m={};for(let p=0;p<o.length;p++){const y=o[p];if(!y)continue;const{name:v,fn:x}=y,{x:w,y:R,data:I,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=R??d,m[v]={...m[v],...I},C&&f<aC&&(f++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:d}=Bc(c,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:m}},lC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=nn(e,t)||{};if(c==null)return{};const d=Df(u),h={x:n,y:r},f=Is(i),m=Ps(f),p=await a.getDimensions(c),y=f==="y",v=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",R=o.reference[m]+o.reference[f]-h[f]-o.floating[m],I=h[f]-o.reference[f],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let k=C?C[w]:0;(!k||!await(a.isElement==null?void 0:a.isElement(C)))&&(k=s.floating[w]||o.floating[m]);const D=R/2-I/2,j=k/2-p[m]/2-1,T=yn(d[v],j),_=yn(d[x],j),L=T,K=k-p[m]-_,B=k/2-p[m]/2+D,V=Na(L,B,K),q=!l.arrow&&xr(i)!=null&&B!==V&&o.reference[m]/2-(B<L?T:_)-p[m]/2<0,Q=q?B<L?B-L:B-K:0;return{[f]:h[f]+Q,data:{[f]:V,centerOffset:B-V-Q,...q&&{alignmentOffset:Q}},reset:q}}}),cC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=nn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=rn(i),x=Wt(s),w=rn(s)===s,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(w||!p?[$i(s)]:ZE(s)),C=m!=="none";!h&&C&&I.push(...rC(s,p,m,R));const k=[s,...I],D=await l.detectOverflow(t,y),j=[];let T=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&j.push(D[v]),d){const B=JE(i,a,R);j.push(D[B[0]],D[B[1]])}if(T=[...T,{placement:i,overflows:j}],!j.every(B=>B<=0)){var _,L;const B=(((_=o.flip)==null?void 0:_.index)||0)+1,V=k[B];if(V&&(!(d==="alignment"?x!==Wt(V):!1)||T.every($=>Wt($.placement)===x?$.overflows[0]>0:!0)))return{data:{index:B,overflows:T},reset:{placement:V}};let q=(L=T.filter(Q=>Q.overflows[0]<=0).sort((Q,$)=>Q.overflows[1]-$.overflows[1])[0])==null?void 0:L.placement;if(!q)switch(f){case"bestFit":{var K;const Q=(K=T.filter($=>{if(C){const F=Wt($.placement);return F===x||F==="y"}return!0}).map($=>[$.placement,$.overflows.filter(F=>F>0).reduce((F,S)=>F+S,0)]).sort(($,F)=>$[1]-F[1])[0])==null?void 0:K[0];Q&&(q=Q);break}case"initialPlacement":q=s;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function Uc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hc(e){return QE.some(t=>e[t]>=0)}const uC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=nn(e,t);switch(i){case"referenceHidden":{const a=await r.detectOverflow(t,{...o,elementContext:"reference"}),s=Uc(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Hc(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...o,altBoundary:!0}),s=Uc(a,n.floating);return{data:{escapedOffsets:s,escaped:Hc(s)}}}default:return{}}}}},_f=new Set(["left","top"]);async function dC(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=rn(n),s=xr(n),l=Wt(n)==="y",c=_f.has(a)?-1:1,u=o&&l?-1:1,d=nn(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(f=s==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const fC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await dC(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},hC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...c}=nn(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),h=Wt(rn(i)),f=Rs(h);let m=u[f],p=u[h];if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=m+d[v],R=m-d[x];m=Na(w,m,R)}if(s){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=p+d[v],R=p-d[x];p=Na(w,p,R)}const y=l.fn({...t,[f]:m,[h]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:a,[h]:s}}}}}},pC=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=nn(e,t),u={x:n,y:r},d=Wt(i),h=Rs(d);let f=u[h],m=u[d];const p=nn(s,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=h==="y"?"height":"width",R=o.reference[h]-o.floating[w]+y.mainAxis,I=o.reference[h]+o.reference[w]-y.mainAxis;f<R?f=R:f>I&&(f=I)}if(c){var v,x;const w=h==="y"?"width":"height",R=_f.has(rn(i)),I=o.reference[d]-o.floating[w]+(R&&((v=a.offset)==null?void 0:v[d])||0)+(R?0:y.crossAxis),C=o.reference[d]+o.reference[w]+(R?0:((x=a.offset)==null?void 0:x[d])||0)-(R?y.crossAxis:0);m<I?m=I:m>C&&(m=C)}return{[h]:f,[d]:m}}}},mC=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...c}=nn(e,t),u=await a.detectOverflow(t,c),d=rn(i),h=xr(i),f=Wt(i)==="y",{width:m,height:p}=o.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,y=h==="end"?"top":"bottom");const x=p-u.top-u.bottom,w=m-u.left-u.right,R=yn(p-u[y],x),I=yn(m-u[v],w),C=!t.middlewareData.shift;let k=R,D=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=x),C&&!h){const T=bt(u.left,0),_=bt(u.right,0),L=bt(u.top,0),K=bt(u.bottom,0);f?D=m-2*(T!==0||_!==0?T+_:bt(u.left,u.right)):k=p-2*(L!==0||K!==0?L+K:bt(u.top,u.bottom))}await l({...t,availableWidth:D,availableHeight:k});const j=await a.getDimensions(s.floating);return m!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function po(){return typeof window<"u"}function wr(e){return Mf(e)?(e.nodeName||"").toLowerCase():"#document"}function wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yt(e){var t;return(t=(Mf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mf(e){return po()?e instanceof Node||e instanceof wt(e).Node:!1}function Dt(e){return po()?e instanceof Element||e instanceof wt(e).Element:!1}function cn(e){return po()?e instanceof HTMLElement||e instanceof wt(e).HTMLElement:!1}function zc(e){return!po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wt(e).ShadowRoot}function oi(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=_t(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function gC(e){return/^(table|td|th)$/.test(wr(e))}function mo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const yC=/transform|translate|scale|rotate|perspective|filter/,bC=/paint|layout|strict|content/,Ln=e=>!!e&&e!=="none";let Yo;function Ls(e){const t=Dt(e)?_t(e):e;return Ln(t.transform)||Ln(t.translate)||Ln(t.scale)||Ln(t.rotate)||Ln(t.perspective)||!Os()&&(Ln(t.backdropFilter)||Ln(t.filter))||yC.test(t.willChange||"")||bC.test(t.contain||"")}function vC(e){let t=bn(e);for(;cn(t)&&!hr(t);){if(Ls(t))return t;if(mo(t))return null;t=bn(t)}return null}function Os(){return Yo==null&&(Yo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Yo}function hr(e){return/^(html|body|#document)$/.test(wr(e))}function _t(e){return wt(e).getComputedStyle(e)}function go(e){return Dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bn(e){if(wr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zc(e)&&e.host||Yt(e);return zc(t)?t.host:t}function jf(e){const t=bn(e);return hr(t)?e.ownerDocument?e.ownerDocument.body:e.body:cn(t)&&oi(t)?t:jf(t)}function Yr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=jf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=wt(i);if(o){const s=_a(a);return t.concat(a,a.visualViewport||[],oi(i)?i:[],s&&n?Yr(s):[])}else return t.concat(i,Yr(i,[],n))}function _a(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ff(e){const t=_t(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cn(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=zi(n)!==o||zi(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function Ns(e){return Dt(e)?e:e.contextElement}function cr(e){const t=Ns(e);if(!cn(t))return qt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Ff(t);let a=(o?zi(n.width):n.width)/r,s=(o?zi(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const xC=qt(0);function Bf(e){const t=wt(e);return!Os()||!t.visualViewport?xC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wt(e)?!1:t}function $n(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ns(e);let a=qt(1);t&&(r?Dt(r)&&(a=cr(r)):a=cr(e));const s=wC(o,n,r)?Bf(o):qt(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const h=wt(o),f=r&&Dt(r)?wt(r):r;let m=h,p=_a(m);for(;p&&r&&f!==m;){const y=cr(p),v=p.getBoundingClientRect(),x=_t(p),w=v.left+(p.clientLeft+parseFloat(x.paddingLeft))*y.x,R=v.top+(p.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=R,m=wt(p),p=_a(m)}}return Vi({width:u,height:d,x:l,y:c})}function yo(e,t){const n=go(e).scrollLeft;return t?t.left+n:$n(Yt(e)).left+n}function Uf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-yo(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function kC(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Yt(r),s=t?mo(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=qt(1);const u=qt(0),d=cn(r);if((d||!d&&!o)&&((wr(r)!=="body"||oi(a))&&(l=go(r)),d)){const f=$n(r);c=cr(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=a&&!d&&!o?Uf(a,l):qt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function SC(e){return Array.from(e.getClientRects())}function EC(e){const t=Yt(e),n=go(e),r=e.ownerDocument.body,i=bt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=bt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+yo(e);const s=-n.scrollTop;return _t(r).direction==="rtl"&&(a+=bt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const $c=25;function CC(e,t){const n=wt(e),r=Yt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=Os();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=yo(r);if(c<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-f);m<=$c&&(o-=m)}else c<=$c&&(o+=c);return{width:o,height:a,x:s,y:l}}function AC(e,t){const n=$n(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=cn(e)?cr(e):qt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function Vc(e,t,n){let r;if(t==="viewport")r=CC(e,n);else if(t==="document")r=EC(Yt(e));else if(Dt(t))r=AC(t,n);else{const i=Bf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Vi(r)}function Hf(e,t){const n=bn(e);return n===t||!Dt(n)||hr(n)?!1:_t(n).position==="fixed"||Hf(n,t)}function TC(e,t){const n=t.get(e);if(n)return n;let r=Yr(e,[],!1).filter(s=>Dt(s)&&wr(s)!=="body"),i=null;const o=_t(e).position==="fixed";let a=o?bn(e):e;for(;Dt(a)&&!hr(a);){const s=_t(a),l=Ls(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||oi(a)&&!l&&Hf(e,a))?r=r.filter(u=>u!==a):i=s,a=bn(a)}return t.set(e,r),r}function RC(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?mo(t)?[]:TC(t,this._c):[].concat(n),r],s=Vc(t,a[0],i);let l=s.top,c=s.right,u=s.bottom,d=s.left;for(let h=1;h<a.length;h++){const f=Vc(t,a[h],i);l=bt(f.top,l),c=yn(f.right,c),u=yn(f.bottom,u),d=bt(f.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function PC(e){const{width:t,height:n}=Ff(e);return{width:t,height:n}}function IC(e,t,n){const r=cn(t),i=Yt(t),o=n==="fixed",a=$n(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=qt(0);function c(){l.x=yo(i)}if(r||!r&&!o)if((wr(t)!=="body"||oi(i))&&(s=go(t)),r){const f=$n(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?Uf(i,s):qt(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function Qo(e){return _t(e).position==="static"}function Wc(e,t){if(!cn(e)||_t(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yt(e)===n&&(n=n.ownerDocument.body),n}function zf(e,t){const n=wt(e);if(mo(e))return n;if(!cn(e)){let i=bn(e);for(;i&&!hr(i);){if(Dt(i)&&!Qo(i))return i;i=bn(i)}return n}let r=Wc(e,t);for(;r&&gC(r)&&Qo(r);)r=Wc(r,t);return r&&hr(r)&&Qo(r)&&!Ls(r)?n:r||vC(e)||n}const LC=async function(e){const t=this.getOffsetParent||zf,n=this.getDimensions,r=await n(e.floating);return{reference:IC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OC(e){return _t(e).direction==="rtl"}const NC={convertOffsetParentRelativeRectToViewportRelativeRect:kC,getDocumentElement:Yt,getClippingRect:RC,getOffsetParent:zf,getElementRects:LC,getClientRects:SC,getDimensions:PC,getScale:cr,isElement:Dt,isRTL:OC};function $f(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function DC(e,t){let n=null,r;const i=Yt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(s||t(),!h||!f)return;const m=gi(d),p=gi(i.clientWidth-(u+h)),y=gi(i.clientHeight-(d+f)),v=gi(u),w={rootMargin:-m+"px "+-p+"px "+-y+"px "+-v+"px",threshold:bt(0,yn(1,l))||1};let R=!0;function I(C){const k=C[0].intersectionRatio;if(k!==l){if(!R)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}k===1&&!$f(c,e.getBoundingClientRect())&&a(),R=!1}try{n=new IntersectionObserver(I,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,w)}n.observe(e)}return a(!0),o}function _C(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ns(e),u=i||o?[...c?Yr(c):[],...t?Yr(t):[]]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=c&&s?DC(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!l&&f.observe(c),t&&f.observe(t));let m,p=l?$n(e):null;l&&y();function y(){const v=$n(e);p&&!$f(p,v)&&n(),p=v,m=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(v=f)==null||v.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const MC=fC,jC=hC,FC=cC,BC=mC,UC=uC,Kc=lC,HC=pC,zC=(e,t,n)=>{const r=new Map,i={platform:NC,...n},o={...i.platform,_c:r};return sC(e,t,{...i,platform:o})};var $C=typeof document<"u",VC=function(){},Ti=$C?g.useLayoutEffect:VC;function Wi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Wi(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Wi(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Vf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qc(e,t){const n=Vf(e);return Math.round(t*n)/n}function Xo(e){const t=g.useRef(e);return Ti(()=>{t.current=e}),t}function WC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=g.useState(r);Wi(h,r)||f(r);const[m,p]=g.useState(null),[y,v]=g.useState(null),x=g.useCallback($=>{$!==C.current&&(C.current=$,p($))},[]),w=g.useCallback($=>{$!==k.current&&(k.current=$,v($))},[]),R=o||m,I=a||y,C=g.useRef(null),k=g.useRef(null),D=g.useRef(u),j=l!=null,T=Xo(l),_=Xo(i),L=Xo(c),K=g.useCallback(()=>{if(!C.current||!k.current)return;const $={placement:t,strategy:n,middleware:h};_.current&&($.platform=_.current),zC(C.current,k.current,$).then(F=>{const S={...F,isPositioned:L.current!==!1};B.current&&!Wi(D.current,S)&&(D.current=S,Jr.flushSync(()=>{d(S)}))})},[h,t,n,_,L]);Ti(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d($=>({...$,isPositioned:!1})))},[c]);const B=g.useRef(!1);Ti(()=>(B.current=!0,()=>{B.current=!1}),[]),Ti(()=>{if(R&&(C.current=R),I&&(k.current=I),R&&I){if(T.current)return T.current(R,I,K);K()}},[R,I,K,T,j]);const V=g.useMemo(()=>({reference:C,floating:k,setReference:x,setFloating:w}),[x,w]),q=g.useMemo(()=>({reference:R,floating:I}),[R,I]),Q=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!q.floating)return $;const F=qc(q.floating,u.x),S=qc(q.floating,u.y);return s?{...$,transform:"translate("+F+"px, "+S+"px)",...Vf(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:S}},[n,s,q.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:K,refs:V,elements:q,floatingStyles:Q}),[u,K,V,q,Q])}const KC=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Kc({element:r.current,padding:i}).fn(n):{}:r?Kc({element:r,padding:i}).fn(n):{}}}},qC=(e,t)=>{const n=MC(e);return{name:n.name,fn:n.fn,options:[e,t]}},GC=(e,t)=>{const n=jC(e);return{name:n.name,fn:n.fn,options:[e,t]}},YC=(e,t)=>({fn:HC(e).fn,options:[e,t]}),QC=(e,t)=>{const n=FC(e);return{name:n.name,fn:n.fn,options:[e,t]}},XC=(e,t)=>{const n=BC(e);return{name:n.name,fn:n.fn,options:[e,t]}},JC=(e,t)=>{const n=UC(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZC=(e,t)=>{const n=KC(e);return{name:n.name,fn:n.fn,options:[e,t]}};var eA="Arrow",Wf=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return b.jsx(We.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});Wf.displayName=eA;var tA=Wf;function nA(e){const[t,n]=g.useState(void 0);return rt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ds="Popper",[Kf,bo]=ho(Ds),[rA,qf]=Kf(Ds),Gf=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return b.jsx(rA,{scope:t,anchor:r,onAnchorChange:i,children:n})};Gf.displayName=Ds;var Yf="PopperAnchor",Qf=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=qf(Yf,n),a=g.useRef(null),s=Ye(t,a),l=g.useRef(null);return g.useEffect(()=>{const c=l.current;l.current=r?.current||a.current,c!==l.current&&o.onAnchorChange(l.current)}),r?null:b.jsx(We.div,{...i,ref:s})});Qf.displayName=Yf;var _s="PopperContent",[iA,oA]=Kf(_s),Xf=g.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:m,...p}=e,y=qf(_s,n),[v,x]=g.useState(null),w=Ye(t,W=>x(W)),[R,I]=g.useState(null),C=nA(R),k=C?.width??0,D=C?.height??0,j=r+(o!=="center"?"-"+o:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},_=Array.isArray(c)?c:[c],L=_.length>0,K={padding:T,boundary:_.filter(sA),altBoundary:L},{refs:B,floatingStyles:V,placement:q,isPositioned:Q,middlewareData:$}=WC({strategy:"fixed",placement:j,whileElementsMounted:(...W)=>_C(...W,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[qC({mainAxis:i+D,alignmentAxis:a}),l&&GC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?YC():void 0,...K}),l&&QC({...K}),XC({...K,apply:({elements:W,rects:ye,availableWidth:Le,availableHeight:ve})=>{const{width:we,height:de}=ye.reference,Be=W.floating.style;Be.setProperty("--radix-popper-available-width",`${Le}px`),Be.setProperty("--radix-popper-available-height",`${ve}px`),Be.setProperty("--radix-popper-anchor-width",`${we}px`),Be.setProperty("--radix-popper-anchor-height",`${de}px`)}}),R&&ZC({element:R,padding:s}),lA({arrowWidth:k,arrowHeight:D}),h&&JC({strategy:"referenceHidden",...K})]}),[F,S]=eh(q),se=zn(m);rt(()=>{Q&&se?.()},[Q,se]);const te=$.arrow?.x,E=$.arrow?.y,oe=$.arrow?.centerOffset!==0,[fe,ge]=g.useState();return rt(()=>{v&&ge(window.getComputedStyle(v).zIndex)},[v]),b.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(iA,{scope:n,placedSide:F,onArrowChange:I,arrowX:te,arrowY:E,shouldHideArrow:oe,children:b.jsx(We.div,{"data-side":F,"data-align":S,...p,ref:w,style:{...p.style,animation:Q?void 0:"none"}})})})});Xf.displayName=_s;var Jf="PopperArrow",aA={top:"bottom",right:"left",bottom:"top",left:"right"},Zf=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=oA(Jf,r),a=aA[o.placedSide];return b.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:b.jsx(tA,{...i,ref:n,style:{...i.style,display:"block"}})})});Zf.displayName=Jf;function sA(e){return e!==null}var lA=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=eh(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+s/2,f=(i.arrow?.y??0)+l/2;let m="",p="";return c==="bottom"?(m=a?d:`${h}px`,p=`${-l}px`):c==="top"?(m=a?d:`${h}px`,p=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,p=a?d:`${f}px`):c==="left"&&(m=`${r.floating.width+l}px`,p=a?d:`${f}px`),{data:{x:m,y:p}}}});function eh(e){const[t,n="center"]=e.split("-");return[t,n]}var cA=Gf,th=Qf,nh=Xf,rh=Zf,uA="Portal",ih=g.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=g.useState(!1);rt(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?ku.createPortal(b.jsx(We.div,{...r,ref:t}),a):null});ih.displayName=uA;function dA(e){const t=fA(e),n=g.forwardRef((r,i)=>{const{children:o,...a}=r,s=g.Children.toArray(o),l=s.find(pA);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return b.jsx(t,{...a,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return b.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function fA(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const a=gA(i),s=mA(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ei(r,a):a),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hA=Symbol("radix.slottable");function pA(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hA}function mA(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function gA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yA=eo[" useInsertionEffect ".trim().toString()]||rt;function Gc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=bA({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=g.useCallback(u=>{if(s){const d=vA(u)?u(e):u;d!==e&&a.current?.(d)}else o(u)},[s,e,o,a]);return[l,c]}function bA({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return yA(()=>{o.current=t},[t]),g.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function vA(e){return typeof e=="function"}function xA(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var oh=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wA="VisuallyHidden",ah=g.forwardRef((e,t)=>b.jsx(We.span,{...e,ref:t,style:{...oh,...e.style}}));ah.displayName=wA;var kA=ah,SA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},er=new WeakMap,yi=new WeakMap,bi={},Jo=0,sh=function(e){return e&&(e.host||sh(e.parentNode))},EA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},CA=function(e,t,n,r){var i=EA(t,Array.isArray(e)?e:[e]);bi[n]||(bi[n]=new WeakMap);var o=bi[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))u(h);else try{var f=h.getAttribute(r),m=f!==null&&f!=="false",p=(er.get(h)||0)+1,y=(o.get(h)||0)+1;er.set(h,p),o.set(h,y),a.push(h),p===1&&m&&yi.set(h,!0),y===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return u(t),s.clear(),Jo++,function(){a.forEach(function(d){var h=er.get(d)-1,f=o.get(d)-1;er.set(d,h),o.set(d,f),h||(yi.has(d)||d.removeAttribute(r),yi.delete(d)),f||d.removeAttribute(n)}),Jo--,Jo||(er=new WeakMap,er=new WeakMap,yi=new WeakMap,bi={})}},AA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=SA(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),CA(r,i,n,"aria-hidden")):function(){return null}},Vt=function(){return Vt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vt.apply(this,arguments)};function lh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function TA(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ri="right-scroll-bar-position",Pi="width-before-scroll-bar",RA="with-scroll-bars-hidden",PA="--removed-body-scroll-bar-size";function Zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function IA(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var LA=typeof window<"u"?g.useLayoutEffect:g.useEffect,Yc=new WeakMap;function OA(e,t){var n=IA(null,function(r){return e.forEach(function(i){return Zo(i,r)})});return LA(function(){var r=Yc.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||Zo(s,null)}),o.forEach(function(s){i.has(s)||Zo(s,a)})}Yc.set(n,e)},[e]),n}function NA(e){return e}function DA(e,t){t===void 0&&(t=NA);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var u=a;a=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return i}function _A(e){e===void 0&&(e={});var t=DA(null);return t.options=Vt({async:!0,ssr:!1},e),t}var ch=function(e){var t=e.sideCar,n=lh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Vt({},n))};ch.isSideCarExport=!0;function MA(e,t){return e.useMedium(t),ch}var uh=_A(),ea=function(){},vo=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:ea,onWheelCapture:ea,onTouchMoveCapture:ea}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,p=e.inert,y=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,w=e.gapMode,R=lh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=h,C=OA([n,t]),k=Vt(Vt({},R),i);return g.createElement(g.Fragment,null,u&&g.createElement(I,{sideCar:uh,removeScrollBar:c,shards:d,noRelative:f,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:w}),a?g.cloneElement(g.Children.only(s),Vt(Vt({},k),{ref:C})):g.createElement(x,Vt({},k,{className:l,ref:C}),s))});vo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vo.classNames={fullWidth:Pi,zeroRight:Ri};var jA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function FA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jA();return t&&e.setAttribute("nonce",t),e}function BA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var HA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=FA())&&(BA(t,n),UA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zA=function(){var e=HA();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dh=function(){var e=zA(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},$A={left:0,top:0,right:0,gap:0},ta=function(e){return parseInt(e||"",10)||0},VA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ta(n),ta(r),ta(i)]},WA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $A;var t=VA(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},KA=dh(),ur="data-scroll-locked",qA=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
155
+ `,...o.current()});return/^[\t ]/.test(c)&&(c=Gr(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}ff.peek=qk;function ff(e){return e.value||""}function qk(){return"<"}hf.peek=Gk;function hf(e,t,n,r){const i=ks(n),o=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),a(),c}function Gk(){return"!"}pf.peek=Yk;function pf(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function Yk(){return"!"}mf.peek=Qk;function mf(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function Qk(){return"`"}function gf(e,t){const n=ps(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yf.peek=Xk;function yf(e,t,n,r){const i=ks(n),o=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(gf(e,n)){const u=n.stack;n.stack=[],s=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),s(),n.stack=u,d}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),s(),c}function Xk(e,t,n){return gf(e,n)?"<":"["}vf.peek=Jk;function vf(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,o(),i==="full"||!c||c!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function Jk(){return"["}function Es(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Zk(e){const t=Es(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function e1(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function bf(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function t1(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?e1(n):Es(n);const s=e.ordered?a==="."?")":".":Zk(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),bf(n)===a&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,i(),c}function n1(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function r1(e,t,n,r){const i=n1(n);let o=n.bulletCurrent||Es(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(a-o.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),u);return l(),c;function u(d,h,f){return h?(f?"":" ".repeat(a))+d:(f?o:o+" ".repeat(a-o.length))+d}}function i1(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),i(),a}const o1=uo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function a1(e,t,n,r){return(e.children.some(function(a){return o1(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function s1(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}xf.peek=l1;function xf(e,t,n,r){const i=s1(n),o=n.enter("strong"),a=n.createTracker(r),s=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:s,...a.current()}));const c=l.charCodeAt(0),u=Ui(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=Gr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),h=Ui(r.after.charCodeAt(0),d,i);h.inside&&(l=l.slice(0,-1)+Gr(d));const f=a.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},s+l+f}function l1(e,t,n){return n.options.strong||"*"}function c1(e,t,n,r){return n.safe(e.value,r)}function u1(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function d1(e,t,n){const r=(bf(n)+(n.options.ruleSpaces?" ":"")).repeat(u1(n));return n.options.ruleSpaces?r.slice(0,-1):r}const wf={blockquote:Nk,break:kc,code:Hk,definition:zk,emphasis:df,hardBreak:kc,heading:Kk,html:ff,image:hf,imageReference:pf,inlineCode:mf,link:yf,linkReference:vf,list:t1,listItem:r1,paragraph:i1,root:a1,strong:xf,text:c1,thematicBreak:d1};function f1(){return{enter:{table:h1,tableData:Ec,tableHeader:Ec,tableRow:m1},exit:{codeText:g1,table:p1,tableData:Wo,tableHeader:Wo,tableRow:Wo}}}function h1(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function p1(e){this.exit(e),this.data.inTable=void 0}function m1(e){this.enter({type:"tableRow",children:[]},e)}function Wo(e){this.exit(e)}function Ec(e){this.enter({type:"tableCell",children:[]},e)}function g1(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,y1));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function y1(e,t){return t==="|"?t:e}function v1(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
156
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:s}};function a(f,m,p,y){return c(u(f,p,y),f.align)}function s(f,m,p,y){const b=d(f,p,y),x=c([b]);return x.slice(0,x.indexOf(`
157
+ `))}function l(f,m,p,y){const b=p.enter("tableCell"),x=p.enter("phrasing"),w=p.containerPhrasing(f,{...y,before:o,after:o});return x(),b(),w}function c(f,m){return Ok(f,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function u(f,m,p){const y=f.children;let b=-1;const x=[],w=m.enter("table");for(;++b<y.length;)x[b]=d(y[b],m,p);return w(),x}function d(f,m,p){const y=f.children;let b=-1;const x=[],w=m.enter("tableRow");for(;++b<y.length;)x[b]=l(y[b],f,m,p);return w(),x}function h(f,m,p){let y=wf.inlineCode(f,m,p);return p.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function b1(){return{exit:{taskListCheckValueChecked:Cc,taskListCheckValueUnchecked:Cc,paragraph:w1}}}function x1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:S1}}}function Cc(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function w1(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,a;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function S1(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(a);let l=wf.listItem(e,t,n,{...r,...s.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+a}}function k1(){return[tk(),Sk(),Ak(),f1(),b1()]}function E1(e){return{extensions:[nk(),kk(e),Tk(),v1(e),x1()]}}const C1={tokenize:L1,partial:!0},Sf={tokenize:O1,partial:!0},kf={tokenize:_1,partial:!0},Ef={tokenize:N1,partial:!0},A1={tokenize:D1,partial:!0},Cf={name:"wwwAutolink",tokenize:P1,previous:Tf},Af={name:"protocolAutolink",tokenize:I1,previous:Rf},ln={name:"emailAutolink",tokenize:R1,previous:Pf},Gt={};function T1(){return{text:Gt}}let In=48;for(;In<123;)Gt[In]=ln,In++,In===58?In=65:In===91&&(In=97);Gt[43]=ln;Gt[45]=ln;Gt[46]=ln;Gt[95]=ln;Gt[72]=[ln,Af];Gt[104]=[ln,Af];Gt[87]=[ln,Cf];Gt[119]=[ln,Cf];function R1(e,t,n){const r=this;let i,o;return a;function a(d){return!La(d)||!Pf.call(r,r.previous)||Cs(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return La(d)?(e.consume(d),s):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(A1,u,c)(d):d===45||d===95||nt(d)?(o=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return o&&i&&st(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function P1(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Tf.call(r,r.previous)||Cs(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(C1,e.attempt(Sf,e.attempt(kf,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function I1(e,t,n){const r=this;let i="",o=!1;return a;function a(d){return(d===72||d===104)&&Rf.call(r,r.previous)&&!Cs(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(st(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),o?c:(o=!0,l)):n(d)}function c(d){return d===null||Fi(d)||Ne(d)||Un(d)||so(d)?n(d):e.attempt(Sf,e.attempt(kf,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function L1(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function O1(e,t,n){let r,i,o;return a;function a(c){return c===46||c===95?e.check(Ef,l,s)(c):c===null||Ne(c)||Un(c)||c!==45&&so(c)?l(c):(o=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),a}function l(c){return i||r||!o?n(c):t(c)}}function _1(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Ef,t,o)(a):a===null||Ne(a)||Un(a)?t(a):(e.consume(a),i)}function o(a){return a===41&&r++,e.consume(a),i}}function N1(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||Ne(s)||Un(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Ne(s)||Un(s)?t(s):r(s)}function o(s){return st(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):st(s)?(e.consume(s),a):n(s)}}function D1(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return nt(o)?n(o):t(o)}}function Tf(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ne(e)}function Rf(e){return!st(e)}function Pf(e){return!(e===47||La(e))}function La(e){return e===43||e===45||e===46||e===95||nt(e)}function Cs(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const M1={tokenize:V1,partial:!0};function j1(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:U1,continuation:{tokenize:z1},exit:$1}},text:{91:{name:"gfmFootnoteCall",tokenize:H1},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:F1,resolveTo:B1}}}}function F1(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=_t(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!o.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function B1(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function H1(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(o>999||d===93&&!a||d===null||d===91||Ne(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(_t(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Ne(d)||(a=!0),o++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),o++,c):c(d)}}function U1(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(m)}function u(m){if(a>999||m===93&&!s||m===null||m===91||Ne(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=_t(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ne(m)||(s=!0),a++,e.consume(m),m===92?d:u}function d(m){return m===91||m===92||m===93?(e.consume(m),a++,u):u(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),Ce(e,f,"gfmFootnoteDefinitionWhitespace")):n(m)}function f(m){return t(m)}}function z1(e,t,n){return e.check(ri,t,e.attempt(M1,t,n))}function $1(e){e.exit("gfmFootnoteDefinition")}function V1(e,t,n){const r=this;return Ce(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function W1(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",u,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",d,s]],f=s.parser.constructs.insideSpan.null;f&&xt(h,h.length,0,lo(f,a.slice(c+1,l),s)),xt(h,h.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),xt(a,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function o(a,s,l){const c=this.previous,u=this.events;let d=0;return h;function h(m){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(m):(a.enter("strikethroughSequenceTemporary"),f(m))}function f(m){const p=fr(c);if(m===126)return d>1?l(m):(a.consume(m),d++,f);if(d<2&&!n)return l(m);const y=a.exit("strikethroughSequenceTemporary"),b=fr(m);return y._open=!b||b===2&&!!p,y._close=!p||p===2&&!!b,s(m)}}}class K1{constructor(){this.map=[]}add(t,n,r){q1(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function q1(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function G1(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Y1(){return{flow:{null:{name:"table",tokenize:Q1,resolveAll:X1}}}}function Q1(e,t,n){const r=this;let i=0,o=0,a;return s;function s(T){let D=r.events.length-1;for(;D>-1;){const B=r.events[D][1].type;if(B==="lineEnding"||B==="linePrefix")D--;else break}const L=D>-1?r.events[D][1].type:null,K=L==="tableHead"||L==="tableRow"?C:l;return K===C&&r.parser.lazy[r.now().line]?n(T):K(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),c(T)}function c(T){return T===124||(a=!0,o+=1),u(T)}function u(T){return T===null?n(T):ie(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),f):n(T):Se(T)?Ce(e,u,"whitespace")(T):(o+=1,a&&(a=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),a=!0,u):(e.enter("data"),d(T)))}function d(T){return T===null||T===124||Ne(T)?(e.exit("data"),u(T)):(e.consume(T),T===92?h:d)}function h(T){return T===92||T===124?(e.consume(T),d):d(T)}function f(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),a=!1,Se(T)?Ce(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?y(T):T===124?(a=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):I(T)}function p(T){return Se(T)?Ce(e,y,"whitespace")(T):y(T)}function y(T){return T===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),b):T===45?(o+=1,b(T)):T===null||ie(T)?R(T):I(T)}function b(T){return T===45?(e.enter("tableDelimiterFiller"),x(T)):I(T)}function x(T){return T===45?(e.consume(T),x):T===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return Se(T)?Ce(e,R,"whitespace")(T):R(T)}function R(T){return T===124?m(T):T===null||ie(T)?!a||i!==o?I(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):I(T)}function I(T){return n(T)}function C(T){return e.enter("tableRow"),S(T)}function S(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),S):T===null||ie(T)?(e.exit("tableRow"),t(T)):Se(T)?Ce(e,S,"whitespace")(T):(e.enter("data"),N(T))}function N(T){return T===null||T===124||Ne(T)?(e.exit("data"),S(T)):(e.consume(T),T===92?j:N)}function j(T){return T===92||T===124?(e.consume(T),N):N(T)}}function X1(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,u,d;const h=new K1;for(;++n<e.length;){const f=e[n],m=f[1];f[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(Ac(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])),i=m.type==="tableDelimiterRow"?2:u?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],d=mi(h,t,o,i,void 0,d),o=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],d=mi(h,t,o,i,void 0,d)),o=a,a=[o[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(a[0]=a[1],d=mi(h,t,o,i,n,d)):a[1]!==0&&(d=mi(h,t,a,i,n,d)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Ac(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=G1(t.events,n))}return e}function mi(e,t,n,r,i,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},or(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=or(t.events,n[1]);if(o={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const c=or(t.events,n[2]),u=or(t.events,n[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},or(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Ac(e,t,n,r,i){const o=[],a=or(t.events,n);i&&(i.end=Object.assign({},a),o.push(["exit",i,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function or(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const J1={name:"tasklistCheck",tokenize:eE};function Z1(){return{text:{91:J1}}}function eE(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Ne(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return ie(l)?t(l):Se(l)?e.check({tokenize:tE},t,n)(l):n(l)}}function tE(e,t,n){return Ce(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function nE(e){return Fd([T1(),j1(),W1(e),Y1(),Z1()])}const rE={};function iE(e){const t=this,n=e||rE,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(nE(n)),o.push(k1()),a.push(E1(n))}const oE={h1:({children:e,...t})=>v.jsx("h2",{className:"mt-2 mb-1 text-base font-semibold",...t,children:e}),h2:({children:e,...t})=>v.jsx("h3",{className:"mt-2 mb-1 text-sm font-semibold",...t,children:e}),h3:({children:e,...t})=>v.jsx("h4",{className:"mt-1.5 mb-1 text-sm font-semibold",...t,children:e}),h4:({children:e,...t})=>v.jsx("h5",{className:"mt-1.5 mb-1 text-xs font-semibold uppercase tracking-wide text-text-muted",...t,children:e}),h5:({children:e,...t})=>v.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-semibold text-text-muted",...t,children:e}),h6:({children:e,...t})=>v.jsx("h6",{className:"mt-1.5 mb-0.5 text-xs font-medium text-text-muted",...t,children:e}),p:({children:e,...t})=>v.jsx("p",{className:"my-1 leading-relaxed",...t,children:e}),strong:({children:e,...t})=>v.jsx("strong",{className:"font-semibold text-text",...t,children:e}),em:({children:e,...t})=>v.jsx("em",{className:"italic",...t,children:e}),a:({children:e,...t})=>v.jsx("a",{className:"text-accent underline decoration-accent/40 underline-offset-2 hover:decoration-accent",target:"_blank",rel:"noreferrer",...t,children:e}),ul:({children:e,...t})=>v.jsx("ul",{className:"my-1 ml-5 list-disc space-y-0.5",...t,children:e}),ol:({children:e,...t})=>v.jsx("ol",{className:"my-1 ml-5 list-decimal space-y-0.5",...t,children:e}),li:({children:e,...t})=>v.jsx("li",{className:"leading-relaxed",...t,children:e}),blockquote:({children:e,...t})=>v.jsx("blockquote",{className:"my-2 border-l-2 border-border pl-3 text-text-dim",...t,children:e}),code:({inline:e,className:t,children:n,...r})=>e?v.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.85em]",...r,children:n}):v.jsx("code",{className:Ie("font-mono text-xs",t),...r,children:n}),pre:({children:e,...t})=>v.jsx("pre",{className:"my-2 overflow-x-auto rounded bg-surface-2 p-2 text-xs leading-relaxed",...t,children:e}),table:({children:e,...t})=>v.jsx("div",{className:"my-2 overflow-x-auto",children:v.jsx("table",{className:"w-full border-collapse text-xs",...t,children:e})}),thead:({children:e,...t})=>v.jsx("thead",{className:"border-b border-border bg-surface-2/50",...t,children:e}),tbody:({children:e,...t})=>v.jsx("tbody",{...t,children:e}),tr:({children:e,...t})=>v.jsx("tr",{className:"border-b border-border/40 last:border-b-0",...t,children:e}),th:({children:e,...t})=>v.jsx("th",{className:"px-2 py-1 text-left font-semibold",...t,children:e}),td:({children:e,...t})=>v.jsx("td",{className:"px-2 py-1 align-top",...t,children:e}),hr:e=>v.jsx("hr",{className:"my-2 border-border",...e})};function aE({content:e,className:t}){return v.jsx("div",{className:Ie("text-sm leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),children:v.jsx(WS,{remarkPlugins:[iE],components:oE,children:e})})}function sE({msg:e,onApprove:t}){if(e.approval)return v.jsx(lE,{approval:e.approval,onApprove:t});const n=e.role==="user";return v.jsx("div",{className:Ie("flex",n?"justify-end":"justify-start"),children:v.jsxs("div",{className:Ie("max-w-[85%] sm:max-w-[75%] rounded-lg px-3 py-2 shadow-sm",n?"bg-accent text-accent-fg":"bg-surface text-text border border-border"),children:[!n&&e.agent&&v.jsx("div",{className:"mb-1 text-xs font-medium text-text-muted",children:e.agent}),!n&&e.content?v.jsx(aE,{content:e.content,className:"break-words"}):v.jsx("div",{className:"whitespace-pre-wrap break-words text-sm leading-relaxed",children:e.content||e.role==="assistant"&&v.jsx("span",{className:"inline-block animate-pulse text-text-dim",children:"…"})})]})})}function lE({approval:e,onApprove:t}){const{t:n}=St(),{messageId:r,prompt:i,text:o,outcome:a}=e,s=i?.mode==="auto-allow",[l,c]=g.useState(null);g.useEffect(()=>{a&&c(null)},[a]);function u(d){if(l||!i||!t)return;c(d),t(r,i.reqId,d)===!1&&c(null)}return v.jsxs("div",{className:Ie("mx-auto w-full max-w-2xl rounded-lg border p-4",s?"border-warning/60 bg-warning-bg":"border-warning bg-warning-bg",a&&"opacity-90"),children:[v.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[v.jsx(at,{variant:"warning",children:n("chat.approvalTitle",{defaultValue:"🔐 Tool approval"})}),s&&!a&&v.jsx(at,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})})]}),s&&!a&&i&&v.jsx(cE,{graceSeconds:i.graceSeconds??0}),i?v.jsxs("div",{className:"mt-1 flex flex-col gap-2 text-sm",children:[v.jsx(Tc,{label:n("chat.approvalToolLabel",{defaultValue:"Tool"}),children:v.jsx("code",{className:"rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})}),v.jsx(Tc,{label:n("chat.approvalInputLabel",{defaultValue:"Input"}),children:v.jsx("pre",{className:"mt-1 max-h-64 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson})})]}):o?v.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm text-text",children:o}):null,a?v.jsx(uE,{outcome:a}):i?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[!s&&v.jsxs(v.Fragment,{children:[v.jsx(bt,{size:"sm",disabled:l!==null,onClick:()=>u("y"),children:n("chat.approvalAllow",{defaultValue:"Allow"})}),v.jsx(bt,{size:"sm",variant:"secondary",disabled:l!==null,onClick:()=>u("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto",{defaultValue:"Auto for similar"})})]}),v.jsx(bt,{size:"sm",variant:"destructive",disabled:l!==null,onClick:()=>u("n"),children:n("chat.approvalDeny",{defaultValue:"Deny"})})]}),l!==null&&v.jsx("p",{className:"mt-2 text-xs text-text-dim",children:n("chat.approvalSubmitting",{defaultValue:"已发送,等待结果…"})})]}):null]})}function Tc({label:e,children:t}){return v.jsxs("div",{className:"flex flex-col gap-0.5",children:[v.jsx("span",{className:"text-xs font-medium text-text-muted",children:e}),t]})}function cE({graceSeconds:e}){const{t}=St(),[n,r]=g.useState(Math.max(0,e));return g.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:v.jsx("p",{className:"mb-2 text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function uE({outcome:e}){const{t}=St(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return v.jsx("div",{className:"mt-3",children:v.jsxs(at,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]})});case"allowed-pinned":return v.jsx("div",{className:"mt-3",children:v.jsxs(at,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]})});case"denied":return v.jsx("div",{className:"mt-3",children:v.jsxs(at,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]})});case"denied-revoked":return v.jsx("div",{className:"mt-3",children:v.jsxs(at,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]})});case"expired":return v.jsx("div",{className:"mt-3",children:v.jsxs(at,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})})}}function dE({approvals:e,onApprove:t}){return e.length===0?null:v.jsx("div",{className:"border-t border-warning/40 bg-warning-bg/40",children:v.jsx("div",{className:"mx-auto max-h-60 w-full max-w-3xl overflow-y-auto px-3 py-2 sm:px-4",children:v.jsx("div",{className:"flex flex-col gap-2",children:e.map(n=>v.jsx(fE,{entry:n,onApprove:t},n.messageId))})})})}function fE({entry:e,onApprove:t}){const{t:n}=St(),{messageId:r,prompt:i,outcome:o}=e,a=i.mode==="auto-allow",[s,l]=g.useState(null);g.useEffect(()=>{o&&l(null)},[o]);function c(u){if(s||!t)return;l(u),t(r,i.reqId,u)===!1&&l(null)}return v.jsxs("div",{className:Ie("rounded-lg border bg-surface p-3 shadow-sm transition-opacity",o?"border-success/60 opacity-80":"border-warning"),children:[v.jsxs("div",{className:"mb-1.5 flex flex-wrap items-center gap-2",children:[v.jsxs(at,{variant:"warning",className:"gap-1",children:[v.jsx(Qg,{className:"h-3 w-3"}),n("chat.approvalTitle",{defaultValue:"工具授权"})]}),a&&!o&&v.jsx(at,{variant:"outline",className:"text-[10px] uppercase",children:n("chat.approvalAutoBadge",{defaultValue:"auto-allow"})}),a&&!o&&i.graceSeconds!=null&&v.jsx(hE,{graceSeconds:i.graceSeconds}),v.jsx("code",{className:"ml-auto rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs",children:i.toolName})]}),v.jsx("pre",{className:"mb-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 font-mono text-xs leading-relaxed text-text",children:i.inputJson}),o?v.jsx(pE,{outcome:o}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-wrap gap-2",children:[!a&&v.jsxs(v.Fragment,{children:[v.jsx(bt,{size:"sm",disabled:s!==null,onClick:()=>c("y"),children:n("chat.approvalAllow",{defaultValue:"批准"})}),v.jsx(bt,{size:"sm",variant:"secondary",disabled:s!==null,onClick:()=>c("a"),title:n("chat.approvalAutoTip",{defaultValue:"Allow and auto-allow similar calls for the rest of the session"}),children:n("chat.approvalAuto",{defaultValue:"本类自动放行"})})]}),v.jsx(bt,{size:"sm",variant:"destructive",disabled:s!==null,onClick:()=>c("n"),children:n("chat.approvalDeny",{defaultValue:"拒绝"})})]}),s!==null&&v.jsx("p",{className:"mt-1.5 text-xs text-text-dim",children:n("chat.approvalSubmitting",{defaultValue:"已发送,等待结果…"})})]})]})}function hE({graceSeconds:e}){const{t}=St(),[n,r]=g.useState(Math.max(0,e));return g.useEffect(()=>{if(e<=0)return;r(e);const i=setInterval(()=>{r(o=>o>0?o-1:0)},1e3);return()=>clearInterval(i)},[e]),e<=0?null:v.jsx("span",{className:"text-xs text-warning",children:n>0?t("chat.approvalAutoIn",{count:n,defaultValue:"Auto-allowing in {{count}}s — Deny to stop."}):t("chat.approvalAutoResolving",{defaultValue:"Auto-allowing now…"})})}function pE({outcome:e}){const{t}=St(),n=e.byUserDisplay?` · ${e.byUserDisplay}`:"";switch(e.decision){case"allowed":return v.jsxs(at,{variant:"success",children:[t("chat.outcome.allowed",{defaultValue:"✅ Allowed"}),n]});case"allowed-pinned":return v.jsxs(at,{variant:"success",children:[t("chat.outcome.allowedPinned",{defaultValue:"✅ Allowed + auto-allow further"}),n]});case"denied":return v.jsxs(at,{variant:"danger",children:[t("chat.outcome.denied",{defaultValue:"❌ Denied"}),n]});case"denied-revoked":return v.jsxs(at,{variant:"danger",children:[t("chat.outcome.deniedRevoked",{defaultValue:"❌ Denied (auto-allow revoked)"}),n]});case"expired":return v.jsxs(at,{variant:"outline",children:[t("chat.outcome.expired",{defaultValue:"⏱ Timed out"}),n]})}}function Rc(e,[t,n]){return Math.min(n,Math.max(t,e))}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function LN(e,t){const n=g.createContext(t),r=o=>{const{children:a,...s}=o,l=g.useMemo(()=>s,Object.values(s));return v.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(o){const a=g.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function ho(e,t=[]){let n=[];function r(o,a){const s=g.createContext(a),l=n.length;n=[...n,a];const c=d=>{const{scope:h,children:f,...m}=d,p=h?.[e]?.[l]||s,y=g.useMemo(()=>m,Object.values(m));return v.jsx(p.Provider,{value:y,children:f})};c.displayName=o+"Provider";function u(d,h){const f=h?.[e]?.[l]||s,m=g.useContext(f);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(a=>g.createContext(a));return function(s){const l=s?.[e]||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,mE(i,...t)]}function mE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Pc(e){const t=gE(e),n=g.forwardRef((r,i)=>{const{children:o,...a}=r,s=g.Children.toArray(o),l=s.find(vE);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return v.jsx(t,{...a,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return v.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function gE(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const a=xE(i),s=bE(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ei(r,a):a),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yE=Symbol("radix.slottable");function vE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yE}function bE(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function xE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wE(e){const t=e+"CollectionProvider",[n,r]=ho(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:y,children:b}=p,x=z.useRef(null),w=z.useRef(new Map).current;return v.jsx(i,{scope:y,itemMap:w,collectionRef:x,children:b})};a.displayName=t;const s=e+"CollectionSlot",l=Pc(s),c=z.forwardRef((p,y)=>{const{scope:b,children:x}=p,w=o(s,b),R=Ye(y,w.collectionRef);return v.jsx(l,{ref:R,children:x})});c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=Pc(u),f=z.forwardRef((p,y)=>{const{scope:b,children:x,...w}=p,R=z.useRef(null),I=Ye(y,R),C=o(u,b);return z.useEffect(()=>(C.itemMap.set(R,{ref:R,...w}),()=>void C.itemMap.delete(R))),v.jsx(h,{[d]:"",ref:I,children:x})});f.displayName=u;function m(p){const y=o(e+"CollectionConsumer",p);return z.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,S)=>w.indexOf(C.ref.current)-w.indexOf(S.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:c,ItemSlot:f},m,r]}var SE=g.createContext(void 0);function kE(e){const t=g.useContext(SE);return e||t||"ltr"}function EE(e){const t=CE(e),n=g.forwardRef((r,i)=>{const{children:o,...a}=r,s=g.Children.toArray(o),l=s.find(TE);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return v.jsx(t,{...a,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return v.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function CE(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const a=PE(i),s=RE(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ei(r,a):a),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AE=Symbol("radix.slottable");function TE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AE}function RE(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function PE(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var IE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=IE.reduce((e,t)=>{const n=EE(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:a,...s}=i,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function LE(e,t){e&&Jr.flushSync(()=>e.dispatchEvent(t))}function zn(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}function OE(e,t=globalThis?.document){const n=zn(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var _E="DismissableLayer",Oa="dismissableLayer.update",NE="dismissableLayer.pointerDownOutside",DE="dismissableLayer.focusOutside",Ic,If=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),As=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,c=g.useContext(If),[u,d]=g.useState(null),h=u?.ownerDocument??globalThis?.document,[,f]=g.useState({}),m=Ye(t,S=>d(S)),p=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=p.indexOf(y),x=u?p.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,R=x>=b,I=FE(S=>{const N=S.target,j=[...c.branches].some(T=>T.contains(N));!R||j||(i?.(S),a?.(S),S.defaultPrevented||s?.())},h),C=BE(S=>{const N=S.target;[...c.branches].some(T=>T.contains(N))||(o?.(S),a?.(S),S.defaultPrevented||s?.())},h);return OE(S=>{x===c.layers.size-1&&(r?.(S),!S.defaultPrevented&&s&&(S.preventDefault(),s()))},h),g.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ic=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Lc(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ic)}},[u,h,n,c]),g.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Lc())},[u,c]),g.useEffect(()=>{const S=()=>f({});return document.addEventListener(Oa,S),()=>document.removeEventListener(Oa,S)},[]),v.jsx(We.div,{...l,ref:m,style:{pointerEvents:w?R?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,C.onFocusCapture),onBlurCapture:je(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,I.onPointerDownCapture)})});As.displayName=_E;var ME="DismissableLayerBranch",jE=g.forwardRef((e,t)=>{const n=g.useContext(If),r=g.useRef(null),i=Ye(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),v.jsx(We.div,{...e,ref:i})});jE.displayName=ME;function FE(e,t=globalThis?.document){const n=zn(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){Lf(NE,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function BE(e,t=globalThis?.document){const n=zn(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Lf(DE,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lc(){const e=new CustomEvent(Oa);document.dispatchEvent(e)}function Lf(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?LE(i,o):i.dispatchEvent(o)}var Ko=0;function HE(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Oc()),document.body.insertAdjacentElement("beforeend",e[1]??Oc()),Ko++,()=>{Ko===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ko--}},[])}function Oc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qo="focusScope.autoFocusOnMount",Go="focusScope.autoFocusOnUnmount",_c={bubbles:!1,cancelable:!0},UE="FocusScope",Of=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=g.useState(null),c=zn(i),u=zn(o),d=g.useRef(null),h=Ye(t,p=>l(p)),f=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let p=function(w){if(f.paused||!s)return;const R=w.target;s.contains(R)?d.current=R:mn(d.current,{select:!0})},y=function(w){if(f.paused||!s)return;const R=w.relatedTarget;R!==null&&(s.contains(R)||mn(d.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const I of w)I.removedNodes.length>0&&mn(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const x=new MutationObserver(b);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),x.disconnect()}}},[r,s,f.paused]),g.useEffect(()=>{if(s){Dc.add(f);const p=document.activeElement;if(!s.contains(p)){const b=new CustomEvent(qo,_c);s.addEventListener(qo,c),s.dispatchEvent(b),b.defaultPrevented||(zE(qE(_f(s)),{select:!0}),document.activeElement===p&&mn(s))}return()=>{s.removeEventListener(qo,c),setTimeout(()=>{const b=new CustomEvent(Go,_c);s.addEventListener(Go,u),s.dispatchEvent(b),b.defaultPrevented||mn(p??document.body,{select:!0}),s.removeEventListener(Go,u),Dc.remove(f)},0)}}},[s,c,u,f]);const m=g.useCallback(p=>{if(!n&&!r||f.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,b=document.activeElement;if(y&&b){const x=p.currentTarget,[w,R]=$E(x);w&&R?!p.shiftKey&&b===R?(p.preventDefault(),n&&mn(w,{select:!0})):p.shiftKey&&b===w&&(p.preventDefault(),n&&mn(R,{select:!0})):b===x&&p.preventDefault()}},[n,r,f.paused]);return v.jsx(We.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});Of.displayName=UE;function zE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mn(r,{select:t}),document.activeElement!==n)return}function $E(e){const t=_f(e),n=Nc(t,e),r=Nc(t.reverse(),e);return[n,r]}function _f(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Nc(e,t){for(const n of e)if(!VE(n,{upTo:t}))return n}function VE(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function WE(e){return e instanceof HTMLInputElement&&"select"in e}function mn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WE(e)&&t&&e.select()}}var Dc=KE();function KE(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Mc(e,t),e.unshift(t)},remove(t){e=Mc(e,t),e[0]?.resume()}}}function Mc(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function qE(e){return e.filter(t=>t.tagName!=="A")}var rt=globalThis?.document?g.useLayoutEffect:()=>{},GE=eo[" useId ".trim().toString()]||(()=>{}),YE=0;function Ts(e){const[t,n]=g.useState(GE());return rt(()=>{n(r=>r??String(YE++))},[e]),t?`radix-${t}`:""}const QE=["top","right","bottom","left"],yn=Math.min,vt=Math.max,zi=Math.round,gi=Math.floor,qt=e=>({x:e,y:e}),XE={left:"right",right:"left",bottom:"top",top:"bottom"};function _a(e,t,n){return vt(e,yn(t,n))}function nn(e,t){return typeof e=="function"?e(t):e}function rn(e){return e.split("-")[0]}function xr(e){return e.split("-")[1]}function Rs(e){return e==="x"?"y":"x"}function Ps(e){return e==="y"?"height":"width"}function Wt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Is(e){return Rs(Wt(e))}function JE(e,t,n){n===void 0&&(n=!1);const r=xr(e),i=Is(e),o=Ps(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=$i(a)),[a,$i(a)]}function ZE(e){const t=$i(e);return[Na(e),t,Na(t)]}function Na(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jc=["left","right"],Fc=["right","left"],eC=["top","bottom"],tC=["bottom","top"];function nC(e,t,n){switch(e){case"top":case"bottom":return n?t?Fc:jc:t?jc:Fc;case"left":case"right":return t?eC:tC;default:return[]}}function rC(e,t,n,r){const i=xr(e);let o=nC(rn(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Na)))),o}function $i(e){const t=rn(e);return XE[t]+e.slice(t.length)}function iC(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nf(e){return typeof e!="number"?iC(e):{top:e,right:e,bottom:e,left:e}}function Vi(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bc(e,t,n){let{reference:r,floating:i}=e;const o=Wt(t),a=Is(t),s=Ps(a),l=rn(t),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(xr(t)){case"start":f[a]-=h*(n&&c?-1:1);break;case"end":f[a]+=h*(n&&c?-1:1);break}return f}async function oC(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=nn(t,e),m=Nf(f),y=s[h?d==="floating"?"reference":"floating":d],b=Vi(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),R=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},I=Vi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-I.top+m.top)/R.y,bottom:(I.bottom-b.bottom+m.bottom)/R.y,left:(b.left-I.left+m.left)/R.x,right:(I.right-b.right+m.right)/R.x}}const aC=50,sC=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:oC},l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bc(c,r,l),h=r,f=0;const m={};for(let p=0;p<o.length;p++){const y=o[p];if(!y)continue;const{name:b,fn:x}=y,{x:w,y:R,data:I,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:m,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=R??d,m[b]={...m[b],...I},C&&f<aC&&(f++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(c=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:d}=Bc(c,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:m}},lC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=nn(e,t)||{};if(c==null)return{};const d=Nf(u),h={x:n,y:r},f=Is(i),m=Ps(f),p=await a.getDimensions(c),y=f==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",R=o.reference[m]+o.reference[f]-h[f]-o.floating[m],I=h[f]-o.reference[f],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let S=C?C[w]:0;(!S||!await(a.isElement==null?void 0:a.isElement(C)))&&(S=s.floating[w]||o.floating[m]);const N=R/2-I/2,j=S/2-p[m]/2-1,T=yn(d[b],j),D=yn(d[x],j),L=T,K=S-p[m]-D,B=S/2-p[m]/2+N,V=_a(L,B,K),q=!l.arrow&&xr(i)!=null&&B!==V&&o.reference[m]/2-(B<L?T:D)-p[m]/2<0,Q=q?B<L?B-L:B-K:0;return{[f]:h[f]+Q,data:{[f]:V,centerOffset:B-V-Q,...q&&{alignmentOffset:Q}},reset:q}}}),cC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...y}=nn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=rn(i),x=Wt(s),w=rn(s)===s,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(w||!p?[$i(s)]:ZE(s)),C=m!=="none";!h&&C&&I.push(...rC(s,p,m,R));const S=[s,...I],N=await l.detectOverflow(t,y),j=[];let T=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&j.push(N[b]),d){const B=JE(i,a,R);j.push(N[B[0]],N[B[1]])}if(T=[...T,{placement:i,overflows:j}],!j.every(B=>B<=0)){var D,L;const B=(((D=o.flip)==null?void 0:D.index)||0)+1,V=S[B];if(V&&(!(d==="alignment"?x!==Wt(V):!1)||T.every($=>Wt($.placement)===x?$.overflows[0]>0:!0)))return{data:{index:B,overflows:T},reset:{placement:V}};let q=(L=T.filter(Q=>Q.overflows[0]<=0).sort((Q,$)=>Q.overflows[1]-$.overflows[1])[0])==null?void 0:L.placement;if(!q)switch(f){case"bestFit":{var K;const Q=(K=T.filter($=>{if(C){const F=Wt($.placement);return F===x||F==="y"}return!0}).map($=>[$.placement,$.overflows.filter(F=>F>0).reduce((F,k)=>F+k,0)]).sort(($,F)=>$[1]-F[1])[0])==null?void 0:K[0];Q&&(q=Q);break}case"initialPlacement":q=s;break}if(i!==q)return{reset:{placement:q}}}return{}}}};function Hc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Uc(e){return QE.some(t=>e[t]>=0)}const uC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=nn(e,t);switch(i){case"referenceHidden":{const a=await r.detectOverflow(t,{...o,elementContext:"reference"}),s=Hc(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Uc(s)}}}case"escaped":{const a=await r.detectOverflow(t,{...o,altBoundary:!0}),s=Hc(a,n.floating);return{data:{escapedOffsets:s,escaped:Uc(s)}}}default:return{}}}}},Df=new Set(["left","top"]);async function dC(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=rn(n),s=xr(n),l=Wt(n)==="y",c=Df.has(a)?-1:1,u=o&&l?-1:1,d=nn(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(f=s==="end"?m*-1:m),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const fC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await dC(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},hC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...c}=nn(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),h=Wt(rn(i)),f=Rs(h);let m=u[f],p=u[h];if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=m+d[b],R=m-d[x];m=_a(w,m,R)}if(s){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",w=p+d[b],R=p-d[x];p=_a(w,p,R)}const y=l.fn({...t,[f]:m,[h]:p});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:a,[h]:s}}}}}},pC=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=nn(e,t),u={x:n,y:r},d=Wt(i),h=Rs(d);let f=u[h],m=u[d];const p=nn(s,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const w=h==="y"?"height":"width",R=o.reference[h]-o.floating[w]+y.mainAxis,I=o.reference[h]+o.reference[w]-y.mainAxis;f<R?f=R:f>I&&(f=I)}if(c){var b,x;const w=h==="y"?"width":"height",R=Df.has(rn(i)),I=o.reference[d]-o.floating[w]+(R&&((b=a.offset)==null?void 0:b[d])||0)+(R?0:y.crossAxis),C=o.reference[d]+o.reference[w]+(R?0:((x=a.offset)==null?void 0:x[d])||0)-(R?y.crossAxis:0);m<I?m=I:m>C&&(m=C)}return{[h]:f,[d]:m}}}},mC=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...c}=nn(e,t),u=await a.detectOverflow(t,c),d=rn(i),h=xr(i),f=Wt(i)==="y",{width:m,height:p}=o.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=h===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,y=h==="end"?"top":"bottom");const x=p-u.top-u.bottom,w=m-u.left-u.right,R=yn(p-u[y],x),I=yn(m-u[b],w),C=!t.middlewareData.shift;let S=R,N=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=x),C&&!h){const T=vt(u.left,0),D=vt(u.right,0),L=vt(u.top,0),K=vt(u.bottom,0);f?N=m-2*(T!==0||D!==0?T+D:vt(u.left,u.right)):S=p-2*(L!==0||K!==0?L+K:vt(u.top,u.bottom))}await l({...t,availableWidth:N,availableHeight:S});const j=await a.getDimensions(s.floating);return m!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function po(){return typeof window<"u"}function wr(e){return Mf(e)?(e.nodeName||"").toLowerCase():"#document"}function wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yt(e){var t;return(t=(Mf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mf(e){return po()?e instanceof Node||e instanceof wt(e).Node:!1}function Nt(e){return po()?e instanceof Element||e instanceof wt(e).Element:!1}function cn(e){return po()?e instanceof HTMLElement||e instanceof wt(e).HTMLElement:!1}function zc(e){return!po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wt(e).ShadowRoot}function oi(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Dt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function gC(e){return/^(table|td|th)$/.test(wr(e))}function mo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const yC=/transform|translate|scale|rotate|perspective|filter/,vC=/paint|layout|strict|content/,Ln=e=>!!e&&e!=="none";let Yo;function Ls(e){const t=Nt(e)?Dt(e):e;return Ln(t.transform)||Ln(t.translate)||Ln(t.scale)||Ln(t.rotate)||Ln(t.perspective)||!Os()&&(Ln(t.backdropFilter)||Ln(t.filter))||yC.test(t.willChange||"")||vC.test(t.contain||"")}function bC(e){let t=vn(e);for(;cn(t)&&!hr(t);){if(Ls(t))return t;if(mo(t))return null;t=vn(t)}return null}function Os(){return Yo==null&&(Yo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Yo}function hr(e){return/^(html|body|#document)$/.test(wr(e))}function Dt(e){return wt(e).getComputedStyle(e)}function go(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vn(e){if(wr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zc(e)&&e.host||Yt(e);return zc(t)?t.host:t}function jf(e){const t=vn(e);return hr(t)?e.ownerDocument?e.ownerDocument.body:e.body:cn(t)&&oi(t)?t:jf(t)}function Yr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=jf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=wt(i);if(o){const s=Da(a);return t.concat(a,a.visualViewport||[],oi(i)?i:[],s&&n?Yr(s):[])}else return t.concat(i,Yr(i,[],n))}function Da(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ff(e){const t=Dt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cn(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=zi(n)!==o||zi(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function _s(e){return Nt(e)?e:e.contextElement}function cr(e){const t=_s(e);if(!cn(t))return qt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Ff(t);let a=(o?zi(n.width):n.width)/r,s=(o?zi(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const xC=qt(0);function Bf(e){const t=wt(e);return!Os()||!t.visualViewport?xC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wt(e)?!1:t}function $n(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=_s(e);let a=qt(1);t&&(r?Nt(r)&&(a=cr(r)):a=cr(e));const s=wC(o,n,r)?Bf(o):qt(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const h=wt(o),f=r&&Nt(r)?wt(r):r;let m=h,p=Da(m);for(;p&&r&&f!==m;){const y=cr(p),b=p.getBoundingClientRect(),x=Dt(p),w=b.left+(p.clientLeft+parseFloat(x.paddingLeft))*y.x,R=b.top+(p.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,d*=y.y,l+=w,c+=R,m=wt(p),p=Da(m)}}return Vi({width:u,height:d,x:l,y:c})}function yo(e,t){const n=go(e).scrollLeft;return t?t.left+n:$n(Yt(e)).left+n}function Hf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-yo(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function SC(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=Yt(r),s=t?mo(t.floating):!1;if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=qt(1);const u=qt(0),d=cn(r);if((d||!d&&!o)&&((wr(r)!=="body"||oi(a))&&(l=go(r)),d)){const f=$n(r);c=cr(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const h=a&&!d&&!o?Hf(a,l):qt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function kC(e){return Array.from(e.getClientRects())}function EC(e){const t=Yt(e),n=go(e),r=e.ownerDocument.body,i=vt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=vt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+yo(e);const s=-n.scrollTop;return Dt(r).direction==="rtl"&&(a+=vt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}const $c=25;function CC(e,t){const n=wt(e),r=Yt(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=Os();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=yo(r);if(c<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-f);m<=$c&&(o-=m)}else c<=$c&&(o+=c);return{width:o,height:a,x:s,y:l}}function AC(e,t){const n=$n(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=cn(e)?cr(e):qt(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function Vc(e,t,n){let r;if(t==="viewport")r=CC(e,n);else if(t==="document")r=EC(Yt(e));else if(Nt(t))r=AC(t,n);else{const i=Bf(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Vi(r)}function Uf(e,t){const n=vn(e);return n===t||!Nt(n)||hr(n)?!1:Dt(n).position==="fixed"||Uf(n,t)}function TC(e,t){const n=t.get(e);if(n)return n;let r=Yr(e,[],!1).filter(s=>Nt(s)&&wr(s)!=="body"),i=null;const o=Dt(e).position==="fixed";let a=o?vn(e):e;for(;Nt(a)&&!hr(a);){const s=Dt(a),l=Ls(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||oi(a)&&!l&&Uf(e,a))?r=r.filter(u=>u!==a):i=s,a=vn(a)}return t.set(e,r),r}function RC(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?mo(t)?[]:TC(t,this._c):[].concat(n),r],s=Vc(t,a[0],i);let l=s.top,c=s.right,u=s.bottom,d=s.left;for(let h=1;h<a.length;h++){const f=Vc(t,a[h],i);l=vt(f.top,l),c=yn(f.right,c),u=yn(f.bottom,u),d=vt(f.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function PC(e){const{width:t,height:n}=Ff(e);return{width:t,height:n}}function IC(e,t,n){const r=cn(t),i=Yt(t),o=n==="fixed",a=$n(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=qt(0);function c(){l.x=yo(i)}if(r||!r&&!o)if((wr(t)!=="body"||oi(i))&&(s=go(t)),r){const f=$n(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?Hf(i,s):qt(0),d=a.left+s.scrollLeft-l.x-u.x,h=a.top+s.scrollTop-l.y-u.y;return{x:d,y:h,width:a.width,height:a.height}}function Qo(e){return Dt(e).position==="static"}function Wc(e,t){if(!cn(e)||Dt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yt(e)===n&&(n=n.ownerDocument.body),n}function zf(e,t){const n=wt(e);if(mo(e))return n;if(!cn(e)){let i=vn(e);for(;i&&!hr(i);){if(Nt(i)&&!Qo(i))return i;i=vn(i)}return n}let r=Wc(e,t);for(;r&&gC(r)&&Qo(r);)r=Wc(r,t);return r&&hr(r)&&Qo(r)&&!Ls(r)?n:r||bC(e)||n}const LC=async function(e){const t=this.getOffsetParent||zf,n=this.getDimensions,r=await n(e.floating);return{reference:IC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OC(e){return Dt(e).direction==="rtl"}const _C={convertOffsetParentRelativeRectToViewportRelativeRect:SC,getDocumentElement:Yt,getClippingRect:RC,getOffsetParent:zf,getElementRects:LC,getClientRects:kC,getDimensions:PC,getScale:cr,isElement:Nt,isRTL:OC};function $f(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function NC(e,t){let n=null,r;const i=Yt(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:f}=c;if(s||t(),!h||!f)return;const m=gi(d),p=gi(i.clientWidth-(u+h)),y=gi(i.clientHeight-(d+f)),b=gi(u),w={rootMargin:-m+"px "+-p+"px "+-y+"px "+-b+"px",threshold:vt(0,yn(1,l))||1};let R=!0;function I(C){const S=C[0].intersectionRatio;if(S!==l){if(!R)return a();S?a(!1,S):r=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!$f(c,e.getBoundingClientRect())&&a(),R=!1}try{n=new IntersectionObserver(I,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,w)}n.observe(e)}return a(!0),o}function DC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=_s(e),u=i||o?[...c?Yr(c):[],...t?Yr(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const d=c&&s?NC(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!l&&f.observe(c),t&&f.observe(t));let m,p=l?$n(e):null;l&&y();function y(){const b=$n(e);p&&!$f(p,b)&&n(),p=b,m=requestAnimationFrame(y)}return n(),()=>{var b;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d?.(),(b=f)==null||b.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const MC=fC,jC=hC,FC=cC,BC=mC,HC=uC,Kc=lC,UC=pC,zC=(e,t,n)=>{const r=new Map,i={platform:_C,...n},o={...i.platform,_c:r};return sC(e,t,{...i,platform:o})};var $C=typeof document<"u",VC=function(){},Ti=$C?g.useLayoutEffect:VC;function Wi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Wi(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Wi(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Vf(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qc(e,t){const n=Vf(e);return Math.round(t*n)/n}function Xo(e){const t=g.useRef(e);return Ti(()=>{t.current=e}),t}function WC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=g.useState(r);Wi(h,r)||f(r);const[m,p]=g.useState(null),[y,b]=g.useState(null),x=g.useCallback($=>{$!==C.current&&(C.current=$,p($))},[]),w=g.useCallback($=>{$!==S.current&&(S.current=$,b($))},[]),R=o||m,I=a||y,C=g.useRef(null),S=g.useRef(null),N=g.useRef(u),j=l!=null,T=Xo(l),D=Xo(i),L=Xo(c),K=g.useCallback(()=>{if(!C.current||!S.current)return;const $={placement:t,strategy:n,middleware:h};D.current&&($.platform=D.current),zC(C.current,S.current,$).then(F=>{const k={...F,isPositioned:L.current!==!1};B.current&&!Wi(N.current,k)&&(N.current=k,Jr.flushSync(()=>{d(k)}))})},[h,t,n,D,L]);Ti(()=>{c===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d($=>({...$,isPositioned:!1})))},[c]);const B=g.useRef(!1);Ti(()=>(B.current=!0,()=>{B.current=!1}),[]),Ti(()=>{if(R&&(C.current=R),I&&(S.current=I),R&&I){if(T.current)return T.current(R,I,K);K()}},[R,I,K,T,j]);const V=g.useMemo(()=>({reference:C,floating:S,setReference:x,setFloating:w}),[x,w]),q=g.useMemo(()=>({reference:R,floating:I}),[R,I]),Q=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!q.floating)return $;const F=qc(q.floating,u.x),k=qc(q.floating,u.y);return s?{...$,transform:"translate("+F+"px, "+k+"px)",...Vf(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:k}},[n,s,q.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:K,refs:V,elements:q,floatingStyles:Q}),[u,K,V,q,Q])}const KC=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Kc({element:r.current,padding:i}).fn(n):{}:r?Kc({element:r,padding:i}).fn(n):{}}}},qC=(e,t)=>{const n=MC(e);return{name:n.name,fn:n.fn,options:[e,t]}},GC=(e,t)=>{const n=jC(e);return{name:n.name,fn:n.fn,options:[e,t]}},YC=(e,t)=>({fn:UC(e).fn,options:[e,t]}),QC=(e,t)=>{const n=FC(e);return{name:n.name,fn:n.fn,options:[e,t]}},XC=(e,t)=>{const n=BC(e);return{name:n.name,fn:n.fn,options:[e,t]}},JC=(e,t)=>{const n=HC(e);return{name:n.name,fn:n.fn,options:[e,t]}},ZC=(e,t)=>{const n=KC(e);return{name:n.name,fn:n.fn,options:[e,t]}};var eA="Arrow",Wf=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return v.jsx(We.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});Wf.displayName=eA;var tA=Wf;function nA(e){const[t,n]=g.useState(void 0);return rt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ns="Popper",[Kf,vo]=ho(Ns),[rA,qf]=Kf(Ns),Gf=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return v.jsx(rA,{scope:t,anchor:r,onAnchorChange:i,children:n})};Gf.displayName=Ns;var Yf="PopperAnchor",Qf=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=qf(Yf,n),a=g.useRef(null),s=Ye(t,a),l=g.useRef(null);return g.useEffect(()=>{const c=l.current;l.current=r?.current||a.current,c!==l.current&&o.onAnchorChange(l.current)}),r?null:v.jsx(We.div,{...i,ref:s})});Qf.displayName=Yf;var Ds="PopperContent",[iA,oA]=Kf(Ds),Xf=g.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:m,...p}=e,y=qf(Ds,n),[b,x]=g.useState(null),w=Ye(t,W=>x(W)),[R,I]=g.useState(null),C=nA(R),S=C?.width??0,N=C?.height??0,j=r+(o!=="center"?"-"+o:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(c)?c:[c],L=D.length>0,K={padding:T,boundary:D.filter(sA),altBoundary:L},{refs:B,floatingStyles:V,placement:q,isPositioned:Q,middlewareData:$}=WC({strategy:"fixed",placement:j,whileElementsMounted:(...W)=>DC(...W,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[qC({mainAxis:i+N,alignmentAxis:a}),l&&GC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?YC():void 0,...K}),l&&QC({...K}),XC({...K,apply:({elements:W,rects:ye,availableWidth:Le,availableHeight:be})=>{const{width:we,height:de}=ye.reference,Be=W.floating.style;Be.setProperty("--radix-popper-available-width",`${Le}px`),Be.setProperty("--radix-popper-available-height",`${be}px`),Be.setProperty("--radix-popper-anchor-width",`${we}px`),Be.setProperty("--radix-popper-anchor-height",`${de}px`)}}),R&&ZC({element:R,padding:s}),lA({arrowWidth:S,arrowHeight:N}),h&&JC({strategy:"referenceHidden",...K})]}),[F,k]=eh(q),se=zn(m);rt(()=>{Q&&se?.()},[Q,se]);const te=$.arrow?.x,E=$.arrow?.y,oe=$.arrow?.centerOffset!==0,[fe,ge]=g.useState();return rt(()=>{b&&ge(window.getComputedStyle(b).zIndex)},[b]),v.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(iA,{scope:n,placedSide:F,onArrowChange:I,arrowX:te,arrowY:E,shouldHideArrow:oe,children:v.jsx(We.div,{"data-side":F,"data-align":k,...p,ref:w,style:{...p.style,animation:Q?void 0:"none"}})})})});Xf.displayName=Ds;var Jf="PopperArrow",aA={top:"bottom",right:"left",bottom:"top",left:"right"},Zf=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=oA(Jf,r),a=aA[o.placedSide];return v.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:v.jsx(tA,{...i,ref:n,style:{...i.style,display:"block"}})})});Zf.displayName=Jf;function sA(e){return e!==null}var lA=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=eh(n),d={start:"0%",center:"50%",end:"100%"}[u],h=(i.arrow?.x??0)+s/2,f=(i.arrow?.y??0)+l/2;let m="",p="";return c==="bottom"?(m=a?d:`${h}px`,p=`${-l}px`):c==="top"?(m=a?d:`${h}px`,p=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,p=a?d:`${f}px`):c==="left"&&(m=`${r.floating.width+l}px`,p=a?d:`${f}px`),{data:{x:m,y:p}}}});function eh(e){const[t,n="center"]=e.split("-");return[t,n]}var cA=Gf,th=Qf,nh=Xf,rh=Zf,uA="Portal",ih=g.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=g.useState(!1);rt(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?Su.createPortal(v.jsx(We.div,{...r,ref:t}),a):null});ih.displayName=uA;function dA(e){const t=fA(e),n=g.forwardRef((r,i)=>{const{children:o,...a}=r,s=g.Children.toArray(o),l=s.find(pA);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return v.jsx(t,{...a,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return v.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function fA(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const a=gA(i),s=mA(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ei(r,a):a),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hA=Symbol("radix.slottable");function pA(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hA}function mA(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const l=o(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function gA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yA=eo[" useInsertionEffect ".trim().toString()]||rt;function Gc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=vA({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=g.useCallback(u=>{if(s){const d=bA(u)?u(e):u;d!==e&&a.current?.(d)}else o(u)},[s,e,o,a]);return[l,c]}function vA({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return yA(()=>{o.current=t},[t]),g.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function bA(e){return typeof e=="function"}function xA(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var oh=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wA="VisuallyHidden",ah=g.forwardRef((e,t)=>v.jsx(We.span,{...e,ref:t,style:{...oh,...e.style}}));ah.displayName=wA;var SA=ah,kA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},er=new WeakMap,yi=new WeakMap,vi={},Jo=0,sh=function(e){return e&&(e.host||sh(e.parentNode))},EA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sh(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},CA=function(e,t,n,r){var i=EA(t,Array.isArray(e)?e:[e]);vi[n]||(vi[n]=new WeakMap);var o=vi[n],a=[],s=new Set,l=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))u(h);else try{var f=h.getAttribute(r),m=f!==null&&f!=="false",p=(er.get(h)||0)+1,y=(o.get(h)||0)+1;er.set(h,p),o.set(h,y),a.push(h),p===1&&m&&yi.set(h,!0),y===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return u(t),s.clear(),Jo++,function(){a.forEach(function(d){var h=er.get(d)-1,f=o.get(d)-1;er.set(d,h),o.set(d,f),h||(yi.has(d)||d.removeAttribute(r),yi.delete(d)),f||d.removeAttribute(n)}),Jo--,Jo||(er=new WeakMap,er=new WeakMap,yi=new WeakMap,vi={})}},AA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=kA(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),CA(r,i,n,"aria-hidden")):function(){return null}},Vt=function(){return Vt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vt.apply(this,arguments)};function lh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function TA(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Ri="right-scroll-bar-position",Pi="width-before-scroll-bar",RA="with-scroll-bars-hidden",PA="--removed-body-scroll-bar-size";function Zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function IA(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var LA=typeof window<"u"?g.useLayoutEffect:g.useEffect,Yc=new WeakMap;function OA(e,t){var n=IA(null,function(r){return e.forEach(function(i){return Zo(i,r)})});return LA(function(){var r=Yc.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(s){o.has(s)||Zo(s,null)}),o.forEach(function(s){i.has(s)||Zo(s,a)})}Yc.set(n,e)},[e]),n}function _A(e){return e}function NA(e,t){t===void 0&&(t=_A);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var u=a;a=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return i}function DA(e){e===void 0&&(e={});var t=NA(null);return t.options=Vt({async:!0,ssr:!1},e),t}var ch=function(e){var t=e.sideCar,n=lh(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,Vt({},n))};ch.isSideCarExport=!0;function MA(e,t){return e.useMedium(t),ch}var uh=DA(),ea=function(){},bo=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:ea,onWheelCapture:ea,onTouchMoveCapture:ea}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,p=e.inert,y=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,w=e.gapMode,R=lh(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=h,C=OA([n,t]),S=Vt(Vt({},R),i);return g.createElement(g.Fragment,null,u&&g.createElement(I,{sideCar:uh,removeScrollBar:c,shards:d,noRelative:f,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:w}),a?g.cloneElement(g.Children.only(s),Vt(Vt({},S),{ref:C})):g.createElement(x,Vt({},S,{className:l,ref:C}),s))});bo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};bo.classNames={fullWidth:Pi,zeroRight:Ri};var jA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function FA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jA();return t&&e.setAttribute("nonce",t),e}function BA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var UA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=FA())&&(BA(t,n),HA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zA=function(){var e=UA();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dh=function(){var e=zA(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},$A={left:0,top:0,right:0,gap:0},ta=function(e){return parseInt(e||"",10)||0},VA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ta(n),ta(r),ta(i)]},WA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $A;var t=VA(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},KA=dh(),ur="data-scroll-locked",qA=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
158
158
  .`.concat(RA,` {
159
159
  overflow: hidden `).concat(r,`;
160
160
  padding-right: `).concat(s,"px ").concat(r,`;
@@ -191,9 +191,9 @@ import{e as g,r as Jr,R as eo,b as kp,a as z,c as ku,d as Ii,g as Su}from"./reac
191
191
  body[`).concat(ur,`] {
192
192
  `).concat(PA,": ").concat(s,`px;
193
193
  }
194
- `)},Qc=function(){var e=parseInt(document.body.getAttribute(ur)||"0",10);return isFinite(e)?e:0},GA=function(){g.useEffect(function(){return document.body.setAttribute(ur,(Qc()+1).toString()),function(){var e=Qc()-1;e<=0?document.body.removeAttribute(ur):document.body.setAttribute(ur,e.toString())}},[])},YA=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;GA();var o=g.useMemo(function(){return WA(i)},[i]);return g.createElement(KA,{styles:qA(o,!t,i,n?"":"!important")})},Ma=!1;if(typeof window<"u")try{var vi=Object.defineProperty({},"passive",{get:function(){return Ma=!0,!0}});window.addEventListener("test",vi,vi),window.removeEventListener("test",vi,vi)}catch{Ma=!1}var tr=Ma?{passive:!1}:!1,QA=function(e){return e.tagName==="TEXTAREA"},fh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!QA(e)&&n[t]==="visible")},XA=function(e){return fh(e,"overflowY")},JA=function(e){return fh(e,"overflowX")},Xc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=hh(e,r);if(i){var o=ph(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZA=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hh=function(e,t){return e==="v"?XA(t):JA(t)},ph=function(e,t){return e==="v"?ZA(t):eT(t)},tT=function(e,t){return e==="h"&&t==="rtl"?-1:1},nT=function(e,t,n,r,i){var o=tT(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,h=0;do{if(!s)break;var f=ph(e,s),m=f[0],p=f[1],y=f[2],v=p-y-o*m;(m||v)&&hh(e,s)&&(d+=v,h+=m);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(c=!0),c},xi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jc=function(e){return[e.deltaX,e.deltaY]},Zc=function(e){return e&&"current"in e?e.current:e},rT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iT=function(e){return`
194
+ `)},Qc=function(){var e=parseInt(document.body.getAttribute(ur)||"0",10);return isFinite(e)?e:0},GA=function(){g.useEffect(function(){return document.body.setAttribute(ur,(Qc()+1).toString()),function(){var e=Qc()-1;e<=0?document.body.removeAttribute(ur):document.body.setAttribute(ur,e.toString())}},[])},YA=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;GA();var o=g.useMemo(function(){return WA(i)},[i]);return g.createElement(KA,{styles:qA(o,!t,i,n?"":"!important")})},Ma=!1;if(typeof window<"u")try{var bi=Object.defineProperty({},"passive",{get:function(){return Ma=!0,!0}});window.addEventListener("test",bi,bi),window.removeEventListener("test",bi,bi)}catch{Ma=!1}var tr=Ma?{passive:!1}:!1,QA=function(e){return e.tagName==="TEXTAREA"},fh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!QA(e)&&n[t]==="visible")},XA=function(e){return fh(e,"overflowY")},JA=function(e){return fh(e,"overflowX")},Xc=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=hh(e,r);if(i){var o=ph(e,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ZA=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hh=function(e,t){return e==="v"?XA(t):JA(t)},ph=function(e,t){return e==="v"?ZA(t):eT(t)},tT=function(e,t){return e==="h"&&t==="rtl"?-1:1},nT=function(e,t,n,r,i){var o=tT(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,h=0;do{if(!s)break;var f=ph(e,s),m=f[0],p=f[1],y=f[2],b=p-y-o*m;(m||b)&&hh(e,s)&&(d+=b,h+=m);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(c=!0),c},xi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jc=function(e){return[e.deltaX,e.deltaY]},Zc=function(e){return e&&"current"in e?e.current:e},rT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iT=function(e){return`
195
195
  .block-interactivity-`.concat(e,` {pointer-events: none;}
196
196
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
197
- `)},oT=0,nr=[];function aT(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(oT++)[0],o=g.useState(dh)[0],a=g.useRef(e);g.useEffect(function(){a.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=TA([e.lockRef.current],(e.shards||[]).map(Zc),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var v=xi(p),x=n.current,w="deltaX"in p?p.deltaX:x[0]-v[0],R="deltaY"in p?p.deltaY:x[1]-v[1],I,C=p.target,k=Math.abs(w)>Math.abs(R)?"h":"v";if("touches"in p&&k==="h"&&C.type==="range")return!1;var D=window.getSelection(),j=D&&D.anchorNode,T=j?j===C||j.contains(C):!1;if(T)return!1;var _=Xc(k,C);if(!_)return!0;if(_?I=k:(I=k==="v"?"h":"v",_=Xc(k,C)),!_)return!1;if(!r.current&&"changedTouches"in p&&(w||R)&&(r.current=I),!I)return!0;var L=r.current||I;return nT(L,y,p,L==="h"?w:R)},[]),l=g.useCallback(function(p){var y=p;if(!(!nr.length||nr[nr.length-1]!==o)){var v="deltaY"in y?Jc(y):xi(y),x=t.current.filter(function(I){return I.name===y.type&&(I.target===y.target||y.target===I.shadowParent)&&rT(I.delta,v)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(Zc).filter(Boolean).filter(function(I){return I.contains(y.target)}),R=w.length>0?s(y,w[0]):!a.current.noIsolation;R&&y.cancelable&&y.preventDefault()}}},[]),c=g.useCallback(function(p,y,v,x){var w={name:p,delta:y,target:v,should:x,shadowParent:sT(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(R){return R!==w})},1)},[]),u=g.useCallback(function(p){n.current=xi(p),r.current=void 0},[]),d=g.useCallback(function(p){c(p.type,Jc(p),p.target,s(p,e.lockRef.current))},[]),h=g.useCallback(function(p){c(p.type,xi(p),p.target,s(p,e.lockRef.current))},[]);g.useEffect(function(){return nr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,tr),document.addEventListener("touchmove",l,tr),document.addEventListener("touchstart",u,tr),function(){nr=nr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,tr),document.removeEventListener("touchmove",l,tr),document.removeEventListener("touchstart",u,tr)}},[]);var f=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(o,{styles:iT(i)}):null,f?g.createElement(YA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lT=MA(uh,aT);var mh=g.forwardRef(function(e,t){return g.createElement(vo,Vt({},e,{ref:t,sideCar:lT}))});mh.classNames=vo.classNames;var cT=[" ","Enter","ArrowUp","ArrowDown"],uT=[" ","Enter"],Vn="Select",[xo,wo,dT]=wE(Vn),[kr]=ho(Vn,[dT,bo]),ko=bo(),[fT,kn]=kr(Vn),[hT,pT]=kr(Vn),gh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:f,form:m}=e,p=ko(t),[y,v]=g.useState(null),[x,w]=g.useState(null),[R,I]=g.useState(!1),C=SE(c),[k,D]=Gc({prop:r,defaultProp:i??!1,onChange:o,caller:Vn}),[j,T]=Gc({prop:a,defaultProp:s,onChange:l,caller:Vn}),_=g.useRef(null),L=y?m||!!y.closest("form"):!0,[K,B]=g.useState(new Set),V=Array.from(K).map(q=>q.props.value).join(";");return b.jsx(cA,{...p,children:b.jsxs(fT,{required:f,scope:t,trigger:y,onTriggerChange:v,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:R,onValueNodeHasChildrenChange:I,contentId:Ts(),value:j,onValueChange:T,open:k,onOpenChange:D,dir:C,triggerPointerDownPosRef:_,disabled:h,children:[b.jsx(xo.Provider,{scope:t,children:b.jsx(hT,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(q=>{B(Q=>new Set(Q).add(q))},[]),onNativeOptionRemove:g.useCallback(q=>{B(Q=>{const $=new Set(Q);return $.delete(q),$})},[]),children:n})}),L?b.jsxs(Uh,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:d,value:j,onChange:q=>T(q.target.value),disabled:h,form:m,children:[j===void 0?b.jsx("option",{value:""}):null,Array.from(K)]},V):null]})})};gh.displayName=Vn;var yh="SelectTrigger",bh=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=ko(n),a=kn(yh,n),s=a.disabled||r,l=Ye(t,a.onTriggerChange),c=wo(n),u=g.useRef("touch"),[d,h,f]=zh(p=>{const y=c().filter(w=>!w.disabled),v=y.find(w=>w.value===a.value),x=$h(y,p,v);x!==void 0&&a.onValueChange(x.value)}),m=p=>{s||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return b.jsx(th,{asChild:!0,...o,children:b.jsx(We.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Hh(a.value)?"":void 0,...i,ref:l,onClick:je(i.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&m(p)}),onPointerDown:je(i.onPointerDown,p=>{u.current=p.pointerType;const y=p.target;y.hasPointerCapture(p.pointerId)&&y.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:je(i.onKeyDown,p=>{const y=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(y&&p.key===" ")&&cT.includes(p.key)&&(m(),p.preventDefault())})})})});bh.displayName=yh;var vh="SelectValue",xh=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,l=kn(vh,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Ye(t,l.onValueNodeChange);return rt(()=>{c(u)},[c,u]),b.jsx(We.span,{...s,ref:d,style:{pointerEvents:"none"},children:Hh(l.value)?b.jsx(b.Fragment,{children:a}):o})});xh.displayName=vh;var mT="SelectIcon",wh=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return b.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});wh.displayName=mT;var gT="SelectPortal",kh=e=>b.jsx(ih,{asChild:!0,...e});kh.displayName=gT;var Wn="SelectContent",Sh=g.forwardRef((e,t)=>{const n=kn(Wn,e.__scopeSelect),[r,i]=g.useState();if(rt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Jr.createPortal(b.jsx(Eh,{scope:e.__scopeSelect,children:b.jsx(xo.Slot,{scope:e.__scopeSelect,children:b.jsx("div",{children:e.children})})}),o):null}return b.jsx(Ch,{...e,ref:t})});Sh.displayName=Wn;var It=10,[Eh,Sn]=kr(Wn),yT="SelectContentImpl",bT=dA("SelectContent.RemoveScroll"),Ch=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:y,...v}=e,x=kn(Wn,n),[w,R]=g.useState(null),[I,C]=g.useState(null),k=Ye(t,W=>R(W)),[D,j]=g.useState(null),[T,_]=g.useState(null),L=wo(n),[K,B]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(w)return AA(w)},[w]),UE();const q=g.useCallback(W=>{const[ye,...Le]=L().map(de=>de.ref.current),[ve]=Le.slice(-1),we=document.activeElement;for(const de of W)if(de===we||(de?.scrollIntoView({block:"nearest"}),de===ye&&I&&(I.scrollTop=0),de===ve&&I&&(I.scrollTop=I.scrollHeight),de?.focus(),document.activeElement!==we))return},[L,I]),Q=g.useCallback(()=>q([D,w]),[q,D,w]);g.useEffect(()=>{K&&Q()},[K,Q]);const{onOpenChange:$,triggerPointerDownPosRef:F}=x;g.useEffect(()=>{if(w){let W={x:0,y:0};const ye=ve=>{W={x:Math.abs(Math.round(ve.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(ve.pageY)-(F.current?.y??0))}},Le=ve=>{W.x<=10&&W.y<=10?ve.preventDefault():w.contains(ve.target)||$(!1),document.removeEventListener("pointermove",ye),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",Le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",Le,{capture:!0})}}},[w,$,F]),g.useEffect(()=>{const W=()=>$(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[$]);const[S,se]=zh(W=>{const ye=L().filter(we=>!we.disabled),Le=ye.find(we=>we.ref.current===document.activeElement),ve=$h(ye,W,Le);ve&&setTimeout(()=>ve.ref.current.focus())}),te=g.useCallback((W,ye,Le)=>{const ve=!V.current&&!Le;(x.value!==void 0&&x.value===ye||ve)&&(j(W),ve&&(V.current=!0))},[x.value]),E=g.useCallback(()=>w?.focus(),[w]),oe=g.useCallback((W,ye,Le)=>{const ve=!V.current&&!Le;(x.value!==void 0&&x.value===ye||ve)&&_(W)},[x.value]),fe=r==="popper"?ja:Ah,ge=fe===ja?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:y}:{};return b.jsx(Eh,{scope:n,content:w,viewport:I,onViewportChange:C,itemRefCallback:te,selectedItem:D,onItemLeave:E,itemTextRefCallback:oe,focusSelectedItem:Q,selectedItemText:T,position:r,isPositioned:K,searchRef:S,children:b.jsx(mh,{as:bT,allowPinchZoom:!0,children:b.jsx(Of,{asChild:!0,trapped:x.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:je(i,W=>{x.trigger?.focus({preventScroll:!0}),W.preventDefault()}),children:b.jsx(As,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:b.jsx(fe,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:W=>W.preventDefault(),...v,...ge,onPlaced:()=>B(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:je(v.onKeyDown,W=>{const ye=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ye&&W.key.length===1&&se(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ve=L().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const we=W.target,de=ve.indexOf(we);ve=ve.slice(de+1)}setTimeout(()=>q(ve)),W.preventDefault()}})})})})})})});Ch.displayName=yT;var vT="SelectItemAlignedPosition",Ah=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=kn(Wn,n),a=Sn(Wn,n),[s,l]=g.useState(null),[c,u]=g.useState(null),d=Ye(t,k=>u(k)),h=wo(n),f=g.useRef(!1),m=g.useRef(!0),{viewport:p,selectedItem:y,selectedItemText:v,focusSelectedItem:x}=a,w=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&p&&y&&v){const k=o.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),j=o.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(o.dir!=="rtl"){const we=T.left-D.left,de=j.left-we,Be=k.left-de,lt=k.width+Be,Mt=Math.max(lt,D.width),Je=window.innerWidth-It,jt=Rc(de,[It,Math.max(It,Je-Mt)]);s.style.minWidth=lt+"px",s.style.left=jt+"px"}else{const we=D.right-T.right,de=window.innerWidth-j.right-we,Be=window.innerWidth-k.right-de,lt=k.width+Be,Mt=Math.max(lt,D.width),Je=window.innerWidth-It,jt=Rc(de,[It,Math.max(It,Je-Mt)]);s.style.minWidth=lt+"px",s.style.right=jt+"px"}const _=h(),L=window.innerHeight-It*2,K=p.scrollHeight,B=window.getComputedStyle(c),V=parseInt(B.borderTopWidth,10),q=parseInt(B.paddingTop,10),Q=parseInt(B.borderBottomWidth,10),$=parseInt(B.paddingBottom,10),F=V+q+K+$+Q,S=Math.min(y.offsetHeight*5,F),se=window.getComputedStyle(p),te=parseInt(se.paddingTop,10),E=parseInt(se.paddingBottom,10),oe=k.top+k.height/2-It,fe=L-oe,ge=y.offsetHeight/2,W=y.offsetTop+ge,ye=V+q+W,Le=F-ye;if(ye<=oe){const we=_.length>0&&y===_[_.length-1].ref.current;s.style.bottom="0px";const de=c.clientHeight-p.offsetTop-p.offsetHeight,Be=Math.max(fe,ge+(we?E:0)+de+Q),lt=ye+Be;s.style.height=lt+"px"}else{const we=_.length>0&&y===_[0].ref.current;s.style.top="0px";const Be=Math.max(oe,V+p.offsetTop+(we?te:0)+ge)+Le;s.style.height=Be+"px",p.scrollTop=ye-oe+p.offsetTop}s.style.margin=`${It}px 0`,s.style.minHeight=S+"px",s.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,s,c,p,y,v,o.dir,r]);rt(()=>w(),[w]);const[R,I]=g.useState();rt(()=>{c&&I(window.getComputedStyle(c).zIndex)},[c]);const C=g.useCallback(k=>{k&&m.current===!0&&(w(),x?.(),m.current=!1)},[w,x]);return b.jsx(wT,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:b.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:b.jsx(We.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Ah.displayName=vT;var xT="SelectPopperPosition",ja=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=It,...o}=e,a=ko(n);return b.jsx(nh,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ja.displayName=xT;var[wT,Ms]=kr(Wn,{}),Fa="SelectViewport",Th=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Sn(Fa,n),a=Ms(Fa,n),s=Ye(t,o.onViewportChange),l=g.useRef(0);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),b.jsx(xo.Slot,{scope:n,children:b.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:je(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=a;if(h?.current&&d){const f=Math.abs(l.current-u.scrollTop);if(f>0){const m=window.innerHeight-It*2,p=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),v=Math.max(p,y);if(v<m){const x=v+f,w=Math.min(m,x),R=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=R>0?R:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Th.displayName=Fa;var Rh="SelectGroup",[kT,ST]=kr(Rh),ET=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ts();return b.jsx(kT,{scope:n,id:i,children:b.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});ET.displayName=Rh;var Ph="SelectLabel",Ih=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ST(Ph,n);return b.jsx(We.div,{id:i.id,...r,ref:t})});Ih.displayName=Ph;var Ki="SelectItem",[CT,Lh]=kr(Ki),Oh=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=kn(Ki,n),l=Sn(Ki,n),c=s.value===r,[u,d]=g.useState(o??""),[h,f]=g.useState(!1),m=Ye(t,x=>l.itemRefCallback?.(x,r,i)),p=Ts(),y=g.useRef("touch"),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b.jsx(CT,{scope:n,value:r,disabled:i,textId:p,isSelected:c,onItemTextChange:g.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:b.jsx(xo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:b.jsx(We.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:je(a.onFocus,()=>f(!0)),onBlur:je(a.onBlur,()=>f(!1)),onClick:je(a.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:je(a.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:je(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:je(a.onPointerMove,x=>{y.current=x.pointerType,i?l.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:je(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(uT.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});Oh.displayName=Ki;var Br="SelectItemText",Nh=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=kn(Br,n),s=Sn(Br,n),l=Lh(Br,n),c=pT(Br,n),[u,d]=g.useState(null),h=Ye(t,v=>d(v),l.onItemTextChange,v=>s.itemTextRefCallback?.(v,l.value,l.disabled)),f=u?.textContent,m=g.useMemo(()=>b.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=c;return rt(()=>(p(m),()=>y(m)),[p,y,m]),b.jsxs(b.Fragment,{children:[b.jsx(We.span,{id:l.textId,...o,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Jr.createPortal(o.children,a.valueNode):null]})});Nh.displayName=Br;var Dh="SelectItemIndicator",_h=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Lh(Dh,n).isSelected?b.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});_h.displayName=Dh;var Ba="SelectScrollUpButton",Mh=g.forwardRef((e,t)=>{const n=Sn(Ba,e.__scopeSelect),r=Ms(Ba,e.__scopeSelect),[i,o]=g.useState(!1),a=Ye(t,r.onScrollButtonChange);return rt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?b.jsx(Fh,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Mh.displayName=Ba;var Ua="SelectScrollDownButton",jh=g.forwardRef((e,t)=>{const n=Sn(Ua,e.__scopeSelect),r=Ms(Ua,e.__scopeSelect),[i,o]=g.useState(!1),a=Ye(t,r.onScrollButtonChange);return rt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?b.jsx(Fh,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});jh.displayName=Ua;var Fh=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Sn("SelectScrollButton",n),a=g.useRef(null),s=wo(n),l=g.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),rt(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),b.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:je(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:je(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:je(i.onPointerLeave,()=>{l()})})}),AT="SelectSeparator",Bh=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return b.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});Bh.displayName=AT;var Ha="SelectArrow",TT=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ko(n),o=kn(Ha,n),a=Sn(Ha,n);return o.open&&a.position==="popper"?b.jsx(rh,{...i,...r,ref:t}):null});TT.displayName=Ha;var RT="SelectBubbleInput",Uh=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=Ye(r,i),a=xA(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const d=new Event("change",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[a,t]),b.jsx(We.select,{...n,style:{...oh,...n.style},ref:o,defaultValue:t})});Uh.displayName=RT;function Hh(e){return e===""||e===void 0}function zh(e){const t=zn(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function $h(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=PT(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function PT(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var IT=gh,Vh=bh,LT=xh,OT=wh,NT=kh,Wh=Sh,DT=Th,Kh=Ih,qh=Oh,_T=Nh,MT=_h,Gh=Mh,Yh=jh,Qh=Bh;const za=IT,$a=LT,qi=g.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(Vh,{ref:r,className:Ie("flex h-8 w-full items-center justify-between gap-2","rounded-md border border-border bg-surface px-3 py-1 text-sm","placeholder:text-text-muted","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55","[&>span]:line-clamp-1",e),...n,children:[t,b.jsx(OT,{asChild:!0,children:b.jsx(Gu,{className:"h-4 w-4 opacity-60"})})]}));qi.displayName=Vh.displayName;const Xh=g.forwardRef(({className:e,...t},n)=>b.jsx(Gh,{ref:n,className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(Hg,{className:"h-4 w-4"})}));Xh.displayName=Gh.displayName;const Jh=g.forwardRef(({className:e,...t},n)=>b.jsx(Yh,{ref:n,className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(Gu,{className:"h-4 w-4"})}));Jh.displayName=Yh.displayName;const Gi=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>b.jsx(NT,{children:b.jsxs(Wh,{ref:i,position:n,className:Ie("relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-border bg-surface text-text shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=top]:-translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1"],e),...r,children:[b.jsx(Xh,{}),b.jsx(DT,{className:Ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),b.jsx(Jh,{})]})}));Gi.displayName=Wh.displayName;const jT=g.forwardRef(({className:e,...t},n)=>b.jsx(Kh,{ref:n,className:Ie("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",e),...t}));jT.displayName=Kh.displayName;const _n=g.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(qh,{ref:r,className:Ie("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover focus:text-text","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(MT,{children:b.jsx(Ug,{className:"h-4 w-4"})})}),b.jsx(_T,{children:t})]}));_n.displayName=qh.displayName;const FT=g.forwardRef(({className:e,...t},n)=>b.jsx(Qh,{ref:n,className:Ie("-mx-1 my-1 h-px bg-border",e),...t}));FT.displayName=Qh.displayName;function BT({agents:e,value:t,onChange:n}){return b.jsxs(za,{value:t||void 0,onValueChange:n,children:[b.jsx(qi,{className:"h-7 w-28 sm:w-36 text-xs",children:b.jsx($a,{placeholder:e[0]??"—"})}),b.jsx(Gi,{children:e.map(r=>b.jsx(_n,{value:r,children:r},r))})]})}const Va="agim-theme",Zh="im-hub-lang";function UT(){try{const e=localStorage.getItem(Va);if(e==="light"||e==="dark")return e}catch{}return"system"}function HT(){try{const t=localStorage.getItem(Zh);if(t==="en"||t==="zh")return t}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function eu(e){try{e==="system"?localStorage.removeItem(Va):localStorage.setItem(Va,e)}catch{}}function zT(e){try{localStorage.setItem(Zh,e)}catch{}}const ar=zu((e,t)=>({theme:UT(),lang:HT(),setTheme:n=>{eu(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=n==="system"?"light":n==="light"?"dark":"system";eu(r),e({theme:r})},setLang:n=>{zT(n),e({lang:n})}}));function tu(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}function $T(){const e=ar(t=>t.theme);g.useEffect(()=>{if(tu(e),e!=="system")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>tu(e);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e])}function VT(){const{t:e}=kt(),t=ar(o=>o.theme),n=ar(o=>o.lang),r=ar(o=>o.setTheme),i=ar(o=>o.setLang);return b.jsxs(b.Fragment,{children:[b.jsxs(za,{value:n,onValueChange:o=>i(o),children:[b.jsx(qi,{className:"h-7 w-16 sm:w-20 text-xs","aria-label":e("lang.label"),children:b.jsx($a,{})}),b.jsxs(Gi,{children:[b.jsx(_n,{value:"en",children:e("lang.en")}),b.jsx(_n,{value:"zh",children:e("lang.zh")})]})]}),b.jsxs(za,{value:t,onValueChange:o=>r(o),children:[b.jsx(qi,{className:"h-7 w-16 text-xs sm:w-28","aria-label":e("theme.label"),children:b.jsx($a,{})}),b.jsxs(Gi,{children:[b.jsx(_n,{value:"system",children:b.jsxs("span",{className:"inline-flex items-center gap-2",children:[b.jsx(Wg,{className:"h-4 w-4"})," ",e("theme.system")]})}),b.jsx(_n,{value:"light",children:b.jsxs("span",{className:"inline-flex items-center gap-2",children:[b.jsx(Xg,{className:"h-4 w-4"})," ",e("theme.light")]})}),b.jsx(_n,{value:"dark",children:b.jsxs("span",{className:"inline-flex items-center gap-2",children:[b.jsx(qg,{className:"h-4 w-4"})," ",e("theme.dark")]})})]})]})]})}function WT(e){const[t,n]=g.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return g.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=o=>n(o.matches);return n(r.matches),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}function KT(){return WT("(min-width: 640px)")}const qT=[{to:"/",i18nKey:"nav.chat",mounted:!0},{to:"/tasks",i18nKey:"nav.tasks",mounted:!0},{to:"/approvals",i18nKey:"nav.approvals",mounted:!0},{to:"/reminders",i18nKey:"nav.reminders",mounted:!0},{to:"/memos",i18nKey:"nav.memos",mounted:!0},{to:"/memory",i18nKey:"nav.memory",mounted:!0},{to:"/workspace",i18nKey:"nav.workspace",mounted:!0},{to:"/observability",i18nKey:"nav.observability",mounted:!0},{to:"/settings",i18nKey:"nav.settings",mounted:!0}];function ep({children:e}){const{t}=kt(),n=KT(),r=b.jsx("nav",{className:Ie("flex flex-1 min-w-0 items-center gap-1","overflow-x-auto scrollbar-thin","[&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-border"),"aria-label":t("appName"),children:qT.filter(i=>i.mounted).map(i=>b.jsx(sl,{to:i.to,end:i.to==="/",className:({isActive:o})=>Ie("shrink-0 rounded-md px-2.5 py-1.5 text-sm no-underline","transition-colors tap-target",o?"bg-accent-bg text-accent font-medium":"text-text-dim hover:bg-surface-hover hover:text-text"),children:t(i.i18nKey)},i.to))});return b.jsxs("header",{className:Ie("sticky top-0 z-20","flex flex-col sm:flex-row sm:items-center sm:gap-3","border-b border-border bg-surface","pt-safe","shadow-sm"),children:[b.jsxs("div",{className:Ie("flex items-center gap-2 sm:gap-3","overflow-x-hidden","px-3 sm:px-4 py-2 sm:py-2","sm:flex-1 sm:min-w-0"),children:[b.jsxs(sl,{to:"/",className:"flex shrink-0 items-center gap-1 text-md font-semibold no-underline",end:!0,children:[b.jsx("span",{"aria-hidden":"true",children:"🤖"}),b.jsx("span",{className:"hidden sm:inline",children:t("appName")})]}),n&&b.jsx("div",{className:"flex flex-1 min-w-0",children:r}),e&&b.jsx("div",{className:"flex items-center gap-2",children:e}),b.jsx("div",{className:"flex shrink-0 items-center gap-2",children:b.jsx(VT,{})})]}),!n&&b.jsx("div",{className:"border-t border-border px-3 py-1",children:r})]})}const GT={open:"bg-success",connecting:"bg-warning animate-pulse",closed:"bg-text-muted",error:"bg-danger"};function YT(){const{t:e}=kt(),{state:t,send:n,switchAgent:r,approvalClick:i,newConversation:o,clearError:a}=dv(),[s,l]=g.useState(""),c=g.useRef(null),u=g.useRef(null);g.useEffect(()=>{if(!c.current)return;const f=c.current;!(f.scrollHeight-f.scrollTop-f.clientHeight<200)&&t.currentReplyId==null||requestAnimationFrame(()=>{f.scrollTop=f.scrollHeight})},[t.messages,t.currentReplyId]),g.useEffect(()=>{t.error&&(Ot.error(t.error),a())},[t.error,a]);function d(f){f?.preventDefault();const m=s.trim();if(m){if(t.status!=="open"){Ot.error(e("chat.notConnected",{defaultValue:"Not connected. Reconnecting…"}));return}n(m),l(""),requestAnimationFrame(()=>u.current?.focus())}}function h(f){f.nativeEvent.isComposing||f.keyCode===229||f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),d())}return b.jsxs("div",{className:"flex h-dvh flex-col bg-bg",children:[b.jsxs(ep,{children:[b.jsx("span",{className:Ie("inline-block h-2 w-2 rounded-full",GT[t.status]),title:t.status}),b.jsx("span",{className:"hidden text-xs text-text-dim sm:inline",children:t.status}),b.jsxs(vt,{variant:"ghost",size:"sm",onClick:()=>{o(),Ot.success(e("chat.newConvToast",{defaultValue:"Started a new conversation"})),requestAnimationFrame(()=>u.current?.focus())},disabled:t.status!=="open",title:e("chat.newConvHint",{defaultValue:"Clear messages and start a fresh session"}),"aria-label":e("chat.newConv",{defaultValue:"New conversation"}),children:[b.jsx(Kg,{className:"h-4 w-4"}),b.jsx("span",{className:"hidden text-xs sm:inline",children:e("chat.newConv",{defaultValue:"New"})})]}),b.jsx(BT,{agents:t.agents,value:t.agent,onChange:r})]}),b.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:b.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-2 px-3 py-3 sm:px-4",children:[t.messages.length===0&&t.status==="open"&&b.jsxs("div",{className:"flex flex-col items-center gap-2 py-16 text-center",children:[b.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-2xl",children:"💬"}),b.jsx("h2",{className:"text-base font-semibold",children:e("chat.welcomeTitle",{defaultValue:"Start a conversation"})}),b.jsx("p",{className:"max-w-md text-sm text-text-dim",children:e("chat.welcomeBody",{defaultValue:"Type a message to ask the active agent. Use the agent dropdown to switch."})})]}),t.messages.length===0&&t.status!=="open"&&b.jsxs("div",{className:"grid place-items-center py-16 text-center",children:[b.jsx(zg,{className:"h-10 w-10 text-text-muted"}),b.jsx("p",{className:"mt-3 text-sm text-text-dim",children:t.status==="connecting"?e("chat.connecting",{defaultValue:"Connecting to agim…"}):e("chat.disconnected",{defaultValue:"Disconnected. Reconnecting automatically; you can keep typing."})})]}),t.messages.filter(f=>!f.approval).map(f=>b.jsx(sE,{msg:f,onApprove:(m,p,y)=>i(m,p,y)},f.id))]})}),b.jsx(dE,{approvals:t.pendingApprovals,onApprove:(f,m,p)=>i(f,m,p)}),b.jsxs("form",{onSubmit:d,className:"sticky bottom-0 border-t border-border bg-surface px-4 py-2 pb-safe sm:px-6",children:[b.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[b.jsx("textarea",{ref:u,value:s,onChange:f=>l(f.target.value),onKeyDown:h,placeholder:e("chat.inputPlaceholder",{defaultValue:"Message… (Enter sends, Shift+Enter newlines)"}),rows:1,className:Ie("flex-1 resize-none rounded-md border border-border bg-bg","px-3 py-1.5 text-sm leading-5","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","max-h-32 min-h-8")}),b.jsx(vt,{type:"submit",disabled:!s.trim()||t.status!=="open","aria-label":e("chat.send",{defaultValue:"Send"}),className:"h-8 w-8 p-0",children:b.jsx(Yg,{className:"h-4 w-4"})})]}),t.currentReplyId&&b.jsx("div",{className:"mx-auto mt-2 flex max-w-3xl items-center gap-2",children:b.jsx(at,{variant:"info",children:e("chat.streaming",{defaultValue:"… streaming"})})})]})]})}function QT(){const{t:e}=kt(),t=sn();return b.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[b.jsx(ep,{}),b.jsx("main",{className:"grid flex-1 place-items-center px-4 py-8 pb-safe",children:b.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3 text-center",children:[b.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-dim",children:b.jsx($g,{className:"h-6 w-6"})}),b.jsx("div",{className:"text-6xl font-bold tracking-tight text-text-muted",children:"404"}),b.jsx("h1",{className:"text-xl font-semibold",children:e("notFound.title",{defaultValue:"Nothing here."})}),b.jsx("p",{className:"text-sm text-text-dim",children:e("notFound.description",{defaultValue:"The page you're looking for doesn't exist."})}),b.jsx("code",{className:"rounded bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.pathname}),b.jsx(vt,{asChild:!0,className:"mt-2",children:b.jsx(ts,{to:"/",children:e("actions.back")})})]})})]})}function hn(e){return async()=>{const n=(await e()).default;return{element:b.jsx($u,{children:b.jsx(n,{})})}}}function Pe(e){return async()=>{const n=(await e()).default;return{element:b.jsx(n,{})}}}const XT=Zm([{path:"/login",element:b.jsx(iv,{})},{path:"/",element:b.jsx($u,{children:b.jsx(YT,{})})},{path:"/tasks",lazy:hn(()=>be(()=>import("./layout-BOtnmIxG.js"),__vite__mapDeps([0,1]))),children:[{index:!0,element:b.jsx(zt,{to:"jobs",replace:!0})},{path:"jobs",lazy:Pe(()=>be(()=>import("./jobs-CZSLi1IN.js"),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])))},{path:"subtasks",lazy:Pe(()=>be(()=>import("./subtasks-CBrBqNyr.js"),__vite__mapDeps([19,1,3,4,5,6,7,13,14,15,16])))},{path:"bgjobs",lazy:Pe(()=>be(()=>import("./bgjobs-DEQOeNl0.js"),__vite__mapDeps([20,1,3,4,5,6,7,13,15,16])))},{path:"schedules",lazy:Pe(()=>be(()=>import("./schedules-BsknKkCe.js"),__vite__mapDeps([21,1,3,4,5,6,13,15,16])))},{path:"outbox",lazy:Pe(()=>be(()=>import("./outbox-BvhcDpdc.js"),__vite__mapDeps([22,1,3,4,5,6,7,10,11,12,13,15,16])))},{path:"a2a",lazy:Pe(()=>be(()=>import("./a2a-DGmlA1kI.js"),__vite__mapDeps([23,1,3,4,5,6,7,13,14,15,16])))},{path:"heartbeat",lazy:Pe(()=>be(()=>import("./heartbeat-NRTRObLx.js"),__vite__mapDeps([24,1,4,25,13,26,15,16,27])))},{path:"goals",lazy:Pe(()=>be(()=>import("./goals-DBghjX3s.js"),__vite__mapDeps([28,1,4,25,13,15,16,29,17])))},{path:"asks",lazy:Pe(()=>be(()=>import("./asks-BQtIx6ky.js"),__vite__mapDeps([30,4,1,25,13,15,16,17])))}]},{path:"/approvals",lazy:hn(()=>be(()=>import("./approvals-BzShPdMC.js"),__vite__mapDeps([31,1,12,5,13,14,15,16])))},{path:"/reminders",lazy:hn(()=>be(()=>import("./reminders-1V1_6Rij.js"),__vite__mapDeps([32,1,3,4,5,6,7,10,11,12,13,15,16,33])))},{path:"/memos",lazy:hn(()=>be(()=>import("./memos-D7RJn57X.js"),__vite__mapDeps([34,1,3,4,5,6,10,11,12,9,13,35,16,36,37])))},{path:"/memory",lazy:hn(()=>be(()=>import("./layout-BboemGJs.js"),__vite__mapDeps([38,39,13,1]))),children:[{index:!0,element:b.jsx(zt,{to:"facts",replace:!0})},{path:"facts",lazy:Pe(()=>be(()=>import("./facts-DqwcWab7.js"),__vite__mapDeps([40,1,3,4,5,6,8,9,10,11,12,39,13,35,41,15,16,36])))},{path:"persona",lazy:Pe(()=>be(()=>import("./persona-Dy-fuCBR.js"),__vite__mapDeps([42,1,5,10,11,12,39,13,41,15,16,27,43,17,35])))},{path:"vector",lazy:Pe(()=>be(()=>import("./vector-v7xjphrN.js"),__vite__mapDeps([44,1,45,13,39,15,46,47,10,11,12,5,17,16,27,48,35,43])))},{path:"skills",element:b.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})}]},{path:"/skills",children:[{index:!0,element:b.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})},{path:"installed",element:b.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})},{path:"hot",element:b.jsx(zt,{to:"/settings/agim-skills/hot",replace:!0})}]},{path:"/workspace",lazy:hn(()=>be(()=>import("./workspace-BtGPH9Sx.js"),__vite__mapDeps([49,1,5,50,13,15,16])))},{path:"/observability",lazy:hn(()=>be(()=>import("./layout-D8Kes1e7.js"),__vite__mapDeps([51,1]))),children:[{index:!0,element:b.jsx(zt,{to:"health",replace:!0})},{path:"health",lazy:Pe(()=>be(()=>import("./health-DV_mII-T.js"),__vite__mapDeps([52,1,5,4,53,13,15,16,54])))},{path:"topn",lazy:Pe(()=>be(()=>import("./topn-7_FUU4Zs.js"),__vite__mapDeps([55,5,4,1,53,13,15,16])))},{path:"audit",lazy:Pe(()=>be(()=>import("./audit-BDIEW7z9.js"),__vite__mapDeps([56,1,3,4,5,6,53,13,15,16,54])))}]},{path:"/settings",lazy:hn(()=>be(()=>import("./layout-CsScgPAG.js"),__vite__mapDeps([57,1]))),children:[{index:!0,element:b.jsx(zt,{to:"messengers",replace:!0})},{path:"messengers",lazy:Pe(()=>be(()=>import("./messengers-BORNy_SW.js"),__vite__mapDeps([58,1,11,12,45,13,15,16,46])))},{path:"email",lazy:Pe(()=>be(()=>import("./email-DIEmIapc.js"),__vite__mapDeps([59,1,45,13,15,17,29,16,47,12,46])))},{path:"viewer",lazy:Pe(()=>be(()=>import("./viewer-BSC-2Lhp.js"),__vite__mapDeps([60,1,45,13,47,15,16,29,61,12,46,37])))},{path:"agents",lazy:Pe(()=>be(()=>import("./agents-Dp4swPPC.js"),__vite__mapDeps([62,1,5,50,13,45,15,16,12,46,63,36,64,35])))},{path:"policy",lazy:Pe(()=>be(()=>import("./policy-DW_kZo8b.js"),__vite__mapDeps([65,45,13,1,15,16])))},{path:"security",lazy:Pe(()=>be(()=>import("./security-B8sBUf6e.js"),__vite__mapDeps([66,1,45,13,15,16,29])))},{path:"service",lazy:Pe(()=>be(()=>import("./service-CB-aBmLS.js"),__vite__mapDeps([67,1,10,11,12,45,13,15,16,27,63,46])))},{path:"admins",lazy:Pe(()=>be(()=>import("./admins-BSDr-HXb.js"),__vite__mapDeps([68,1,10,11,12,5,4,45,13,15,16,35])))},{path:"workspaces",lazy:Pe(()=>be(()=>import("./workspaces-_PTrUhIq.js"),__vite__mapDeps([69,1,5,4,45,13,15,16,18,46])))},{path:"llm",lazy:Pe(()=>be(()=>import("./llm-78WCRfgL.js"),__vite__mapDeps([70,1,4,71,13,15,16,35,64])))},{path:"mcp",lazy:Pe(()=>be(()=>import("./mcp-oeRvo7Aw.js"),__vite__mapDeps([72,1,4,71,13,15,16,54,35,64])))},{path:"native-agent",lazy:Pe(()=>be(()=>import("./native-agent-CNPVWQ9T.js"),__vite__mapDeps([73,1,45,13,15,16,12,46,33,26])))},{path:"search",lazy:Pe(()=>be(()=>import("./search-HQWlCBKK.js"),__vite__mapDeps([74,1,45,13,15,16,12,46,6,29,17])))},{path:"agim-skills",lazy:Pe(()=>be(()=>import("./layout-CBbV3YNj.js"),__vite__mapDeps([75,1]))),children:[{index:!0,element:b.jsx(zt,{to:"installed",replace:!0})},{path:"installed",lazy:Pe(()=>be(()=>import("./installed-B2goeV3S.js"),__vite__mapDeps([76,1,13,15,16,35,46])))},{path:"hot",lazy:Pe(()=>be(()=>import("./hot-BNH34Amf.js"),__vite__mapDeps([77,1,5,11,12,13,61,15,16,36,48])))}]}]},{path:"*",element:b.jsx(QT,{})}]);function JT(){return b.jsx(Uy,{children:b.jsx(sg,{router:XT})})}const ZT=new bb({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1,retryDelay:e=>Math.min(1e3*2**e,8e3),refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{retry:0}}}),ue=e=>typeof e=="string",jr=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},nu=e=>e==null?"":""+e,eR=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},tR=/###/g,ru=e=>e&&e.indexOf("###")>-1?e.replace(tR,"."):e,iu=e=>!e||ue(e),$r=(e,t,n)=>{const r=ue(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(iu(e))return{};const o=ru(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return iu(e)?{}:{obj:e,k:ru(r[i])}},ou=(e,t,n)=>{const{obj:r,k:i}=$r(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=$r(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=$r(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},nR=(e,t,n,r)=>{const{obj:i,k:o}=$r(e,t,Object);i[o]=i[o]||[],i[o].push(n)},Yi=(e,t)=>{const{obj:n,k:r}=$r(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},rR=(e,t,n)=>{const r=Yi(e,n);return r!==void 0?r:Yi(t,n)},tp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?ue(e[r])||e[r]instanceof String||ue(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):tp(e[r],t[r],n):e[r]=t[r]);return e},rr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var iR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const oR=e=>ue(e)?e.replace(/[&<>"'\/]/g,t=>iR[t]):e;class aR{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const sR=[" ",",","?","!",";"],lR=new aR(20),cR=(e,t,n)=>{t=t||"",n=n||"";const r=sR.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=lR.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},Wa=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,s="";for(let l=o;l<r.length;++l)if(l!==o&&(s+=n),s+=r[l],a=i[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;o+=l-o+1;break}i=a}return i},Qi=e=>e?.replace("_","-"),uR={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Xi{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||uR,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(ue(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Xi(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Xi(this.logger,t)}}var Kt=new Xi;class So{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s.apply(s,[t,...r])})}}class au extends So{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):ue(r)&&o?s.push(...r.split(o)):s.push(r)));const l=Yi(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!ue(r)?l:Wa(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),ou(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(ue(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=Yi(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?tp(l,r,o):l={...l,...r},ou(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var np={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const su={},lu=e=>!ue(e)&&typeof e!="boolean"&&typeof e!="number";class Ji extends So{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),eR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Kt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!cR(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:ue(o)?[o]:o};const c=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return{key:t,namespaces:ue(o)?[o]:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode"){if(u){const _=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${_}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${_}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a}const d=this.resolve(t,n);let h=d?.res;const f=d?.usedKey||a,m=d?.exactUsedKey||a,p=["[object Number]","[object Function]","[object RegExp]"],y=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,x=n.count!==void 0&&!ue(n.count),w=Ji.hasDefaultValue(n),R=x?this.pluralResolver.getSuffix(c,n.count,n):"",I=n.ordinal&&x?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",C=x&&!n.ordinal&&n.count===0,k=C&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${I}`]||n.defaultValue;let D=h;v&&!h&&w&&(D=k);const j=lu(D),T=Object.prototype.toString.apply(D);if(v&&D&&j&&p.indexOf(T)<0&&!(ue(y)&&Array.isArray(D))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,D,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=_,d.usedParams=this.getUsedParamsDetails(n),d):_}if(o){const _=Array.isArray(D),L=_?[]:{},K=_?m:f;for(const B in D)if(Object.prototype.hasOwnProperty.call(D,B)){const V=`${K}${o}${B}`;w&&!h?L[B]=this.translate(V,{...n,defaultValue:lu(k)?k[B]:void 0,joinArrays:!1,ns:s}):L[B]=this.translate(V,{...n,joinArrays:!1,ns:s}),L[B]===V&&(L[B]=D[B])}h=L}}else if(v&&ue(y)&&Array.isArray(h))h=h.join(y),h&&(h=this.extendTranslation(h,t,n,r));else{let _=!1,L=!1;!this.isValidLookup(h)&&w&&(_=!0,h=k),this.isValidLookup(h)||(L=!0,h=a);const B=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:h,V=w&&k!==h&&this.options.updateMissing;if(L||_||V){if(this.logger.log(V?"updateKey":"missingKey",c,l,a,V?k:h),o){const F=this.resolve(a,{...n,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let q=[];const Q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Q&&Q[0])for(let F=0;F<Q.length;F++)q.push(Q[F]);else this.options.saveMissingTo==="all"?q=this.languageUtils.toResolveHierarchy(n.lng||this.language):q.push(n.lng||this.language);const $=(F,S,se)=>{const te=w&&se!==h?se:B;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,S,te,V,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,l,S,te,V,n),this.emit("missingKey",F,l,S,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?q.forEach(F=>{const S=this.pluralResolver.getSuffixes(F,n);C&&n[`defaultValue${this.options.pluralSeparator}zero`]&&S.indexOf(`${this.options.pluralSeparator}zero`)<0&&S.push(`${this.options.pluralSeparator}zero`),S.forEach(se=>{$([F],a+se,n[`defaultValue${se}`]||k)})}):$(q,a,k))}h=this.extendTranslation(h,t,n,d,r),L&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${a}`),(L||_)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,_?h:void 0))}return i?(d.res=h,d.usedParams=this.getUsedParamsDetails(n),d):h}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=ue(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const h=t.match(this.interpolator.nestingRegexp);u=h&&h.length}let d=r.replace&&!ue(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),c){const h=t.match(this.interpolator.nestingRegexp),f=h&&h.length;u<f&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];return o?.[0]===f[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):a.translate(...f,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=ue(s)?[s]:s;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=np.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return ue(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;i=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const h=n.count!==void 0&&!ue(n.count),f=h&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(ue(n.context)||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(y=>{this.isValidLookup(r)||(s=y,!su[`${p[0]}-${y}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(su[`${p[0]}-${y}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(v=>{if(this.isValidLookup(r))return;a=v;const x=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,u,v,y,n);else{let R;h&&(R=this.pluralResolver.getSuffix(v,n.count,n));const I=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(x.push(u+R),n.ordinal&&R.indexOf(C)===0&&x.push(u+R.replace(C,this.options.pluralSeparator)),f&&x.push(u+I)),m){const k=`${u}${this.options.contextSeparator}${n.context}`;x.push(k),h&&(x.push(k+R),n.ordinal&&R.indexOf(C)===0&&x.push(k+R.replace(C,this.options.pluralSeparator)),f&&x.push(k+I))}}let w;for(;w=x.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(v,y,w,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!ue(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class cu{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kt.create("languageUtils")}getScriptPartFromCode(t){if(t=Qi(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Qi(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(ue(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),ue(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return ue(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):ue(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const uu={zero:0,one:1,two:2,few:3,many:4,other:5},du={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class dR{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Kt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Qi(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),du;if(!t.match(/-|_/))return du;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>uu[i]-uu[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const fu=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=rR(e,t,n);return!o&&i&&ue(n)&&(o=Wa(e,n,r),o===void 0&&(o=Wa(t,n,r))),o},na=e=>e.replace(/\$/g,"$$$$");class fR{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Kt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:m,nestingSuffixEscaped:p,nestingOptionsSeparator:y,maxReplaces:v,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:oR,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?rr(o):a||"{{",this.suffix=s?rr(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?rr(h):f||rr("$t("),this.nestingSuffix=m?rr(m):p||rr(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=v||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const v=fu(n,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...i,...n,interpolationkey:f}):v}const m=f.split(this.formatSeparator),p=m.shift().trim(),y=m.join(this.formatSeparator).trim();return this.format(fu(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure),y,r,{...i,...n,interpolationkey:p})};this.resetRegExp();const u=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>na(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?na(this.escape(f)):na(f)}].forEach(f=>{for(s=0;o=f.regex.exec(t);){const m=o[1].trim();if(a=c(m),a===void 0)if(typeof u=="function"){const y=u(t,o,i);a=ue(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(d){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else!ue(a)&&!this.useRawValueToEscape&&(a=nu(a));const p=f.safeValue(a);if(t=t.replace(o[0],p),d?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=o[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;const s=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const d=l.split(new RegExp(`${u}[ ]*{`));let h=`{${d[1]}`;l=d[0],h=this.interpolate(h,a);const f=h.match(/'/g),m=h.match(/"/g);((f?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),c&&(a={...c,...a})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${u}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!ue(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const u=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=u.shift(),l=u,c=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!ue(o))return o;ue(o)||(o=nu(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const hR=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=s.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},ir=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(Qi(r),i),t[a]=s),s(n)}};class pR{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Kt.create("formatter"),this.options=t,this.formats={number:ir((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:ir((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:ir((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:ir((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:ir((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=ir(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,l)=>{const{formatName:c,formatOptions:u}=hR(l);if(this.formats[c]){let d=s;try{const h=i?.formatParams?.[i.interpolationkey]||{},f=h.locale||h.lng||i.locale||i.lng||r;d=this.formats[c](s,f,{...u,...i,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}const mR=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class gR extends So{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Kt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(d=>{const h=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,u=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{nR(l.loaded,[o],a),mR(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{s[c][d]===void 0&&(s[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();ue(t)&&(t=this.languageUtils.toResolveHierarchy(t)),ue(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,i,l):u=c(t,n,r,i),u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}else c(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const hu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),ue(e[1])&&(t.defaultValue=e[1]),ue(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),pu=e=>(ue(e.ns)&&(e.ns=[e.ns]),ue(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ue(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),wi=()=>{},yR=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Qr extends So{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=pu(t),this.services={},this.logger=Kt,this.modules={external:[]},yR(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(ue(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=hu();this.options={...i,...this.options,...pu(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Kt.init(o(this.modules.logger),this.options):Kt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=pR;const d=new cu(this.options);this.store=new au(this.options.resources,this.options);const h=this.services;h.logger=Kt,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new dR(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=o(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new fR(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new gR(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),y=1;y<m;y++)p[y-1]=arguments[y];t.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new Ji(this.services,this.options),this.translator.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),y=1;y<m;y++)p[y-1]=arguments[y];t.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=wi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=jr(),c=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(h),r(d,h)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wi;const i=ue(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&o.indexOf(c)<0&&o.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=jr();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=wi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&np.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=jr();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=ue(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{a(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d<c;d++)u[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(u))}else l={...s};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||o.keyPrefix);const h=i.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(m=>`${l.keyPrefix}${h}${m}`):f=l.keyPrefix?`${l.keyPrefix}${h}${a}`:a,i.t(f,l)};return ue(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=jr();return this.options.ns?(ue(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=jr();ue(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new cu(hu());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Qr(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wi;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Qr(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},Object.keys(l[c]).reduce((u,d)=>(u[d]={...l[c][d]},u),{})),{});o.store=new au(s,i),o.services.resourceStore=o.store}return o.translator=new Ji(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];o.emit(s,...c)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Xe=Qr.createInstance();Xe.createInstance=Qr.createInstance;Xe.createInstance;Xe.dir;Xe.init;Xe.loadResources;Xe.reloadResources;Xe.use;Xe.changeLanguage;Xe.getFixedT;Xe.t;Xe.exists;Xe.setDefaultNamespace;Xe.hasLoadedNamespace;Xe.loadNamespaces;Xe.loadLanguages;function bR(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=vR(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
198
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function vR(e,t){if(e){if(typeof e=="string")return mu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mu(e,t):void 0}}function mu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ka(e){"@babel/helpers - typeof";return Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ka(e)}var rp=["__proto__","constructor","prototype"];function ip(e){return!(typeof e!="string"||e.length===0||e.length>128||rp.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function op(e){return!(!ip(e)||e.indexOf("/")>-1)}function xR(e){return ip(e)}var wR={lng:op,ns:xR};function ki(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function kR(e){if(typeof e!="string"||e.length===0)return e;try{var t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function ap(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Ka(XMLHttpRequest))==="object"}function SR(e){return!!e&&typeof e.then=="function"}function ER(e){return SR(e)?e:Promise.resolve(e)}var CR=/\{\{(.+?)\}\}/g;function gu(e,t){var n=!1,r=e.replace(CR,function(i,o){var a=o.trim();if(rp.indexOf(a)>-1)return i;var s=t[a];if(s==null)return i;var l=wR[a]||op,c=String(s).split("+"),u=bR(c),d;try{for(u.s();!(d=u.n()).done;){var h=d.value;if(!l(h))return n=!0,i}}catch(f){u.e(f)}finally{u.f()}return c.join("+")});return n?null:r}function yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yu(Object(n),!0).forEach(function(r){AR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AR(e,t,n){return(t=TR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TR(e){var t=RR(e,"string");return Kn(t)=="symbol"?t:t+""}function RR(e,t){if(Kn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kn(e){"@babel/helpers - typeof";return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(e)}var vn=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?vn=global.fetch:typeof window<"u"&&window.fetch&&(vn=window.fetch);var Xr;ap()&&(typeof global<"u"&&global.XMLHttpRequest?Xr=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Xr=window.XMLHttpRequest));var Zi;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Zi=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Zi=window.ActiveXObject));typeof vn!="function"&&(vn=void 0);if(!vn&&!Xr&&!Zi)try{be(()=>import("./browser-ponyfill-BOcGq8h9.js").then(e=>e.b),__vite__mapDeps([78,1])).then(function(e){vn=e.default}).catch(function(){})}catch{}var sp=["__proto__","constructor","prototype"],qa=function(t,n){if(n&&Kn(n)==="object"){for(var r="",i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];sp.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},vu=function(t,n,r,i){var o=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(i){var a=i(t,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(o).catch(r):vn(t,n).then(o).catch(r)},PR=function(t,n,r,i){t.queryStringParams&&(n=qa(n,t.queryStringParams));var o=bu({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=bu({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},t._omitFetchOptions?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{vu(n,s,i,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return i(c);try{Object.keys(a).forEach(function(u){delete s[u]}),vu(n,s,i,l),t._omitFetchOptions=!0}catch(u){i(u)}}},IR=function(t,n,r,i){r&&Kn(r)==="object"&&(r=qa("",r).slice(1)),t.queryStringParams&&(n=qa(n,t.queryStringParams));try{var o=Xr?new Xr:new Zi("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s=0,l=Object.keys(a);s<l.length;s++){var c=l[s];sp.indexOf(c)>-1||o.setRequestHeader(c,a[c])}o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(u){console&&console.log(u)}},LR=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},vn&&n.indexOf("file:")!==0)return PR(t,n,r,i);if(ap()||typeof ActiveXObject=="function")return IR(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function pr(e){"@babel/helpers - typeof";return pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(e)}function xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ra(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xu(Object(n),!0).forEach(function(r){lp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cp(r.key),r)}}function DR(e,t,n){return t&&NR(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lp(e,t,n){return(t=cp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cp(e){var t=_R(e,"string");return pr(t)=="symbol"?t:t+""}function _R(e,t){if(pr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var MR=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return lp({},r,i||"")},parseLoadPayload:function(n,r){},request:LR,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},up=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};OR(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return DR(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=ra(ra(ra({},MR()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);pr(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=ER(l),l.then(function(c){if(!c)return a(null,{});var u=gu(c,{lng:n.join("+"),ns:i.join("+")});if(u==null){var d=n.map(ki).join(", "),h=i.map(ki).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+d+"] namespaces=["+h+"]"),!1)}s.loadUrl(u,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,c=this.options.parseLoadPayload(s,l),u=ki(kR(n));this.options.request(this.options,n,c,function(d,h){if(h&&(h.status>=500&&h.status<600||!h.status))return r("failed loading "+u+"; status code: "+h.status,!0);if(h&&h.status>=400&&h.status<500)return r("failed loading "+u+"; status code: "+h.status,!1);if(!h&&d&&d.message){var f=d.message.toLowerCase(),m=["failed","fetch","network","load"].find(function(v){return f.indexOf(v)>-1});if(m)return r("failed loading "+u+": "+ki(d.message),!0)}if(d)return r(d,!1);var p,y;try{typeof h.data=="string"?p=a.options.parse(h.data,i,o):p=h.data}catch{y="failed parsing "+u+" to json"}if(y)return r(y,!1);r(null,p)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),c=0,u=[],d=[];n.forEach(function(h){var f=s.options.addPath;typeof s.options.addPath=="function"&&(f=s.options.addPath(h,r));var m=gu(f,{lng:h,ns:r});if(m==null){c+=1,a&&c===n.length&&a(u,d);return}s.options.request(s.options,m,l,function(p,y){c+=1,u.push(p),d.push(y),c===n.length&&typeof a=="function"&&a(u,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(d){var h=o.toResolveHierarchy(d);h.forEach(function(f){l.indexOf(f)<0&&l.push(f)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(d){i.read(u,d,"read",null,null,function(h,f){h&&a.warn("loading namespace ".concat(d," for language ").concat(u," failed"),h),!h&&f&&a.log("loaded namespace ".concat(d," for language ").concat(u),f),i.loaded("".concat(u,"|").concat(d),h,f)})})})}}}])}();up.type="backend";const jR="Agim",FR={refresh:"Refresh",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",submit:"Submit",close:"Close",back:"Back",next:"Next",previous:"Previous",create:"Create",search:"Search",retry:"Retry",confirm:"Confirm"},BR={loading:"Loading…",empty:"No data",saving:"Saving…",saved:"Saved",error:"Something went wrong"},UR={label:"Theme",system:"System",light:"Light",dark:"Dark",cycleHint:"Click to cycle theme"},HR={label:"Language",en:"English",zh:"中文"},zR={chat:"Chat",tasks:"Tasks",approvals:"Approvals",reminders:"Reminders",memos:"Memos",memory:"Memory",skills:"Skills",workspace:"Workspace",observability:"Observability",settings:"Settings"},$R={deleteTitle:"Delete this item?",deleteDescription:"This cannot be undone.",destructiveAction:"Delete"},VR={label:"Pagination",perPage:"Per page",firstPage:"First page",lastPage:"Last page",pageOfTotal:"Page {{page}} of {{totalPages}}",range:"{{from}}–{{to}} of {{total}}"},WR={selectAll:"Select all rows",selectRow:"Select row"},KR={intro:"Paste your access token from ~/.agim/tokens.json or `agim token list`.",tokenLabel:"Access token",submit:"Sign in",hint:"Loopback (127.0.0.1) requests bypass this page; you only land here from another host or with IMHUB_TRUST_LOOPBACK=off."},qR={placeholder:"Signed in. The chat surface ships in PR-6; this route is intentionally blank for now.",healthCheck:"Backend reachable"},GR={title:"Nothing here.",description:"The page you're looking for doesn't exist."},YR={title:"Something went wrong.",description:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it.",reload:"Reload",home:"Home"},QR={send:"Send",streaming:"… streaming",notConnected:"Not connected. Reconnecting…",connecting:"Connecting to agim…",disconnected:"Disconnected. Reconnecting automatically; you can keep typing.",welcomeTitle:"Start a conversation",welcomeBody:"Type a message to ask the active agent. Use the agent dropdown to switch.",inputPlaceholder:"Message… (Enter sends, Shift+Enter newlines)",newConv:"New",newConvHint:"Clear messages and start a fresh session",newConvToast:"Started a new conversation",approvalTitle:"🔐 Tool approval",approvalAutoBadge:"auto-allow",approvalAutoIn:"Auto-allowing in {{count}}s — Deny to stop.",approvalAutoResolving:"Auto-allowing now…",approvalToolLabel:"Tool",approvalInputLabel:"Input",approvalAllow:"Allow",approvalAuto:"Auto for similar",approvalAutoTip:"Allow and auto-allow similar calls for the rest of the session",approvalDeny:"Deny",outcome:{allowed:"✅ Allowed",allowedPinned:"✅ Allowed + auto-allow further",denied:"❌ Denied",deniedRevoked:"❌ Denied (auto-allow revoked)",expired:"⏱ Timed out"}},XR={appName:jR,actions:FR,states:BR,theme:UR,lang:HR,nav:zR,confirm:$R,pagination:VR,table:WR,login:KR,home:qR,notFound:GR,errorBoundary:YR,chat:QR},JR="Agim",ZR={refresh:"刷新",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",submit:"提交",close:"关闭",back:"返回",next:"下一页",previous:"上一页",create:"新建",search:"搜索",retry:"重试",confirm:"确定"},eP={loading:"加载中…",empty:"暂无数据",saving:"保存中…",saved:"已保存",error:"出错了"},tP={label:"主题",system:"跟随系统",light:"浅色",dark:"深色",cycleHint:"点击切换主题"},nP={label:"语言",en:"English",zh:"中文"},rP={chat:"对话",tasks:"任务",approvals:"审批",reminders:"提醒",memos:"备忘",memory:"记忆",skills:"技能",workspace:"工作区",observability:"观测",settings:"设置"},iP={deleteTitle:"确认删除?",deleteDescription:"操作不可撤销。",destructiveAction:"删除"},oP={label:"分页",perPage:"每页",firstPage:"首页",lastPage:"末页",pageOfTotal:"第 {{page}} / {{totalPages}} 页",range:"{{from}}–{{to}} / 共 {{total}}"},aP={selectAll:"全选",selectRow:"选中此行"},sP={intro:"粘贴 ~/.agim/tokens.json 里的访问令牌(或运行 `agim token list` 查看)。",tokenLabel:"访问令牌",submit:"登录",hint:"loopback(127.0.0.1)的请求会跳过此页;只有跨机访问或设置了 IMHUB_TRUST_LOOPBACK=off 时才会看到此页。"},lP={placeholder:"已登录。聊天界面将在 PR-6 落地;当前页暂为占位。",healthCheck:"后端可达"},cP={title:"什么也没找到。",description:"你要找的页面不存在。"},uP={title:"出错了。",description:"页面渲染过程中遇到了未预期的错误。可以尝试刷新或返回主页;若问题反复出现,请复制下方错误信息反馈。",reload:"刷新",home:"返回主页"},dP={send:"发送",streaming:"… 接收中",notConnected:"未连接,正在重连…",connecting:"正在连接 agim…",disconnected:"已断开,自动重连中;可以继续输入。",welcomeTitle:"开始对话",welcomeBody:"输入消息向当前 Agent 提问。点上方下拉可切换 Agent。",inputPlaceholder:"输入消息……(Enter 发送,Shift+Enter 换行)",newConv:"新对话",newConvHint:"清空消息并开启新会话",newConvToast:"已开启新对话",approvalTitle:"🔐 工具授权",approvalAutoBadge:"自动放行",approvalAutoIn:"{{count}} 秒后自动放行 — 点「拒绝」可中止。",approvalAutoResolving:"正在自动放行…",approvalToolLabel:"工具",approvalInputLabel:"输入",approvalAllow:"批准",approvalAuto:"本类自动放行",approvalAutoTip:"批准并对本会话内同类调用自动放行",approvalDeny:"拒绝",outcome:{allowed:"✅ 已批准",allowedPinned:"✅ 已批准 · 后续同类自动放行",denied:"❌ 已拒绝",deniedRevoked:"❌ 已拒绝(撤销自动放行)",expired:"⏱ 已超时"}},fP={appName:JR,actions:ZR,states:eP,theme:tP,lang:nP,nav:rP,confirm:iP,pagination:oP,table:aP,login:sP,home:lP,notFound:cP,errorBoundary:uP,chat:dP},hP="Couldn't reach the server. Check your connection and retry.",pP="Your session expired. Please sign in again.",mP="Sign-in required.",gP="Auth token missing from request.",yP="Auth subsystem isn't ready yet. Retry in a moment.",bP="You don't have permission to do that.",vP="The requested resource wasn't found.",xP="That request is too big — try splitting it.",wP="The server rejected the request: {{detail}}",kP="Request body wasn't valid JSON.",SP="Configuration didn't validate. Check the form fields.",EP="Couldn't save configuration: {{detail}}",CP="Send an `updates` object to change env values.",AP="None of the keys you sent are editable.",TP="SMTP isn't configured. Save host / user / password first.",RP="SMTP verify failed: {{detail}}",PP="Provide a baseUrl to discover ACP agents.",IP="Provide an `endpoint` to test the agent.",LP="ACP discovery failed: {{detail}}",OP="ACP agent test failed: {{detail}}",NP="A user_key (platform:userId) is required.",DP="Something went wrong (code {{code}}).",_P="Bad request.",MP="Sign-in required.",jP="Forbidden.",FP="Not found.",BP="Conflict — refresh and try again.",UP="Request too large.",HP="Server error.",zP="Gateway error.",$P="Service unavailable.",VP="Gateway timeout.",WP={NETWORK:hP,AUTH_INVALID:pP,AUTH_REQUIRED:mP,AUTH_TOKEN_REQUIRED:gP,AUTH_NOT_READY:yP,FORBIDDEN:bP,NOT_FOUND:vP,PAYLOAD_TOO_LARGE:xP,VALIDATION:wP,INVALID_JSON_BODY:kP,CONFIG_INVALID:SP,CONFIG_SAVE_FAILED:EP,ENV_UPDATES_REQUIRED:CP,ENV_NO_EDITABLE_KEYS:AP,EMAIL_NOT_CONFIGURED:TP,EMAIL_VERIFY_FAILED:RP,ACP_BASEURL_REQUIRED:PP,ACP_ENDPOINT_REQUIRED:IP,ACP_DISCOVER_FAILED:LP,ACP_TEST_FAILED:OP,MEMORY_USER_KEY_REQUIRED:NP,UNKNOWN:DP,HTTP_400:_P,HTTP_401:MP,HTTP_403:jP,HTTP_404:FP,HTTP_409:BP,HTTP_413:UP,HTTP_500:HP,HTTP_502:zP,HTTP_503:$P,HTTP_504:VP},KP="无法访问服务器,请检查网络后重试。",qP="登录状态已过期,请重新登录。",GP="请先登录。",YP="请求缺少 auth token。",QP="鉴权子系统尚未就绪,请稍后重试。",XP="没有执行该操作的权限。",JP="请求的资源不存在。",ZP="请求体过大,请拆分后重试。",eI="服务端拒绝了请求:{{detail}}",tI="请求体不是合法的 JSON。",nI="配置校验失败,请检查表单字段。",rI="保存配置失败:{{detail}}",iI="请在请求体中提供 `updates` 对象以修改 env。",oI="请求里的 key 均不可编辑。",aI="SMTP 未配置,请先保存 host / user / password。",sI="SMTP 连接测试失败:{{detail}}",lI="需要 baseUrl 才能发现 ACP Agent。",cI="需要 `endpoint` 才能测试该 Agent。",uI="ACP 发现失败:{{detail}}",dI="ACP Agent 测试失败:{{detail}}",fI="需要 user_key(形如 `platform:userId`)。",hI="出错了 (code {{code}})。",pI="请求格式不正确。",mI="请先登录。",gI="没有权限。",yI="未找到。",bI="状态冲突,请刷新后重试。",vI="请求体过大。",xI="服务端出错。",wI="网关错误。",kI="服务暂不可用。",SI="网关超时。",EI={NETWORK:KP,AUTH_INVALID:qP,AUTH_REQUIRED:GP,AUTH_TOKEN_REQUIRED:YP,AUTH_NOT_READY:QP,FORBIDDEN:XP,NOT_FOUND:JP,PAYLOAD_TOO_LARGE:ZP,VALIDATION:eI,INVALID_JSON_BODY:tI,CONFIG_INVALID:nI,CONFIG_SAVE_FAILED:rI,ENV_UPDATES_REQUIRED:iI,ENV_NO_EDITABLE_KEYS:oI,EMAIL_NOT_CONFIGURED:aI,EMAIL_VERIFY_FAILED:sI,ACP_BASEURL_REQUIRED:lI,ACP_ENDPOINT_REQUIRED:cI,ACP_DISCOVER_FAILED:uI,ACP_TEST_FAILED:dI,MEMORY_USER_KEY_REQUIRED:fI,UNKNOWN:hI,HTTP_400:pI,HTTP_401:mI,HTTP_403:gI,HTTP_404:yI,HTTP_409:bI,HTTP_413:vI,HTTP_500:xI,HTTP_502:wI,HTTP_503:kI,HTTP_504:SI},CI="Tasks",AI={jobs:"Jobs",subtasks:"Subtasks",bgjobs:"Background",schedules:"Schedules",outbox:"Outbox",a2a:"Agent ↔ Agent",heartbeat:"Heartbeat",goals:"Goals",asks:"Ask User"},TI={title:"Jobs",subtitle:"Long-running agent invocations and their results.",empty:{title:"No jobs yet",description:"Jobs are created when an agent runs in async mode — via `agim --invoke` or an inline /run command from chat."},filter:{status:"Status",statusAny:"Any status",agent:"Agent",agentAny:"Any agent",kind:"Kind",kindAny:"Any kind"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",createdAt:"Created",duration:"Duration",cost:"Cost"},status:{pending:"Pending",running:"Running",completed:"Completed",delivered:"Delivered",failed:"Failed",cancelled:"Cancelled",interrupted:"Interrupted",replaced:"Replaced",abandoned:"Abandoned"},kind:{job:"Job",inline:"Inline"},stats:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},batch:{selected:"{{count}} selected",cancel:"Cancel selected",rerun:"Re-run selected",confirmCancel:"Cancel {{count}} job(s)?",confirmCancelDesc:"Running jobs will be sent a stop signal. Already-completed jobs are unaffected.",confirmRerun:"Re-run {{count}} job(s)?",confirmRerunDesc:"New jobs will be created from the original prompts."},live:{connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"}},RI={title:"Subtasks",subtitle:"Per-conversation child tasks spawned by the parent agent.",empty:{title:"No subtasks yet",description:"Subtasks appear when an agent dispatches work to another agent inside a chat thread."},filter:{agent:"Parent agent",agentAny:"Any agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",parent:"Parent",platform:"Platform",createdAt:"Created"},status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"}},PI={title:"Background jobs",subtitle:"Long-running scripts the agent wrappers (Claude Code / opencode / codex) launched via bgjob.",empty:{title:"No background jobs",description:"Background jobs show up here once an agent has used its bgjob wrapper. Roots come from ~/.claude/bgjobs/, ~/.config/opencode/bgjobs/, ~/.codex/bgjobs/ (override via IMHUB_BGJOB_ROOTS)."},filter:{root:"Root",rootAny:"All roots"},col:{name:"Name",status:"Status",root:"Root",pid:"PID",startedAt:"Started",endedAt:"Ended",exit:"Exit"},exitOk:"ok",stillRunning:"—"},II={title:"Schedules",subtitle:"Cron-style triggers that re-invoke an agent with a fixed prompt.",empty:{title:"No schedules configured",description:"Create a schedule from the agent's chat via `/cron set` or by running `agim cron create` in the CLI."},filter:{agent:"Agent",agentAny:"Any agent"},col:{id:"ID",name:"Name",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"Enabled",nextRun:"Next run",lastRun:"Last run"},enabled:"On",disabled:"Off"},LI={title:"Outbox",subtitle:"Pending IM-platform deliveries. The crash-safe queue retries on transient failures and parks unrecoverable ones in `giving_up`.",empty:{title:"Outbox is empty",description:"Messages move through the queue and are deleted on successful delivery. A non-empty outbox here means the queue is actively flushing or a delivery is stuck."},filter:{status:"Status",statusAny:"Any status",thread:"Thread key"},stats:{pending:"Pending",giving_up:"Giving up",delivered:"Delivered (lifetime)",lastDelivered:"Last delivery"},col:{id:"ID",status:"Status",platform:"Platform",preview:"Preview",thread:"Thread",kind:"Kind",attempts:"Attempts",createdAt:"Created",lastError:"Last error",jobId:"Job"},status:{pending:"Pending",delivered:"Delivered",giving_up:"Giving up"},action:{retry:"Retry",confirmRetry:"Re-queue this delivery?",confirmRetryDesc:"The row's status flips back to pending and the sender will attempt delivery again on the next tick."}},OI={title:"Agent ↔ Agent",subtitle:"Recent inline jobs spawned with a parent (one agent invoking another).",empty:{title:"No agent-to-agent calls yet",description:"Inline a2a calls appear here once an agent uses the `agim --invoke` tool with a parent context."},stats:{total:"Total",recent24h:"Last 24h",maxDepth:"Max depth"},col:{id:"ID",agent:"Agent",parent:"Parent",depth:"Depth",status:"Status",prompt:"Prompt",createdAt:"Created"}},NI={title:"Heartbeat bindings",subtitle:"Cross-thread view of every /heartbeat bind. Enable/disable a binding from here; create new ones from inside the IM thread itself (/heartbeat bind <body>).",refresh:"Refresh",empty:"No heartbeat bindings yet. Run /heartbeat bind <body> in any IM thread to create one.",col:{thread:"Thread",owner:"Owner",interval:"Interval",lastTick:"Last tick",enabled:"Enabled",body:"Body"},never:"never",pause:"Pause",enable:"Enable",show:"Show",hide:"Hide",enabledToast:"enabled binding",disabledToast:"disabled binding",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",intervalMin:"{{count}}m"},DI={title:"Active goals",subtitle:"Cross-thread view of every active /goal. Lifecycle controls (pause / complete / cancel) operate without the IM thread; creating a new goal still requires the thread context — /goal set <title>.",refresh:"Refresh",empty:"No active goals. Create one inside any IM thread with /goal set <title>.",col:{id:"#",thread:"Thread",title:"Title",progress:"Progress",updated:"Updated",actions:"Actions"},showBody:"Show body",hideBody:"Hide body",pause:"Pause",complete:"Complete",cancel:"Cancel",body:"Body",recentProgress:"Recent progress (latest {{count}})",created:"created {{at}}",closed:"closed {{at}}",statusUpdated:"Goal {{status}}"},_I={title:"Pending ask_user",subtitle:"Live list of every mcp__imhub__ask_user waiting on a reply. Cancelling here gives the agent the same response shape as a natural timeout (ok: false, reason: 'cancelled').",refresh:"Refresh",empty:"No pending asks. Auto-refreshes every 5s.",col:{reqId:"Req ID",thread:"Thread",question:"Question",choices:"Choices",age:"Age",actions:""},cancel:"Cancel",cancelConfirm:"Cancel pending ask {{id}}…?",cancelledToast:"Cancelled",justNow:"just now",seconds:"{{count}}s",minutes:"{{count}}m",hours:"{{count}}h"},MI={pageTitle:CI,subnav:AI,jobs:TI,subtasks:RI,bgjobs:PI,schedules:II,outbox:LI,a2a:OI,heartbeat:NI,goals:DI,asks:_I},jI="任务",FI={jobs:"作业",subtasks:"子任务",bgjobs:"后台脚本",schedules:"定时任务",outbox:"投递队列",a2a:"Agent 互调",heartbeat:"心跳",goals:"目标",asks:"待回答"},BI={title:"作业",subtitle:"Agent 的长任务调用与结果。",empty:{title:"暂无作业",description:"通过 `agim --invoke` 或聊天里的 /run 命令异步启动 Agent 时会自动生成作业记录。"},filter:{status:"状态",statusAny:"全部状态",agent:"Agent",agentAny:"全部 Agent",kind:"类型",kindAny:"全部类型"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",createdAt:"创建时间",duration:"耗时",cost:"成本"},status:{pending:"等待中",running:"运行中",completed:"已完成",delivered:"已送达",failed:"失败",cancelled:"已取消",interrupted:"已中断",replaced:"已替换",abandoned:"已放弃"},kind:{job:"作业",inline:"即时"},stats:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败"},batch:{selected:"已选 {{count}} 项",cancel:"取消所选",rerun:"重跑所选",confirmCancel:"确认取消 {{count}} 个作业?",confirmCancelDesc:"运行中的作业会收到停止信号。已完成的作业不受影响。",confirmRerun:"确认重跑 {{count}} 个作业?",confirmRerunDesc:"将根据原 Prompt 重新创建作业。"},live:{connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"}},UI={title:"子任务",subtitle:"由父 Agent 在对话内派发出的子任务列表。",empty:{title:"暂无子任务",description:"当 Agent 在聊天线程内向其他 Agent 委派工作时,子任务会出现在这里。"},filter:{agent:"父 Agent",agentAny:"全部 Agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",parent:"父级",platform:"平台",createdAt:"创建时间"},status:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消"}},HI={title:"后台脚本",subtitle:"Agent 封装(Claude Code / opencode / codex)通过 bgjob 启动的长任务进程。",empty:{title:"暂无后台脚本",description:"当 Agent 使用其 bgjob 封装时,记录会在这里出现。Root 路径默认取 ~/.claude/bgjobs/、~/.config/opencode/bgjobs/、~/.codex/bgjobs/(可通过 IMHUB_BGJOB_ROOTS 覆盖)。"},filter:{root:"Root",rootAny:"全部 Root"},col:{name:"名称",status:"状态",root:"Root",pid:"PID",startedAt:"开始时间",endedAt:"结束时间",exit:"退出码"},exitOk:"ok",stillRunning:"—"},zI={title:"定时任务",subtitle:"Cron 触发的 Agent 调用 — 按固定 Prompt 重新执行。",empty:{title:"暂无定时任务",description:"可在聊天中通过 `/cron set` 或 CLI `agim cron create` 创建定时任务。"},filter:{agent:"Agent",agentAny:"全部 Agent"},col:{id:"ID",name:"名称",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"启用",nextRun:"下次运行",lastRun:"上次运行"},enabled:"开",disabled:"关"},$I={title:"投递队列",subtitle:"面向 IM 平台的待投递消息队列。瞬态失败会自动重试;不可恢复的会停在 giving_up。",empty:{title:"投递队列为空",description:"消息成功投递后会被删除。如果这里非空,说明队列正在刷出消息,或某条消息卡住了。"},filter:{status:"状态",statusAny:"全部状态",thread:"Thread 标识"},stats:{pending:"待发送",giving_up:"放弃中",delivered:"已投递(累计)",lastDelivered:"最近投递"},col:{id:"ID",status:"状态",platform:"平台",preview:"内容",thread:"Thread",kind:"类型",attempts:"尝试次数",createdAt:"创建时间",lastError:"最后错误",jobId:"Job"},status:{pending:"待发送",delivered:"已投递",giving_up:"放弃中"},action:{retry:"重试",confirmRetry:"重新入队这条投递?",confirmRetryDesc:"状态会切回 pending,发送器会在下一轮 tick 再次尝试投递。"}},VI={title:"Agent 互调",subtitle:"带父级 ID 的最近 inline 作业(一个 Agent 调用另一个 Agent 的记录)。",empty:{title:"暂无 Agent 互调记录",description:"当某 Agent 使用 `agim --invoke` 工具并带上父级上下文时,这里会出现 inline a2a 调用记录。"},stats:{total:"累计",recent24h:"近 24 小时",maxDepth:"最大深度"},col:{id:"ID",agent:"Agent",parent:"父级",depth:"深度",status:"状态",prompt:"Prompt",createdAt:"创建时间"}},WI={title:"心跳绑定",subtitle:"跨线程查看所有 /heartbeat bind。可在此启用/停用绑定;新建绑定需在 IM 线程内执行 /heartbeat bind <body>。",refresh:"刷新",empty:"尚无心跳绑定。在任意 IM 线程执行 /heartbeat bind <body> 即可创建。",col:{thread:"线程",owner:"所有者",interval:"间隔",lastTick:"上次 tick",enabled:"启用",body:"正文"},never:"从未",pause:"暂停",enable:"启用",show:"展开",hide:"收起",enabledToast:"已启用绑定",disabledToast:"已停用绑定",justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",intervalMin:"{{count}} 分钟"},KI={title:"活跃目标",subtitle:"跨线程查看所有活跃 /goal。生命周期操作(暂停/完成/取消)无需 IM 线程;新建目标仍需在线程内执行 /goal set <title>。",refresh:"刷新",empty:"暂无活跃目标。在任意 IM 线程执行 /goal set <title> 创建。",col:{id:"#",thread:"线程",title:"标题",progress:"进度",updated:"更新",actions:"操作"},showBody:"展开正文",hideBody:"收起正文",pause:"暂停",complete:"完成",cancel:"取消",body:"正文",recentProgress:"最近进度(最新 {{count}} 条)",created:"创建于 {{at}}",closed:"关闭于 {{at}}",statusUpdated:"目标已{{status}}"},qI={title:"待回答 ask_user",subtitle:"所有等待回复的 mcp__imhub__ask_user 实时列表。在此取消与超时相同(ok: false, reason: 'cancelled')。",refresh:"刷新",empty:"暂无待回答。每 5 秒自动刷新。",col:{reqId:"请求 ID",thread:"线程",question:"问题",choices:"选项数",age:"等待时长",actions:""},cancel:"取消",cancelConfirm:"取消待回答 {{id}}…?",cancelledToast:"已取消",justNow:"刚刚",seconds:"{{count}} 秒",minutes:"{{count}} 分",hours:"{{count}} 小时"},GI={pageTitle:jI,subnav:FI,jobs:BI,subtasks:UI,bgjobs:HI,schedules:zI,outbox:$I,a2a:VI,heartbeat:WI,goals:KI,asks:qI},YI="Approvals",QI="Pending tool invocations the agent is asking permission for.",XI={connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"},JI={pending:"Pending",totalAllowed:"Total allowed",totalDenied:"Total denied",totalTimedOut:"Timed out",totalReadonly:"Read-only auto-allowed"},ZI={title:"No approvals waiting",description:"The queue is empty. Tool requests show up here when an agent calls a tool that's not on its allow-list yet."},eL="Thread",tL="auto-allow",nL="Backend auto-allowed this read-only tool; the card is shown for visibility only.",rL="Allow",iL="Deny",oL={allowedShort:"Allowed",deniedShort:"Denied"},aL={pageTitle:YI,subtitle:QI,live:XI,stats:JI,empty:ZI,threadLabel:eL,autoAllowedTag:tL,autoAllowedTitle:nL,allow:rL,deny:iL,toast:oL},sL="审批",lL="Agent 等待批准的工具调用。",cL={connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"},uL={pending:"待审批",totalAllowed:"累计放行",totalDenied:"累计拒绝",totalTimedOut:"超时",totalReadonly:"只读自动放行"},dL={title:"暂无待审批请求",description:"队列为空。当 Agent 调用尚未加入白名单的工具时,请求会在这里出现。"},fL="Thread",hL="自动放行",pL="后端已对该只读工具自动放行;此处仅供可见性展示。",mL="放行",gL="拒绝",yL={allowedShort:"已放行",deniedShort:"已拒绝"},bL={pageTitle:sL,subtitle:lL,live:cL,stats:uL,empty:dL,threadLabel:fL,autoAllowedTag:hL,autoAllowedTitle:pL,allow:mL,deny:gL,toast:yL},vL="Reminders",xL="Queued reminders waiting to fire. Cancel or snooze pending ones; fired and cancelled rows are kept for audit.",wL={status:"Status",statusAny:"Any status"},kL={pending:"Pending",firing:"Firing",fired:"Fired",cancelled:"Cancelled",failed:"Failed"},SL={slash:"/remind",mcp:"MCP",api:"API"},EL={literal:"Literal",llm:"LLM"},CL={title:"Nothing scheduled",description:"Reminders show up here once an agent (via /remind, MCP, or API) queues one. Filter by status to see fired or cancelled ones."},AL={id:"ID",fireAt:"Fires",text:"Text",status:"Status",platform:"Platform",thread:"Thread",source:"Source",recurrence:"Recurrence",createdAt:"Created"},TL={cancel:"Cancel",snooze:"Snooze",confirmCancel:"Cancel this reminder?",confirmCancelDesc:"The reminder is removed from the queue. Recurring reminders won't fire again unless re-created."},RL={title:"Snooze reminder",description:"How long should it be pushed back?",preset5m:"5 minutes",preset30m:"30 minutes",preset1h:"1 hour",preset1d:"1 day",submit:"Snooze",toastOk:"Snoozed for {{duration}}"},PL={cancelled:"Reminder cancelled"},IL={pageTitle:vL,subtitle:xL,filter:wL,status:kL,source:SL,promptMode:EL,empty:CL,col:AL,action:TL,snooze:RL,toast:PL},LL="提醒",OL="排队待触发的提醒。可对 pending 的提醒做取消 / 延后;已触发与已取消的记录保留以备审计。",NL={status:"状态",statusAny:"全部状态"},DL={pending:"等待中",firing:"触发中",fired:"已触发",cancelled:"已取消",failed:"失败"},_L={slash:"/remind",mcp:"MCP",api:"API"},ML={literal:"原文",llm:"LLM"},jL={title:"暂无提醒",description:"当 Agent 通过 /remind、MCP 或 API 创建提醒时,记录会出现在这里。可切换状态查看已触发或已取消的记录。"},FL={id:"ID",fireAt:"触发时间",text:"内容",status:"状态",platform:"平台",thread:"Thread",source:"来源",recurrence:"周期",createdAt:"创建时间"},BL={cancel:"取消",snooze:"延后",confirmCancel:"确认取消这条提醒?",confirmCancelDesc:"该提醒会被移出队列。周期提醒在未重新创建前不会再触发。"},UL={title:"延后提醒",description:"延后多久?",preset5m:"5 分钟",preset30m:"30 分钟",preset1h:"1 小时",preset1d:"1 天",submit:"确认延后",toastOk:"已延后 {{duration}}"},HL={cancelled:"已取消"},zL={pageTitle:LL,subtitle:OL,filter:NL,status:DL,source:_L,promptMode:ML,empty:jL,col:FL,action:BL,snooze:UL,toast:HL},$L="Memos",VL="Long-term notes the operator captured for the agent — searchable by content, person, or location.",WL={placeholder:"Search memos…",who:"Who",what:"What",hasLocation:"Has location",includeExpired:"Include expired"},KL={title:"No memos match",description:"Memos are created from chat via `/memo` or auto-extracted by the memory subsystem. Try clearing filters or widening the search."},qL={id:"ID",what:"What",who:"Who",when:"When",where:"Where",platform:"Platform",createdAt:"Created",expiresAt:"Expires"},GL={delete:"Delete",confirmDelete:"Delete this memo?",confirmDeleteDesc:"This cannot be undone. The memory subsystem still has any embeddings derived from this memo until a backfill prune lands."},YL={label:"Open map",baidu:"Baidu Maps",apple:"Apple Maps",google:"Google Maps",osm:"OpenStreetMap"},QL={deleted:"Memo deleted"},XL={pageTitle:$L,subtitle:VL,search:WL,empty:KL,col:qL,action:GL,openMap:YL,toast:QL},JL="备忘",ZL="操作员为 Agent 记下的长期备忘 — 可按内容、人物、地点检索。",eO={placeholder:"搜索备忘…",who:"谁",what:"做什么",hasLocation:"含位置",includeExpired:"包含过期"},tO={title:"未匹配到备忘",description:"备忘通过聊天中的 `/memo` 命令或记忆子系统自动抽取生成。可清空筛选或放宽搜索条件再试。"},nO={id:"ID",what:"事项",who:"对象",when:"时间",where:"地点",platform:"平台",createdAt:"创建时间",expiresAt:"过期时间"},rO={delete:"删除",confirmDelete:"确认删除此备忘?",confirmDeleteDesc:"操作不可撤销。记忆子系统中由此备忘衍生的 embedding 在下一次 backfill 清理前仍会保留。"},iO={label:"在地图中打开",baidu:"百度地图",apple:"Apple 地图",google:"Google 地图",osm:"OpenStreetMap"},oO={deleted:"已删除"},aO={pageTitle:JL,subtitle:ZL,search:eO,empty:tO,col:nO,action:rO,openMap:iO,toast:oO},sO="Memory",lO="Per-user facts the agent has accumulated. Long-term memory that survives session resets.",cO={label:"User",placeholder:"Pick a user",factsLabel:"{{count}} facts",personaTag:"persona"},uO={title:"Pick a user to view their memory",description:"Memory is partitioned per user_key (platform:userId). The dropdown above lists every user whose memory has any rows in the bank."},dO={facts:"Facts",persona:"Persona",vector:"Vector",skills:"Skills"},fO={title:"Facts",empty:{title:"No facts yet",description:"Facts accumulate as the agent extracts them from chat history during memory consolidation. Triggering `/memory consolidate` from chat (or the Persona tab's button when it lands) seeds this list."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},category:{fact:"Fact",preference:"Preference",goal:"Goal",history:"History",profile:"Profile"},col:{id:"ID",what:"What",category:"Category",confidence:"Confidence",source:"Source",createdAt:"Created"},batch:{selected:"{{count}} selected",deleteSelected:"Delete selected",confirmDelete:"Delete {{count}} fact(s)?",confirmDeleteDesc:"This removes the rows from the bank. The vector index keeps any embedding derived from these rows until the next backfill prune."},action:{delete:"Delete",confirmDelete:"Delete this fact?",confirmDeleteDesc:"This row is removed permanently. The vector index retains its embedding until the next backfill prune."},toast:{deletedOne:"Fact deleted",deletedMany:"Deleted {{count}} facts"}},hO={title:"Persona",subtitle:"Long-form summary of who this user is, refined by periodic consolidation of their facts.",empty:{title:"No persona yet",description:"Personas are written by the consolidation pass — run it from the button below once enough facts have accumulated."},updated:"Updated {{at}}",editorLabel:"Persona summary",save:"Save",saved:"Saved",delete:"Delete persona",confirmDelete:"Delete this persona?",confirmDeleteDesc:"The persona summary is removed from the bank. Facts the persona was derived from stay in place; the next consolidate pass will rewrite a fresh one.",consolidate:{trigger:"Run consolidation",triggering:"Starting…",running:"Consolidation running…",doneOk:"Consolidation complete",doneFailed:"Consolidation failed",lastRun:"Last run {{at}}",result:"Processed {{users}} user(s), {{updated}} persona(s) updated"}},pO={title:"Vector backend",subtitle:"Embeddings power hybrid recall on memory facts. The active backend, model, and per-user coverage live here.",config:{title:"Backend configuration",hint:"Backend selection + OpenAI / local-model parameters live in env. Edit `~/.agim/env` on the host (or set systemd `Environment=`); the `IMHUB_MEMORY_VECTOR_*` keys are listed below.",editLink:"env file"},form:{title:"Backend configuration",hint:"Pick a backend, fill in the parameters, then save & test. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",saveAndTest:"Save & test",savedToast:"Saved — running test…",nothingChanged:"Nothing to save",backend:"Backend",backendHelp:"off = vector recall disabled; local = on-device BGE; openai = OpenAI-compatible remote endpoint",backendOff:"Off",backendLocal:"Local (BGE)",backendOpenai:"OpenAI-compatible",localModel:"Local model",localModelHelp:"Xenova model id, defaults to Xenova/bge-base-zh-v1.5. First-time use needs a manual download.",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI-compatible endpoint root, e.g. https://api.openai.com/v1 or your self-hosted gateway.",openaiModel:"Model",openaiModelHelp:"Embedding model id, defaults to text-embedding-3-small. Match your provider's docs for other endpoints.",openaiApiKey:"API key",apiKeyKeepHint:"Leave blank to keep the existing key (placeholder shows the masked value); typing replaces it.",apiKeyNewHint:"Paste your OpenAI-compatible API key (only the server sees the raw value after save).",toggleApiKey:"Show / hide API key",batchSize:"Batch size",batchSizeHelp:"Max texts per embed call, 1–1024 (default 32).",hybridWeight:"Hybrid weight",hybridWeightHelp:"Vector branch weight when fusing with FTS5 recall, 0–1 (default 0.5).",errors:{baseUrlRequired:"Base URL is required",baseUrlInvalid:"Base URL is not a valid URL",openaiModelRequired:"Embedding model id is required",apiKeyRequired:"API key is required for the OpenAI backend on first setup",localModelRequired:"Local model id is required",batchSizeRange:"Batch size must be between 1 and 1024",hybridWeightRange:"Hybrid weight must be between 0 and 1"}},backendLabel:"Backend",modelLabel:"Model",dimsLabel:"Dimensions",readyTrue:"Ready",readyFalse:"Not ready",downloadedTrue:"Files on disk",lastError:"Last error",coverage:{title:"Coverage",total:"Facts",withEmbedding:"Embedded",withDifferentModel:"Mismatched model",scope_user:"for {{userKey}}",scope_global:"across every user"},actions:{title:"Maintenance",test:"Test",testOk:"Backend test OK",testFail:"Backend test failed: {{detail}}",download:"Download model",downloadStarted:"Download started",downloadAlreadyReady:"Model is already ready",backfill:"Backfill embeddings",backfillStarted:"Backfill started",backfillNotReady:"Backend not ready — run download first",clear:"Clear embeddings",clearStarted:"Cleared {{count}} embedding(s)",confirmClear:"Clear all embeddings?",confirmClearDesc:"Drops the embedding column for {{scope}}. Facts themselves stay; you'll need to backfill again before vector recall works."},jobs:{title:"Recent jobs",empty:"No recent jobs",phase:{running:"Running",done:"Done",failed:"Failed"}}},mO={title:"Skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills installed",description:"Drop a SKILL.md (with `name` and `description` frontmatter) under one of the configured roots and refresh."},filter:{search:"Search",category:"Category",categoryAny:"All categories"},sources:{title:"Source directories",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Available to"}},gO={pageTitle:sO,subtitle:lO,userPicker:cO,noUserSelected:uO,tabs:dO,facts:fO,persona:hO,vector:pO,skills:mO},yO="记忆",bO="Agent 为每个用户积累的事实库。跨会话保留的长期记忆。",vO={label:"用户",placeholder:"选择一个用户",factsLabel:"{{count}} 条事实",personaTag:"persona"},xO={title:"选择一个用户查看其记忆",description:"记忆按 user_key(platform:userId)分隔。上方下拉列出每位在库中有任何记忆数据的用户。"},wO={facts:"事实",persona:"Persona",vector:"向量",skills:"技能"},kO={title:"事实",empty:{title:"暂无事实",description:"Agent 在记忆整理过程中会从聊天历史中抽取事实。可在聊天里运行 `/memory consolidate` 或后续 Persona 子页内的按钮触发整理。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},category:{fact:"事实",preference:"偏好",goal:"目标",history:"历史",profile:"档案"},col:{id:"ID",what:"内容",category:"类别",confidence:"置信度",source:"来源",createdAt:"创建时间"},batch:{selected:"已选 {{count}} 项",deleteSelected:"删除所选",confirmDelete:"确认删除 {{count}} 条事实?",confirmDeleteDesc:"记忆库中的这些行将被删除。向量索引中相应的 embedding 在下一次 backfill 清理前仍会保留。"},action:{delete:"删除",confirmDelete:"确认删除此事实?",confirmDeleteDesc:"该行被永久删除。向量索引会在下一次 backfill 清理前保留对应 embedding。"},toast:{deletedOne:"已删除",deletedMany:"已删除 {{count}} 条"}},SO={title:"Persona",subtitle:"该用户的长篇画像,由记忆整理任务从事实库中提炼。",empty:{title:"暂无 Persona",description:"Persona 由整理任务生成。当事实积累到一定量后,点击下方按钮运行整理。"},updated:"更新于 {{at}}",editorLabel:"Persona 内容",save:"保存",saved:"已保存",delete:"删除 Persona",confirmDelete:"确认删除此 Persona?",confirmDeleteDesc:"Persona 概要会从库中删除。生成它的事实仍保留,下一次整理会重新生成。",consolidate:{trigger:"运行整理",triggering:"启动中…",running:"整理进行中…",doneOk:"整理完成",doneFailed:"整理失败",lastRun:"上次运行:{{at}}",result:"处理 {{users}} 位用户,更新 {{updated}} 条 Persona"}},EO={title:"向量后端",subtitle:"Embedding 驱动事实库的混合检索。当前后端、模型与每位用户的覆盖情况都在这里。",config:{title:"后端配置",hint:"后端选择与 OpenAI / 本地模型的参数都通过环境变量配置。请在宿主机直接编辑 `~/.agim/env`(或 systemd unit 的 `Environment=`),下方列出的 `IMHUB_MEMORY_VECTOR_*` 系列 key 即对应字段。",editLink:"env file"},form:{title:"后端配置",hint:"选好后端、填好参数 → 保存并测试。配置只对本进程生效,重启服务后从 env 文件重新加载。",dirty:"有未保存的改动",discard:"放弃改动",saveAndTest:"保存并测试",savedToast:"已保存,正在测试…",nothingChanged:"没有需要保存的改动",backend:"后端",backendHelp:"off = 关闭向量召回;local = 本地 BGE 模型;openai = 调远程 OpenAI 协议端点",backendOff:"关闭",backendLocal:"本地(BGE)",backendOpenai:"OpenAI 协议远程",localModel:"本地模型",localModelHelp:"Xenova 仓库的 model id,默认 Xenova/bge-base-zh-v1.5;首次使用需手动触发下载。",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI 兼容端点根路径,例如 https://api.openai.com/v1 或自部署网关。",openaiModel:"模型",openaiModelHelp:"Embedding 模型 id,默认 text-embedding-3-small;用其他兼容端点请按其文档填写。",openaiApiKey:"API Key",apiKeyKeepHint:"留空 = 保留当前 key(占位显示为脱敏值);填了就会覆盖。",apiKeyNewHint:"粘贴你的 OpenAI 兼容 API Key(保存后只在服务端可见)。",toggleApiKey:"显示 / 隐藏 API Key",batchSize:"批大小",batchSizeHelp:"单次嵌入的最大文本数,1–1024,默认 32。",hybridWeight:"混合权重",hybridWeightHelp:"FTS5 与向量召回融合时向量分支的权重,0–1,默认 0.5。",errors:{baseUrlRequired:"Base URL 不能为空",baseUrlInvalid:"Base URL 不是合法 URL",openaiModelRequired:"Embedding 模型 id 不能为空",apiKeyRequired:"首次使用 OpenAI 后端需要填 API Key",localModelRequired:"本地模型 id 不能为空",batchSizeRange:"批大小需在 1–1024 之间",hybridWeightRange:"混合权重需在 0–1 之间"}},backendLabel:"后端",modelLabel:"模型",dimsLabel:"维度",readyTrue:"就绪",readyFalse:"未就绪",downloadedTrue:"已下载",lastError:"最近错误",coverage:{title:"覆盖率",total:"事实总数",withEmbedding:"已嵌入",withDifferentModel:"模型不匹配",scope_user:"(针对 {{userKey}})",scope_global:"(全部用户)"},actions:{title:"维护",test:"测试",testOk:"后端测试通过",testFail:"后端测试失败:{{detail}}",download:"下载模型",downloadStarted:"下载已开始",downloadAlreadyReady:"模型已就绪",backfill:"回填 embedding",backfillStarted:"回填已开始",backfillNotReady:"后端未就绪 — 请先下载",clear:"清空 embedding",clearStarted:"已清空 {{count}} 条",confirmClear:"确认清空全部 embedding?",confirmClearDesc:"会丢弃 {{scope}} 的 embedding 列。事实本身保留;下次回填前向量检索不可用。"},jobs:{title:"近期任务",empty:"暂无任务",phase:{running:"运行中",done:"完成",failed:"失败"}}},CO={title:"技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},AO={pageTitle:yO,subtitle:bO,userPicker:vO,noUserSelected:xO,tabs:wO,facts:kO,persona:SO,vector:EO,skills:CO},TO="Skills",RO={installed:"Installed",hot:"Hot on skillhub.cn"},PO={title:"Installed skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills",description:"Drop a SKILL.md with `name` + `description` frontmatter under a configured root and refresh."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},sources:{title:"Sources",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Picked up by"}},IO={title:"Hot on skillhub.cn",subtitle:"Live top entries from skillhub.cn (cached 5 min on the server). Click a row for the install commands. agim never auto-runs installs — you copy the command and paste into shell or IM.",openHub:"Open skillhub.cn",loading:"Loading…",empty:"No data",cached:"cache hit",stale:"upstream unreachable — serving stale",updatedAt:"updated {{at}}",col:{slug:"slug",name:"Name / description",stars:"stars",installs:"installs"},detail:{version:"Version",category:"Category",stars:"Stars",installs:"Installs",downloads:"Downloads",howInstall:"How to install (pick one; agim never auto-runs)",copy:"Copy",copied:"Copied",label:{cliInstall:"On host (recommended)",cliSearch:"Dry-run first",imAsk:"Ask an IM agent"},hint:"The two CLI commands need skillhub CLI installed on the host first. See docs/skills.md or skillhub.cn."}},LO={pageTitle:TO,subnav:RO,installed:PO,hot:IO},OO="技能",NO={installed:"已安装",hot:"skillhub.cn 热门"},DO={title:"已安装的技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},_O={title:"skillhub.cn 热门",subtitle:"实时拉取 skillhub.cn 热门下载(服务端 5 分钟缓存)。点击任意条目查看安装命令。agim 不会自动跑安装——命令复制后由你贴去 shell 或 IM 触发。",openHub:"前往 skillhub.cn",loading:"正在加载…",empty:"暂无数据",cached:"缓存命中",stale:"上游不可达,使用旧数据",updatedAt:"更新于 {{at}}",col:{slug:"slug",name:"名称 / 描述",stars:"stars",installs:"installs"},detail:{version:"版本",category:"类别",stars:"stars",installs:"installs",downloads:"downloads",howInstall:"安装方式(任选一个;agim 不会自动跑)",copy:"复制",copied:"已复制",label:{cliInstall:"Host 上跑(推荐)",cliSearch:"先查再装",imAsk:"在 IM 里让 agent 装"},hint:"前两条要先在 host 上安装 skillhub CLI。详见 docs/skills.md 或 skillhub.cn。"}},MO={pageTitle:OO,subnav:NO,installed:DO,hot:_O},jO="Workspace",FO="Read and edit files in the per-agent working directories (`AGENT_CWD`).",BO={label:"Agent",placeholder:"Pick an agent",online:"online",offline:"offline"},UO={title:"Pick an agent to browse its workspace",description:"Each registered agent runs from its own CWD. The picker lists every agent the registry knows about; the green dot next to a name means it reports available."},HO={title:"Files",loading:"Loading…",empty:"(empty directory)",up:"Up",rootLabel:"(workspace root)",binary:"binary",symlinkEscape:"symlink → outside workspace, hidden",broken:"unreadable"},zO={noFile:"Select a file from the tree to view or edit it.",binary:"This file looks binary (base64-encoded) — editing not supported.",truncated:"File is over 1 MiB; only the first 1 MiB is shown. Saving from here would replace the whole file with the truncated content — close without saving.",save:"Save",saving:"Saving…",savedMeta:"Saved · {{size}} bytes · {{at}}",dirtyHint:"Unsaved changes",loadFailed:"Failed to load file"},$O={saved:"Saved {{path}}"},VO={pageTitle:jO,subtitle:FO,agentPicker:BO,noAgent:UO,tree:HO,editor:zO,toast:$O},WO="工作区",KO="在每个 Agent 的工作目录(`AGENT_CWD`)下浏览与编辑文件。",qO={label:"Agent",placeholder:"选择一个 Agent",online:"在线",offline:"离线"},GO={title:"选择一个 Agent 来浏览其工作区",description:"每个已注册的 Agent 都有自己的 CWD。下拉列出注册表中所有已知的 Agent;名字旁的绿点表示该 Agent 当前可用。"},YO={title:"文件",loading:"加载中…",empty:"(目录为空)",up:"返回上级",rootLabel:"(工作区根目录)",binary:"二进制",symlinkEscape:"符号链接指向工作区外,已隐藏",broken:"不可读"},QO={noFile:"从左侧选择一个文件查看或编辑。",binary:"该文件是二进制(base64 编码)— 不支持编辑。",truncated:"文件超过 1 MiB;仅显示前 1 MiB。直接保存会用截断内容覆盖整个文件 — 请关闭而不要保存。",save:"保存",saving:"保存中…",savedMeta:"已保存 · {{size}} 字节 · {{at}}",dirtyHint:"有未保存的修改",loadFailed:"加载文件失败"},XO={saved:"已保存 {{path}}"},JO={pageTitle:WO,subtitle:KO,agentPicker:qO,noAgent:GO,tree:YO,editor:QO,toast:XO},ZO="Observability",eN="Operational health: invocation totals, top-N leaderboards, and the audit timeline.",tN={health:"Health",topn:"Top-N",audit:"Audit"},nN={label:"Window",days_one:"{{count}} day",days_other:"{{count}} days"},rN={title:"Health",totals:"Totals",byDay:"By day",kpi:{calls:"Calls",cost:"Cost",errors:"Errors",errorRate:"Error rate",avgLatencyMs:"Avg latency",p95LatencyMs:"P95 latency"},byDayCol:{date:"Date",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data in this window",description:"No invocations recorded in the selected time window. Widen the window or wait for an agent call to fire."}},iN={title:"Top-N",filter:{dim:"Group by",metric:"Rank by"},dim:{user:"User",agent:"Agent",platform:"Platform",intent:"Intent"},metric:{cost:"Cost",calls:"Calls",errors:"Errors",avg_latency:"Avg latency"},col:{rank:"#",key:"Key",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data",description:"No invocations matched the filters."}},oN={title:"Audit",stats:{total:"Total",totalCost:"Total cost"},filter:{agent:"Agent",platform:"Platform",user:"User",intent:"Intent"},col:{ts:"Time",trace:"Trace",agent:"Agent",platform:"Platform",user:"User",intent:"Intent",duration:"Duration",cost:"Cost",outcome:"Outcome"},outcome:{ok:"ok",fail:"fail"},empty:{title:"No invocations",description:"Audit rows appear here when an agent is invoked. Adjust filters or widen the window."}},aN={pageTitle:ZO,subtitle:eN,tabs:tN,window:nN,health:rN,topn:iN,audit:oN},sN="观测",lN="运行健康:调用总量、Top-N 排行与审计时间线。",cN={health:"健康",topn:"Top-N",audit:"审计"},uN={label:"时间窗口",days_one:"{{count}} 天",days_other:"{{count}} 天"},dN={title:"健康",totals:"总览",byDay:"每日明细",kpi:{calls:"调用",cost:"成本",errors:"错误",errorRate:"错误率",avgLatencyMs:"平均延迟",p95LatencyMs:"P95 延迟"},byDayCol:{date:"日期",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"时间窗口内无数据",description:"所选时间范围内没有任何调用记录。可以放宽时间窗口或等待 Agent 被调用。"}},fN={title:"Top-N",filter:{dim:"分组维度",metric:"排序依据"},dim:{user:"用户",agent:"Agent",platform:"平台",intent:"意图"},metric:{cost:"成本",calls:"调用",errors:"错误",avg_latency:"平均延迟"},col:{rank:"#",key:"Key",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"暂无数据",description:"当前筛选下没有调用记录。"}},hN={title:"审计",stats:{total:"累计",totalCost:"累计成本"},filter:{agent:"Agent",platform:"平台",user:"用户",intent:"意图"},col:{ts:"时间",trace:"Trace",agent:"Agent",platform:"平台",user:"用户",intent:"意图",duration:"耗时",cost:"成本",outcome:"结果"},outcome:{ok:"成功",fail:"失败"},empty:{title:"暂无调用",description:"当 Agent 被调用时,审计记录会出现在这里。可调整筛选或放宽时间窗口。"}},pN={pageTitle:sN,subtitle:lN,tabs:cN,window:uN,health:dN,topn:fN,audit:hN},mN="Settings",gN="Operational configuration: environment variables and service lifecycle.",yN={messengers:"Messengers",email:"Email (SMTP)",viewer:"Viewer & Maps",agents:"Agents",llm:"LLM Backends",mcp:"MCP Servers",nativeAgent:"Native Agent",search:"Web search",agimSkills:"agim Skills",policy:"Policy",security:"Security",workspaces:"Workspaces",admins:"Admins",env:"Env Vars",service:"Service"},bN={title:"Agents",subtitle:"Built-in agent adapters. Enable the ones whose CLI is installed on this host; pick which one handles unrouted messages by default.",installHint:"Not installed. `npm install -g {{pkg}}` on the host.",aliasesLabel:"Aliases",online:"online",offline:"offline",defaultAgent:"Default agent",defaultAgentHint:"Used when the intent classifier has no preference (new web threads, etc.). Only enabled + online agents appear here.",noEligible:"No eligible default",saveBtn:"Save",saving:"Saving…",dirtyHint:"Unsaved changes",discard:"Discard",toast:{saved:"Saved"},acp:{title:"Remote agents (ACP)",subtitle:"Agents reachable over HTTP via the Agent Communication Protocol. Each entry persists in config and registers on the next service restart.",discoverBtn:"Discover",runDiscover:"Probe",baseUrl:"Discovery URL",baseUrlHint:"Probes `<base>/.well-known/acp` and adds the entries it lists. Skips names already present.",addTitle:"Add agent",name:"Name",nameHint:"Stable identifier; letters, digits, `._-`.",aliases:"Aliases",aliasesHint:"Comma-separated; routed via `/alias` in chat.",endpoint:"Endpoint",endpointHint:"Base URL of the agent's ACP root (no trailing `/`).",authType:"Auth",auth:{none:"None",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"Paste token",testBtn:"Test",addBtn:"Add",removeBtn:"Remove",on:"on",off:"off",dupName:"An agent with this name already exists.",empty:{title:"No remote agents",description:"Add an ACP endpoint below or use Discover for a `.well-known/acp` directory."},toast:{staged:"Staged. Save to persist.",testOk:"Reached `{{name}}`",testMasked:"Save first — token is masked, can't test in place.",discoverEmpty:"Nothing new to add.",discoverAdded_one:"Added {{count}} agent.",discoverAdded_other:"Added {{count}} agents."}}},vN={title:"Policy & toggles",subtitle:"Frequently-flipped switches that operate on env values under the hood. Each toggle persists immediately; the change applies on the next service restart unless the relevant module supports hot-reload (most do).",savingToast:"Saved",safety:{title:"Skip permissions (DANGEROUS)",description:"When ON, the Claude Code adapter passes `--dangerously-skip-permissions` to the wrapped CLI, bypassing every tool-use confirmation. Recommended OFF for production. Only enable for trusted, isolated workspaces.",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"production deployments should keep this OFF"},approval:{title:"Approval timeout default",description:'What the approval bus does when a pending tool-use request expires with no human reply. `Deny` is the safe default and keeps write-side calls (Bash / Edit / Write) gated; `Allow` is "user away" mode and lets the agent keep moving.',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"Deny on timeout",valAllow:"Allow on timeout"},memory:{title:"Long-term memory",description:"Master switch for the per-user memory subsystem (facts + persona + vector retrieval). Disabling stops new fact extraction and persona consolidation; the existing bank stays on disk.",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"Long-message viewer",description:"When ON, IM replies that exceed the viewer threshold are uploaded to the local paste store and the IM message becomes a short URL the user can click. Without it, long replies get truncated by the messenger.",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A notify mode",description:"How verbose the bus is when one agent calls another. `essential` (default) sends only headline events; `verbose` includes every transition; `off` silences cross-agent notifications entirely.",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"Essential",valVerbose:"Verbose",valOff:"Off"}},xN={title:"Messengers",subtitle:"Per-IM-platform connection settings. Toggle a platform on, fill in its credentials, and Save. The next service restart picks up the new config.",saveAll:"Save all",saving:"Saving…",savedToast:"Configuration saved",discardAll:"Discard changes",dirtyHint:"Unsaved changes",platform:{wechat:"WeChat",telegram:"Telegram",feishu:"Feishu (Lark)",dingtalk:"DingTalk",discord:"Discord"},hint:{wechat:"iLink-based QR login. Click Scan, scan the QR with your phone WeChat, confirm — the bot logs in as that account.",telegram:"Bot API token from @BotFather; channel id is optional and only used when targeting a specific chat.",feishu:"App credentials from the Lark developer console. App must have the messaging scopes.",dingtalk:"Stream API client credentials from the DingTalk developer console.",discord:"Bot token from the Discord developer portal. The bot must be invited to the target channel."},enabled:"Enabled",disabled:"Disabled",scanQr:"Scan QR",fields:{botToken:"Bot token",appId:"App ID",appSecret:"App secret",clientId:"Client ID",clientSecret:"Client secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"DM policy",groupPolicy:"Group policy",allowFrom:"DM allowFrom (staffIds, comma-separated)",groupAllowFrom:"Group allowFrom (staffIds, comma-separated)",ackReaction:"Ack-reaction",policy:{open:"open — anyone may talk",pairing:"pairing — first DMer pinned",allowlist:"allowlist — only listed IDs",disabled:"disabled — bot ignores groups"},ack:{off:"off — no ack glyph",emoji:"emoji ⏳→✅",kaomoji:"kaomoji (text-face)"},accountsTitle:"Extra accounts",accountDisabled:"disabled",accountsHint:"Each entry starts its own DWClient with isolated dmPolicy / allowFrom / ack-reaction. Restart agim after Save for new accounts to take effect.",accountsEmpty:"No extra accounts yet. Click ‘+ add account’ to wire another DingTalk bot.",addAccount:"Add account",accountName:"Display name (optional)",accountRenameCollision:'An account with id "{{id}}" already exists; pick another id.'},qr:{title:"Scan WeChat QR",description:"Open WeChat on your phone, scan this code, then confirm the login prompt inside WeChat.",starting:"Starting QR session…",loadFailed:"Failed to start QR session",expired:"QR code expired — close and start a new one.",cancelled:"Cancelled.",confirmed:"Login confirmed — wechat-ilink will start on the next service restart."}},wN={title:"Email (SMTP)",subtitle:"Outbound mail delivery for `/remind email me@x.com …`. Credentials persist to `~/.agim/.env`. Leave blank to disable.",cardTitle:"SMTP credentials",statusOn:"configured",statusOff:"disabled",host:"Host",hostHint:"Mail server hostname (e.g. `smtp.gmail.com`).",port:"Port",portHint:"Usually 465 (SSL) or 587 (STARTTLS).",user:"Username",userHint:"Login email; often the sender address too.",pass:"Password / app token",passHint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",from:"From",fromHint:"Sender header. Defaults to the username when blank.",secure:"TLS mode",secureHint:"`auto` follows the port; force SSL or STARTTLS if your provider requires it.",secureAuto:"auto (port-based)",secureTrue:"true (SSL, port 465)",secureFalse:"false (STARTTLS, port 587)",reveal:"Reveal",hide:"Hide",testBtn:"Test connection",testNeedsConfigured:"Save host / user / password first.",disableBtn:"Disable SMTP",saveBtn:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"SMTP saved",disabled:"SMTP disabled",noChanges:"Nothing to save"}},kN={title:"Viewer & Maps",subtitle:"Public-facing surfaces: the long-message Viewer (turns >threshold replies into a `/v/<id>` short link) and Baidu Maps AK (drives `/memo` address geocoding).",reveal:"Reveal",hide:"Hide",save:"Save",saving:"Saving…",discard:"Discard",dirtyHint:"Unsaved changes",toast:{saved:"Viewer settings saved"},viewer:{title:"Viewer (long-message links)",subtitle:"Replies longer than the chars / lines threshold are uploaded to the local paste store and the IM message becomes a short `/v/<id>` link.",on:"enabled",off:"disabled",enableLabel:"Enable the long-message Viewer",publicUrl:"Public base URL",publicUrlHint:"What the operator's reverse proxy / tunnel exposes. Used to build `/v/<id>` links.",tunnelMode:"Tunnel mode",tunnelOff:"off (use Public base URL)",tunnelQuick:"quick (cloudflared)",tunnelHint:"`quick` launches a Cloudflare quick tunnel and uses its URL when the operator hasn't fronted agim themselves.",remotePasteUrl:"Remote paste URL",remotePasteUrlHint:"POST markdown here to get a public URL back; overrides Public base URL + tunnel. Leave empty to use the community default https://viewer.iclaw.host/paste.",remotePasteToken:"Remote paste bearer token",remotePasteTokenHint:"Optional bearer token sent to the remote paste server. Required only if your paste server protects POSTs.",noDefaultRemote:"Disable community default",noDefaultRemoteLabel:"Don't fall back to viewer.iclaw.host when nothing else is configured",noDefaultRemoteHint:"v1.2.43+: when no mode is configured, agim defaults to remote mode against viewer.iclaw.host. Check this to disable that fallback (markdown stays inline if no other mode is set).",tunnelStatus:"Tunnel status",refreshTunnel:"Refresh",tunnelRunning:"Running",yes:"yes",no:"no",tunnelUrl:"Live URL",effectiveUrl:"Effective URL",binary:"cloudflared binary",binaryMissing:"not found in PATH — install from cloudflare/cloudflared releases",lastError:"Last error",tunnelLoading:"Loading tunnel status…",thresholds:"Thresholds",chars:"Max chars",charsHint:"Replies above this length route through Viewer.",lines:"Max lines",linesHint:"Same routing decision, on line count.",codeLines:"Max code lines",codeLinesHint:"Lower threshold for replies inside code fences.",maxPastes:"Paste store cap",maxPastesHint:"Older pastes are evicted FIFO once the count exceeds this."},baidu:{title:"Baidu Maps AK",subtitle:"Enables `/memo` address-to-coords lookup. Without it, /memo still works via raw coords or browser GPS share. Free AK: lbsyun.baidu.com → Console → Application → Server-side API.",configured:"configured",empty:"not set",placeholder:"32-char AK starting with a non-digit",hint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",suspicious:"AK length is {{length}} — usually a Baidu AK is 32 characters. Double-check?",clear:"Clear AK",toast:{saved:"Baidu Maps AK saved",cleared:"Baidu Maps AK cleared"}}},SN={title:"Workspaces",subtitle:"Multi-tenant workspace registry. Each workspace has its own agent whitelist, rate-limit, and (optionally) member list. The `default` workspace catches every unrouted user.",empty:{title:"Only the default workspace",description:"Add a workspace below to partition a team / project / customer. Each one gets its own agent whitelist + rate-limit."},col:{id:"ID",name:"Name",agents:"Agents",members:"Members",rateLimit:"Rate limit"},rateLimitFormat:"{{rate}} per {{intervalSec}}s, burst {{burst}}",membersOpen:"open (any user)",membersCount_one:"{{count}} member",membersCount_other:"{{count}} members",edit:"Edit",form:{title:"Add or edit a workspace",subtitleEdit:"Editing existing workspace — change id to clone, keep to upsert.",id:"ID",idHint:"Stable identifier; [a-zA-Z0-9_-]+; the special name `default` is reserved.",name:"Display name",agents:"Agent whitelist",agentsHint:"Comma-separated; empty = allow every registered agent.",members:"Member user IDs",membersHint:"Comma-separated `platform:userId`; empty = open workspace.",rateLimit:"Rate limit (optional)",rate:"Calls",intervalSec:"Per (seconds)",burst:"Burst",submit:"Save workspace",reset:"Clear form"},toast:{saved:"Workspace saved"}},EN={title:"Service",subtitle:"Inspect the running agim process + start, stop, or restart it.",modeLabel:"Mode",pidLabel:"PID",uptimeLabel:"Uptime",webLabel:"Web",bootPhaseLabel:"Boot phase",mode:{systemd:"systemd",background:"background",foreground:"foreground",none:"not running"},actions:{start:"Start",stop:"Stop",restart:"Restart",confirmStop:"Stop the agim service?",confirmStopDesc:"The web console, the messenger adapters, and any in-flight job will all stop. You'll need to start the service again before you can use it.",confirmRestart:"Restart the agim service?",confirmRestartDesc:"The process stops and re-starts. In-flight jobs are cancelled; outbox + queued reminders survive the bounce. The web console will be unreachable for ~5-30 seconds."},toast:{started:"Service started",stopped:"Service stopped",restarted:"Service restarted"},ports:{title:"Ports",subtitle:"Which ports agim binds when started. Leave blank to use the default. Changes apply on the next service restart (use the Restart button below after saving).",webPort:"Web port",webPortHint:"HTTP server for the chat UI + REST API. Default: {{default}}.",acpPort:"ACP port",acpPortHint:"Agent Communication Protocol server (remote agent surface). Default: {{default}}.",invalidPort:"Must be a number between 1 and 65535.",restartRequired:"Restart required",save:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"Ports saved — restart agim to bind the new ports"}}},CN={title:"Security",subtitle:"Tool sandbox, SSRF block, sender allowlist, runtime audit. Changes persist to the env file immediately. Most native tools read process.env per call (hot-reload); exec sandbox + sender allowlist need a service restart to apply.",diagnostics:{title:"Runtime diagnostics",runningAsRoot:"Running as root",runningAsRootHelp:"Tool calls run with root privileges. Recommend creating a dedicated user + setting User= in the systemd unit.",envFilePerms:"Env file permissions",envFilePermsLax:"Too permissive (group/world readable)",envFilePermsOk:"0600 (owner-only)",bwrapAvailable:"bubblewrap installed",bwrapMissing:"Not installed (apt install bubblewrap)",senderAllowlist:"Sender allowlist",senderAllowlistOff:"Not configured (open access)",senderAllowlistOn:"Configured",adminAllowlist:"Admin allowlist",adminAllowlistOff:"Not configured (populated after first /setup)",adminAllowlistOn:"Configured"},sender:{title:"Sender allowlist (who can talk to the bot)",description:"Comma-separated platform:userId pairs, e.g. telegram:8754479311,wechat-ilink:wxid_abc. Set to * to mark 'everyone explicitly allowed'. Empty = open access (preserves backward compatibility; startup logs OPEN_IM_ACCESS).",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},exec:{title:"Native exec tool",description:"Sandbox + timeout controls for native_exec. Each invocation also goes through an IM approval card (unless previously auto-allowed by fingerprint).",sandbox:"Sandbox backend",sandboxNone:"None (plain spawn)",sandboxBwrap:"bubblewrap (Linux only)",sandboxBwrapMissing:"bubblewrap not installed",sandboxNet:"Sandbox network",sandboxNetOn:"Allowed (default)",sandboxNetOff:"Blocked (--unshare-net)",timeoutMs:"Command timeout (ms, default 60000)",maxOutput:"Per-stream output cap (bytes, default 32768)"},web:{title:"Native web tools",description:"SSRF defense and timeouts. CIDR whitelist lets you allow Tailscale / 100.64.0.0/10 / VPN ranges back in.",allowPrivate:"Allow all private ranges (not recommended)",allowPrivateHelp:"= 1 disables all private-IP checks. Only for trusted internal deployments.",ssrfWhitelist:"SSRF CIDR whitelist",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search timeout (ms, default 30000)"},fs:{title:"Native filesystem tools",description:"fs tools default to the native agent's per-thread workspace subtree.",restrict:"Restrict to workspace",restrictOn:"ON (recommended)",restrictOff:"OFF (allow any path; sensitive-paths denylist still applies)",timeoutMs:"fs tool timeout (ms, default 60000)"},delegation:{title:"Native call_agent cap",description:"Max mcp__imhub__call_agent invocations per turn. Prevents native from spinning on infinite delegations. 0 = unlimited.",envKey:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"default 2"},platformBlacklist:{title:"IM platform blacklist",description:"Comma-separated platform ids. Listed platforms are hidden from the CLI wizard, from this admin page, and registry.registerMessenger refuses to register them at boot — even if their credentials still live in the env file the adapter won't come up. Default empty (no blocks). Common ids: wechat-ilink / telegram / feishu / dingtalk / discord / email.",envKey:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"Currently in force"},diagnosticsPlatformBlacklist:"Platform blacklist",savingToast:"Saved.",resetTitle:"Reset to default"},AN={title:"Admin allowlist",subtitle:"IM-side users who can run admin-tier commands (`/admin promote`, `/admin token`, etc.). The list lives in `IMHUB_ADMIN_USERS`; this editor only works when the agim web port is bound locally.",configured:"Allowlist configured",notConfigured:"Allowlist not configured — anyone with the CLI bootstrap token can self-promote.",bootstrapAvailable:"Bootstrap token file present",bootstrapPath:"Token path",empty:"No admins added yet.",col:{platform:"Platform",userId:"User ID"},add:{title:"Add admin",platform:"Platform",userId:"User ID",submit:"Add"},remove:{label:"Remove",confirmTitle:"Remove this admin?",confirmDescription:"They lose access to all admin-tier commands. Re-add to restore."},toast:{added:"Admin added",removed:"Admin removed"}},TN={title:"Native LLM Backends",subtitle:"These backends power the in-process native agent and internal introspection callers (memo extraction, intent classification, notification evaluator, heartbeat). Backend metadata lives in ~/.agim/config.json; API keys live in ~/.agim/llm-secrets.json (0600) or the AGIM_LLM_SECRET_<NAME> env var.",refresh:"Refresh",backendsTitle:"Backends ({{count}})",backendsEmpty:"No LLM backends configured yet. Add one below.",rolesTitle:"Role Bindings",addTitle:"Add Backend",col:{name:"Name",provider:"Provider",model:"Model",baseUrl:"Base URL",apiKey:"API Key",actions:"Actions"},secretMissing:"missing",ping:"Ping",remove:"Remove",pinging:"pinging…",setKeyFirst:"set API key first",pingHint:"send a tiny chat probe",removeConfirm:'Remove backend "{{name}}"? Role bindings + API key will be cleared.',removedToast:"Removed (also cleared {{count}} role binding(s)).",roleUpdated:"Updated role {{role}}",unset:"(unset)",unbound:"(unbound)",roleHint:{cheap:"Internal introspection: memo extraction, intent classification, fallback chain stage 1.",evaluator:"Notification evaluator + router-compare judge LLM.","native-chat":"The /na agent loop default. Used when /cc native is invoked."},preset:"Provider preset",name:"Name",namePlaceholder:"e.g. deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"Model",modelPlaceholder:"model-id",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"sk-...",addBackend:"Add Backend",invalidPreset:"invalid preset",nameRequired:"name required",baseUrlRequired:"baseUrl required",modelRequired:"model required",addedWithKey:'Added "{{name}}" with API key',addedNoKey:'Added "{{name}}" (set key separately)',presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"Zhipu GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"Custom"}},RN={title:"External MCP Servers",subtitle:"Tools advertised by these servers are exposed to the in-process native agent (via mcp_<server>_<tool> naming). CLI agents have their own MCP configs and ignore this list. Header values may contain bearer tokens — admin-only.",refresh:"Refresh",serversTitle:"Servers ({{count}})",serversEmpty:"No MCP servers configured. Add one below — common picks: filesystem, github, postgres.",totalTools:"total tools: {{count}}",addTitle:"Add Server",col:{name:"Name",transport:"Transport",target:"Target",runtime:"Runtime",actions:"Actions"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"unknown",runtimeConnected:"connected · {{count}} tools",runtimeConnectedOne:"connected · {{count}} tool",runtimeDisconnected:"disconnected",health:"Health",remove:"Remove",probing:"probing…",removeConfirm:'Remove MCP server "{{name}}"?',removedToast:'Removed "{{name}}"',nameRequired:"name required",commandRequired:"command required for stdio transport",urlRequired:"url required for http/sse transport",headersInvalid:"headers must be valid JSON",addedToast:'Added "{{name}}"',nameLabel:"Name",namePlaceholder:"e.g. filesystem",transportLabel:"Transport",transportStdioOption:"stdio (subprocess)",transportHttpOption:"http / SSE",commandLabel:"Command",commandPlaceholder:"e.g. npx",argsLabel:"Args (space-separated)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers (JSON, optional)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"Add Server"},PN={title:"Native Agent · Evaluator · Heartbeat",subtitle:"Behavior knobs for the in-process native agent and the two LLM-driven gates (notification evaluator, heartbeat). LLM backend + role wiring lives on /settings/llm; this page covers what the agent + gates actually do at runtime.",llmLink:"/settings/llm",refresh:"Refresh",unsaved:"unsaved changes",discard:"Discard",save:"Save",savedToast:"Saved.",agentCard:"Native Agent (in-process)",evaluatorCard:"Notification Evaluator",heartbeatCard:"Heartbeat Scheduler",on:"on",off:"off",roleOverride:"Role override",roleHint:"LLM role the native loop resolves. Default: native-chat (falls back to cheap). Match a key from /settings/llm role bindings.",approvalMode:"Approval mode",approvalHint:"How tool calls from the native loop are gated.",modeReadOnly:"read-only (safe default; built-ins only)",modeAllowList:"allow-list (only autoAllow entries)",modeAllowAll:"allow-all (every tool, no gate)",modeDenyAll:"deny-all (no tools)",autoAllow:"Auto-allow tool prefixes",autoAllowHint:"Comma-separated. Tool names starting with any entry bypass the gate (e.g. native_,mcp_filesystem_).",denyList:"Deny-list tool prefixes",denyListHint:"Comma-separated. Always rejected regardless of mode (e.g. mcp_shell_).",evalDesc:"LLM gate that filters routine / empty agent-initiated push messages. Uses the evaluator role. Fail-open: LLM error or missing backend → message is delivered.",enableGate:"Enable gate",filterViaLlm:"Filter via LLM",evalSources:"Sources to gate",evalSourcesHint:"Comma-separated subset of: push, notify, reminder, heartbeat. Empty = default push,heartbeat.",hbDesc:"Periodic proactive wake-up loop. With this off, /heartbeat bind still works (saves the binding) but no scans run. Three-phase tick: DECIDE → EXECUTE → EVALUATE.",enableScheduler:"Enable scheduler",startScanLoop:"Start scan loop",tickInterval:"Tick interval (ms)",tickHint:"How often the scan loop checks due bindings. Default 60000.",defaultInterval:"Default binding interval (min)",defaultIntervalHint:"Minutes between ticks when a binding didn't specify one. Default 15.",runtimeCard:"Runtime caps (v1.2.126)",runtimeDesc:"Hard caps for native-agent tool calls + retries. All keys hot-reload; no restart needed. Leave blank to use defaults.",toolResultCap:"Max tool-result chars",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS. Truncates + appends a note. Default 64000.",toolTimeoutMs:"Per-tool timeout (ms)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS. Default 60000 (60 s).",blankRetryMax:"Blank-response retries",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX. Times to retry when the model returns empty text. Default 1.",lengthRecoveryMax:"Length-truncation continues",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX. Times to auto-continue on finishReason=length. Default 1."},IN={title:"Web search providers",subtitle:"Backend chain for the native_web_search tool. Falls through to the next provider on error. Clear a key to remove it; type to overwrite. All changes hot-reload.",refresh:"Refresh",save:"Save",discard:"Discard",unsaved:"Unsaved changes",savedToast:"Saved. Next search will use the new chain.",chainLabel:"Active chain:",chainEmpty:"no providers available",chainHint:"Resolved from IMHUB_WEB_SEARCH_PROVIDERS; only entries whose available() is true appear.",configured:"configured",missingKey:"missing key",noKey:"no key needed",moveUp:"Move up",moveDown:"Move down",testBtn:"Test",clearKey:"Clear",placeholderConfigured:"Saved (hidden) — leave blank to keep",placeholderEnter:"Enter new key",keyHint:"On Save, value is written to ~/.agim/env under {{envKey}}.",testOk:"{{provider}} ✓ {{hits}} hits / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},LN={title:"agim Skills",tab:{installed:"Installed",hot:"skillhub Hot"},reload:"Reload from disk",subtitle:"SKILL.md files loaded by src/core/skills/loader.ts. Tier-1 summary (name + description) is auto-injected into every agent system prompt; full body is read on-demand via mcp__imhub__read_skill. Workspace skills shadow bundled builtin skills by name.",reloadedToast:"Reloaded — {{count}} skill(s) on disk",selectHint:"Select a skill on the left, or click New to create one.",emptyList:"No skills loaded. Click New to create one (lands at ~/.agim/skills/<name>/SKILL.md).",unavailable:"unavailable",alwaysOn:"always-on",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"Not found.",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin (read-only via UI)",builtinShadowHint:"Builtin shown for reference. Save creates a workspace shadow that overrides it.",delete:"Delete",save:"Save",saveShadow:"Save (create workspace shadow)",savedToast:'Saved "{{name}}"',deleteConfirm:'Delete workspace skill "{{name}}"? The builtin (if any) will become visible again.',deletedToast:'Deleted "{{name}}"',new:"New",newTitle:"New skill",newName:"Skill name",newNamePlaceholder:"my-skill",newCreate:"Create",createdToast:'Created "{{name}}"',nameRequired:"name required",pathLabel:"Workspace path:",binsLabel:"Required bins:",envLabel:"Required env:",none:"none"},ON={pageTitle:mN,subtitle:gN,tabs:yN,agents:bN,policy:vN,messengers:xN,email:wN,viewerSettings:kN,workspaces:SN,service:EN,security:CN,admins:AN,llm:TN,mcp:RN,nativeAgent:PN,search:IN,agimSkills:LN},NN="设置",DN="运维配置:环境变量与服务生命周期。",_N={messengers:"IM 平台",email:"邮件 (SMTP)",viewer:"Viewer & 地图",agents:"Agent",llm:"LLM 后端",mcp:"MCP 服务器",nativeAgent:"Native Agent",search:"Web 搜索",agimSkills:"agim Skills",policy:"策略",security:"安全",workspaces:"工作区",admins:"管理员",env:"环境变量",service:"服务"},MN={title:"Agent",subtitle:"内置 Agent 适配器。启用宿主机已安装 CLI 的;并选择一个作为默认 Agent(用于路由无法判定的消息)。",installHint:"未安装。在宿主机执行 `npm install -g {{pkg}}`。",aliasesLabel:"别名",online:"在线",offline:"未就绪",defaultAgent:"默认 Agent",defaultAgentHint:"意图分类无判定时使用(新建 web 线程等)。下拉只列出已启用且在线的 Agent。",noEligible:"无可选默认",saveBtn:"保存",saving:"保存中…",dirtyHint:"有未保存改动",discard:"放弃改动",toast:{saved:"已保存"},acp:{title:"远程 Agent (ACP)",subtitle:"通过 Agent Communication Protocol 接入的 HTTP Agent。每个条目持久化到 config,下次服务重启时注册。",discoverBtn:"批量发现",runDiscover:"探测",baseUrl:"发现地址",baseUrlHint:"探测 `<base>/.well-known/acp` 并追加返回的 Agent;同名条目自动跳过。",addTitle:"新增 Agent",name:"名称",nameHint:"稳定标识;只允许 字母 数字 `._-`。",aliases:"别名",aliasesHint:"逗号分隔;在 IM 内通过 `/alias` 路由。",endpoint:"Endpoint",endpointHint:"Agent 的 ACP 根路径(不带尾部 `/`)。",authType:"鉴权",auth:{none:"无",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"粘贴 token",testBtn:"测试",addBtn:"新增",removeBtn:"移除",on:"已启用",off:"已停用",dupName:"已存在同名 Agent。",empty:{title:"暂无远程 Agent",description:"下方填写 ACP endpoint 新增,或使用「批量发现」自动从 `.well-known/acp` 导入。"},toast:{staged:"已暂存,点击「保存」生效。",testOk:"已联通 `{{name}}`",testMasked:"Token 是掩码态,请先保存后再测试。",discoverEmpty:"没有可新增的 Agent。",discoverAdded_one:"已新增 {{count}} 个 Agent。",discoverAdded_other:"已新增 {{count}} 个 Agent。"}}},jN={title:"策略与开关",subtitle:"高频切换的开关,底层操作的是 env 值。每个开关变更后立即持久化;多数模块支持热加载,少数需要等下次服务重启。",savingToast:"已保存",safety:{title:"跳过权限确认(危险)",description:"打开后,Claude Code 适配器会向 CLI 传递 `--dangerously-skip-permissions`,跳过所有工具调用确认。生产环境强烈建议保持关闭;仅在隔离的可信工作区内启用。",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"生产部署建议保持关闭"},approval:{title:"审批超时默认行为",description:'当 pending 的工具调用无人响应而超时时审批 bus 的行为。`拒绝` 是安全默认值,会让 Bash / Edit / Write 等写入调用保持阻断;`放行` 是"用户离开"模式,让 Agent 继续运行。',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"超时拒绝",valAllow:"超时放行"},memory:{title:"长期记忆",description:"每用户记忆子系统(事实 + persona + 向量检索)的总开关。关闭后停止抽取新事实和 persona 整理;已有数据保留在磁盘。",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"长消息查看器",description:"打开后,超过阈值的 IM 回复会被上传到本地 paste 存储,IM 消息变成一个可点击的短链。关闭则消息会被 IM 平台截断。",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A 通知模式",description:"Agent 间互相调用时 bus 的提示详细程度。`essential`(默认)仅发关键事件;`verbose` 包含每次状态切换;`off` 完全静默跨 Agent 通知。",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"关键事件",valVerbose:"详细",valOff:"关闭"}},FN={title:"IM 平台",subtitle:"各 IM 平台的连接配置。打开开关、填写凭据、保存;下次服务重启即生效。",saveAll:"全部保存",saving:"保存中…",savedToast:"配置已保存",discardAll:"放弃改动",dirtyHint:"有未保存的改动",platform:{wechat:"微信",telegram:"Telegram",feishu:"飞书",dingtalk:"钉钉",discord:"Discord"},hint:{wechat:'基于 iLink 的扫码登录。点击 "扫码登录",用手机微信扫码并在弹窗中确认;机器人以该微信账号登录。',telegram:"@BotFather 申请的 Bot Token;Channel ID 可选,仅用于定向到特定群组。",feishu:"飞书开放平台的应用凭据。应用需开启消息权限。",dingtalk:"钉钉开发者后台的 Stream API 客户端凭据。",discord:"Discord 开发者门户的 Bot Token。需将机器人邀请到目标频道。"},enabled:"已启用",disabled:"未启用",scanQr:"扫码登录",fields:{botToken:"Bot Token",appId:"App ID",appSecret:"App Secret",clientId:"Client ID",clientSecret:"Client Secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"私聊访问策略",groupPolicy:"群聊访问策略",allowFrom:"私聊白名单(staffId,英文逗号分隔)",groupAllowFrom:"群聊白名单(staffId,英文逗号分隔)",ackReaction:"ack 反馈方式",policy:{open:"open — 任何人都能对话",pairing:"pairing — 第一个私聊的人锁定为唯一对端",allowlist:"allowlist — 只允许名单中的 ID",disabled:"disabled — 机器人完全忽略群聊"},ack:{off:"off — 不发标记",emoji:"emoji ⏳→✅",kaomoji:"kaomoji(纯文本颜文字)"},accountsTitle:"多账号 / 多机器人",accountDisabled:"已禁用",accountsHint:"每个 entry 启动独立的 DWClient,dmPolicy / allowFrom / ack-reaction 全部隔离。保存后请重启 agim 让新账号生效。",accountsEmpty:"还没有额外账号。点「+ 添加账号」接入另一个钉钉机器人。",addAccount:"添加账号",accountName:"显示名(可选)",accountRenameCollision:'已存在 id 为 "{{id}}" 的账号;请换一个 id。'},qr:{title:"扫码登录微信",description:"打开手机微信扫一扫这个二维码,然后在微信内确认登录。",starting:"正在启动 QR 会话…",loadFailed:"QR 启动失败",expired:"二维码已过期 — 关闭并重新发起。",cancelled:"已取消。",confirmed:"登录成功 — wechat-ilink 将在下次服务重启后启用。"}},BN={title:"邮件 (SMTP)",subtitle:"用于 `/remind email me@x.com …` 的对外邮件投递。凭据保存在 `~/.agim/.env`,留空即停用。",cardTitle:"SMTP 凭据",statusOn:"已配置",statusOff:"未配置",host:"Host",hostHint:"邮件服务器域名(如 `smtp.gmail.com`)。",port:"Port",portHint:"通常 465 (SSL) 或 587 (STARTTLS)。",user:"用户名",userHint:"登录邮箱;通常也是发件人地址。",pass:"密码 / 应用 Token",passHint:"保存到 `~/.agim/.env`(chmod 600)。默认遮罩,按「显示」可查看。",from:"发件人",fromHint:"发件 header;为空则使用用户名。",secure:"TLS 模式",secureHint:"`auto` 按端口判定;如运营商要求可强制 SSL 或 STARTTLS。",secureAuto:"auto(按端口)",secureTrue:"true(SSL,对应 465)",secureFalse:"false(STARTTLS,对应 587)",reveal:"显示",hide:"隐藏",testBtn:"测试连接",testNeedsConfigured:"请先保存 host / user / password。",disableBtn:"停用 SMTP",saveBtn:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"SMTP 已保存",disabled:"SMTP 已停用",noChanges:"无可保存的改动"}},UN={title:"Viewer & 地图",subtitle:"公开访问的两个外设:长消息 Viewer(超过阈值的回复转成 `/v/<id>` 短链)+ Baidu Maps AK(驱动 `/memo` 地址解析)。",reveal:"显示",hide:"隐藏",save:"保存",saving:"保存中…",discard:"放弃改动",dirtyHint:"有未保存改动",toast:{saved:"Viewer 设置已保存"},viewer:{title:"Viewer(长消息短链)",subtitle:"超过字符 / 行数阈值的回复会被上传到本地 paste 存储,IM 消息变成一条 `/v/<id>` 短链。",on:"已启用",off:"未启用",enableLabel:"启用长消息 Viewer",publicUrl:"公开基础 URL",publicUrlHint:"反代 / 隧道暴露给外网的地址。用于拼接 `/v/<id>` 短链。",remotePasteUrl:"远端 paste URL",remotePasteUrlHint:"POST markdown 到这个地址换公网链接;优先级高于 Public base URL 和 quick 隧道。留空使用社区默认 https://viewer.iclaw.host/paste。",remotePasteToken:"远端 paste Bearer Token",remotePasteTokenHint:"可选;只在你的 paste 服务要求鉴权时需要填。",noDefaultRemote:"禁用社区默认",noDefaultRemoteLabel:"未配置任何模式时不回退到 viewer.iclaw.host",noDefaultRemoteHint:"v1.2.43+:未配置任何模式时,agim 默认走 remote 模式上传到 viewer.iclaw.host。勾选此项可关闭该回退(这时长内容会直接 inline)。",tunnelMode:"隧道模式",tunnelOff:"关闭(使用上方公开 URL)",tunnelQuick:"quick(cloudflared 临时隧道)",tunnelHint:"`quick` 会本地拉起 Cloudflare quick tunnel;当运营商自己没有反代 agim 时启用。",tunnelStatus:"隧道状态",refreshTunnel:"刷新",tunnelRunning:"运行中",yes:"是",no:"否",tunnelUrl:"实时 URL",effectiveUrl:"生效 URL",binary:"cloudflared 二进制",binaryMissing:"PATH 中未找到 — 请从 cloudflare/cloudflared releases 安装",lastError:"最近一次错误",tunnelLoading:"正在加载隧道状态…",thresholds:"路由阈值",chars:"字符上限",charsHint:"回复超过此长度走 Viewer。",lines:"行数上限",linesHint:"相同的路由判定,按行数。",codeLines:"代码行数上限",codeLinesHint:"代码块内回复的更低阈值。",maxPastes:"Paste 存储上限",maxPastesHint:"超过此数量后按 FIFO 淘汰旧 paste。"},baidu:{title:"Baidu Maps AK",subtitle:"启用 `/memo` 的地址→坐标解析。不配置 AK,/memo 仍可通过裸坐标或浏览器 GPS 分享工作。免费 AK:lbsyun.baidu.com → 控制台 → 应用管理 → 创建应用 → 服务端 API。",configured:"已配置",empty:"未配置",placeholder:"32 位 AK,首字符非数字",hint:"保存到 `~/.agim/.env`(chmod 600),默认遮罩,按「显示」可查看。",suspicious:"AK 长度为 {{length}},通常 Baidu AK 是 32 位 — 请核对。",clear:"清除 AK",toast:{saved:"Baidu Maps AK 已保存",cleared:"Baidu Maps AK 已清除"}}},HN={title:"工作区",subtitle:"多租户工作区注册表。每个工作区有独立的 Agent 白名单、限流配置以及(可选的)成员名单。`default` 工作区承接所有未匹配的用户。",empty:{title:"只有默认工作区",description:"在下方添加工作区,可按团队 / 项目 / 客户分隔。每个工作区有独立的 Agent 白名单与限流。"},col:{id:"ID",name:"名称",agents:"Agent 白名单",members:"成员",rateLimit:"限流"},rateLimitFormat:"{{rate}} / {{intervalSec}}s,突发 {{burst}}",membersOpen:"开放(任何用户)",membersCount_one:"{{count}} 位成员",membersCount_other:"{{count}} 位成员",edit:"编辑",form:{title:"新增或编辑工作区",subtitleEdit:"编辑已有工作区 — 改 ID 可克隆,保持原 ID 即 upsert。",id:"ID",idHint:"稳定标识符;只允许 [a-zA-Z0-9_-]+;`default` 为保留名。",name:"显示名",agents:"Agent 白名单",agentsHint:"逗号分隔;为空 = 允许所有已注册 Agent。",members:"成员用户 ID",membersHint:"逗号分隔,形如 `platform:userId`;为空 = 开放工作区。",rateLimit:"限流(可选)",rate:"调用数",intervalSec:"周期(秒)",burst:"突发上限",submit:"保存工作区",reset:"清空表单"},toast:{saved:"工作区已保存"}},zN={title:"服务",subtitle:"查看运行中的 agim 进程,并启动 / 停止 / 重启它。",modeLabel:"运行模式",pidLabel:"PID",uptimeLabel:"运行时长",webLabel:"Web 端口",bootPhaseLabel:"启动阶段",mode:{systemd:"systemd",background:"后台",foreground:"前台",none:"未运行"},actions:{start:"启动",stop:"停止",restart:"重启",confirmStop:"停止 agim 服务?",confirmStopDesc:"Web 控制台、消息适配器、所有正在进行的作业都会停止。需要重新启动后才能继续使用。",confirmRestart:"重启 agim 服务?",confirmRestartDesc:"进程会先停止再启动。进行中的作业会被取消;投递队列与已排队的提醒会保留。重启期间 Web 控制台不可达,通常 5-30 秒。"},toast:{started:"服务已启动",stopped:"服务已停止",restarted:"服务已重启"},ports:{title:"端口",subtitle:"agim 启动时监听的端口。留空使用默认值;改动需下次服务重启生效(保存后点下方「重启」按钮)。",webPort:"Web 端口",webPortHint:"聊天 UI + REST API 的 HTTP 服务端口。默认 {{default}}。",acpPort:"ACP 端口",acpPortHint:"Agent Communication Protocol 服务端口(远程 Agent 接入面)。默认 {{default}}。",invalidPort:"需为 1-65535 之间的数字。",restartRequired:"需重启生效",save:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"端口已保存 — 重启 agim 以绑定新端口"}}},$N={title:"安全",subtitle:"工具沙盒、SSRF 拦截、发送方门禁、运行时审计。改动立即写入 env 文件;多数 native 工具读 process.env,下次工具调用即生效;exec 沙盒和发送方门禁需要「重启服务」生效。",diagnostics:{title:"运行时诊断",runningAsRoot:"以 root 运行",runningAsRootHelp:"tool 调用会拿到 root 权限。建议在 systemd unit 设 User=agim 后重启。",envFilePerms:"env 文件权限",envFilePermsLax:"过宽(group/world 可读)",envFilePermsOk:"0600(仅 owner 可读写)",bwrapAvailable:"bubblewrap 已装",bwrapMissing:"未装(apt install bubblewrap)",senderAllowlist:"发送方门禁",senderAllowlistOff:"未配置(开放访问)",senderAllowlistOn:"已配置",adminAllowlist:"管理员清单",adminAllowlistOff:"未配置(首次 setup 后填充)",adminAllowlistOn:"已配置"},sender:{title:"发送方门禁 (谁能跟 bot 说话)",description:"允许列表,逗号分隔 platform:userId 对,例如 telegram:8754479311,wechat-ilink:wxid_abc。设为 * 显式表示「所有人都允许」。空值 = 开放访问(保持向后兼容;启动日志 OPEN_IM_ACCESS)。",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},exec:{title:"Native exec 工具",description:"对 native_exec 的沙盒与超时控制。每次 exec 调用还会经 IM 审批卡(除非已 autoallow 同 fingerprint)。",sandbox:"沙盒后端",sandboxNone:"无(直接 spawn)",sandboxBwrap:"bubblewrap(Linux only)",sandboxBwrapMissing:"bubblewrap 未装",sandboxNet:"沙盒内网络",sandboxNetOn:"允许(默认)",sandboxNetOff:"禁用(--unshare-net)",timeoutMs:"命令超时(毫秒,默认 60000)",maxOutput:"单流输出上限(字节,默认 32768)"},web:{title:"Native web 工具",description:"SSRF 防护与超时。CIDR 白名单可放行 Tailscale/100.64.0.0/10 这类私网。",allowPrivate:"允许所有私网(不推荐)",allowPrivateHelp:"= 1 时跳过所有私网检查。仅用于受信任的内网部署。",ssrfWhitelist:"SSRF CIDR 白名单",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search 超时(毫秒,默认 30000)"},fs:{title:"Native filesystem 工具",description:"fs 工具默认限制在 native 当前线程的 workspace 子树内。",restrict:"限制到 workspace",restrictOn:"ON(推荐)",restrictOff:"OFF(允许任意路径;sensitive-paths 黑名单仍生效)",timeoutMs:"fs 工具超时(毫秒,默认 60000)"},delegation:{title:"Native call_agent 上限",description:"一次对话内 mcp__imhub__call_agent 允许的最多次数。防止 native 死循环委托给 CLI agent。0 = 无限。",envKey:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"默认 2"},platformBlacklist:{title:"IM 平台黑名单",description:"逗号分隔的 IM 平台 id,列入后:CLI 向导不显示、web 后台不出现、注册时被直接拒绝。即使凭证仍在 env 文件里,进程也不会拉起这个适配器。默认空(不拦截)。常见 id:wechat-ilink / telegram / feishu / dingtalk / discord / email。",envKey:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"当前生效"},diagnosticsPlatformBlacklist:"IM 平台黑名单",savingToast:"已保存。",resetTitle:"清空 (使用默认值)"},VN={title:"管理员名单",subtitle:"可执行管理员级命令的 IM 用户(`/admin promote`、`/admin token` 等)。名单保存在 `IMHUB_ADMIN_USERS` 环境变量;仅当 agim Web 端口本地绑定时才能在此编辑。",configured:"名单已配置",notConfigured:"尚未配置名单 — 任何持有 CLI bootstrap token 的人都可自我提权。",bootstrapAvailable:"Bootstrap token 文件存在",bootstrapPath:"文件路径",empty:"暂无管理员。",col:{platform:"平台",userId:"用户 ID"},add:{title:"添加管理员",platform:"平台",userId:"用户 ID",submit:"添加"},remove:{label:"移除",confirmTitle:"确认移除该管理员?",confirmDescription:"该用户将失去所有管理员命令访问权限。可再次添加恢复。"},toast:{added:"已添加",removed:"已移除"}},WN={title:"Native LLM 后端",subtitle:"这些后端为进程内 native agent 及内部 introspection 调用方(记忆提取、意图分类、通知评估器、心跳)提供能力。后端元数据保存在 ~/.agim/config.json;API Key 保存在 ~/.agim/llm-secrets.json(0600)或 AGIM_LLM_SECRET_<NAME> 环境变量。",refresh:"刷新",backendsTitle:"后端 ({{count}})",backendsEmpty:"尚未配置 LLM 后端。请在下方添加。",rolesTitle:"角色绑定",addTitle:"添加后端",col:{name:"名称",provider:"提供商",model:"模型",baseUrl:"Base URL",apiKey:"API Key",actions:"操作"},secretMissing:"缺失",ping:"探测",remove:"删除",pinging:"探测中…",setKeyFirst:"请先设置 API Key",pingHint:"发送一次小型 chat 探测",removeConfirm:'删除后端 "{{name}}"?角色绑定与 API Key 将被清除。',removedToast:"已删除(同时清除 {{count}} 个角色绑定)。",roleUpdated:"已更新角色 {{role}}",unset:"(未设置)",unbound:"(未绑定)",roleHint:{cheap:"内部 introspection:记忆提取、意图分类、回退链第一阶段。",evaluator:"通知评估器 + router-compare 裁判 LLM。","native-chat":"/na agent 循环默认角色;/cc native 调用时使用。"},preset:"提供商预设",name:"名称",namePlaceholder:"如 deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"模型",modelPlaceholder:"model-id",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"sk-...",addBackend:"添加后端",invalidPreset:"无效预设",nameRequired:"名称必填",baseUrlRequired:"baseUrl 必填",modelRequired:"model 必填",addedWithKey:'已添加 "{{name}}"(含 API Key)',addedNoKey:'已添加 "{{name}}"(请单独设置 Key)',presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"智谱 GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"自定义"}},KN={title:"外部 MCP 服务器",subtitle:"这些服务器提供的工具会暴露给进程内 native agent(命名规则 mcp_<server>_<tool>)。CLI agent 使用各自的 MCP 配置,不会读取此列表。Header 可能包含 Bearer Token — 仅管理员可见。",refresh:"刷新",serversTitle:"服务器 ({{count}})",serversEmpty:"尚未配置 MCP 服务器。请在下方添加 — 常见选择:filesystem、github、postgres。",totalTools:"工具总数:{{count}}",addTitle:"添加服务器",col:{name:"名称",transport:"传输",target:"目标",runtime:"运行时",actions:"操作"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"未知",runtimeConnected:"已连接 · {{count}} 个工具",runtimeConnectedOne:"已连接 · {{count}} 个工具",runtimeDisconnected:"未连接",health:"健康检查",remove:"删除",probing:"探测中…",removeConfirm:'删除 MCP 服务器 "{{name}}"?',removedToast:'已删除 "{{name}}"',nameRequired:"名称必填",commandRequired:"stdio 传输需要 command",urlRequired:"http/sse 传输需要 url",headersInvalid:"headers 必须是合法 JSON",addedToast:'已添加 "{{name}}"',nameLabel:"名称",namePlaceholder:"如 filesystem",transportLabel:"传输",transportStdioOption:"stdio(子进程)",transportHttpOption:"http / SSE",commandLabel:"命令",commandPlaceholder:"如 npx",argsLabel:"参数(空格分隔)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers(JSON,可选)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"添加服务器"},qN={title:"Native Agent · 评估器 · 心跳",subtitle:"进程内 native agent 及两个 LLM 驱动门控(通知评估器、心跳)的运行时行为。LLM 后端与角色绑定在 /settings/llm;本页配置 agent 与门控的实际行为。",llmLink:"/settings/llm",refresh:"刷新",unsaved:"有未保存改动",discard:"放弃",save:"保存",savedToast:"已保存。",agentCard:"Native Agent(进程内)",evaluatorCard:"通知评估器",heartbeatCard:"心跳调度器",on:"开",off:"关",roleOverride:"角色覆盖",roleHint:"native 循环解析的 LLM 角色。默认 native-chat(回退 cheap)。需与 /settings/llm 中的角色绑定一致。",approvalMode:"审批模式",approvalHint:"native 循环中工具调用的门控方式。",modeReadOnly:"read-only(安全默认;仅内置工具)",modeAllowList:"allow-list(仅 autoAllow 条目)",modeAllowAll:"allow-all(所有工具,无门控)",modeDenyAll:"deny-all(禁止工具)",autoAllow:"自动允许工具前缀",autoAllowHint:"逗号分隔。名称以任一前缀开头的工具绕过门控(如 native_,mcp_filesystem_)。",denyList:"拒绝列表工具前缀",denyListHint:"逗号分隔。无论模式如何始终拒绝(如 mcp_shell_)。",evalDesc:"过滤例行/空的 agent 主动推送消息的 LLM 门控。使用 evaluator 角色。失败开放:LLM 错误或缺少后端 → 仍投递消息。",enableGate:"启用门控",filterViaLlm:"通过 LLM 过滤",evalSources:"门控来源",evalSourcesHint:"逗号分隔子集:push, notify, reminder, heartbeat。留空 = 默认 push,heartbeat。",hbDesc:"周期性主动唤醒循环。关闭后 /heartbeat bind 仍可保存绑定,但不执行扫描。三阶段 tick:DECIDE → EXECUTE → EVALUATE。",enableScheduler:"启用调度器",startScanLoop:"启动扫描循环",tickInterval:"Tick 间隔(毫秒)",tickHint:"扫描循环检查到期绑定的频率。默认 60000。",defaultInterval:"默认绑定间隔(分钟)",defaultIntervalHint:"绑定未指定时的 tick 间隔。默认 15。",runtimeCard:"运行参数(v1.2.126)",runtimeDesc:"Native agent 工具调用与重试的硬上限。所有键热生效,无需重启服务。留空使用默认值。",toolResultCap:"单次工具返回最大字符",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS。超出截断+附说明。默认 64000。",toolTimeoutMs:"单次工具超时(毫秒)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS。默认 60000(60 秒)。",blankRetryMax:"空响应重试上限",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX。模型连续返回空文本时的重试次数。默认 1。",lengthRecoveryMax:"长度截断续写上限",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX。finishReason=length 时自动续写次数。默认 1。"},GN={title:"Web 搜索 Provider",subtitle:"native_web_search 工具的后端链路。失败时按顺序回退到下一家。键留空 = 删除该值;填则覆盖。所有修改热生效。",refresh:"刷新",save:"保存",discard:"放弃",unsaved:"有未保存改动",savedToast:"已保存。下一次搜索即生效。",chainLabel:"当前生效链路:",chainEmpty:"无可用 provider",chainHint:"由 IMHUB_WEB_SEARCH_PROVIDERS 决定;只列出已启用且 available() 为真的项。",configured:"已配置",missingKey:"缺 API key",noKey:"无需 key",moveUp:"上移",moveDown:"下移",testBtn:"测试",clearKey:"清空",placeholderConfigured:"已保存(隐藏) — 不输入则保留",placeholderEnter:"输入新 key",keyHint:"提交后将以密文写入 ~/.agim/env 的 {{envKey}} 键。",testOk:"{{provider}} ✓ {{hits}} 条结果 / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},YN={title:"agim Skills",tab:{installed:"已安装",hot:"skillhub 热门"},reload:"从磁盘重新加载",subtitle:"由 src/core/skills/loader.ts 加载的 SKILL.md 文件。Tier-1 摘要(name + description)自动注入每个 agent 系统提示;完整正文通过 mcp__imhub__read_skill 按需读取。工作区 skill 按名称覆盖内置 skill。",reloadedToast:"已重新加载 — 磁盘上 {{count}} 个 skill",selectHint:"在左侧选择一个 skill,或点击「新建」创建。",emptyList:"尚未加载 skill。点击「新建」创建(保存到 ~/.agim/skills/<name>/SKILL.md)。",unavailable:"不可用",alwaysOn:"常驻",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"未找到。",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin(UI 只读)",builtinShadowHint:"内置 skill 仅供参考。保存将创建工作区 shadow 覆盖它。",delete:"删除",save:"保存",saveShadow:"保存(创建工作区 shadow)",savedToast:'已保存 "{{name}}"',deleteConfirm:'删除工作区 skill "{{name}}"?如有内置版本将重新可见。',deletedToast:'已删除 "{{name}}"',new:"新建",newTitle:"新建 skill",newName:"Skill 名称",newNamePlaceholder:"my-skill",newCreate:"创建",createdToast:'已创建 "{{name}}"',nameRequired:"名称必填",pathLabel:"工作区路径:",binsLabel:"依赖二进制:",envLabel:"依赖环境变量:",none:"无"},QN={pageTitle:NN,subtitle:DN,tabs:_N,agents:MN,policy:jN,messengers:FN,email:BN,viewerSettings:UN,workspaces:HN,service:zN,security:$N,admins:VN,llm:WN,mcp:KN,nativeAgent:qN,search:GN,agimSkills:YN};Xe.use(up).use(Og).init({resources:{en:{common:XR,errors:WP,tasks:MI,approvals:aL,reminders:IL,memos:XL,memory:gO,skills:LO,workspace:VO,observability:aN,settings:ON},zh:{common:fP,errors:EI,tasks:GI,approvals:bL,reminders:zL,memos:aO,memory:AO,skills:MO,workspace:JO,observability:pN,settings:QN}},lng:XN(),fallbackLng:"en",supportedLngs:["en","zh"],ns:["common","errors","tasks","approvals","reminders","memos","memory","skills","workspace","observability","settings"],defaultNS:"common",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:[],caches:[]}});function XN(){try{const e=localStorage.getItem("im-hub-lang");if(e==="en"||e==="zh")return e}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function JN(e){Xe.language!==e&&Xe.changeLanguage(e)}function ZN(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var dp=e=>{const{present:t,children:n}=e,r=eD(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=Ye(r.ref,tD(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};dp.displayName="Presence";function eD(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),a=e?"mounted":"unmounted",[s,l]=ZN(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=Si(r.current);o.current=s==="mounted"?c:"none"},[s]),rt(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=Si(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),rt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const p=Si(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=f=>{f.target===t&&(o.current=Si(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Si(e){return e?.animationName||"none"}function tD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nD=Symbol("radix.slottable");function rD(e){const t=({children:n})=>b.jsx(b.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=nD,t}var[Eo]=ho("Tooltip",[bo]),js=bo(),fp="TooltipProvider",iD=700,wu="tooltip.open",[oD,hp]=Eo(fp),pp=e=>{const{__scopeTooltip:t,delayDuration:n=iD,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=g.useRef(!0),s=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),b.jsx(oD,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};pp.displayName=fp;var mp="Tooltip",[OD,Co]=Eo(mp),Ga="TooltipTrigger",aD=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Co(Ga,n),o=hp(Ga,n),a=js(n),s=g.useRef(null),l=Ye(t,s,i.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),b.jsx(th,{asChild:!0,...a,children:b.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:je(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:je(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:je(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:je(e.onBlur,i.onClose),onClick:je(e.onClick,i.onClose)})})});aD.displayName=Ga;var sD="TooltipPortal",[ND,lD]=Eo(sD,{forceMount:void 0}),mr="TooltipContent",gp=g.forwardRef((e,t)=>{const n=lD(mr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Co(mr,e.__scopeTooltip);return b.jsx(dp,{present:r||a.open,children:a.disableHoverableContent?b.jsx(yp,{side:i,...o,ref:t}):b.jsx(cD,{side:i,...o,ref:t})})}),cD=g.forwardRef((e,t)=>{const n=Co(mr,e.__scopeTooltip),r=hp(mr,e.__scopeTooltip),i=g.useRef(null),o=Ye(t,i),[a,s]=g.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,h=g.useCallback(()=>{s(null),d(!1)},[d]),f=g.useCallback((m,p)=>{const y=m.currentTarget,v={x:m.clientX,y:m.clientY},x=pD(v,y.getBoundingClientRect()),w=mD(v,x),R=gD(p.getBoundingClientRect()),I=bD([...w,...R]);s(I),d(!0)},[d]);return g.useEffect(()=>()=>h(),[h]),g.useEffect(()=>{if(l&&u){const m=y=>f(y,u),p=y=>f(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",p)}}},[l,u,f,h]),g.useEffect(()=>{if(a){const m=p=>{const y=p.target,v={x:p.clientX,y:p.clientY},x=l?.contains(y)||u?.contains(y),w=!yD(v,a);x?h():w&&(h(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,a,c,h]),b.jsx(yp,{...e,ref:o})}),[uD,dD]=Eo(mp,{isInside:!1}),fD=rD("TooltipContent"),yp=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=Co(mr,n),c=js(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(wu,u),()=>document.removeEventListener(wu,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=h=>{h.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),b.jsx(As,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:b.jsxs(nh,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[b.jsx(fD,{children:r}),b.jsx(uD,{scope:n,isInside:!0,children:b.jsx(kA,{id:l.contentId,role:"tooltip",children:i||r})})]})})});gp.displayName=mr;var bp="TooltipArrow",hD=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=js(n);return dD(bp,n).isInside?null:b.jsx(rh,{...i,...r,ref:t})});hD.displayName=bp;function pD(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mD(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function gD(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function yD(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o],l=t[a],c=s.x,u=s.y,d=l.x,h=l.y;u>r!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=!i)}return i}function bD(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),vD(t)}function vD(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var xD=pp,vp=gp;const wD=xD,kD=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>b.jsx(vp,{ref:r,sideOffset:t,className:Ie("z-50 overflow-hidden rounded-md","bg-text text-bg px-2 py-1 text-xs font-medium shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95",e),...n}));kD.displayName=vp.displayName;function SD(e){return b.jsx(Gb,{position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"border border-border bg-surface text-text shadow-md",title:"font-medium",description:"text-text-dim text-sm",actionButton:"bg-accent text-accent-fg rounded-md",cancelButton:"bg-surface-2 text-text rounded-md",error:"bg-danger-bg text-danger border-danger",success:"bg-success-bg text-success border-success",warning:"bg-warning-bg text-warning border-warning",info:"bg-info-bg text-info border-info"}},...e})}function ED({children:e}){const t=ar(r=>r.lang),{i18n:n}=kt();return g.useEffect(()=>{n.language!==t&&JN(t)},[t,n]),b.jsx(b.Fragment,{children:e})}function CD({children:e}){return $T(),b.jsx(b.Fragment,{children:e})}function AD({children:e}){return g.useEffect(()=>xg(),[]),b.jsx(b.Fragment,{children:e})}function TD({children:e}){return b.jsx(xb,{client:ZT,children:b.jsx(ED,{children:b.jsx(CD,{children:b.jsx(AD,{children:b.jsxs(wD,{children:[e,b.jsx(SD,{})]})})})})})}const xp=document.getElementById("root");if(!xp)throw new Error("agim: #root not found in index.html");ia.createRoot(xp).render(b.jsx(z.StrictMode,{children:b.jsx(TD,{children:b.jsx(JT,{})})}));export{ma as $,th as A,at as B,Ug as C,As as D,bo as E,Of as F,Jb as G,LE as H,xd as I,sd as J,hb as K,Sd as L,id as M,sl as N,PD as O,ih as P,AA as Q,mh as R,za as S,ep as T,Gy as U,b as V,Et as W,et as X,ob as Y,eb as Z,Qy as _,va as a,Jy as a0,rb as a1,Yy as a2,pa as a3,Ot as a4,zn as a5,Ye as a6,Gc as a7,SE as a8,UE as a9,Ts as aa,wb as ab,vb as ac,pg as ad,kt as ae,rh as b,vt as c,Hg as d,nh as e,dp as f,We as g,cA as h,Gg as i,Gi as j,_n as k,qi as l,$a as m,Yg as n,Qg as o,ti as p,Jg as q,Xb as r,Y as s,Ie as t,je as u,ei as v,wE as w,LD as x,ho as y,ht as z};
199
- //# sourceMappingURL=index-igqJknUt.js.map
197
+ `)},oT=0,nr=[];function aT(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(oT++)[0],o=g.useState(dh)[0],a=g.useRef(e);g.useEffect(function(){a.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=TA([e.lockRef.current],(e.shards||[]).map(Zc),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var b=xi(p),x=n.current,w="deltaX"in p?p.deltaX:x[0]-b[0],R="deltaY"in p?p.deltaY:x[1]-b[1],I,C=p.target,S=Math.abs(w)>Math.abs(R)?"h":"v";if("touches"in p&&S==="h"&&C.type==="range")return!1;var N=window.getSelection(),j=N&&N.anchorNode,T=j?j===C||j.contains(C):!1;if(T)return!1;var D=Xc(S,C);if(!D)return!0;if(D?I=S:(I=S==="v"?"h":"v",D=Xc(S,C)),!D)return!1;if(!r.current&&"changedTouches"in p&&(w||R)&&(r.current=I),!I)return!0;var L=r.current||I;return nT(L,y,p,L==="h"?w:R)},[]),l=g.useCallback(function(p){var y=p;if(!(!nr.length||nr[nr.length-1]!==o)){var b="deltaY"in y?Jc(y):xi(y),x=t.current.filter(function(I){return I.name===y.type&&(I.target===y.target||y.target===I.shadowParent)&&rT(I.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(Zc).filter(Boolean).filter(function(I){return I.contains(y.target)}),R=w.length>0?s(y,w[0]):!a.current.noIsolation;R&&y.cancelable&&y.preventDefault()}}},[]),c=g.useCallback(function(p,y,b,x){var w={name:p,delta:y,target:b,should:x,shadowParent:sT(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(R){return R!==w})},1)},[]),u=g.useCallback(function(p){n.current=xi(p),r.current=void 0},[]),d=g.useCallback(function(p){c(p.type,Jc(p),p.target,s(p,e.lockRef.current))},[]),h=g.useCallback(function(p){c(p.type,xi(p),p.target,s(p,e.lockRef.current))},[]);g.useEffect(function(){return nr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,tr),document.addEventListener("touchmove",l,tr),document.addEventListener("touchstart",u,tr),function(){nr=nr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,tr),document.removeEventListener("touchmove",l,tr),document.removeEventListener("touchstart",u,tr)}},[]);var f=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(o,{styles:iT(i)}):null,f?g.createElement(YA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lT=MA(uh,aT);var mh=g.forwardRef(function(e,t){return g.createElement(bo,Vt({},e,{ref:t,sideCar:lT}))});mh.classNames=bo.classNames;var cT=[" ","Enter","ArrowUp","ArrowDown"],uT=[" ","Enter"],Vn="Select",[xo,wo,dT]=wE(Vn),[Sr]=ho(Vn,[dT,vo]),So=vo(),[fT,Sn]=Sr(Vn),[hT,pT]=Sr(Vn),gh=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:f,form:m}=e,p=So(t),[y,b]=g.useState(null),[x,w]=g.useState(null),[R,I]=g.useState(!1),C=kE(c),[S,N]=Gc({prop:r,defaultProp:i??!1,onChange:o,caller:Vn}),[j,T]=Gc({prop:a,defaultProp:s,onChange:l,caller:Vn}),D=g.useRef(null),L=y?m||!!y.closest("form"):!0,[K,B]=g.useState(new Set),V=Array.from(K).map(q=>q.props.value).join(";");return v.jsx(cA,{...p,children:v.jsxs(fT,{required:f,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:R,onValueNodeHasChildrenChange:I,contentId:Ts(),value:j,onValueChange:T,open:S,onOpenChange:N,dir:C,triggerPointerDownPosRef:D,disabled:h,children:[v.jsx(xo.Provider,{scope:t,children:v.jsx(hT,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(q=>{B(Q=>new Set(Q).add(q))},[]),onNativeOptionRemove:g.useCallback(q=>{B(Q=>{const $=new Set(Q);return $.delete(q),$})},[]),children:n})}),L?v.jsxs(Hh,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:d,value:j,onChange:q=>T(q.target.value),disabled:h,form:m,children:[j===void 0?v.jsx("option",{value:""}):null,Array.from(K)]},V):null]})})};gh.displayName=Vn;var yh="SelectTrigger",vh=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=So(n),a=Sn(yh,n),s=a.disabled||r,l=Ye(t,a.onTriggerChange),c=wo(n),u=g.useRef("touch"),[d,h,f]=zh(p=>{const y=c().filter(w=>!w.disabled),b=y.find(w=>w.value===a.value),x=$h(y,p,b);x!==void 0&&a.onValueChange(x.value)}),m=p=>{s||(a.onOpenChange(!0),f()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return v.jsx(th,{asChild:!0,...o,children:v.jsx(We.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Uh(a.value)?"":void 0,...i,ref:l,onClick:je(i.onClick,p=>{p.currentTarget.focus(),u.current!=="mouse"&&m(p)}),onPointerDown:je(i.onPointerDown,p=>{u.current=p.pointerType;const y=p.target;y.hasPointerCapture(p.pointerId)&&y.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(m(p),p.preventDefault())}),onKeyDown:je(i.onKeyDown,p=>{const y=d.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&h(p.key),!(y&&p.key===" ")&&cT.includes(p.key)&&(m(),p.preventDefault())})})})});vh.displayName=yh;var bh="SelectValue",xh=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,l=Sn(bh,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Ye(t,l.onValueNodeChange);return rt(()=>{c(u)},[c,u]),v.jsx(We.span,{...s,ref:d,style:{pointerEvents:"none"},children:Uh(l.value)?v.jsx(v.Fragment,{children:a}):o})});xh.displayName=bh;var mT="SelectIcon",wh=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return v.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});wh.displayName=mT;var gT="SelectPortal",Sh=e=>v.jsx(ih,{asChild:!0,...e});Sh.displayName=gT;var Wn="SelectContent",kh=g.forwardRef((e,t)=>{const n=Sn(Wn,e.__scopeSelect),[r,i]=g.useState();if(rt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Jr.createPortal(v.jsx(Eh,{scope:e.__scopeSelect,children:v.jsx(xo.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),o):null}return v.jsx(Ch,{...e,ref:t})});kh.displayName=Wn;var It=10,[Eh,kn]=Sr(Wn),yT="SelectContentImpl",vT=dA("SelectContent.RemoveScroll"),Ch=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:y,...b}=e,x=Sn(Wn,n),[w,R]=g.useState(null),[I,C]=g.useState(null),S=Ye(t,W=>R(W)),[N,j]=g.useState(null),[T,D]=g.useState(null),L=wo(n),[K,B]=g.useState(!1),V=g.useRef(!1);g.useEffect(()=>{if(w)return AA(w)},[w]),HE();const q=g.useCallback(W=>{const[ye,...Le]=L().map(de=>de.ref.current),[be]=Le.slice(-1),we=document.activeElement;for(const de of W)if(de===we||(de?.scrollIntoView({block:"nearest"}),de===ye&&I&&(I.scrollTop=0),de===be&&I&&(I.scrollTop=I.scrollHeight),de?.focus(),document.activeElement!==we))return},[L,I]),Q=g.useCallback(()=>q([N,w]),[q,N,w]);g.useEffect(()=>{K&&Q()},[K,Q]);const{onOpenChange:$,triggerPointerDownPosRef:F}=x;g.useEffect(()=>{if(w){let W={x:0,y:0};const ye=be=>{W={x:Math.abs(Math.round(be.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(be.pageY)-(F.current?.y??0))}},Le=be=>{W.x<=10&&W.y<=10?be.preventDefault():w.contains(be.target)||$(!1),document.removeEventListener("pointermove",ye),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",Le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",Le,{capture:!0})}}},[w,$,F]),g.useEffect(()=>{const W=()=>$(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[$]);const[k,se]=zh(W=>{const ye=L().filter(we=>!we.disabled),Le=ye.find(we=>we.ref.current===document.activeElement),be=$h(ye,W,Le);be&&setTimeout(()=>be.ref.current.focus())}),te=g.useCallback((W,ye,Le)=>{const be=!V.current&&!Le;(x.value!==void 0&&x.value===ye||be)&&(j(W),be&&(V.current=!0))},[x.value]),E=g.useCallback(()=>w?.focus(),[w]),oe=g.useCallback((W,ye,Le)=>{const be=!V.current&&!Le;(x.value!==void 0&&x.value===ye||be)&&D(W)},[x.value]),fe=r==="popper"?ja:Ah,ge=fe===ja?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:m,hideWhenDetached:p,avoidCollisions:y}:{};return v.jsx(Eh,{scope:n,content:w,viewport:I,onViewportChange:C,itemRefCallback:te,selectedItem:N,onItemLeave:E,itemTextRefCallback:oe,focusSelectedItem:Q,selectedItemText:T,position:r,isPositioned:K,searchRef:k,children:v.jsx(mh,{as:vT,allowPinchZoom:!0,children:v.jsx(Of,{asChild:!0,trapped:x.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:je(i,W=>{x.trigger?.focus({preventScroll:!0}),W.preventDefault()}),children:v.jsx(As,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:v.jsx(fe,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:W=>W.preventDefault(),...b,...ge,onPlaced:()=>B(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:je(b.onKeyDown,W=>{const ye=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ye&&W.key.length===1&&se(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let be=L().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(W.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const we=W.target,de=be.indexOf(we);be=be.slice(de+1)}setTimeout(()=>q(be)),W.preventDefault()}})})})})})})});Ch.displayName=yT;var bT="SelectItemAlignedPosition",Ah=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Sn(Wn,n),a=kn(Wn,n),[s,l]=g.useState(null),[c,u]=g.useState(null),d=Ye(t,S=>u(S)),h=wo(n),f=g.useRef(!1),m=g.useRef(!0),{viewport:p,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=a,w=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&p&&y&&b){const S=o.trigger.getBoundingClientRect(),N=c.getBoundingClientRect(),j=o.valueNode.getBoundingClientRect(),T=b.getBoundingClientRect();if(o.dir!=="rtl"){const we=T.left-N.left,de=j.left-we,Be=S.left-de,lt=S.width+Be,Mt=Math.max(lt,N.width),Je=window.innerWidth-It,jt=Rc(de,[It,Math.max(It,Je-Mt)]);s.style.minWidth=lt+"px",s.style.left=jt+"px"}else{const we=N.right-T.right,de=window.innerWidth-j.right-we,Be=window.innerWidth-S.right-de,lt=S.width+Be,Mt=Math.max(lt,N.width),Je=window.innerWidth-It,jt=Rc(de,[It,Math.max(It,Je-Mt)]);s.style.minWidth=lt+"px",s.style.right=jt+"px"}const D=h(),L=window.innerHeight-It*2,K=p.scrollHeight,B=window.getComputedStyle(c),V=parseInt(B.borderTopWidth,10),q=parseInt(B.paddingTop,10),Q=parseInt(B.borderBottomWidth,10),$=parseInt(B.paddingBottom,10),F=V+q+K+$+Q,k=Math.min(y.offsetHeight*5,F),se=window.getComputedStyle(p),te=parseInt(se.paddingTop,10),E=parseInt(se.paddingBottom,10),oe=S.top+S.height/2-It,fe=L-oe,ge=y.offsetHeight/2,W=y.offsetTop+ge,ye=V+q+W,Le=F-ye;if(ye<=oe){const we=D.length>0&&y===D[D.length-1].ref.current;s.style.bottom="0px";const de=c.clientHeight-p.offsetTop-p.offsetHeight,Be=Math.max(fe,ge+(we?E:0)+de+Q),lt=ye+Be;s.style.height=lt+"px"}else{const we=D.length>0&&y===D[0].ref.current;s.style.top="0px";const Be=Math.max(oe,V+p.offsetTop+(we?te:0)+ge)+Le;s.style.height=Be+"px",p.scrollTop=ye-oe+p.offsetTop}s.style.margin=`${It}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,s,c,p,y,b,o.dir,r]);rt(()=>w(),[w]);const[R,I]=g.useState();rt(()=>{c&&I(window.getComputedStyle(c).zIndex)},[c]);const C=g.useCallback(S=>{S&&m.current===!0&&(w(),x?.(),m.current=!1)},[w,x]);return v.jsx(wT,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:v.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:v.jsx(We.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Ah.displayName=bT;var xT="SelectPopperPosition",ja=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=It,...o}=e,a=So(n);return v.jsx(nh,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ja.displayName=xT;var[wT,Ms]=Sr(Wn,{}),Fa="SelectViewport",Th=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=kn(Fa,n),a=Ms(Fa,n),s=Ye(t,o.onViewportChange),l=g.useRef(0);return v.jsxs(v.Fragment,{children:[v.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),v.jsx(xo.Slot,{scope:n,children:v.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:je(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=a;if(h?.current&&d){const f=Math.abs(l.current-u.scrollTop);if(f>0){const m=window.innerHeight-It*2,p=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(p,y);if(b<m){const x=b+f,w=Math.min(m,x),R=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=R>0?R:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Th.displayName=Fa;var Rh="SelectGroup",[ST,kT]=Sr(Rh),ET=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ts();return v.jsx(ST,{scope:n,id:i,children:v.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});ET.displayName=Rh;var Ph="SelectLabel",Ih=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=kT(Ph,n);return v.jsx(We.div,{id:i.id,...r,ref:t})});Ih.displayName=Ph;var Ki="SelectItem",[CT,Lh]=Sr(Ki),Oh=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=Sn(Ki,n),l=kn(Ki,n),c=s.value===r,[u,d]=g.useState(o??""),[h,f]=g.useState(!1),m=Ye(t,x=>l.itemRefCallback?.(x,r,i)),p=Ts(),y=g.useRef("touch"),b=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return v.jsx(CT,{scope:n,value:r,disabled:i,textId:p,isSelected:c,onItemTextChange:g.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:v.jsx(xo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:v.jsx(We.div,{role:"option","aria-labelledby":p,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:je(a.onFocus,()=>f(!0)),onBlur:je(a.onBlur,()=>f(!1)),onClick:je(a.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:je(a.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:je(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:je(a.onPointerMove,x=>{y.current=x.pointerType,i?l.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:je(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(uT.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});Oh.displayName=Ki;var Br="SelectItemText",_h=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Sn(Br,n),s=kn(Br,n),l=Lh(Br,n),c=pT(Br,n),[u,d]=g.useState(null),h=Ye(t,b=>d(b),l.onItemTextChange,b=>s.itemTextRefCallback?.(b,l.value,l.disabled)),f=u?.textContent,m=g.useMemo(()=>v.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:p,onNativeOptionRemove:y}=c;return rt(()=>(p(m),()=>y(m)),[p,y,m]),v.jsxs(v.Fragment,{children:[v.jsx(We.span,{id:l.textId,...o,ref:h}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Jr.createPortal(o.children,a.valueNode):null]})});_h.displayName=Br;var Nh="SelectItemIndicator",Dh=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Lh(Nh,n).isSelected?v.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});Dh.displayName=Nh;var Ba="SelectScrollUpButton",Mh=g.forwardRef((e,t)=>{const n=kn(Ba,e.__scopeSelect),r=Ms(Ba,e.__scopeSelect),[i,o]=g.useState(!1),a=Ye(t,r.onScrollButtonChange);return rt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?v.jsx(Fh,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Mh.displayName=Ba;var Ha="SelectScrollDownButton",jh=g.forwardRef((e,t)=>{const n=kn(Ha,e.__scopeSelect),r=Ms(Ha,e.__scopeSelect),[i,o]=g.useState(!1),a=Ye(t,r.onScrollButtonChange);return rt(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?v.jsx(Fh,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});jh.displayName=Ha;var Fh=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=kn("SelectScrollButton",n),a=g.useRef(null),s=wo(n),l=g.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),rt(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),v.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:je(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:je(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:je(i.onPointerLeave,()=>{l()})})}),AT="SelectSeparator",Bh=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return v.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});Bh.displayName=AT;var Ua="SelectArrow",TT=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=So(n),o=Sn(Ua,n),a=kn(Ua,n);return o.open&&a.position==="popper"?v.jsx(rh,{...i,...r,ref:t}):null});TT.displayName=Ua;var RT="SelectBubbleInput",Hh=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=Ye(r,i),a=xA(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const d=new Event("change",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[a,t]),v.jsx(We.select,{...n,style:{...oh,...n.style},ref:o,defaultValue:t})});Hh.displayName=RT;function Uh(e){return e===""||e===void 0}function zh(e){const t=zn(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function $h(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=PT(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function PT(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var IT=gh,Vh=vh,LT=xh,OT=wh,_T=Sh,Wh=kh,NT=Th,Kh=Ih,qh=Oh,DT=_h,MT=Dh,Gh=Mh,Yh=jh,Qh=Bh;const za=IT,$a=LT,qi=g.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Vh,{ref:r,className:Ie("flex h-8 w-full items-center justify-between gap-2","rounded-md border border-border bg-surface px-3 py-1 text-sm","placeholder:text-text-muted","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","disabled:cursor-not-allowed disabled:opacity-55","[&>span]:line-clamp-1",e),...n,children:[t,v.jsx(OT,{asChild:!0,children:v.jsx(Gu,{className:"h-4 w-4 opacity-60"})})]}));qi.displayName=Vh.displayName;const Xh=g.forwardRef(({className:e,...t},n)=>v.jsx(Gh,{ref:n,className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(Ug,{className:"h-4 w-4"})}));Xh.displayName=Gh.displayName;const Jh=g.forwardRef(({className:e,...t},n)=>v.jsx(Yh,{ref:n,className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(Gu,{className:"h-4 w-4"})}));Jh.displayName=Yh.displayName;const Gi=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>v.jsx(_T,{children:v.jsxs(Wh,{ref:i,position:n,className:Ie("relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-border bg-surface text-text shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",n==="popper"&&["data-[side=bottom]:translate-y-1","data-[side=top]:-translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1"],e),...r,children:[v.jsx(Xh,{}),v.jsx(NT,{className:Ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(Jh,{})]})}));Gi.displayName=Wh.displayName;const jT=g.forwardRef(({className:e,...t},n)=>v.jsx(Kh,{ref:n,className:Ie("px-2 py-1.5 text-xs font-semibold uppercase tracking-wide text-text-muted",e),...t}));jT.displayName=Kh.displayName;const Dn=g.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(qh,{ref:r,className:Ie("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-surface-hover focus:text-text","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(MT,{children:v.jsx(Hg,{className:"h-4 w-4"})})}),v.jsx(DT,{children:t})]}));Dn.displayName=qh.displayName;const FT=g.forwardRef(({className:e,...t},n)=>v.jsx(Qh,{ref:n,className:Ie("-mx-1 my-1 h-px bg-border",e),...t}));FT.displayName=Qh.displayName;function BT({agents:e,value:t,onChange:n}){return v.jsxs(za,{value:t||void 0,onValueChange:n,children:[v.jsx(qi,{className:"h-7 w-28 sm:w-36 text-xs",children:v.jsx($a,{placeholder:e[0]??"—"})}),v.jsx(Gi,{children:e.map(r=>v.jsx(Dn,{value:r,children:r},r))})]})}const Va="agim-theme",Zh="im-hub-lang";function HT(){try{const e=localStorage.getItem(Va);if(e==="light"||e==="dark")return e}catch{}return"system"}function UT(){try{const t=localStorage.getItem(Zh);if(t==="en"||t==="zh")return t}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function eu(e){try{e==="system"?localStorage.removeItem(Va):localStorage.setItem(Va,e)}catch{}}function zT(e){try{localStorage.setItem(Zh,e)}catch{}}const ar=zu((e,t)=>({theme:HT(),lang:UT(),setTheme:n=>{eu(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=n==="system"?"light":n==="light"?"dark":"system";eu(r),e({theme:r})},setLang:n=>{zT(n),e({lang:n})}}));function tu(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}function $T(){const e=ar(t=>t.theme);g.useEffect(()=>{if(tu(e),e!=="system")return;const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>tu(e);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e])}function VT(){const{t:e}=St(),t=ar(o=>o.theme),n=ar(o=>o.lang),r=ar(o=>o.setTheme),i=ar(o=>o.setLang);return v.jsxs(v.Fragment,{children:[v.jsxs(za,{value:n,onValueChange:o=>i(o),children:[v.jsx(qi,{className:"h-7 w-16 sm:w-20 text-xs","aria-label":e("lang.label"),children:v.jsx($a,{})}),v.jsxs(Gi,{children:[v.jsx(Dn,{value:"en",children:e("lang.en")}),v.jsx(Dn,{value:"zh",children:e("lang.zh")})]})]}),v.jsxs(za,{value:t,onValueChange:o=>r(o),children:[v.jsx(qi,{className:"h-7 w-16 text-xs sm:w-28","aria-label":e("theme.label"),children:v.jsx($a,{})}),v.jsxs(Gi,{children:[v.jsx(Dn,{value:"system",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Wg,{className:"h-4 w-4"})," ",e("theme.system")]})}),v.jsx(Dn,{value:"light",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(Xg,{className:"h-4 w-4"})," ",e("theme.light")]})}),v.jsx(Dn,{value:"dark",children:v.jsxs("span",{className:"inline-flex items-center gap-2",children:[v.jsx(qg,{className:"h-4 w-4"})," ",e("theme.dark")]})})]})]})]})}function WT(e){const[t,n]=g.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return g.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),i=o=>n(o.matches);return n(r.matches),r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t}function KT(){return WT("(min-width: 640px)")}const qT=[{to:"/",i18nKey:"nav.chat",mounted:!0},{to:"/tasks",i18nKey:"nav.tasks",mounted:!0},{to:"/approvals",i18nKey:"nav.approvals",mounted:!0},{to:"/reminders",i18nKey:"nav.reminders",mounted:!0},{to:"/memos",i18nKey:"nav.memos",mounted:!0},{to:"/memory",i18nKey:"nav.memory",mounted:!0},{to:"/workspace",i18nKey:"nav.workspace",mounted:!0},{to:"/observability",i18nKey:"nav.observability",mounted:!0},{to:"/settings",i18nKey:"nav.settings",mounted:!0}];function ep({children:e}){const{t}=St(),n=KT(),r=v.jsx("nav",{className:Ie("flex flex-1 min-w-0 items-center gap-1","overflow-x-auto scrollbar-thin","[&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-thumb]:bg-border"),"aria-label":t("appName"),children:qT.filter(i=>i.mounted).map(i=>v.jsx(sl,{to:i.to,end:i.to==="/",className:({isActive:o})=>Ie("shrink-0 rounded-md px-2.5 py-1.5 text-sm no-underline","transition-colors tap-target",o?"bg-accent-bg text-accent font-medium":"text-text-dim hover:bg-surface-hover hover:text-text"),children:t(i.i18nKey)},i.to))});return v.jsxs("header",{className:Ie("sticky top-0 z-20","flex flex-col sm:flex-row sm:items-center sm:gap-3","border-b border-border bg-surface","pt-safe","shadow-sm"),children:[v.jsxs("div",{className:Ie("flex items-center gap-2 sm:gap-3","overflow-x-hidden","px-3 sm:px-4 py-2 sm:py-2","sm:flex-1 sm:min-w-0"),children:[v.jsxs(sl,{to:"/",className:"flex shrink-0 items-center gap-1 text-md font-semibold no-underline",end:!0,children:[v.jsx("span",{"aria-hidden":"true",children:"🤖"}),v.jsx("span",{className:"hidden sm:inline",children:t("appName")})]}),n&&v.jsx("div",{className:"flex flex-1 min-w-0",children:r}),e&&v.jsx("div",{className:"flex items-center gap-2",children:e}),v.jsx("div",{className:"flex shrink-0 items-center gap-2",children:v.jsx(VT,{})})]}),!n&&v.jsx("div",{className:"border-t border-border px-3 py-1",children:r})]})}const GT={open:"bg-success",connecting:"bg-warning animate-pulse",closed:"bg-text-muted",error:"bg-danger"};function YT(){const{t:e}=St(),{state:t,send:n,switchAgent:r,approvalClick:i,newConversation:o,clearError:a}=db(),[s,l]=g.useState(""),c=g.useRef(null),u=g.useRef(null);g.useEffect(()=>{if(!c.current)return;const f=c.current;!(f.scrollHeight-f.scrollTop-f.clientHeight<200)&&t.currentReplyId==null||requestAnimationFrame(()=>{f.scrollTop=f.scrollHeight})},[t.messages,t.currentReplyId]),g.useEffect(()=>{t.error&&(Ot.error(t.error),a())},[t.error,a]);function d(f){f?.preventDefault();const m=s.trim();if(m){if(t.status!=="open"){Ot.error(e("chat.notConnected",{defaultValue:"Not connected. Reconnecting…"}));return}n(m),l(""),requestAnimationFrame(()=>u.current?.focus())}}function h(f){f.nativeEvent.isComposing||f.keyCode===229||f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),d())}return v.jsxs("div",{className:"flex h-dvh flex-col bg-bg",children:[v.jsxs(ep,{children:[v.jsx("span",{className:Ie("inline-block h-2 w-2 rounded-full",GT[t.status]),title:t.status}),v.jsx("span",{className:"hidden text-xs text-text-dim sm:inline",children:t.status}),v.jsxs(bt,{variant:"ghost",size:"sm",onClick:()=>{o(),Ot.success(e("chat.newConvToast",{defaultValue:"Started a new conversation"})),requestAnimationFrame(()=>u.current?.focus())},disabled:t.status!=="open",title:e("chat.newConvHint",{defaultValue:"Clear messages and start a fresh session"}),"aria-label":e("chat.newConv",{defaultValue:"New conversation"}),children:[v.jsx(Kg,{className:"h-4 w-4"}),v.jsx("span",{className:"hidden text-xs sm:inline",children:e("chat.newConv",{defaultValue:"New"})})]}),v.jsx(BT,{agents:t.agents,value:t.agent,onChange:r})]}),v.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:v.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col gap-2 px-3 py-3 sm:px-4",children:[t.messages.length===0&&t.status==="open"&&v.jsxs("div",{className:"flex flex-col items-center gap-2 py-16 text-center",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-2xl",children:"💬"}),v.jsx("h2",{className:"text-base font-semibold",children:e("chat.welcomeTitle",{defaultValue:"Start a conversation"})}),v.jsx("p",{className:"max-w-md text-sm text-text-dim",children:e("chat.welcomeBody",{defaultValue:"Type a message to ask the active agent. Use the agent dropdown to switch."})})]}),t.messages.length===0&&t.status!=="open"&&v.jsxs("div",{className:"grid place-items-center py-16 text-center",children:[v.jsx(zg,{className:"h-10 w-10 text-text-muted"}),v.jsx("p",{className:"mt-3 text-sm text-text-dim",children:t.status==="connecting"?e("chat.connecting",{defaultValue:"Connecting to agim…"}):e("chat.disconnected",{defaultValue:"Disconnected. Reconnecting automatically; you can keep typing."})})]}),t.messages.filter(f=>!f.approval).map(f=>v.jsx(sE,{msg:f,onApprove:(m,p,y)=>i(m,p,y)},f.id))]})}),v.jsx(dE,{approvals:t.pendingApprovals,onApprove:(f,m,p)=>i(f,m,p)}),v.jsxs("form",{onSubmit:d,className:"sticky bottom-0 border-t border-border bg-surface px-4 py-2 pb-safe sm:px-6",children:[v.jsxs("div",{className:"mx-auto flex max-w-3xl items-end gap-2",children:[v.jsx("textarea",{ref:u,value:s,onChange:f=>l(f.target.value),onKeyDown:h,placeholder:e("chat.inputPlaceholder",{defaultValue:"Message… (Enter sends, Shift+Enter newlines)"}),rows:1,className:Ie("flex-1 resize-none rounded-md border border-border bg-bg","px-3 py-1.5 text-sm leading-5","focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1 focus:ring-offset-bg","max-h-32 min-h-8")}),v.jsx(bt,{type:"submit",disabled:!s.trim()||t.status!=="open","aria-label":e("chat.send",{defaultValue:"Send"}),className:"h-8 w-8 p-0",children:v.jsx(Yg,{className:"h-4 w-4"})})]}),t.currentReplyId&&v.jsx("div",{className:"mx-auto mt-2 flex max-w-3xl items-center gap-2",children:v.jsx(at,{variant:"info",children:e("chat.streaming",{defaultValue:"… streaming"})})})]})]})}function QT(){const{t:e}=St(),t=sn();return v.jsxs("div",{className:"flex min-h-dvh flex-col bg-bg",children:[v.jsx(ep,{}),v.jsx("main",{className:"grid flex-1 place-items-center px-4 py-8 pb-safe",children:v.jsxs("div",{className:"flex max-w-md flex-col items-center gap-3 text-center",children:[v.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 text-text-dim",children:v.jsx($g,{className:"h-6 w-6"})}),v.jsx("div",{className:"text-6xl font-bold tracking-tight text-text-muted",children:"404"}),v.jsx("h1",{className:"text-xl font-semibold",children:e("notFound.title",{defaultValue:"Nothing here."})}),v.jsx("p",{className:"text-sm text-text-dim",children:e("notFound.description",{defaultValue:"The page you're looking for doesn't exist."})}),v.jsx("code",{className:"rounded bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.pathname}),v.jsx(bt,{asChild:!0,className:"mt-2",children:v.jsx(ts,{to:"/",children:e("actions.back")})})]})})]})}function hn(e){return async()=>{const n=(await e()).default;return{element:v.jsx($u,{children:v.jsx(n,{})})}}}function Pe(e){return async()=>{const n=(await e()).default;return{element:v.jsx(n,{})}}}const XT=Zm([{path:"/login",element:v.jsx(ib,{})},{path:"/",element:v.jsx($u,{children:v.jsx(YT,{})})},{path:"/tasks",lazy:hn(()=>ve(()=>import("./layout-B5rK_h6Q.js"),__vite__mapDeps([0,1]))),children:[{index:!0,element:v.jsx(zt,{to:"jobs",replace:!0})},{path:"jobs",lazy:Pe(()=>ve(()=>import("./jobs-DWBDqKx-.js"),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])))},{path:"subtasks",lazy:Pe(()=>ve(()=>import("./subtasks-CbLAkygG.js"),__vite__mapDeps([19,1,3,4,5,6,7,13,14,15,16])))},{path:"bgjobs",lazy:Pe(()=>ve(()=>import("./bgjobs-vhVtnLSx.js"),__vite__mapDeps([20,1,3,4,5,6,7,13,15,16])))},{path:"schedules",lazy:Pe(()=>ve(()=>import("./schedules-fxKnDnxp.js"),__vite__mapDeps([21,1,3,4,5,6,13,15,16])))},{path:"outbox",lazy:Pe(()=>ve(()=>import("./outbox-T3NnYmK0.js"),__vite__mapDeps([22,1,3,4,5,6,7,10,11,12,13,15,16])))},{path:"a2a",lazy:Pe(()=>ve(()=>import("./a2a-CbxNgf9H.js"),__vite__mapDeps([23,1,3,4,5,6,7,13,14,15,16])))},{path:"heartbeat",lazy:Pe(()=>ve(()=>import("./heartbeat-Bc4SZawQ.js"),__vite__mapDeps([24,1,4,25,13,26,15,16,27])))},{path:"goals",lazy:Pe(()=>ve(()=>import("./goals-BQkhal_h.js"),__vite__mapDeps([28,1,4,25,13,15,16,29,17])))},{path:"asks",lazy:Pe(()=>ve(()=>import("./asks-B6L3PSml.js"),__vite__mapDeps([30,4,1,25,13,15,16,17])))}]},{path:"/approvals",lazy:hn(()=>ve(()=>import("./approvals-CyPhYcGG.js"),__vite__mapDeps([31,1,12,5,13,14,15,16])))},{path:"/reminders",lazy:hn(()=>ve(()=>import("./reminders-R14lWHEJ.js"),__vite__mapDeps([32,1,3,4,5,6,7,10,11,12,13,15,16,33])))},{path:"/memos",lazy:hn(()=>ve(()=>import("./memos-LpUpTmYL.js"),__vite__mapDeps([34,1,3,4,5,6,10,11,12,9,13,35,16,36,37])))},{path:"/memory",lazy:hn(()=>ve(()=>import("./layout-D7gNMUDZ.js"),__vite__mapDeps([38,39,13,1]))),children:[{index:!0,element:v.jsx(zt,{to:"facts",replace:!0})},{path:"facts",lazy:Pe(()=>ve(()=>import("./facts-Cfu6Lg3H.js"),__vite__mapDeps([40,1,3,4,5,6,8,9,10,11,12,39,13,35,41,15,16,36])))},{path:"persona",lazy:Pe(()=>ve(()=>import("./persona-CHz80XDk.js"),__vite__mapDeps([42,1,5,10,11,12,39,13,41,15,16,27,43,17,35])))},{path:"vector",lazy:Pe(()=>ve(()=>import("./vector-BmpvJTWt.js"),__vite__mapDeps([44,1,45,13,39,15,46,47,10,11,12,5,17,16,27,48,35,43])))},{path:"skills",element:v.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})}]},{path:"/skills",children:[{index:!0,element:v.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})},{path:"installed",element:v.jsx(zt,{to:"/settings/agim-skills/installed",replace:!0})},{path:"hot",element:v.jsx(zt,{to:"/settings/agim-skills/hot",replace:!0})}]},{path:"/workspace",lazy:hn(()=>ve(()=>import("./workspace-DTbEdEyD.js"),__vite__mapDeps([49,1,5,50,13,15,16])))},{path:"/observability",lazy:hn(()=>ve(()=>import("./layout-DJKxW33x.js"),__vite__mapDeps([51,1]))),children:[{index:!0,element:v.jsx(zt,{to:"health",replace:!0})},{path:"health",lazy:Pe(()=>ve(()=>import("./health-BObMAngj.js"),__vite__mapDeps([52,1,5,4,53,13,15,16,54])))},{path:"topn",lazy:Pe(()=>ve(()=>import("./topn-BE7RU5cV.js"),__vite__mapDeps([55,5,4,1,53,13,15,16])))},{path:"audit",lazy:Pe(()=>ve(()=>import("./audit-CCGCdw6P.js"),__vite__mapDeps([56,1,3,4,5,6,53,13,15,16,54])))}]},{path:"/settings",lazy:hn(()=>ve(()=>import("./layout-CX3nXpWb.js"),__vite__mapDeps([57,1]))),children:[{index:!0,element:v.jsx(zt,{to:"messengers",replace:!0})},{path:"messengers",lazy:Pe(()=>ve(()=>import("./messengers-CWMsJz1e.js"),__vite__mapDeps([58,1,11,12,45,13,15,16,46])))},{path:"email",lazy:Pe(()=>ve(()=>import("./email-Dy3UoyzF.js"),__vite__mapDeps([59,1,45,13,15,17,29,16,47,12,46])))},{path:"viewer",lazy:Pe(()=>ve(()=>import("./viewer-BOSX-lUS.js"),__vite__mapDeps([60,1,45,13,47,15,16,29,61,12,46,37])))},{path:"agents",lazy:Pe(()=>ve(()=>import("./agents-DOW1_NGT.js"),__vite__mapDeps([62,1,5,50,13,45,15,16,12,46,63,36,64,35])))},{path:"policy",lazy:Pe(()=>ve(()=>import("./policy-CtKRzual.js"),__vite__mapDeps([65,45,13,1,15,16])))},{path:"security",lazy:Pe(()=>ve(()=>import("./security-Dw1mh68G.js"),__vite__mapDeps([66,1,45,13,15,16,67,29])))},{path:"service",lazy:Pe(()=>ve(()=>import("./service-CB55xtmh.js"),__vite__mapDeps([68,1,10,11,12,45,13,15,16,27,63,46])))},{path:"admins",lazy:Pe(()=>ve(()=>import("./admins-C0BJw6X9.js"),__vite__mapDeps([69,1,10,11,12,5,4,45,13,15,16,35])))},{path:"workspaces",lazy:Pe(()=>ve(()=>import("./workspaces-BIZGVK8F.js"),__vite__mapDeps([70,1,5,4,45,13,15,16,18,46])))},{path:"llm",lazy:Pe(()=>ve(()=>import("./llm-CPOd98Hy.js"),__vite__mapDeps([71,1,4,72,13,15,16,35,64])))},{path:"mcp",lazy:Pe(()=>ve(()=>import("./mcp-DGxGN2iX.js"),__vite__mapDeps([73,1,4,72,13,15,16,54,35,64])))},{path:"native-agent",lazy:Pe(()=>ve(()=>import("./native-agent-CPkYGY3I.js"),__vite__mapDeps([74,1,45,13,15,16,12,46,63,67,33,26])))},{path:"search",lazy:Pe(()=>ve(()=>import("./search-DzgimpPy.js"),__vite__mapDeps([75,1,45,13,15,16,12,46,6,29,17])))},{path:"agim-skills",lazy:Pe(()=>ve(()=>import("./layout-ByUY6XZQ.js"),__vite__mapDeps([76,1]))),children:[{index:!0,element:v.jsx(zt,{to:"installed",replace:!0})},{path:"installed",lazy:Pe(()=>ve(()=>import("./installed-DswmDcea.js"),__vite__mapDeps([77,1,13,15,16,35,46])))},{path:"hot",lazy:Pe(()=>ve(()=>import("./hot-BXYotT26.js"),__vite__mapDeps([78,1,5,11,12,13,61,15,16,36,48])))}]}]},{path:"*",element:v.jsx(QT,{})}]);function JT(){return v.jsx(Hy,{children:v.jsx(sg,{router:XT})})}const ZT=new vv({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:1,retryDelay:e=>Math.min(1e3*2**e,8e3),refetchOnWindowFocus:!1,refetchOnReconnect:!0},mutations:{retry:0}}}),ue=e=>typeof e=="string",jr=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},nu=e=>e==null?"":""+e,eR=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},tR=/###/g,ru=e=>e&&e.indexOf("###")>-1?e.replace(tR,"."):e,iu=e=>!e||ue(e),$r=(e,t,n)=>{const r=ue(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(iu(e))return{};const o=ru(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return iu(e)?{}:{obj:e,k:ru(r[i])}},ou=(e,t,n)=>{const{obj:r,k:i}=$r(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=$r(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=$r(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},nR=(e,t,n,r)=>{const{obj:i,k:o}=$r(e,t,Object);i[o]=i[o]||[],i[o].push(n)},Yi=(e,t)=>{const{obj:n,k:r}=$r(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},rR=(e,t,n)=>{const r=Yi(e,n);return r!==void 0?r:Yi(t,n)},tp=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?ue(e[r])||e[r]instanceof String||ue(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):tp(e[r],t[r],n):e[r]=t[r]);return e},rr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var iR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const oR=e=>ue(e)?e.replace(/[&<>"'\/]/g,t=>iR[t]):e;class aR{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const sR=[" ",",","?","!",";"],lR=new aR(20),cR=(e,t,n)=>{t=t||"",n=n||"";const r=sR.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=lR.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},Wa=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,s="";for(let l=o;l<r.length;++l)if(l!==o&&(s+=n),s+=r[l],a=i[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;o+=l-o+1;break}i=a}return i},Qi=e=>e?.replace("_","-"),uR={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class Xi{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||uR,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(ue(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Xi(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Xi(this.logger,t)}}var Kt=new Xi;class ko{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[s,l]=a;for(let c=0;c<l;c++)s.apply(s,[t,...r])})}}class au extends ko{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):ue(r)&&o?s.push(...r.split(o)):s.push(r)));const l=Yi(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!ue(r)?l:Wa(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),ou(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(ue(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=Yi(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?tp(l,r,o):l={...l,...r},ou(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var np={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const su={},lu=e=>!ue(e)&&typeof e!="boolean"&&typeof e!="number";class Ji extends ko{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),eR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Kt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};return t==null?!1:this.resolve(t,n)?.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!cR(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:ue(o)?[o]:o};const c=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return{key:t,namespaces:ue(o)?[o]:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode"){if(u){const D=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${D}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${D}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a}const d=this.resolve(t,n);let h=d?.res;const f=d?.usedKey||a,m=d?.exactUsedKey||a,p=["[object Number]","[object Function]","[object RegExp]"],y=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,x=n.count!==void 0&&!ue(n.count),w=Ji.hasDefaultValue(n),R=x?this.pluralResolver.getSuffix(c,n.count,n):"",I=n.ordinal&&x?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",C=x&&!n.ordinal&&n.count===0,S=C&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${R}`]||n[`defaultValue${I}`]||n.defaultValue;let N=h;b&&!h&&w&&(N=S);const j=lu(N),T=Object.prototype.toString.apply(N);if(b&&N&&j&&p.indexOf(T)<0&&!(ue(y)&&Array.isArray(N))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,N,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=D,d.usedParams=this.getUsedParamsDetails(n),d):D}if(o){const D=Array.isArray(N),L=D?[]:{},K=D?m:f;for(const B in N)if(Object.prototype.hasOwnProperty.call(N,B)){const V=`${K}${o}${B}`;w&&!h?L[B]=this.translate(V,{...n,defaultValue:lu(S)?S[B]:void 0,joinArrays:!1,ns:s}):L[B]=this.translate(V,{...n,joinArrays:!1,ns:s}),L[B]===V&&(L[B]=N[B])}h=L}}else if(b&&ue(y)&&Array.isArray(h))h=h.join(y),h&&(h=this.extendTranslation(h,t,n,r));else{let D=!1,L=!1;!this.isValidLookup(h)&&w&&(D=!0,h=S),this.isValidLookup(h)||(L=!0,h=a);const B=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:h,V=w&&S!==h&&this.options.updateMissing;if(L||D||V){if(this.logger.log(V?"updateKey":"missingKey",c,l,a,V?S:h),o){const F=this.resolve(a,{...n,keySeparator:!1});F&&F.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let q=[];const Q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Q&&Q[0])for(let F=0;F<Q.length;F++)q.push(Q[F]);else this.options.saveMissingTo==="all"?q=this.languageUtils.toResolveHierarchy(n.lng||this.language):q.push(n.lng||this.language);const $=(F,k,se)=>{const te=w&&se!==h?se:B;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,k,te,V,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,l,k,te,V,n),this.emit("missingKey",F,l,k,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?q.forEach(F=>{const k=this.pluralResolver.getSuffixes(F,n);C&&n[`defaultValue${this.options.pluralSeparator}zero`]&&k.indexOf(`${this.options.pluralSeparator}zero`)<0&&k.push(`${this.options.pluralSeparator}zero`),k.forEach(se=>{$([F],a+se,n[`defaultValue${se}`]||S)})}):$(q,a,S))}h=this.extendTranslation(h,t,n,d,r),L&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${a}`),(L||D)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,D?h:void 0))}return i?(d.res=h,d.usedParams=this.getUsedParamsDetails(n),d):h}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=ue(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const h=t.match(this.interpolator.nestingRegexp);u=h&&h.length}let d=r.replace&&!ue(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language||i.usedLng,r),c){const h=t.match(this.interpolator.nestingRegexp),f=h&&h.length;u<f&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var h=arguments.length,f=new Array(h),m=0;m<h;m++)f[m]=arguments[m];return o?.[0]===f[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):a.translate(...f,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=ue(s)?[s]:s;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=np.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return ue(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;i=u;let d=c.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const h=n.count!==void 0&&!ue(n.count),f=h&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(ue(n.context)||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(y=>{this.isValidLookup(r)||(s=y,!su[`${p[0]}-${y}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(su[`${p[0]}-${y}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(b=>{if(this.isValidLookup(r))return;a=b;const x=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(x,u,b,y,n);else{let R;h&&(R=this.pluralResolver.getSuffix(b,n.count,n));const I=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(x.push(u+R),n.ordinal&&R.indexOf(C)===0&&x.push(u+R.replace(C,this.options.pluralSeparator)),f&&x.push(u+I)),m){const S=`${u}${this.options.contextSeparator}${n.context}`;x.push(S),h&&(x.push(S+R),n.ordinal&&R.indexOf(C)===0&&x.push(S+R.replace(C,this.options.pluralSeparator)),f&&x.push(S+I))}}let w;for(;w=x.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(b,y,w,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!ue(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class cu{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kt.create("languageUtils")}getScriptPartFromCode(t){if(t=Qi(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Qi(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(ue(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),ue(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return ue(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):ue(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const uu={zero:0,one:1,two:2,few:3,many:4,other:5},du={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class dR{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Kt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=Qi(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),du;if(!t.match(/-|_/))return du;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>uu[i]-uu[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const fu=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=rR(e,t,n);return!o&&i&&ue(n)&&(o=Wa(e,n,r),o===void 0&&(o=Wa(t,n,r))),o},na=e=>e.replace(/\$/g,"$$$$");class fR{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Kt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:m,nestingSuffixEscaped:p,nestingOptionsSeparator:y,maxReplaces:b,alwaysFormat:x}=t.interpolation;this.escape=n!==void 0?n:oR,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?rr(o):a||"{{",this.suffix=s?rr(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?rr(h):f||rr("$t("),this.nestingSuffix=m?rr(m):p||rr(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=b||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const b=fu(n,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...i,...n,interpolationkey:f}):b}const m=f.split(this.formatSeparator),p=m.shift().trim(),y=m.join(this.formatSeparator).trim();return this.format(fu(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure),y,r,{...i,...n,interpolationkey:p})};this.resetRegExp();const u=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>na(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?na(this.escape(f)):na(f)}].forEach(f=>{for(s=0;o=f.regex.exec(t);){const m=o[1].trim();if(a=c(m),a===void 0)if(typeof u=="function"){const y=u(t,o,i);a=ue(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(d){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else!ue(a)&&!this.useRawValueToEscape&&(a=nu(a));const p=f.safeValue(a);if(t=t.replace(o[0],p),d?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=o[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;const s=(l,c)=>{const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const d=l.split(new RegExp(`${u}[ ]*{`));let h=`{${d[1]}`;l=d[0],h=this.interpolate(h,a);const f=h.match(/'/g),m=h.match(/"/g);((f?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),c&&(a={...c,...a})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${u}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!ue(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const u=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=u.shift(),l=u,c=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!ue(o))return o;ue(o)||(o=nu(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((u,d)=>this.format(u,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const hR=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),u=s.trim();n[u]||(n[u]=c),c==="false"&&(n[u]=!1),c==="true"&&(n[u]=!0),isNaN(c)||(n[u]=parseInt(c,10))}})}return{formatName:t,formatOptions:n}},ir=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(Qi(r),i),t[a]=s),s(n)}};class pR{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Kt.create("formatter"),this.options=t,this.formats={number:ir((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:ir((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:ir((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:ir((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:ir((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=ir(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,l)=>{const{formatName:c,formatOptions:u}=hR(l);if(this.formats[c]){let d=s;try{const h=i?.formatParams?.[i.interpolationkey]||{},f=h.locale||h.lng||i.locale||i.lng||r;d=this.formats[c](s,f,{...u,...i,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}const mR=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class gR extends ko{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Kt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(d=>{const h=`${c}|${d}`;!r.reload&&this.store.hasResourceBundle(c,d)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,u=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),l[d]===void 0&&(l[d]=!0)))}),u||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{nR(l.loaded,[o],a),mR(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(d=>{s[c][d]===void 0&&(s[c][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(c&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();ue(t)&&(t=this.languageUtils.toResolveHierarchy(t)),ue(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,i,l):u=c(t,n,r,i),u&&typeof u.then=="function"?u.then(d=>s(null,d)).catch(s):s(null,u)}catch(u){s(u)}else c(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const hu=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),ue(e[1])&&(t.defaultValue=e[1]),ue(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),pu=e=>(ue(e.ns)&&(e.ns=[e.ns]),ue(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ue(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),wi=()=>{},yR=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Qr extends ko{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=pu(t),this.services={},this.logger=Kt,this.modules={external:[]},yR(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),n.defaultNS==null&&n.ns&&(ue(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=hu();this.options={...i,...this.options,...pu(n)},this.options.interpolation={...i.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Kt.init(o(this.modules.logger),this.options):Kt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=pR;const d=new cu(this.options);this.store=new au(this.options.resources,this.options);const h=this.services;h.logger=Kt,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new dR(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=o(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new fR(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new gR(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),y=1;y<m;y++)p[y-1]=arguments[y];t.emit(f,...p)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new Ji(this.services,this.options),this.translator.on("*",function(f){for(var m=arguments.length,p=new Array(m>1?m-1:0),y=1;y<m;y++)p[y-1]=arguments[y];t.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=wi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=jr(),c=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(h),r(d,h)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wi;const i=ue(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&o.indexOf(c)<0&&o.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=jr();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=wi),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&np.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=jr();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=ue(l)?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,u=>{a(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;d<c;d++)u[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(u))}else l={...s};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||o.keyPrefix);const h=i.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(m=>`${l.keyPrefix}${h}${m}`):f=l.keyPrefix?`${l.keyPrefix}${h}${a}`:a,i.t(f,l)};return ue(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.translate(...n)}exists(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.translator?.exists(...n)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=jr();return this.options.ns?(ue(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=jr();ue(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new cu(hu());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Qr(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wi;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Qr(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},Object.keys(l[c]).reduce((u,d)=>(u[d]={...l[c][d]},u),{})),{});o.store=new au(s,i),o.services.resourceStore=o.store}return o.translator=new Ji(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];o.emit(s,...c)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Xe=Qr.createInstance();Xe.createInstance=Qr.createInstance;Xe.createInstance;Xe.dir;Xe.init;Xe.loadResources;Xe.reloadResources;Xe.use;Xe.changeLanguage;Xe.getFixedT;Xe.t;Xe.exists;Xe.setDefaultNamespace;Xe.hasLoadedNamespace;Xe.loadNamespaces;Xe.loadLanguages;function vR(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=bR(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
198
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{a||n.return==null||n.return()}finally{if(s)throw o}}}}function bR(e,t){if(e){if(typeof e=="string")return mu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mu(e,t):void 0}}function mu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ka(e){"@babel/helpers - typeof";return Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ka(e)}var rp=["__proto__","constructor","prototype"];function ip(e){return!(typeof e!="string"||e.length===0||e.length>128||rp.indexOf(e)>-1||e.indexOf("..")>-1||e.indexOf("\\")>-1||/[?#%\s@]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function op(e){return!(!ip(e)||e.indexOf("/")>-1)}function xR(e){return ip(e)}var wR={lng:op,ns:xR};function Si(e){return typeof e!="string"?e:e.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function SR(e){if(typeof e!="string"||e.length===0)return e;try{var t=new URL(e);return t.username||t.password?(t.username="",t.password="",t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,"$1")}}function ap(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Ka(XMLHttpRequest))==="object"}function kR(e){return!!e&&typeof e.then=="function"}function ER(e){return kR(e)?e:Promise.resolve(e)}var CR=/\{\{(.+?)\}\}/g;function gu(e,t){var n=!1,r=e.replace(CR,function(i,o){var a=o.trim();if(rp.indexOf(a)>-1)return i;var s=t[a];if(s==null)return i;var l=wR[a]||op,c=String(s).split("+"),u=vR(c),d;try{for(u.s();!(d=u.n()).done;){var h=d.value;if(!l(h))return n=!0,i}}catch(f){u.e(f)}finally{u.f()}return c.join("+")});return n?null:r}function yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yu(Object(n),!0).forEach(function(r){AR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AR(e,t,n){return(t=TR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TR(e){var t=RR(e,"string");return Kn(t)=="symbol"?t:t+""}function RR(e,t){if(Kn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kn(e){"@babel/helpers - typeof";return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(e)}var bn=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?bn=global.fetch:typeof window<"u"&&window.fetch&&(bn=window.fetch);var Xr;ap()&&(typeof global<"u"&&global.XMLHttpRequest?Xr=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Xr=window.XMLHttpRequest));var Zi;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Zi=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Zi=window.ActiveXObject));typeof bn!="function"&&(bn=void 0);if(!bn&&!Xr&&!Zi)try{ve(()=>import("./browser-ponyfill-BOcGq8h9.js").then(e=>e.b),__vite__mapDeps([79,1])).then(function(e){bn=e.default}).catch(function(){})}catch{}var sp=["__proto__","constructor","prototype"],qa=function(t,n){if(n&&Kn(n)==="object"){for(var r="",i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];sp.indexOf(a)>-1||(r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(n[a]))}if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},bu=function(t,n,r,i){var o=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(i){var a=i(t,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(o).catch(r):bn(t,n).then(o).catch(r)},PR=function(t,n,r,i){t.queryStringParams&&(n=qa(n,t.queryStringParams));var o=vu({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=vu({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},t._omitFetchOptions?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{bu(n,s,i,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return i(c);try{Object.keys(a).forEach(function(u){delete s[u]}),bu(n,s,i,l),t._omitFetchOptions=!0}catch(u){i(u)}}},IR=function(t,n,r,i){r&&Kn(r)==="object"&&(r=qa("",r).slice(1)),t.queryStringParams&&(n=qa(n,t.queryStringParams));try{var o=Xr?new Xr:new Zi("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s=0,l=Object.keys(a);s<l.length;s++){var c=l[s];sp.indexOf(c)>-1||o.setRequestHeader(c,a[c])}o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(u){console&&console.log(u)}},LR=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},bn&&n.indexOf("file:")!==0)return PR(t,n,r,i);if(ap()||typeof ActiveXObject=="function")return IR(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function pr(e){"@babel/helpers - typeof";return pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(e)}function xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ra(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xu(Object(n),!0).forEach(function(r){lp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cp(r.key),r)}}function NR(e,t,n){return t&&_R(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lp(e,t,n){return(t=cp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cp(e){var t=DR(e,"string");return pr(t)=="symbol"?t:t+""}function DR(e,t){if(pr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var MR=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return lp({},r,i||"")},parseLoadPayload:function(n,r){},request:LR,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},up=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};OR(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return NR(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=ra(ra(ra({},MR()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);pr(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=ER(l),l.then(function(c){if(!c)return a(null,{});var u=gu(c,{lng:n.join("+"),ns:i.join("+")});if(u==null){var d=n.map(Si).join(", "),h=i.map(Si).join(", ");return a(new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+d+"] namespaces=["+h+"]"),!1)}s.loadUrl(u,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,c=this.options.parseLoadPayload(s,l),u=Si(SR(n));this.options.request(this.options,n,c,function(d,h){if(h&&(h.status>=500&&h.status<600||!h.status))return r("failed loading "+u+"; status code: "+h.status,!0);if(h&&h.status>=400&&h.status<500)return r("failed loading "+u+"; status code: "+h.status,!1);if(!h&&d&&d.message){var f=d.message.toLowerCase(),m=["failed","fetch","network","load"].find(function(b){return f.indexOf(b)>-1});if(m)return r("failed loading "+u+": "+Si(d.message),!0)}if(d)return r(d,!1);var p,y;try{typeof h.data=="string"?p=a.options.parse(h.data,i,o):p=h.data}catch{y="failed parsing "+u+" to json"}if(y)return r(y,!1);r(null,p)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),c=0,u=[],d=[];n.forEach(function(h){var f=s.options.addPath;typeof s.options.addPath=="function"&&(f=s.options.addPath(h,r));var m=gu(f,{lng:h,ns:r});if(m==null){c+=1,a&&c===n.length&&a(u,d);return}s.options.request(s.options,m,l,function(p,y){c+=1,u.push(p),d.push(y),c===n.length&&typeof a=="function"&&a(u,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(d){var h=o.toResolveHierarchy(d);h.forEach(function(f){l.indexOf(f)<0&&l.push(f)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(d){i.read(u,d,"read",null,null,function(h,f){h&&a.warn("loading namespace ".concat(d," for language ").concat(u," failed"),h),!h&&f&&a.log("loaded namespace ".concat(d," for language ").concat(u),f),i.loaded("".concat(u,"|").concat(d),h,f)})})})}}}])}();up.type="backend";const jR="Agim",FR={refresh:"Refresh",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",submit:"Submit",close:"Close",back:"Back",next:"Next",previous:"Previous",create:"Create",search:"Search",retry:"Retry",confirm:"Confirm"},BR={loading:"Loading…",empty:"No data",saving:"Saving…",saved:"Saved",error:"Something went wrong"},HR={label:"Theme",system:"System",light:"Light",dark:"Dark",cycleHint:"Click to cycle theme"},UR={label:"Language",en:"English",zh:"中文"},zR={chat:"Chat",tasks:"Tasks",approvals:"Approvals",reminders:"Reminders",memos:"Memos",memory:"Memory",skills:"Skills",workspace:"Workspace",observability:"Observability",settings:"Settings"},$R={deleteTitle:"Delete this item?",deleteDescription:"This cannot be undone.",destructiveAction:"Delete"},VR={label:"Pagination",perPage:"Per page",firstPage:"First page",lastPage:"Last page",pageOfTotal:"Page {{page}} of {{totalPages}}",range:"{{from}}–{{to}} of {{total}}"},WR={selectAll:"Select all rows",selectRow:"Select row"},KR={intro:"Paste your access token from ~/.agim/tokens.json or `agim token list`.",tokenLabel:"Access token",submit:"Sign in",hint:"Loopback (127.0.0.1) requests bypass this page; you only land here from another host or with IMHUB_TRUST_LOOPBACK=off."},qR={placeholder:"Signed in. The chat surface ships in PR-6; this route is intentionally blank for now.",healthCheck:"Backend reachable"},GR={title:"Nothing here.",description:"The page you're looking for doesn't exist."},YR={title:"Something went wrong.",description:"An unexpected error broke the page render. Try reloading or heading back to the home screen; if it persists, copy the message below and report it.",reload:"Reload",home:"Home"},QR={send:"Send",streaming:"… streaming",notConnected:"Not connected. Reconnecting…",connecting:"Connecting to agim…",disconnected:"Disconnected. Reconnecting automatically; you can keep typing.",welcomeTitle:"Start a conversation",welcomeBody:"Type a message to ask the active agent. Use the agent dropdown to switch.",inputPlaceholder:"Message… (Enter sends, Shift+Enter newlines)",newConv:"New",newConvHint:"Clear messages and start a fresh session",newConvToast:"Started a new conversation",approvalTitle:"🔐 Tool approval",approvalAutoBadge:"auto-allow",approvalAutoIn:"Auto-allowing in {{count}}s — Deny to stop.",approvalAutoResolving:"Auto-allowing now…",approvalToolLabel:"Tool",approvalInputLabel:"Input",approvalAllow:"Allow",approvalAuto:"Auto for similar",approvalAutoTip:"Allow and auto-allow similar calls for the rest of the session",approvalDeny:"Deny",outcome:{allowed:"✅ Allowed",allowedPinned:"✅ Allowed + auto-allow further",denied:"❌ Denied",deniedRevoked:"❌ Denied (auto-allow revoked)",expired:"⏱ Timed out"}},XR={appName:jR,actions:FR,states:BR,theme:HR,lang:UR,nav:zR,confirm:$R,pagination:VR,table:WR,login:KR,home:qR,notFound:GR,errorBoundary:YR,chat:QR},JR="Agim",ZR={refresh:"刷新",save:"保存",cancel:"取消",delete:"删除",edit:"编辑",submit:"提交",close:"关闭",back:"返回",next:"下一页",previous:"上一页",create:"新建",search:"搜索",retry:"重试",confirm:"确定"},eP={loading:"加载中…",empty:"暂无数据",saving:"保存中…",saved:"已保存",error:"出错了"},tP={label:"主题",system:"跟随系统",light:"浅色",dark:"深色",cycleHint:"点击切换主题"},nP={label:"语言",en:"English",zh:"中文"},rP={chat:"对话",tasks:"任务",approvals:"审批",reminders:"提醒",memos:"备忘",memory:"记忆",skills:"技能",workspace:"工作区",observability:"观测",settings:"设置"},iP={deleteTitle:"确认删除?",deleteDescription:"操作不可撤销。",destructiveAction:"删除"},oP={label:"分页",perPage:"每页",firstPage:"首页",lastPage:"末页",pageOfTotal:"第 {{page}} / {{totalPages}} 页",range:"{{from}}–{{to}} / 共 {{total}}"},aP={selectAll:"全选",selectRow:"选中此行"},sP={intro:"粘贴 ~/.agim/tokens.json 里的访问令牌(或运行 `agim token list` 查看)。",tokenLabel:"访问令牌",submit:"登录",hint:"loopback(127.0.0.1)的请求会跳过此页;只有跨机访问或设置了 IMHUB_TRUST_LOOPBACK=off 时才会看到此页。"},lP={placeholder:"已登录。聊天界面将在 PR-6 落地;当前页暂为占位。",healthCheck:"后端可达"},cP={title:"什么也没找到。",description:"你要找的页面不存在。"},uP={title:"出错了。",description:"页面渲染过程中遇到了未预期的错误。可以尝试刷新或返回主页;若问题反复出现,请复制下方错误信息反馈。",reload:"刷新",home:"返回主页"},dP={send:"发送",streaming:"… 接收中",notConnected:"未连接,正在重连…",connecting:"正在连接 agim…",disconnected:"已断开,自动重连中;可以继续输入。",welcomeTitle:"开始对话",welcomeBody:"输入消息向当前 Agent 提问。点上方下拉可切换 Agent。",inputPlaceholder:"输入消息……(Enter 发送,Shift+Enter 换行)",newConv:"新对话",newConvHint:"清空消息并开启新会话",newConvToast:"已开启新对话",approvalTitle:"🔐 工具授权",approvalAutoBadge:"自动放行",approvalAutoIn:"{{count}} 秒后自动放行 — 点「拒绝」可中止。",approvalAutoResolving:"正在自动放行…",approvalToolLabel:"工具",approvalInputLabel:"输入",approvalAllow:"批准",approvalAuto:"本类自动放行",approvalAutoTip:"批准并对本会话内同类调用自动放行",approvalDeny:"拒绝",outcome:{allowed:"✅ 已批准",allowedPinned:"✅ 已批准 · 后续同类自动放行",denied:"❌ 已拒绝",deniedRevoked:"❌ 已拒绝(撤销自动放行)",expired:"⏱ 已超时"}},fP={appName:JR,actions:ZR,states:eP,theme:tP,lang:nP,nav:rP,confirm:iP,pagination:oP,table:aP,login:sP,home:lP,notFound:cP,errorBoundary:uP,chat:dP},hP="Couldn't reach the server. Check your connection and retry.",pP="Your session expired. Please sign in again.",mP="Sign-in required.",gP="Auth token missing from request.",yP="Auth subsystem isn't ready yet. Retry in a moment.",vP="You don't have permission to do that.",bP="The requested resource wasn't found.",xP="That request is too big — try splitting it.",wP="The server rejected the request: {{detail}}",SP="Request body wasn't valid JSON.",kP="Configuration didn't validate. Check the form fields.",EP="Couldn't save configuration: {{detail}}",CP="Send an `updates` object to change env values.",AP="None of the keys you sent are editable.",TP="SMTP isn't configured. Save host / user / password first.",RP="SMTP verify failed: {{detail}}",PP="Provide a baseUrl to discover ACP agents.",IP="Provide an `endpoint` to test the agent.",LP="ACP discovery failed: {{detail}}",OP="ACP agent test failed: {{detail}}",_P="A user_key (platform:userId) is required.",NP="Something went wrong (code {{code}}).",DP="Bad request.",MP="Sign-in required.",jP="Forbidden.",FP="Not found.",BP="Conflict — refresh and try again.",HP="Request too large.",UP="Server error.",zP="Gateway error.",$P="Service unavailable.",VP="Gateway timeout.",WP={NETWORK:hP,AUTH_INVALID:pP,AUTH_REQUIRED:mP,AUTH_TOKEN_REQUIRED:gP,AUTH_NOT_READY:yP,FORBIDDEN:vP,NOT_FOUND:bP,PAYLOAD_TOO_LARGE:xP,VALIDATION:wP,INVALID_JSON_BODY:SP,CONFIG_INVALID:kP,CONFIG_SAVE_FAILED:EP,ENV_UPDATES_REQUIRED:CP,ENV_NO_EDITABLE_KEYS:AP,EMAIL_NOT_CONFIGURED:TP,EMAIL_VERIFY_FAILED:RP,ACP_BASEURL_REQUIRED:PP,ACP_ENDPOINT_REQUIRED:IP,ACP_DISCOVER_FAILED:LP,ACP_TEST_FAILED:OP,MEMORY_USER_KEY_REQUIRED:_P,UNKNOWN:NP,HTTP_400:DP,HTTP_401:MP,HTTP_403:jP,HTTP_404:FP,HTTP_409:BP,HTTP_413:HP,HTTP_500:UP,HTTP_502:zP,HTTP_503:$P,HTTP_504:VP},KP="无法访问服务器,请检查网络后重试。",qP="登录状态已过期,请重新登录。",GP="请先登录。",YP="请求缺少 auth token。",QP="鉴权子系统尚未就绪,请稍后重试。",XP="没有执行该操作的权限。",JP="请求的资源不存在。",ZP="请求体过大,请拆分后重试。",eI="服务端拒绝了请求:{{detail}}",tI="请求体不是合法的 JSON。",nI="配置校验失败,请检查表单字段。",rI="保存配置失败:{{detail}}",iI="请在请求体中提供 `updates` 对象以修改 env。",oI="请求里的 key 均不可编辑。",aI="SMTP 未配置,请先保存 host / user / password。",sI="SMTP 连接测试失败:{{detail}}",lI="需要 baseUrl 才能发现 ACP Agent。",cI="需要 `endpoint` 才能测试该 Agent。",uI="ACP 发现失败:{{detail}}",dI="ACP Agent 测试失败:{{detail}}",fI="需要 user_key(形如 `platform:userId`)。",hI="出错了 (code {{code}})。",pI="请求格式不正确。",mI="请先登录。",gI="没有权限。",yI="未找到。",vI="状态冲突,请刷新后重试。",bI="请求体过大。",xI="服务端出错。",wI="网关错误。",SI="服务暂不可用。",kI="网关超时。",EI={NETWORK:KP,AUTH_INVALID:qP,AUTH_REQUIRED:GP,AUTH_TOKEN_REQUIRED:YP,AUTH_NOT_READY:QP,FORBIDDEN:XP,NOT_FOUND:JP,PAYLOAD_TOO_LARGE:ZP,VALIDATION:eI,INVALID_JSON_BODY:tI,CONFIG_INVALID:nI,CONFIG_SAVE_FAILED:rI,ENV_UPDATES_REQUIRED:iI,ENV_NO_EDITABLE_KEYS:oI,EMAIL_NOT_CONFIGURED:aI,EMAIL_VERIFY_FAILED:sI,ACP_BASEURL_REQUIRED:lI,ACP_ENDPOINT_REQUIRED:cI,ACP_DISCOVER_FAILED:uI,ACP_TEST_FAILED:dI,MEMORY_USER_KEY_REQUIRED:fI,UNKNOWN:hI,HTTP_400:pI,HTTP_401:mI,HTTP_403:gI,HTTP_404:yI,HTTP_409:vI,HTTP_413:bI,HTTP_500:xI,HTTP_502:wI,HTTP_503:SI,HTTP_504:kI},CI="Tasks",AI={jobs:"Jobs",subtasks:"Subtasks",bgjobs:"Background",schedules:"Schedules",outbox:"Outbox",a2a:"Agent ↔ Agent",heartbeat:"Heartbeat",goals:"Goals",asks:"Ask User"},TI={title:"Jobs",subtitle:"Long-running agent invocations and their results.",empty:{title:"No jobs yet",description:"Jobs are created when an agent runs in async mode — via `agim --invoke` or an inline /run command from chat."},filter:{status:"Status",statusAny:"Any status",agent:"Agent",agentAny:"Any agent",kind:"Kind",kindAny:"Any kind"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",createdAt:"Created",duration:"Duration",cost:"Cost"},status:{pending:"Pending",running:"Running",completed:"Completed",delivered:"Delivered",failed:"Failed",cancelled:"Cancelled",interrupted:"Interrupted",replaced:"Replaced",abandoned:"Abandoned"},kind:{job:"Job",inline:"Inline"},stats:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},batch:{selected:"{{count}} selected",cancel:"Cancel selected",rerun:"Re-run selected",confirmCancel:"Cancel {{count}} job(s)?",confirmCancelDesc:"Running jobs will be sent a stop signal. Already-completed jobs are unaffected.",confirmRerun:"Re-run {{count}} job(s)?",confirmRerunDesc:"New jobs will be created from the original prompts."},live:{connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"}},RI={title:"Subtasks",subtitle:"Per-conversation child tasks spawned by the parent agent.",empty:{title:"No subtasks yet",description:"Subtasks appear when an agent dispatches work to another agent inside a chat thread."},filter:{agent:"Parent agent",agentAny:"Any agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"Status",parent:"Parent",platform:"Platform",createdAt:"Created"},status:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed",cancelled:"Cancelled"}},PI={title:"Background jobs",subtitle:"Long-running scripts the agent wrappers (Claude Code / opencode / codex) launched via bgjob.",empty:{title:"No background jobs",description:"Background jobs show up here once an agent has used its bgjob wrapper. Roots come from ~/.claude/bgjobs/, ~/.config/opencode/bgjobs/, ~/.codex/bgjobs/ (override via IMHUB_BGJOB_ROOTS)."},filter:{root:"Root",rootAny:"All roots"},col:{name:"Name",status:"Status",root:"Root",pid:"PID",startedAt:"Started",endedAt:"Ended",exit:"Exit"},exitOk:"ok",stillRunning:"—"},II={title:"Schedules",subtitle:"Cron-style triggers that re-invoke an agent with a fixed prompt.",empty:{title:"No schedules configured",description:"Create a schedule from the agent's chat via `/cron set` or by running `agim cron create` in the CLI."},filter:{agent:"Agent",agentAny:"Any agent"},col:{id:"ID",name:"Name",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"Enabled",nextRun:"Next run",lastRun:"Last run"},enabled:"On",disabled:"Off"},LI={title:"Outbox",subtitle:"Pending IM-platform deliveries. The crash-safe queue retries on transient failures and parks unrecoverable ones in `giving_up`.",empty:{title:"Outbox is empty",description:"Messages move through the queue and are deleted on successful delivery. A non-empty outbox here means the queue is actively flushing or a delivery is stuck."},filter:{status:"Status",statusAny:"Any status",thread:"Thread key"},stats:{pending:"Pending",giving_up:"Giving up",delivered:"Delivered (lifetime)",lastDelivered:"Last delivery"},col:{id:"ID",status:"Status",platform:"Platform",preview:"Preview",thread:"Thread",kind:"Kind",attempts:"Attempts",createdAt:"Created",lastError:"Last error",jobId:"Job"},status:{pending:"Pending",delivered:"Delivered",giving_up:"Giving up"},action:{retry:"Retry",confirmRetry:"Re-queue this delivery?",confirmRetryDesc:"The row's status flips back to pending and the sender will attempt delivery again on the next tick."}},OI={title:"Agent ↔ Agent",subtitle:"Recent inline jobs spawned with a parent (one agent invoking another).",empty:{title:"No agent-to-agent calls yet",description:"Inline a2a calls appear here once an agent uses the `agim --invoke` tool with a parent context."},stats:{total:"Total",recent24h:"Last 24h",maxDepth:"Max depth"},col:{id:"ID",agent:"Agent",parent:"Parent",depth:"Depth",status:"Status",prompt:"Prompt",createdAt:"Created"}},_I={title:"Heartbeat bindings",subtitle:"Cross-thread view of every /heartbeat bind. Enable/disable a binding from here; create new ones from inside the IM thread itself (/heartbeat bind <body>).",refresh:"Refresh",empty:"No heartbeat bindings yet. Run /heartbeat bind <body> in any IM thread to create one.",col:{thread:"Thread",owner:"Owner",interval:"Interval",lastTick:"Last tick",enabled:"Enabled",body:"Body"},never:"never",pause:"Pause",enable:"Enable",show:"Show",hide:"Hide",enabledToast:"enabled binding",disabledToast:"disabled binding",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",intervalMin:"{{count}}m"},NI={title:"Active goals",subtitle:"Cross-thread view of every active /goal. Lifecycle controls (pause / complete / cancel) operate without the IM thread; creating a new goal still requires the thread context — /goal set <title>.",refresh:"Refresh",empty:"No active goals. Create one inside any IM thread with /goal set <title>.",col:{id:"#",thread:"Thread",title:"Title",progress:"Progress",updated:"Updated",actions:"Actions"},showBody:"Show body",hideBody:"Hide body",pause:"Pause",complete:"Complete",cancel:"Cancel",body:"Body",recentProgress:"Recent progress (latest {{count}})",created:"created {{at}}",closed:"closed {{at}}",statusUpdated:"Goal {{status}}"},DI={title:"Pending ask_user",subtitle:"Live list of every mcp__imhub__ask_user waiting on a reply. Cancelling here gives the agent the same response shape as a natural timeout (ok: false, reason: 'cancelled').",refresh:"Refresh",empty:"No pending asks. Auto-refreshes every 5s.",col:{reqId:"Req ID",thread:"Thread",question:"Question",choices:"Choices",age:"Age",actions:""},cancel:"Cancel",cancelConfirm:"Cancel pending ask {{id}}…?",cancelledToast:"Cancelled",justNow:"just now",seconds:"{{count}}s",minutes:"{{count}}m",hours:"{{count}}h"},MI={pageTitle:CI,subnav:AI,jobs:TI,subtasks:RI,bgjobs:PI,schedules:II,outbox:LI,a2a:OI,heartbeat:_I,goals:NI,asks:DI},jI="任务",FI={jobs:"作业",subtasks:"子任务",bgjobs:"后台脚本",schedules:"定时任务",outbox:"投递队列",a2a:"Agent 互调",heartbeat:"心跳",goals:"目标",asks:"待回答"},BI={title:"作业",subtitle:"Agent 的长任务调用与结果。",empty:{title:"暂无作业",description:"通过 `agim --invoke` 或聊天里的 /run 命令异步启动 Agent 时会自动生成作业记录。"},filter:{status:"状态",statusAny:"全部状态",agent:"Agent",agentAny:"全部 Agent",kind:"类型",kindAny:"全部类型"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",createdAt:"创建时间",duration:"耗时",cost:"成本"},status:{pending:"等待中",running:"运行中",completed:"已完成",delivered:"已送达",failed:"失败",cancelled:"已取消",interrupted:"已中断",replaced:"已替换",abandoned:"已放弃"},kind:{job:"作业",inline:"即时"},stats:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败"},batch:{selected:"已选 {{count}} 项",cancel:"取消所选",rerun:"重跑所选",confirmCancel:"确认取消 {{count}} 个作业?",confirmCancelDesc:"运行中的作业会收到停止信号。已完成的作业不受影响。",confirmRerun:"确认重跑 {{count}} 个作业?",confirmRerunDesc:"将根据原 Prompt 重新创建作业。"},live:{connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"}},HI={title:"子任务",subtitle:"由父 Agent 在对话内派发出的子任务列表。",empty:{title:"暂无子任务",description:"当 Agent 在聊天线程内向其他 Agent 委派工作时,子任务会出现在这里。"},filter:{agent:"父 Agent",agentAny:"全部 Agent"},col:{id:"ID",agent:"Agent",prompt:"Prompt",status:"状态",parent:"父级",platform:"平台",createdAt:"创建时间"},status:{pending:"等待中",running:"运行中",completed:"已完成",failed:"失败",cancelled:"已取消"}},UI={title:"后台脚本",subtitle:"Agent 封装(Claude Code / opencode / codex)通过 bgjob 启动的长任务进程。",empty:{title:"暂无后台脚本",description:"当 Agent 使用其 bgjob 封装时,记录会在这里出现。Root 路径默认取 ~/.claude/bgjobs/、~/.config/opencode/bgjobs/、~/.codex/bgjobs/(可通过 IMHUB_BGJOB_ROOTS 覆盖)。"},filter:{root:"Root",rootAny:"全部 Root"},col:{name:"名称",status:"状态",root:"Root",pid:"PID",startedAt:"开始时间",endedAt:"结束时间",exit:"退出码"},exitOk:"ok",stillRunning:"—"},zI={title:"定时任务",subtitle:"Cron 触发的 Agent 调用 — 按固定 Prompt 重新执行。",empty:{title:"暂无定时任务",description:"可在聊天中通过 `/cron set` 或 CLI `agim cron create` 创建定时任务。"},filter:{agent:"Agent",agentAny:"全部 Agent"},col:{id:"ID",name:"名称",agent:"Agent",cron:"Cron",prompt:"Prompt",enabled:"启用",nextRun:"下次运行",lastRun:"上次运行"},enabled:"开",disabled:"关"},$I={title:"投递队列",subtitle:"面向 IM 平台的待投递消息队列。瞬态失败会自动重试;不可恢复的会停在 giving_up。",empty:{title:"投递队列为空",description:"消息成功投递后会被删除。如果这里非空,说明队列正在刷出消息,或某条消息卡住了。"},filter:{status:"状态",statusAny:"全部状态",thread:"Thread 标识"},stats:{pending:"待发送",giving_up:"放弃中",delivered:"已投递(累计)",lastDelivered:"最近投递"},col:{id:"ID",status:"状态",platform:"平台",preview:"内容",thread:"Thread",kind:"类型",attempts:"尝试次数",createdAt:"创建时间",lastError:"最后错误",jobId:"Job"},status:{pending:"待发送",delivered:"已投递",giving_up:"放弃中"},action:{retry:"重试",confirmRetry:"重新入队这条投递?",confirmRetryDesc:"状态会切回 pending,发送器会在下一轮 tick 再次尝试投递。"}},VI={title:"Agent 互调",subtitle:"带父级 ID 的最近 inline 作业(一个 Agent 调用另一个 Agent 的记录)。",empty:{title:"暂无 Agent 互调记录",description:"当某 Agent 使用 `agim --invoke` 工具并带上父级上下文时,这里会出现 inline a2a 调用记录。"},stats:{total:"累计",recent24h:"近 24 小时",maxDepth:"最大深度"},col:{id:"ID",agent:"Agent",parent:"父级",depth:"深度",status:"状态",prompt:"Prompt",createdAt:"创建时间"}},WI={title:"心跳绑定",subtitle:"跨线程查看所有 /heartbeat bind。可在此启用/停用绑定;新建绑定需在 IM 线程内执行 /heartbeat bind <body>。",refresh:"刷新",empty:"尚无心跳绑定。在任意 IM 线程执行 /heartbeat bind <body> 即可创建。",col:{thread:"线程",owner:"所有者",interval:"间隔",lastTick:"上次 tick",enabled:"启用",body:"正文"},never:"从未",pause:"暂停",enable:"启用",show:"展开",hide:"收起",enabledToast:"已启用绑定",disabledToast:"已停用绑定",justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前",intervalMin:"{{count}} 分钟"},KI={title:"活跃目标",subtitle:"跨线程查看所有活跃 /goal。生命周期操作(暂停/完成/取消)无需 IM 线程;新建目标仍需在线程内执行 /goal set <title>。",refresh:"刷新",empty:"暂无活跃目标。在任意 IM 线程执行 /goal set <title> 创建。",col:{id:"#",thread:"线程",title:"标题",progress:"进度",updated:"更新",actions:"操作"},showBody:"展开正文",hideBody:"收起正文",pause:"暂停",complete:"完成",cancel:"取消",body:"正文",recentProgress:"最近进度(最新 {{count}} 条)",created:"创建于 {{at}}",closed:"关闭于 {{at}}",statusUpdated:"目标已{{status}}"},qI={title:"待回答 ask_user",subtitle:"所有等待回复的 mcp__imhub__ask_user 实时列表。在此取消与超时相同(ok: false, reason: 'cancelled')。",refresh:"刷新",empty:"暂无待回答。每 5 秒自动刷新。",col:{reqId:"请求 ID",thread:"线程",question:"问题",choices:"选项数",age:"等待时长",actions:""},cancel:"取消",cancelConfirm:"取消待回答 {{id}}…?",cancelledToast:"已取消",justNow:"刚刚",seconds:"{{count}} 秒",minutes:"{{count}} 分",hours:"{{count}} 小时"},GI={pageTitle:jI,subnav:FI,jobs:BI,subtasks:HI,bgjobs:UI,schedules:zI,outbox:$I,a2a:VI,heartbeat:WI,goals:KI,asks:qI},YI="Approvals",QI="Pending tool invocations the agent is asking permission for.",XI={connected:"● Live",connecting:"● Connecting",reconnecting:"● Reconnecting",closed:"● Offline"},JI={pending:"Pending",totalAllowed:"Total allowed",totalDenied:"Total denied",totalTimedOut:"Timed out",totalReadonly:"Read-only auto-allowed"},ZI={title:"No approvals waiting",description:"The queue is empty. Tool requests show up here when an agent calls a tool that's not on its allow-list yet."},eL="Thread",tL="auto-allow",nL="Backend auto-allowed this read-only tool; the card is shown for visibility only.",rL="Allow",iL="Deny",oL={allowedShort:"Allowed",deniedShort:"Denied"},aL={pageTitle:YI,subtitle:QI,live:XI,stats:JI,empty:ZI,threadLabel:eL,autoAllowedTag:tL,autoAllowedTitle:nL,allow:rL,deny:iL,toast:oL},sL="审批",lL="Agent 等待批准的工具调用。",cL={connected:"● 实时",connecting:"● 连接中",reconnecting:"● 重连中",closed:"● 离线"},uL={pending:"待审批",totalAllowed:"累计放行",totalDenied:"累计拒绝",totalTimedOut:"超时",totalReadonly:"只读自动放行"},dL={title:"暂无待审批请求",description:"队列为空。当 Agent 调用尚未加入白名单的工具时,请求会在这里出现。"},fL="Thread",hL="自动放行",pL="后端已对该只读工具自动放行;此处仅供可见性展示。",mL="放行",gL="拒绝",yL={allowedShort:"已放行",deniedShort:"已拒绝"},vL={pageTitle:sL,subtitle:lL,live:cL,stats:uL,empty:dL,threadLabel:fL,autoAllowedTag:hL,autoAllowedTitle:pL,allow:mL,deny:gL,toast:yL},bL="Reminders",xL="Queued reminders waiting to fire. Cancel or snooze pending ones; fired and cancelled rows are kept for audit.",wL={status:"Status",statusAny:"Any status"},SL={pending:"Pending",firing:"Firing",fired:"Fired",cancelled:"Cancelled",failed:"Failed"},kL={slash:"/remind",mcp:"MCP",api:"API"},EL={literal:"Literal",llm:"LLM"},CL={title:"Nothing scheduled",description:"Reminders show up here once an agent (via /remind, MCP, or API) queues one. Filter by status to see fired or cancelled ones."},AL={id:"ID",fireAt:"Fires",text:"Text",status:"Status",platform:"Platform",thread:"Thread",source:"Source",recurrence:"Recurrence",createdAt:"Created"},TL={cancel:"Cancel",snooze:"Snooze",confirmCancel:"Cancel this reminder?",confirmCancelDesc:"The reminder is removed from the queue. Recurring reminders won't fire again unless re-created."},RL={title:"Snooze reminder",description:"How long should it be pushed back?",preset5m:"5 minutes",preset30m:"30 minutes",preset1h:"1 hour",preset1d:"1 day",submit:"Snooze",toastOk:"Snoozed for {{duration}}"},PL={cancelled:"Reminder cancelled"},IL={pageTitle:bL,subtitle:xL,filter:wL,status:SL,source:kL,promptMode:EL,empty:CL,col:AL,action:TL,snooze:RL,toast:PL},LL="提醒",OL="排队待触发的提醒。可对 pending 的提醒做取消 / 延后;已触发与已取消的记录保留以备审计。",_L={status:"状态",statusAny:"全部状态"},NL={pending:"等待中",firing:"触发中",fired:"已触发",cancelled:"已取消",failed:"失败"},DL={slash:"/remind",mcp:"MCP",api:"API"},ML={literal:"原文",llm:"LLM"},jL={title:"暂无提醒",description:"当 Agent 通过 /remind、MCP 或 API 创建提醒时,记录会出现在这里。可切换状态查看已触发或已取消的记录。"},FL={id:"ID",fireAt:"触发时间",text:"内容",status:"状态",platform:"平台",thread:"Thread",source:"来源",recurrence:"周期",createdAt:"创建时间"},BL={cancel:"取消",snooze:"延后",confirmCancel:"确认取消这条提醒?",confirmCancelDesc:"该提醒会被移出队列。周期提醒在未重新创建前不会再触发。"},HL={title:"延后提醒",description:"延后多久?",preset5m:"5 分钟",preset30m:"30 分钟",preset1h:"1 小时",preset1d:"1 天",submit:"确认延后",toastOk:"已延后 {{duration}}"},UL={cancelled:"已取消"},zL={pageTitle:LL,subtitle:OL,filter:_L,status:NL,source:DL,promptMode:ML,empty:jL,col:FL,action:BL,snooze:HL,toast:UL},$L="Memos",VL="Long-term notes the operator captured for the agent — searchable by content, person, or location.",WL={placeholder:"Search memos…",who:"Who",what:"What",hasLocation:"Has location",includeExpired:"Include expired"},KL={title:"No memos match",description:"Memos are created from chat via `/memo` or auto-extracted by the memory subsystem. Try clearing filters or widening the search."},qL={id:"ID",what:"What",who:"Who",when:"When",where:"Where",platform:"Platform",createdAt:"Created",expiresAt:"Expires"},GL={delete:"Delete",confirmDelete:"Delete this memo?",confirmDeleteDesc:"This cannot be undone. The memory subsystem still has any embeddings derived from this memo until a backfill prune lands."},YL={label:"Open map",baidu:"Baidu Maps",apple:"Apple Maps",google:"Google Maps",osm:"OpenStreetMap"},QL={deleted:"Memo deleted"},XL={pageTitle:$L,subtitle:VL,search:WL,empty:KL,col:qL,action:GL,openMap:YL,toast:QL},JL="备忘",ZL="操作员为 Agent 记下的长期备忘 — 可按内容、人物、地点检索。",eO={placeholder:"搜索备忘…",who:"谁",what:"做什么",hasLocation:"含位置",includeExpired:"包含过期"},tO={title:"未匹配到备忘",description:"备忘通过聊天中的 `/memo` 命令或记忆子系统自动抽取生成。可清空筛选或放宽搜索条件再试。"},nO={id:"ID",what:"事项",who:"对象",when:"时间",where:"地点",platform:"平台",createdAt:"创建时间",expiresAt:"过期时间"},rO={delete:"删除",confirmDelete:"确认删除此备忘?",confirmDeleteDesc:"操作不可撤销。记忆子系统中由此备忘衍生的 embedding 在下一次 backfill 清理前仍会保留。"},iO={label:"在地图中打开",baidu:"百度地图",apple:"Apple 地图",google:"Google 地图",osm:"OpenStreetMap"},oO={deleted:"已删除"},aO={pageTitle:JL,subtitle:ZL,search:eO,empty:tO,col:nO,action:rO,openMap:iO,toast:oO},sO="Memory",lO="Per-user facts the agent has accumulated. Long-term memory that survives session resets.",cO={label:"User",placeholder:"Pick a user",factsLabel:"{{count}} facts",personaTag:"persona"},uO={title:"Pick a user to view their memory",description:"Memory is partitioned per user_key (platform:userId). The dropdown above lists every user whose memory has any rows in the bank."},dO={facts:"Facts",persona:"Persona",vector:"Vector",skills:"Skills"},fO={title:"Facts",empty:{title:"No facts yet",description:"Facts accumulate as the agent extracts them from chat history during memory consolidation. Triggering `/memory consolidate` from chat (or the Persona tab's button when it lands) seeds this list."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},category:{fact:"Fact",preference:"Preference",goal:"Goal",history:"History",profile:"Profile"},col:{id:"ID",what:"What",category:"Category",confidence:"Confidence",source:"Source",createdAt:"Created"},batch:{selected:"{{count}} selected",deleteSelected:"Delete selected",confirmDelete:"Delete {{count}} fact(s)?",confirmDeleteDesc:"This removes the rows from the bank. The vector index keeps any embedding derived from these rows until the next backfill prune."},action:{delete:"Delete",confirmDelete:"Delete this fact?",confirmDeleteDesc:"This row is removed permanently. The vector index retains its embedding until the next backfill prune."},toast:{deletedOne:"Fact deleted",deletedMany:"Deleted {{count}} facts"}},hO={title:"Persona",subtitle:"Long-form summary of who this user is, refined by periodic consolidation of their facts.",empty:{title:"No persona yet",description:"Personas are written by the consolidation pass — run it from the button below once enough facts have accumulated."},updated:"Updated {{at}}",editorLabel:"Persona summary",save:"Save",saved:"Saved",delete:"Delete persona",confirmDelete:"Delete this persona?",confirmDeleteDesc:"The persona summary is removed from the bank. Facts the persona was derived from stay in place; the next consolidate pass will rewrite a fresh one.",consolidate:{trigger:"Run consolidation",triggering:"Starting…",running:"Consolidation running…",doneOk:"Consolidation complete",doneFailed:"Consolidation failed",lastRun:"Last run {{at}}",result:"Processed {{users}} user(s), {{updated}} persona(s) updated"}},pO={title:"Vector backend",subtitle:"Embeddings power hybrid recall on memory facts. The active backend, model, and per-user coverage live here.",config:{title:"Backend configuration",hint:"Backend selection + OpenAI / local-model parameters live in env. Edit `~/.agim/env` on the host (or set systemd `Environment=`); the `IMHUB_MEMORY_VECTOR_*` keys are listed below.",editLink:"env file"},form:{title:"Backend configuration",hint:"Pick a backend, fill in the parameters, then save & test. Changes hit the env file and reload in-process; a restart re-reads them.",dirty:"Unsaved changes",discard:"Discard",saveAndTest:"Save & test",savedToast:"Saved — running test…",nothingChanged:"Nothing to save",backend:"Backend",backendHelp:"off = vector recall disabled; local = on-device BGE; openai = OpenAI-compatible remote endpoint",backendOff:"Off",backendLocal:"Local (BGE)",backendOpenai:"OpenAI-compatible",localModel:"Local model",localModelHelp:"Xenova model id, defaults to Xenova/bge-base-zh-v1.5. First-time use needs a manual download.",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI-compatible endpoint root, e.g. https://api.openai.com/v1 or your self-hosted gateway.",openaiModel:"Model",openaiModelHelp:"Embedding model id, defaults to text-embedding-3-small. Match your provider's docs for other endpoints.",openaiApiKey:"API key",apiKeyKeepHint:"Leave blank to keep the existing key (placeholder shows the masked value); typing replaces it.",apiKeyNewHint:"Paste your OpenAI-compatible API key (only the server sees the raw value after save).",toggleApiKey:"Show / hide API key",batchSize:"Batch size",batchSizeHelp:"Max texts per embed call, 1–1024 (default 32).",hybridWeight:"Hybrid weight",hybridWeightHelp:"Vector branch weight when fusing with FTS5 recall, 0–1 (default 0.5).",errors:{baseUrlRequired:"Base URL is required",baseUrlInvalid:"Base URL is not a valid URL",openaiModelRequired:"Embedding model id is required",apiKeyRequired:"API key is required for the OpenAI backend on first setup",localModelRequired:"Local model id is required",batchSizeRange:"Batch size must be between 1 and 1024",hybridWeightRange:"Hybrid weight must be between 0 and 1"}},backendLabel:"Backend",modelLabel:"Model",dimsLabel:"Dimensions",readyTrue:"Ready",readyFalse:"Not ready",downloadedTrue:"Files on disk",lastError:"Last error",coverage:{title:"Coverage",total:"Facts",withEmbedding:"Embedded",withDifferentModel:"Mismatched model",scope_user:"for {{userKey}}",scope_global:"across every user"},actions:{title:"Maintenance",test:"Test",testOk:"Backend test OK",testFail:"Backend test failed: {{detail}}",download:"Download model",downloadStarted:"Download started",downloadAlreadyReady:"Model is already ready",backfill:"Backfill embeddings",backfillStarted:"Backfill started",backfillNotReady:"Backend not ready — run download first",clear:"Clear embeddings",clearStarted:"Cleared {{count}} embedding(s)",confirmClear:"Clear all embeddings?",confirmClearDesc:"Drops the embedding column for {{scope}}. Facts themselves stay; you'll need to backfill again before vector recall works."},jobs:{title:"Recent jobs",empty:"No recent jobs",phase:{running:"Running",done:"Done",failed:"Failed"}}},mO={title:"Skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills installed",description:"Drop a SKILL.md (with `name` and `description` frontmatter) under one of the configured roots and refresh."},filter:{search:"Search",category:"Category",categoryAny:"All categories"},sources:{title:"Source directories",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Available to"}},gO={pageTitle:sO,subtitle:lO,userPicker:cO,noUserSelected:uO,tabs:dO,facts:fO,persona:hO,vector:pO,skills:mO},yO="记忆",vO="Agent 为每个用户积累的事实库。跨会话保留的长期记忆。",bO={label:"用户",placeholder:"选择一个用户",factsLabel:"{{count}} 条事实",personaTag:"persona"},xO={title:"选择一个用户查看其记忆",description:"记忆按 user_key(platform:userId)分隔。上方下拉列出每位在库中有任何记忆数据的用户。"},wO={facts:"事实",persona:"Persona",vector:"向量",skills:"技能"},SO={title:"事实",empty:{title:"暂无事实",description:"Agent 在记忆整理过程中会从聊天历史中抽取事实。可在聊天里运行 `/memory consolidate` 或后续 Persona 子页内的按钮触发整理。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},category:{fact:"事实",preference:"偏好",goal:"目标",history:"历史",profile:"档案"},col:{id:"ID",what:"内容",category:"类别",confidence:"置信度",source:"来源",createdAt:"创建时间"},batch:{selected:"已选 {{count}} 项",deleteSelected:"删除所选",confirmDelete:"确认删除 {{count}} 条事实?",confirmDeleteDesc:"记忆库中的这些行将被删除。向量索引中相应的 embedding 在下一次 backfill 清理前仍会保留。"},action:{delete:"删除",confirmDelete:"确认删除此事实?",confirmDeleteDesc:"该行被永久删除。向量索引会在下一次 backfill 清理前保留对应 embedding。"},toast:{deletedOne:"已删除",deletedMany:"已删除 {{count}} 条"}},kO={title:"Persona",subtitle:"该用户的长篇画像,由记忆整理任务从事实库中提炼。",empty:{title:"暂无 Persona",description:"Persona 由整理任务生成。当事实积累到一定量后,点击下方按钮运行整理。"},updated:"更新于 {{at}}",editorLabel:"Persona 内容",save:"保存",saved:"已保存",delete:"删除 Persona",confirmDelete:"确认删除此 Persona?",confirmDeleteDesc:"Persona 概要会从库中删除。生成它的事实仍保留,下一次整理会重新生成。",consolidate:{trigger:"运行整理",triggering:"启动中…",running:"整理进行中…",doneOk:"整理完成",doneFailed:"整理失败",lastRun:"上次运行:{{at}}",result:"处理 {{users}} 位用户,更新 {{updated}} 条 Persona"}},EO={title:"向量后端",subtitle:"Embedding 驱动事实库的混合检索。当前后端、模型与每位用户的覆盖情况都在这里。",config:{title:"后端配置",hint:"后端选择与 OpenAI / 本地模型的参数都通过环境变量配置。请在宿主机直接编辑 `~/.agim/env`(或 systemd unit 的 `Environment=`),下方列出的 `IMHUB_MEMORY_VECTOR_*` 系列 key 即对应字段。",editLink:"env file"},form:{title:"后端配置",hint:"选好后端、填好参数 → 保存并测试。配置只对本进程生效,重启服务后从 env 文件重新加载。",dirty:"有未保存的改动",discard:"放弃改动",saveAndTest:"保存并测试",savedToast:"已保存,正在测试…",nothingChanged:"没有需要保存的改动",backend:"后端",backendHelp:"off = 关闭向量召回;local = 本地 BGE 模型;openai = 调远程 OpenAI 协议端点",backendOff:"关闭",backendLocal:"本地(BGE)",backendOpenai:"OpenAI 协议远程",localModel:"本地模型",localModelHelp:"Xenova 仓库的 model id,默认 Xenova/bge-base-zh-v1.5;首次使用需手动触发下载。",openaiBaseUrl:"Base URL",openaiBaseUrlHelp:"OpenAI 兼容端点根路径,例如 https://api.openai.com/v1 或自部署网关。",openaiModel:"模型",openaiModelHelp:"Embedding 模型 id,默认 text-embedding-3-small;用其他兼容端点请按其文档填写。",openaiApiKey:"API Key",apiKeyKeepHint:"留空 = 保留当前 key(占位显示为脱敏值);填了就会覆盖。",apiKeyNewHint:"粘贴你的 OpenAI 兼容 API Key(保存后只在服务端可见)。",toggleApiKey:"显示 / 隐藏 API Key",batchSize:"批大小",batchSizeHelp:"单次嵌入的最大文本数,1–1024,默认 32。",hybridWeight:"混合权重",hybridWeightHelp:"FTS5 与向量召回融合时向量分支的权重,0–1,默认 0.5。",errors:{baseUrlRequired:"Base URL 不能为空",baseUrlInvalid:"Base URL 不是合法 URL",openaiModelRequired:"Embedding 模型 id 不能为空",apiKeyRequired:"首次使用 OpenAI 后端需要填 API Key",localModelRequired:"本地模型 id 不能为空",batchSizeRange:"批大小需在 1–1024 之间",hybridWeightRange:"混合权重需在 0–1 之间"}},backendLabel:"后端",modelLabel:"模型",dimsLabel:"维度",readyTrue:"就绪",readyFalse:"未就绪",downloadedTrue:"已下载",lastError:"最近错误",coverage:{title:"覆盖率",total:"事实总数",withEmbedding:"已嵌入",withDifferentModel:"模型不匹配",scope_user:"(针对 {{userKey}})",scope_global:"(全部用户)"},actions:{title:"维护",test:"测试",testOk:"后端测试通过",testFail:"后端测试失败:{{detail}}",download:"下载模型",downloadStarted:"下载已开始",downloadAlreadyReady:"模型已就绪",backfill:"回填 embedding",backfillStarted:"回填已开始",backfillNotReady:"后端未就绪 — 请先下载",clear:"清空 embedding",clearStarted:"已清空 {{count}} 条",confirmClear:"确认清空全部 embedding?",confirmClearDesc:"会丢弃 {{scope}} 的 embedding 列。事实本身保留;下次回填前向量检索不可用。"},jobs:{title:"近期任务",empty:"暂无任务",phase:{running:"运行中",done:"完成",failed:"失败"}}},CO={title:"技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},AO={pageTitle:yO,subtitle:vO,userPicker:bO,noUserSelected:xO,tabs:wO,facts:SO,persona:kO,vector:EO,skills:CO},TO="Skills",RO={installed:"Installed",hot:"Hot on skillhub.cn"},PO={title:"Installed skills",subtitle:"SKILL.md files the host agents pick up from ~/.claude/skills/ + ~/.config/opencode/skills/.",empty:{title:"No skills",description:"Drop a SKILL.md with `name` + `description` frontmatter under a configured root and refresh."},filter:{search:"Search",category:"Category",categoryAny:"Any category"},sources:{title:"Sources",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"Loading SKILL.md…",loadFailed:"Failed to load skill detail",metadataLabel:"Metadata",agentsLabel:"Picked up by"}},IO={title:"Hot on skillhub.cn",subtitle:"Live top entries from skillhub.cn (cached 5 min on the server). Click a row for the install commands. agim never auto-runs installs — you copy the command and paste into shell or IM.",openHub:"Open skillhub.cn",loading:"Loading…",empty:"No data",cached:"cache hit",stale:"upstream unreachable — serving stale",updatedAt:"updated {{at}}",col:{slug:"slug",name:"Name / description",stars:"stars",installs:"installs"},detail:{version:"Version",category:"Category",stars:"Stars",installs:"Installs",downloads:"Downloads",howInstall:"How to install (pick one; agim never auto-runs)",copy:"Copy",copied:"Copied",label:{cliInstall:"On host (recommended)",cliSearch:"Dry-run first",imAsk:"Ask an IM agent"},hint:"The two CLI commands need skillhub CLI installed on the host first. See docs/skills.md or skillhub.cn."}},LO={pageTitle:TO,subnav:RO,installed:PO,hot:IO},OO="技能",_O={installed:"已安装",hot:"skillhub.cn 热门"},NO={title:"已安装的技能",subtitle:"宿主 Agent 从 ~/.claude/skills/ + ~/.config/opencode/skills/ 中识别的 SKILL.md 文件。",empty:{title:"暂无技能",description:"在已配置的 root 目录下放一个带 `name` + `description` frontmatter 的 SKILL.md,然后刷新。"},filter:{search:"搜索",category:"类别",categoryAny:"全部类别"},sources:{title:"源目录",claude:"Claude Code",opencode:"opencode"},agentTag:{claude:"claude",opencode:"opencode"},detail:{loading:"正在加载 SKILL.md…",loadFailed:"加载技能详情失败",metadataLabel:"元数据",agentsLabel:"可用于"}},DO={title:"skillhub.cn 热门",subtitle:"实时拉取 skillhub.cn 热门下载(服务端 5 分钟缓存)。点击任意条目查看安装命令。agim 不会自动跑安装——命令复制后由你贴去 shell 或 IM 触发。",openHub:"前往 skillhub.cn",loading:"正在加载…",empty:"暂无数据",cached:"缓存命中",stale:"上游不可达,使用旧数据",updatedAt:"更新于 {{at}}",col:{slug:"slug",name:"名称 / 描述",stars:"stars",installs:"installs"},detail:{version:"版本",category:"类别",stars:"stars",installs:"installs",downloads:"downloads",howInstall:"安装方式(任选一个;agim 不会自动跑)",copy:"复制",copied:"已复制",label:{cliInstall:"Host 上跑(推荐)",cliSearch:"先查再装",imAsk:"在 IM 里让 agent 装"},hint:"前两条要先在 host 上安装 skillhub CLI。详见 docs/skills.md 或 skillhub.cn。"}},MO={pageTitle:OO,subnav:_O,installed:NO,hot:DO},jO="Workspace",FO="Read and edit files in the per-agent working directories (`AGENT_CWD`).",BO={label:"Agent",placeholder:"Pick an agent",online:"online",offline:"offline"},HO={title:"Pick an agent to browse its workspace",description:"Each registered agent runs from its own CWD. The picker lists every agent the registry knows about; the green dot next to a name means it reports available."},UO={title:"Files",loading:"Loading…",empty:"(empty directory)",up:"Up",rootLabel:"(workspace root)",binary:"binary",symlinkEscape:"symlink → outside workspace, hidden",broken:"unreadable"},zO={noFile:"Select a file from the tree to view or edit it.",binary:"This file looks binary (base64-encoded) — editing not supported.",truncated:"File is over 1 MiB; only the first 1 MiB is shown. Saving from here would replace the whole file with the truncated content — close without saving.",save:"Save",saving:"Saving…",savedMeta:"Saved · {{size}} bytes · {{at}}",dirtyHint:"Unsaved changes",loadFailed:"Failed to load file"},$O={saved:"Saved {{path}}"},VO={pageTitle:jO,subtitle:FO,agentPicker:BO,noAgent:HO,tree:UO,editor:zO,toast:$O},WO="工作区",KO="在每个 Agent 的工作目录(`AGENT_CWD`)下浏览与编辑文件。",qO={label:"Agent",placeholder:"选择一个 Agent",online:"在线",offline:"离线"},GO={title:"选择一个 Agent 来浏览其工作区",description:"每个已注册的 Agent 都有自己的 CWD。下拉列出注册表中所有已知的 Agent;名字旁的绿点表示该 Agent 当前可用。"},YO={title:"文件",loading:"加载中…",empty:"(目录为空)",up:"返回上级",rootLabel:"(工作区根目录)",binary:"二进制",symlinkEscape:"符号链接指向工作区外,已隐藏",broken:"不可读"},QO={noFile:"从左侧选择一个文件查看或编辑。",binary:"该文件是二进制(base64 编码)— 不支持编辑。",truncated:"文件超过 1 MiB;仅显示前 1 MiB。直接保存会用截断内容覆盖整个文件 — 请关闭而不要保存。",save:"保存",saving:"保存中…",savedMeta:"已保存 · {{size}} 字节 · {{at}}",dirtyHint:"有未保存的修改",loadFailed:"加载文件失败"},XO={saved:"已保存 {{path}}"},JO={pageTitle:WO,subtitle:KO,agentPicker:qO,noAgent:GO,tree:YO,editor:QO,toast:XO},ZO="Observability",e_="Operational health: invocation totals, top-N leaderboards, and the audit timeline.",t_={health:"Health",topn:"Top-N",audit:"Audit"},n_={label:"Window",days_one:"{{count}} day",days_other:"{{count}} days"},r_={title:"Health",totals:"Totals",byDay:"By day",kpi:{calls:"Calls",cost:"Cost",errors:"Errors",errorRate:"Error rate",avgLatencyMs:"Avg latency",p95LatencyMs:"P95 latency"},byDayCol:{date:"Date",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data in this window",description:"No invocations recorded in the selected time window. Widen the window or wait for an agent call to fire."}},i_={title:"Top-N",filter:{dim:"Group by",metric:"Rank by"},dim:{user:"User",agent:"Agent",platform:"Platform",intent:"Intent"},metric:{cost:"Cost",calls:"Calls",errors:"Errors",avg_latency:"Avg latency"},col:{rank:"#",key:"Key",calls:"Calls",cost:"Cost",errors:"Errors",avgLatencyMs:"Avg latency"},empty:{title:"No data",description:"No invocations matched the filters."}},o_={title:"Audit",stats:{total:"Total",totalCost:"Total cost"},filter:{agent:"Agent",platform:"Platform",user:"User",intent:"Intent"},col:{ts:"Time",trace:"Trace",agent:"Agent",platform:"Platform",user:"User",intent:"Intent",duration:"Duration",cost:"Cost",outcome:"Outcome"},outcome:{ok:"ok",fail:"fail"},empty:{title:"No invocations",description:"Audit rows appear here when an agent is invoked. Adjust filters or widen the window."}},a_={pageTitle:ZO,subtitle:e_,tabs:t_,window:n_,health:r_,topn:i_,audit:o_},s_="观测",l_="运行健康:调用总量、Top-N 排行与审计时间线。",c_={health:"健康",topn:"Top-N",audit:"审计"},u_={label:"时间窗口",days_one:"{{count}} 天",days_other:"{{count}} 天"},d_={title:"健康",totals:"总览",byDay:"每日明细",kpi:{calls:"调用",cost:"成本",errors:"错误",errorRate:"错误率",avgLatencyMs:"平均延迟",p95LatencyMs:"P95 延迟"},byDayCol:{date:"日期",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"时间窗口内无数据",description:"所选时间范围内没有任何调用记录。可以放宽时间窗口或等待 Agent 被调用。"}},f_={title:"Top-N",filter:{dim:"分组维度",metric:"排序依据"},dim:{user:"用户",agent:"Agent",platform:"平台",intent:"意图"},metric:{cost:"成本",calls:"调用",errors:"错误",avg_latency:"平均延迟"},col:{rank:"#",key:"Key",calls:"调用",cost:"成本",errors:"错误",avgLatencyMs:"平均延迟"},empty:{title:"暂无数据",description:"当前筛选下没有调用记录。"}},h_={title:"审计",stats:{total:"累计",totalCost:"累计成本"},filter:{agent:"Agent",platform:"平台",user:"用户",intent:"意图"},col:{ts:"时间",trace:"Trace",agent:"Agent",platform:"平台",user:"用户",intent:"意图",duration:"耗时",cost:"成本",outcome:"结果"},outcome:{ok:"成功",fail:"失败"},empty:{title:"暂无调用",description:"当 Agent 被调用时,审计记录会出现在这里。可调整筛选或放宽时间窗口。"}},p_={pageTitle:s_,subtitle:l_,tabs:c_,window:u_,health:d_,topn:f_,audit:h_},m_="Settings",g_="Operational configuration: environment variables and service lifecycle.",y_={messengers:"Messengers",email:"Email (SMTP)",viewer:"Viewer & Maps",agents:"Agents",llm:"LLM Backends",mcp:"MCP Servers",nativeAgent:"Native Agent",search:"Web search",agimSkills:"agim Skills",policy:"Policy",security:"Security",workspaces:"Workspaces",admins:"Admins",env:"Env Vars",service:"Service"},v_={title:"Agents",subtitle:"Built-in agent adapters. Enable the ones whose CLI is installed on this host; pick which one handles unrouted messages by default.",installHint:"Not installed. `npm install -g {{pkg}}` on the host.",aliasesLabel:"Aliases",online:"online",offline:"offline",defaultAgent:"Default agent",defaultAgentHint:"Used when the intent classifier has no preference (new web threads, etc.). Only enabled + online agents appear here.",noEligible:"No eligible default",saveBtn:"Save",saving:"Saving…",dirtyHint:"Unsaved changes",discard:"Discard",toast:{saved:"Saved"},acp:{title:"Remote agents (ACP)",subtitle:"Agents reachable over HTTP via the Agent Communication Protocol. Each entry persists in config and registers on the next service restart.",discoverBtn:"Discover",runDiscover:"Probe",baseUrl:"Discovery URL",baseUrlHint:"Probes `<base>/.well-known/acp` and adds the entries it lists. Skips names already present.",addTitle:"Add agent",name:"Name",nameHint:"Stable identifier; letters, digits, `._-`.",aliases:"Aliases",aliasesHint:"Comma-separated; routed via `/alias` in chat.",endpoint:"Endpoint",endpointHint:"Base URL of the agent's ACP root (no trailing `/`).",authType:"Auth",auth:{none:"None",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"Paste token",testBtn:"Test",addBtn:"Add",removeBtn:"Remove",on:"on",off:"off",dupName:"An agent with this name already exists.",empty:{title:"No remote agents",description:"Add an ACP endpoint below or use Discover for a `.well-known/acp` directory."},toast:{staged:"Staged. Save to persist.",testOk:"Reached `{{name}}`",testMasked:"Save first — token is masked, can't test in place.",discoverEmpty:"Nothing new to add.",discoverAdded_one:"Added {{count}} agent.",discoverAdded_other:"Added {{count}} agents."}}},b_={title:"Policy & toggles",subtitle:"Frequently-flipped switches that operate on env values under the hood. Each toggle persists immediately; the change applies on the next service restart unless the relevant module supports hot-reload (most do).",savingToast:"Saved",safety:{title:"Skip permissions (DANGEROUS)",description:"When ON, the Claude Code adapter passes `--dangerously-skip-permissions` to the wrapped CLI, bypassing every tool-use confirmation. Recommended OFF for production. Only enable for trusted, isolated workspaces.",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"production deployments should keep this OFF"},approval:{title:"Approval timeout default",description:'What the approval bus does when a pending tool-use request expires with no human reply. `Deny` is the safe default and keeps write-side calls (Bash / Edit / Write) gated; `Allow` is "user away" mode and lets the agent keep moving.',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"Deny on timeout",valAllow:"Allow on timeout"},memory:{title:"Long-term memory",description:"Master switch for the per-user memory subsystem (facts + persona + vector retrieval). Disabling stops new fact extraction and persona consolidation; the existing bank stays on disk.",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"Long-message viewer",description:"When ON, IM replies that exceed the viewer threshold are uploaded to the local paste store and the IM message becomes a short URL the user can click. Without it, long replies get truncated by the messenger.",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A notify mode",description:"How verbose the bus is when one agent calls another. `essential` (default) sends only headline events; `verbose` includes every transition; `off` silences cross-agent notifications entirely.",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"Essential",valVerbose:"Verbose",valOff:"Off"}},x_={title:"Messengers",subtitle:"Per-IM-platform connection settings. Toggle a platform on, fill in its credentials, and Save. The next service restart picks up the new config.",saveAll:"Save all",saving:"Saving…",savedToast:"Configuration saved",discardAll:"Discard changes",dirtyHint:"Unsaved changes",platform:{wechat:"WeChat",telegram:"Telegram",feishu:"Feishu (Lark)",dingtalk:"DingTalk",discord:"Discord"},hint:{wechat:"iLink-based QR login. Click Scan, scan the QR with your phone WeChat, confirm — the bot logs in as that account.",telegram:"Bot API token from @BotFather; channel id is optional and only used when targeting a specific chat.",feishu:"App credentials from the Lark developer console. App must have the messaging scopes.",dingtalk:"Stream API client credentials from the DingTalk developer console.",discord:"Bot token from the Discord developer portal. The bot must be invited to the target channel."},enabled:"Enabled",disabled:"Disabled",scanQr:"Scan QR",fields:{botToken:"Bot token",appId:"App ID",appSecret:"App secret",clientId:"Client ID",clientSecret:"Client secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"DM policy",groupPolicy:"Group policy",allowFrom:"DM allowFrom (staffIds, comma-separated)",groupAllowFrom:"Group allowFrom (staffIds, comma-separated)",ackReaction:"Ack-reaction",policy:{open:"open — anyone may talk",pairing:"pairing — first DMer pinned",allowlist:"allowlist — only listed IDs",disabled:"disabled — bot ignores groups"},ack:{off:"off — no ack glyph",emoji:"emoji ⏳→✅",kaomoji:"kaomoji (text-face)"},accountsTitle:"Extra accounts",accountDisabled:"disabled",accountsHint:"Each entry starts its own DWClient with isolated dmPolicy / allowFrom / ack-reaction. Restart agim after Save for new accounts to take effect.",accountsEmpty:"No extra accounts yet. Click ‘+ add account’ to wire another DingTalk bot.",addAccount:"Add account",accountName:"Display name (optional)",accountRenameCollision:'An account with id "{{id}}" already exists; pick another id.'},qr:{title:"Scan WeChat QR",description:"Open WeChat on your phone, scan this code, then confirm the login prompt inside WeChat.",starting:"Starting QR session…",loadFailed:"Failed to start QR session",expired:"QR code expired — close and start a new one.",cancelled:"Cancelled.",confirmed:"Login confirmed — wechat-ilink will start on the next service restart."}},w_={title:"Email (SMTP)",subtitle:"Outbound mail delivery for `/remind email me@x.com …`. Credentials persist to `~/.agim/.env`. Leave blank to disable.",cardTitle:"SMTP credentials",statusOn:"configured",statusOff:"disabled",host:"Host",hostHint:"Mail server hostname (e.g. `smtp.gmail.com`).",port:"Port",portHint:"Usually 465 (SSL) or 587 (STARTTLS).",user:"Username",userHint:"Login email; often the sender address too.",pass:"Password / app token",passHint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",from:"From",fromHint:"Sender header. Defaults to the username when blank.",secure:"TLS mode",secureHint:"`auto` follows the port; force SSL or STARTTLS if your provider requires it.",secureAuto:"auto (port-based)",secureTrue:"true (SSL, port 465)",secureFalse:"false (STARTTLS, port 587)",reveal:"Reveal",hide:"Hide",testBtn:"Test connection",testNeedsConfigured:"Save host / user / password first.",disableBtn:"Disable SMTP",saveBtn:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"SMTP saved",disabled:"SMTP disabled",noChanges:"Nothing to save"}},S_={title:"Viewer & Maps",subtitle:"Public-facing surfaces: the long-message Viewer (turns >threshold replies into a `/v/<id>` short link) and Baidu Maps AK (drives `/memo` address geocoding).",reveal:"Reveal",hide:"Hide",save:"Save",saving:"Saving…",discard:"Discard",dirtyHint:"Unsaved changes",toast:{saved:"Viewer settings saved"},viewer:{title:"Viewer (long-message links)",subtitle:"Replies longer than the chars / lines threshold are uploaded to the local paste store and the IM message becomes a short `/v/<id>` link.",on:"enabled",off:"disabled",enableLabel:"Enable the long-message Viewer",publicUrl:"Public base URL",publicUrlHint:"What the operator's reverse proxy / tunnel exposes. Used to build `/v/<id>` links.",tunnelMode:"Tunnel mode",tunnelOff:"off (use Public base URL)",tunnelQuick:"quick (cloudflared)",tunnelHint:"`quick` launches a Cloudflare quick tunnel and uses its URL when the operator hasn't fronted agim themselves.",remotePasteUrl:"Remote paste URL",remotePasteUrlHint:"POST markdown here to get a public URL back; overrides Public base URL + tunnel. Leave empty to use the community default https://viewer.iclaw.host/paste.",remotePasteToken:"Remote paste bearer token",remotePasteTokenHint:"Optional bearer token sent to the remote paste server. Required only if your paste server protects POSTs.",noDefaultRemote:"Disable community default",noDefaultRemoteLabel:"Don't fall back to viewer.iclaw.host when nothing else is configured",noDefaultRemoteHint:"v1.2.43+: when no mode is configured, agim defaults to remote mode against viewer.iclaw.host. Check this to disable that fallback (markdown stays inline if no other mode is set).",tunnelStatus:"Tunnel status",refreshTunnel:"Refresh",tunnelRunning:"Running",yes:"yes",no:"no",tunnelUrl:"Live URL",effectiveUrl:"Effective URL",binary:"cloudflared binary",binaryMissing:"not found in PATH — install from cloudflare/cloudflared releases",lastError:"Last error",tunnelLoading:"Loading tunnel status…",thresholds:"Thresholds",chars:"Max chars",charsHint:"Replies above this length route through Viewer.",lines:"Max lines",linesHint:"Same routing decision, on line count.",codeLines:"Max code lines",codeLinesHint:"Lower threshold for replies inside code fences.",maxPastes:"Paste store cap",maxPastesHint:"Older pastes are evicted FIFO once the count exceeds this."},baidu:{title:"Baidu Maps AK",subtitle:"Enables `/memo` address-to-coords lookup. Without it, /memo still works via raw coords or browser GPS share. Free AK: lbsyun.baidu.com → Console → Application → Server-side API.",configured:"configured",empty:"not set",placeholder:"32-char AK starting with a non-digit",hint:"Stored in `~/.agim/.env` (chmod 600). Masked unless Reveal is on.",suspicious:"AK length is {{length}} — usually a Baidu AK is 32 characters. Double-check?",clear:"Clear AK",toast:{saved:"Baidu Maps AK saved",cleared:"Baidu Maps AK cleared"}}},k_={title:"Workspaces",subtitle:"Multi-tenant workspace registry. Each workspace has its own agent whitelist, rate-limit, and (optionally) member list. The `default` workspace catches every unrouted user.",empty:{title:"Only the default workspace",description:"Add a workspace below to partition a team / project / customer. Each one gets its own agent whitelist + rate-limit."},col:{id:"ID",name:"Name",agents:"Agents",members:"Members",rateLimit:"Rate limit"},rateLimitFormat:"{{rate}} per {{intervalSec}}s, burst {{burst}}",membersOpen:"open (any user)",membersCount_one:"{{count}} member",membersCount_other:"{{count}} members",edit:"Edit",form:{title:"Add or edit a workspace",subtitleEdit:"Editing existing workspace — change id to clone, keep to upsert.",id:"ID",idHint:"Stable identifier; [a-zA-Z0-9_-]+; the special name `default` is reserved.",name:"Display name",agents:"Agent whitelist",agentsHint:"Comma-separated; empty = allow every registered agent.",members:"Member user IDs",membersHint:"Comma-separated `platform:userId`; empty = open workspace.",rateLimit:"Rate limit (optional)",rate:"Calls",intervalSec:"Per (seconds)",burst:"Burst",submit:"Save workspace",reset:"Clear form"},toast:{saved:"Workspace saved"}},E_={title:"Service",subtitle:"Inspect the running agim process + start, stop, or restart it.",modeLabel:"Mode",pidLabel:"PID",uptimeLabel:"Uptime",webLabel:"Web",bootPhaseLabel:"Boot phase",mode:{systemd:"systemd",background:"background",foreground:"foreground",none:"not running"},actions:{start:"Start",stop:"Stop",restart:"Restart",confirmStop:"Stop the agim service?",confirmStopDesc:"The web console, the messenger adapters, and any in-flight job will all stop. You'll need to start the service again before you can use it.",confirmRestart:"Restart the agim service?",confirmRestartDesc:"The process stops and re-starts. In-flight jobs are cancelled; outbox + queued reminders survive the bounce. The web console will be unreachable for ~5-30 seconds."},toast:{started:"Service started",stopped:"Service stopped",restarted:"Service restarted"},ports:{title:"Ports",subtitle:"Which ports agim binds when started. Leave blank to use the default. Changes apply on the next service restart (use the Restart button below after saving).",webPort:"Web port",webPortHint:"HTTP server for the chat UI + REST API. Default: {{default}}.",acpPort:"ACP port",acpPortHint:"Agent Communication Protocol server (remote agent surface). Default: {{default}}.",invalidPort:"Must be a number between 1 and 65535.",restartRequired:"Restart required",save:"Save",saving:"Saving…",discard:"Discard",toast:{saved:"Ports saved — restart agim to bind the new ports"}}},C_={title:"Security",subtitle:"Tool sandbox, SSRF block, sender allowlist, runtime audit. Changes persist to the env file immediately. Most native tools read process.env per call (hot-reload); exec sandbox + sender allowlist need a service restart to apply.",diagnostics:{title:"Runtime diagnostics",runningAsRoot:"Running as root",runningAsRootHelp:"Tool calls run with root privileges. Recommend creating a dedicated user + setting User= in the systemd unit.",envFilePerms:"Env file permissions",envFilePermsLax:"Too permissive (group/world readable)",envFilePermsOk:"0600 (owner-only)",bwrapAvailable:"bubblewrap installed",bwrapMissing:"Not installed (apt install bubblewrap)",senderAllowlist:"Sender allowlist",senderAllowlistOff:"Not configured (open access)",senderAllowlistOn:"Configured",adminAllowlist:"Admin allowlist",adminAllowlistOff:"Not configured (populated after first /setup)",adminAllowlistOn:"Configured"},sender:{title:"Sender allowlist (who can talk to the bot)",description:"Comma-separated platform:userId pairs, e.g. telegram:8754479311,wechat-ilink:wxid_abc. Set to * to mark 'everyone explicitly allowed'. Empty = open access (preserves backward compatibility; startup logs OPEN_IM_ACCESS).",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},exec:{title:"Native exec tool",description:"Sandbox + timeout controls for native_exec. Each invocation also goes through an IM approval card (unless previously auto-allowed by fingerprint).",sandbox:"Sandbox backend",sandboxNone:"None (plain spawn)",sandboxBwrap:"bubblewrap (Linux only)",sandboxBwrapMissing:"bubblewrap not installed",sandboxNet:"Sandbox network",sandboxNetOn:"Allowed (default)",sandboxNetOff:"Blocked (--unshare-net)",timeoutMs:"Command timeout (ms, default 60000)",maxOutput:"Per-stream output cap (bytes, default 32768)"},web:{title:"Native web tools",description:"SSRF defense and timeouts. CIDR whitelist lets you allow Tailscale / 100.64.0.0/10 / VPN ranges back in.",allowPrivate:"Allow all private ranges (not recommended)",allowPrivateHelp:"= 1 disables all private-IP checks. Only for trusted internal deployments.",ssrfWhitelist:"SSRF CIDR whitelist",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search timeout (ms, default 30000)"},fs:{title:"Native filesystem tools",description:"fs tools default to the native agent's per-thread workspace subtree.",restrict:"Restrict to workspace",restrictOn:"ON (recommended)",restrictOff:"OFF (allow any path; sensitive-paths denylist still applies)",timeoutMs:"fs tool timeout (ms, default 60000)"},delegation:{title:"Native call_agent cap",description:"Max mcp__imhub__call_agent invocations per turn. Prevents native from spinning on infinite delegations. 0 = unlimited.",envKey:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"default 2"},platformBlacklist:{title:"IM platform blacklist",description:"Comma-separated platform ids. Listed platforms are hidden from the CLI wizard, from this admin page, and registry.registerMessenger refuses to register them at boot — even if their credentials still live in the env file the adapter won't come up. Default empty (no blocks). Common ids: wechat-ilink / telegram / feishu / dingtalk / discord / email.",envKey:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"Currently in force"},diagnosticsPlatformBlacklist:"Platform blacklist",savingToast:"Saved.",resetTitle:"Reset to default"},A_={title:"Admin allowlist",subtitle:"IM-side users who can run admin-tier commands (`/admin promote`, `/admin token`, etc.). The list lives in `IMHUB_ADMIN_USERS`; this editor only works when the agim web port is bound locally.",configured:"Allowlist configured",notConfigured:"Allowlist not configured — anyone with the CLI bootstrap token can self-promote.",bootstrapAvailable:"Bootstrap token file present",bootstrapPath:"Token path",empty:"No admins added yet.",col:{platform:"Platform",userId:"User ID"},add:{title:"Add admin",platform:"Platform",userId:"User ID",submit:"Add"},remove:{label:"Remove",confirmTitle:"Remove this admin?",confirmDescription:"They lose access to all admin-tier commands. Re-add to restore."},toast:{added:"Admin added",removed:"Admin removed"}},T_={title:"Native LLM Backends",subtitle:"These backends power the in-process native agent and internal introspection callers (memo extraction, intent classification, notification evaluator, heartbeat). Backend metadata lives in ~/.agim/config.json; API keys live in ~/.agim/llm-secrets.json (0600) or the AGIM_LLM_SECRET_<NAME> env var.",refresh:"Refresh",backendsTitle:"Backends ({{count}})",backendsEmpty:"No LLM backends configured yet. Add one below.",rolesTitle:"Role Bindings",addTitle:"Add Backend",col:{name:"Name",provider:"Provider",model:"Model",baseUrl:"Base URL",apiKey:"API Key",actions:"Actions"},secretMissing:"missing",ping:"Ping",remove:"Remove",pinging:"pinging…",setKeyFirst:"set API key first",pingHint:"send a tiny chat probe",removeConfirm:'Remove backend "{{name}}"? Role bindings + API key will be cleared.',removedToast:"Removed (also cleared {{count}} role binding(s)).",roleUpdated:"Updated role {{role}}",unset:"(unset)",unbound:"(unbound)",roleHint:{cheap:"Internal introspection: memo extraction, intent classification, fallback chain stage 1.",evaluator:"Notification evaluator + router-compare judge LLM.","native-chat":"The /na agent loop default. Used when /cc native is invoked."},preset:"Provider preset",name:"Name",namePlaceholder:"e.g. deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"Model",modelPlaceholder:"model-id",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"sk-...",addBackend:"Add Backend",invalidPreset:"invalid preset",nameRequired:"name required",baseUrlRequired:"baseUrl required",modelRequired:"model required",addedWithKey:'Added "{{name}}" with API key',addedNoKey:'Added "{{name}}" (set key separately)',presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"Zhipu GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"Custom"}},R_={title:"External MCP Servers",subtitle:"Tools advertised by these servers are exposed to the in-process native agent (via mcp_<server>_<tool> naming). CLI agents have their own MCP configs and ignore this list. Header values may contain bearer tokens — admin-only.",refresh:"Refresh",serversTitle:"Servers ({{count}})",serversEmpty:"No MCP servers configured. Add one below — common picks: filesystem, github, postgres.",totalTools:"total tools: {{count}}",addTitle:"Add Server",col:{name:"Name",transport:"Transport",target:"Target",runtime:"Runtime",actions:"Actions"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"unknown",runtimeConnected:"connected · {{count}} tools",runtimeConnectedOne:"connected · {{count}} tool",runtimeDisconnected:"disconnected",health:"Health",remove:"Remove",probing:"probing…",removeConfirm:'Remove MCP server "{{name}}"?',removedToast:'Removed "{{name}}"',nameRequired:"name required",commandRequired:"command required for stdio transport",urlRequired:"url required for http/sse transport",headersInvalid:"headers must be valid JSON",addedToast:'Added "{{name}}"',nameLabel:"Name",namePlaceholder:"e.g. filesystem",transportLabel:"Transport",transportStdioOption:"stdio (subprocess)",transportHttpOption:"http / SSE",commandLabel:"Command",commandPlaceholder:"e.g. npx",argsLabel:"Args (space-separated)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers (JSON, optional)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"Add Server"},P_={title:"Native Agent · Evaluator · Heartbeat",subtitle:"Behavior knobs for the in-process native agent and the two LLM-driven gates (notification evaluator, heartbeat). LLM backend + role wiring lives on /settings/llm; this page covers what the agent + gates actually do at runtime.",llmLink:"/settings/llm",refresh:"Refresh",unsaved:"unsaved changes",discard:"Discard",save:"Save",savedToast:"Saved.",agentCard:"Native Agent (in-process)",evaluatorCard:"Notification Evaluator",heartbeatCard:"Heartbeat Scheduler",on:"on",off:"off",roleOverride:"Role override",roleHint:"LLM role the native loop resolves. Default: native-chat (falls back to cheap). Match a key from /settings/llm role bindings.",approvalMode:"Approval mode",approvalHint:"How tool calls from the native loop are gated.",modeReadOnly:"read-only (safe default; built-ins only)",modeAllowList:"allow-list (only autoAllow entries)",modeAllowAll:"allow-all (every tool, no gate)",modeDenyAll:"deny-all (no tools)",autoAllow:"Auto-allow tool prefixes",autoAllowHint:"Comma-separated. Tool names starting with any entry bypass the gate (e.g. native_,mcp_filesystem_).",denyList:"Deny-list tool prefixes",denyListHint:"Comma-separated. Always rejected regardless of mode (e.g. mcp_shell_).",evalDesc:"LLM gate that filters routine / empty agent-initiated push messages. Uses the evaluator role. Fail-open: LLM error or missing backend → message is delivered.",enableGate:"Enable gate",filterViaLlm:"Filter via LLM",evalSources:"Sources to gate",evalSourcesHint:"Comma-separated subset of: push, notify, reminder, heartbeat. Empty = default push,heartbeat.",hbDesc:"Periodic proactive wake-up loop. With this off, /heartbeat bind still works (saves the binding) but no scans run. Three-phase tick: DECIDE → EXECUTE → EVALUATE.",enableScheduler:"Enable scheduler",startScanLoop:"Start scan loop",tickInterval:"Tick interval (ms)",tickHint:"How often the scan loop checks due bindings. Default 60000.",defaultInterval:"Default binding interval (min)",defaultIntervalHint:"Minutes between ticks when a binding didn't specify one. Default 15.",runtimeCard:"Runtime caps (v1.2.126)",runtimeDesc:"Hard caps for native-agent tool calls + retries. All keys hot-reload; no restart needed. Leave blank to use defaults.",toolResultCap:"Max tool-result chars",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS. Truncates + appends a note. Default 64000.",toolTimeoutMs:"Per-tool timeout (ms)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS. Default 60000 (60 s).",blankRetryMax:"Blank-response retries",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX. Times to retry when the model returns empty text. Default 1.",lengthRecoveryMax:"Length-truncation continues",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX. Times to auto-continue on finishReason=length. Default 1.",a2aCard:"A2A sub-agent spawn (v1.2.127)",a2aDesc:"When the model calls `mcp__imhub__call_agent`, depth + timeout caps apply, and native→native fast-paths in-process. All hot-reload.",a2aMaxDepth:"Max recursion depth",a2aMaxDepthHint:"IMHUB_A2A_MAX_DEPTH. Hard cap on nested call_agent chains. Default 1.",a2aTimeoutMs:"Default timeout (ms)",a2aTimeoutMsHint:"IMHUB_A2A_TIMEOUT_DEFAULT_MS. Default 1800000 (30 min).",callAgentInProcess:"Native→native in-process",callAgentInProcessHint:"IMHUB_NATIVE_CALL_AGENT_IN_PROCESS. Off falls back to the CLI subprocess. Default on.",callAgentMaxPerTurn:"Calls per turn cap",callAgentMaxPerTurnHint:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN. 0 = unlimited. Default 2.",criticCard:"Early stop + critic (v1.2.127)",criticDesc:"Semantic stuck-loop kills 3-strike same-intent across tools. Critic is an opt-in goal-divergence detector.",semanticStuckLoop:"Semantic stuck-loop",semanticStuckLoopHint:"IMHUB_NATIVE_SEMANTIC_STUCK_LOOP. Default on; off disables the v1.2.122 cross-tool dedup.",criticEnabled:"Goal critic",criticEnabledHint:"IMHUB_NATIVE_CRITIC. Off by default; on enables off-track early-stop reviews.",criticRole:"Critic LLM role",criticRoleHint:"IMHUB_NATIVE_CRITIC_ROLE. Optional override (else uses main backend).",planModeDefault:"PlanMode default state",planModeDefaultHint:"IMHUB_NATIVE_PLAN_MODE. Default off; `/plan on` toggles per-thread regardless.",compactCard:"Auto-compact (v1.2.127)",compactDesc:"Head + summary + tail (OpenHands Condenser). Triggers when total chars > threshold; KEEP_FIRST preserves original goal.",compactTriggerChars:"Trigger chars",compactTriggerCharsHint:"IMHUB_NATIVE_COMPACT_TRIGGER_CHARS. Set 0 to disable. Default 60000.",compactKeepTurns:"Keep last N pairs",compactKeepTurnsHint:"IMHUB_NATIVE_COMPACT_KEEP_TURNS. Tail size in user/assistant turns. Default 6.",compactKeepFirst:"Keep first N user msgs",compactKeepFirstHint:"IMHUB_NATIVE_COMPACT_KEEP_FIRST. Head preserves original user goal(s). Default 1.",compactSummaryChars:"Summary char cap",compactSummaryCharsHint:"IMHUB_NATIVE_COMPACT_SUMMARY_CHARS. Cap on the LLM-generated summary. Default 1500.",streamCard:"Streaming + iteration (v1.2.127)",streamDesc:"Streaming preserves partial text on IM's 30-min hard timeout. Max-iter is the worst-case tool-call ceiling.",streamPartial:"Stream partial",streamPartialHint:"IMHUB_NATIVE_STREAM_PARTIAL. Default on; off uses legacy non-stream path.",maxIter:"Max iterations",maxIterHint:"IMHUB_NATIVE_AGENT_MAX_ITER. Clamped to [1,100]. Default 20."},I_={title:"Web search providers",subtitle:"Backend chain for the native_web_search tool. Falls through to the next provider on error. Clear a key to remove it; type to overwrite. All changes hot-reload.",refresh:"Refresh",save:"Save",discard:"Discard",unsaved:"Unsaved changes",savedToast:"Saved. Next search will use the new chain.",chainLabel:"Active chain:",chainEmpty:"no providers available",chainHint:"Resolved from IMHUB_WEB_SEARCH_PROVIDERS; only entries whose available() is true appear.",configured:"configured",missingKey:"missing key",noKey:"no key needed",moveUp:"Move up",moveDown:"Move down",testBtn:"Test",clearKey:"Clear",placeholderConfigured:"Saved (hidden) — leave blank to keep",placeholderEnter:"Enter new key",keyHint:"On Save, value is written to ~/.agim/env under {{envKey}}.",testOk:"{{provider}} ✓ {{hits}} hits / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},L_={title:"agim Skills",tab:{installed:"Installed",hot:"skillhub Hot"},reload:"Reload from disk",subtitle:"SKILL.md files loaded by src/core/skills/loader.ts. Tier-1 summary (name + description) is auto-injected into every agent system prompt; full body is read on-demand via mcp__imhub__read_skill. Workspace skills shadow bundled builtin skills by name.",reloadedToast:"Reloaded — {{count}} skill(s) on disk",selectHint:"Select a skill on the left, or click New to create one.",emptyList:"No skills loaded. Click New to create one (lands at ~/.agim/skills/<name>/SKILL.md).",unavailable:"unavailable",alwaysOn:"always-on",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"Not found.",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin (read-only via UI)",builtinShadowHint:"Builtin shown for reference. Save creates a workspace shadow that overrides it.",delete:"Delete",save:"Save",saveShadow:"Save (create workspace shadow)",savedToast:'Saved "{{name}}"',deleteConfirm:'Delete workspace skill "{{name}}"? The builtin (if any) will become visible again.',deletedToast:'Deleted "{{name}}"',new:"New",newTitle:"New skill",newName:"Skill name",newNamePlaceholder:"my-skill",newCreate:"Create",createdToast:'Created "{{name}}"',nameRequired:"name required",pathLabel:"Workspace path:",binsLabel:"Required bins:",envLabel:"Required env:",none:"none"},O_={pageTitle:m_,subtitle:g_,tabs:y_,agents:v_,policy:b_,messengers:x_,email:w_,viewerSettings:S_,workspaces:k_,service:E_,security:C_,admins:A_,llm:T_,mcp:R_,nativeAgent:P_,search:I_,agimSkills:L_},__="设置",N_="运维配置:环境变量与服务生命周期。",D_={messengers:"IM 平台",email:"邮件 (SMTP)",viewer:"Viewer & 地图",agents:"Agent",llm:"LLM 后端",mcp:"MCP 服务器",nativeAgent:"Native Agent",search:"Web 搜索",agimSkills:"agim Skills",policy:"策略",security:"安全",workspaces:"工作区",admins:"管理员",env:"环境变量",service:"服务"},M_={title:"Agent",subtitle:"内置 Agent 适配器。启用宿主机已安装 CLI 的;并选择一个作为默认 Agent(用于路由无法判定的消息)。",installHint:"未安装。在宿主机执行 `npm install -g {{pkg}}`。",aliasesLabel:"别名",online:"在线",offline:"未就绪",defaultAgent:"默认 Agent",defaultAgentHint:"意图分类无判定时使用(新建 web 线程等)。下拉只列出已启用且在线的 Agent。",noEligible:"无可选默认",saveBtn:"保存",saving:"保存中…",dirtyHint:"有未保存改动",discard:"放弃改动",toast:{saved:"已保存"},acp:{title:"远程 Agent (ACP)",subtitle:"通过 Agent Communication Protocol 接入的 HTTP Agent。每个条目持久化到 config,下次服务重启时注册。",discoverBtn:"批量发现",runDiscover:"探测",baseUrl:"发现地址",baseUrlHint:"探测 `<base>/.well-known/acp` 并追加返回的 Agent;同名条目自动跳过。",addTitle:"新增 Agent",name:"名称",nameHint:"稳定标识;只允许 字母 数字 `._-`。",aliases:"别名",aliasesHint:"逗号分隔;在 IM 内通过 `/alias` 路由。",endpoint:"Endpoint",endpointHint:"Agent 的 ACP 根路径(不带尾部 `/`)。",authType:"鉴权",auth:{none:"无",apikey:"API key",bearer:"Bearer"},token:"Token",tokenPlaceholder:"粘贴 token",testBtn:"测试",addBtn:"新增",removeBtn:"移除",on:"已启用",off:"已停用",dupName:"已存在同名 Agent。",empty:{title:"暂无远程 Agent",description:"下方填写 ACP endpoint 新增,或使用「批量发现」自动从 `.well-known/acp` 导入。"},toast:{staged:"已暂存,点击「保存」生效。",testOk:"已联通 `{{name}}`",testMasked:"Token 是掩码态,请先保存后再测试。",discoverEmpty:"没有可新增的 Agent。",discoverAdded_one:"已新增 {{count}} 个 Agent。",discoverAdded_other:"已新增 {{count}} 个 Agent。"}}},j_={title:"策略与开关",subtitle:"高频切换的开关,底层操作的是 env 值。每个开关变更后立即持久化;多数模块支持热加载,少数需要等下次服务重启。",savingToast:"已保存",safety:{title:"跳过权限确认(危险)",description:"打开后,Claude Code 适配器会向 CLI 传递 `--dangerously-skip-permissions`,跳过所有工具调用确认。生产环境强烈建议保持关闭;仅在隔离的可信工作区内启用。",envKey:"IMHUB_DANGEROUSLY_SKIP_PERMISSIONS",tagWarn:"生产部署建议保持关闭"},approval:{title:"审批超时默认行为",description:'当 pending 的工具调用无人响应而超时时审批 bus 的行为。`拒绝` 是安全默认值,会让 Bash / Edit / Write 等写入调用保持阻断;`放行` 是"用户离开"模式,让 Agent 继续运行。',envKey:"IMHUB_TIMEOUT_DEFAULT",valDeny:"超时拒绝",valAllow:"超时放行"},memory:{title:"长期记忆",description:"每用户记忆子系统(事实 + persona + 向量检索)的总开关。关闭后停止抽取新事实和 persona 整理;已有数据保留在磁盘。",envKey:"IMHUB_MEMORY_ENABLED"},viewer:{title:"长消息查看器",description:"打开后,超过阈值的 IM 回复会被上传到本地 paste 存储,IM 消息变成一个可点击的短链。关闭则消息会被 IM 平台截断。",envKey:"IMHUB_VIEWER_ENABLED"},a2aNotify:{title:"A2A 通知模式",description:"Agent 间互相调用时 bus 的提示详细程度。`essential`(默认)仅发关键事件;`verbose` 包含每次状态切换;`off` 完全静默跨 Agent 通知。",envKey:"IMHUB_A2A_NOTIFY_MODE",valEssential:"关键事件",valVerbose:"详细",valOff:"关闭"}},F_={title:"IM 平台",subtitle:"各 IM 平台的连接配置。打开开关、填写凭据、保存;下次服务重启即生效。",saveAll:"全部保存",saving:"保存中…",savedToast:"配置已保存",discardAll:"放弃改动",dirtyHint:"有未保存的改动",platform:{wechat:"微信",telegram:"Telegram",feishu:"飞书",dingtalk:"钉钉",discord:"Discord"},hint:{wechat:'基于 iLink 的扫码登录。点击 "扫码登录",用手机微信扫码并在弹窗中确认;机器人以该微信账号登录。',telegram:"@BotFather 申请的 Bot Token;Channel ID 可选,仅用于定向到特定群组。",feishu:"飞书开放平台的应用凭据。应用需开启消息权限。",dingtalk:"钉钉开发者后台的 Stream API 客户端凭据。",discord:"Discord 开发者门户的 Bot Token。需将机器人邀请到目标频道。"},enabled:"已启用",disabled:"未启用",scanQr:"扫码登录",fields:{botToken:"Bot Token",appId:"App ID",appSecret:"App Secret",clientId:"Client ID",clientSecret:"Client Secret",channelId:"Channel ID"},dingtalk:{dmPolicy:"私聊访问策略",groupPolicy:"群聊访问策略",allowFrom:"私聊白名单(staffId,英文逗号分隔)",groupAllowFrom:"群聊白名单(staffId,英文逗号分隔)",ackReaction:"ack 反馈方式",policy:{open:"open — 任何人都能对话",pairing:"pairing — 第一个私聊的人锁定为唯一对端",allowlist:"allowlist — 只允许名单中的 ID",disabled:"disabled — 机器人完全忽略群聊"},ack:{off:"off — 不发标记",emoji:"emoji ⏳→✅",kaomoji:"kaomoji(纯文本颜文字)"},accountsTitle:"多账号 / 多机器人",accountDisabled:"已禁用",accountsHint:"每个 entry 启动独立的 DWClient,dmPolicy / allowFrom / ack-reaction 全部隔离。保存后请重启 agim 让新账号生效。",accountsEmpty:"还没有额外账号。点「+ 添加账号」接入另一个钉钉机器人。",addAccount:"添加账号",accountName:"显示名(可选)",accountRenameCollision:'已存在 id 为 "{{id}}" 的账号;请换一个 id。'},qr:{title:"扫码登录微信",description:"打开手机微信扫一扫这个二维码,然后在微信内确认登录。",starting:"正在启动 QR 会话…",loadFailed:"QR 启动失败",expired:"二维码已过期 — 关闭并重新发起。",cancelled:"已取消。",confirmed:"登录成功 — wechat-ilink 将在下次服务重启后启用。"}},B_={title:"邮件 (SMTP)",subtitle:"用于 `/remind email me@x.com …` 的对外邮件投递。凭据保存在 `~/.agim/.env`,留空即停用。",cardTitle:"SMTP 凭据",statusOn:"已配置",statusOff:"未配置",host:"Host",hostHint:"邮件服务器域名(如 `smtp.gmail.com`)。",port:"Port",portHint:"通常 465 (SSL) 或 587 (STARTTLS)。",user:"用户名",userHint:"登录邮箱;通常也是发件人地址。",pass:"密码 / 应用 Token",passHint:"保存到 `~/.agim/.env`(chmod 600)。默认遮罩,按「显示」可查看。",from:"发件人",fromHint:"发件 header;为空则使用用户名。",secure:"TLS 模式",secureHint:"`auto` 按端口判定;如运营商要求可强制 SSL 或 STARTTLS。",secureAuto:"auto(按端口)",secureTrue:"true(SSL,对应 465)",secureFalse:"false(STARTTLS,对应 587)",reveal:"显示",hide:"隐藏",testBtn:"测试连接",testNeedsConfigured:"请先保存 host / user / password。",disableBtn:"停用 SMTP",saveBtn:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"SMTP 已保存",disabled:"SMTP 已停用",noChanges:"无可保存的改动"}},H_={title:"Viewer & 地图",subtitle:"公开访问的两个外设:长消息 Viewer(超过阈值的回复转成 `/v/<id>` 短链)+ Baidu Maps AK(驱动 `/memo` 地址解析)。",reveal:"显示",hide:"隐藏",save:"保存",saving:"保存中…",discard:"放弃改动",dirtyHint:"有未保存改动",toast:{saved:"Viewer 设置已保存"},viewer:{title:"Viewer(长消息短链)",subtitle:"超过字符 / 行数阈值的回复会被上传到本地 paste 存储,IM 消息变成一条 `/v/<id>` 短链。",on:"已启用",off:"未启用",enableLabel:"启用长消息 Viewer",publicUrl:"公开基础 URL",publicUrlHint:"反代 / 隧道暴露给外网的地址。用于拼接 `/v/<id>` 短链。",remotePasteUrl:"远端 paste URL",remotePasteUrlHint:"POST markdown 到这个地址换公网链接;优先级高于 Public base URL 和 quick 隧道。留空使用社区默认 https://viewer.iclaw.host/paste。",remotePasteToken:"远端 paste Bearer Token",remotePasteTokenHint:"可选;只在你的 paste 服务要求鉴权时需要填。",noDefaultRemote:"禁用社区默认",noDefaultRemoteLabel:"未配置任何模式时不回退到 viewer.iclaw.host",noDefaultRemoteHint:"v1.2.43+:未配置任何模式时,agim 默认走 remote 模式上传到 viewer.iclaw.host。勾选此项可关闭该回退(这时长内容会直接 inline)。",tunnelMode:"隧道模式",tunnelOff:"关闭(使用上方公开 URL)",tunnelQuick:"quick(cloudflared 临时隧道)",tunnelHint:"`quick` 会本地拉起 Cloudflare quick tunnel;当运营商自己没有反代 agim 时启用。",tunnelStatus:"隧道状态",refreshTunnel:"刷新",tunnelRunning:"运行中",yes:"是",no:"否",tunnelUrl:"实时 URL",effectiveUrl:"生效 URL",binary:"cloudflared 二进制",binaryMissing:"PATH 中未找到 — 请从 cloudflare/cloudflared releases 安装",lastError:"最近一次错误",tunnelLoading:"正在加载隧道状态…",thresholds:"路由阈值",chars:"字符上限",charsHint:"回复超过此长度走 Viewer。",lines:"行数上限",linesHint:"相同的路由判定,按行数。",codeLines:"代码行数上限",codeLinesHint:"代码块内回复的更低阈值。",maxPastes:"Paste 存储上限",maxPastesHint:"超过此数量后按 FIFO 淘汰旧 paste。"},baidu:{title:"Baidu Maps AK",subtitle:"启用 `/memo` 的地址→坐标解析。不配置 AK,/memo 仍可通过裸坐标或浏览器 GPS 分享工作。免费 AK:lbsyun.baidu.com → 控制台 → 应用管理 → 创建应用 → 服务端 API。",configured:"已配置",empty:"未配置",placeholder:"32 位 AK,首字符非数字",hint:"保存到 `~/.agim/.env`(chmod 600),默认遮罩,按「显示」可查看。",suspicious:"AK 长度为 {{length}},通常 Baidu AK 是 32 位 — 请核对。",clear:"清除 AK",toast:{saved:"Baidu Maps AK 已保存",cleared:"Baidu Maps AK 已清除"}}},U_={title:"工作区",subtitle:"多租户工作区注册表。每个工作区有独立的 Agent 白名单、限流配置以及(可选的)成员名单。`default` 工作区承接所有未匹配的用户。",empty:{title:"只有默认工作区",description:"在下方添加工作区,可按团队 / 项目 / 客户分隔。每个工作区有独立的 Agent 白名单与限流。"},col:{id:"ID",name:"名称",agents:"Agent 白名单",members:"成员",rateLimit:"限流"},rateLimitFormat:"{{rate}} / {{intervalSec}}s,突发 {{burst}}",membersOpen:"开放(任何用户)",membersCount_one:"{{count}} 位成员",membersCount_other:"{{count}} 位成员",edit:"编辑",form:{title:"新增或编辑工作区",subtitleEdit:"编辑已有工作区 — 改 ID 可克隆,保持原 ID 即 upsert。",id:"ID",idHint:"稳定标识符;只允许 [a-zA-Z0-9_-]+;`default` 为保留名。",name:"显示名",agents:"Agent 白名单",agentsHint:"逗号分隔;为空 = 允许所有已注册 Agent。",members:"成员用户 ID",membersHint:"逗号分隔,形如 `platform:userId`;为空 = 开放工作区。",rateLimit:"限流(可选)",rate:"调用数",intervalSec:"周期(秒)",burst:"突发上限",submit:"保存工作区",reset:"清空表单"},toast:{saved:"工作区已保存"}},z_={title:"服务",subtitle:"查看运行中的 agim 进程,并启动 / 停止 / 重启它。",modeLabel:"运行模式",pidLabel:"PID",uptimeLabel:"运行时长",webLabel:"Web 端口",bootPhaseLabel:"启动阶段",mode:{systemd:"systemd",background:"后台",foreground:"前台",none:"未运行"},actions:{start:"启动",stop:"停止",restart:"重启",confirmStop:"停止 agim 服务?",confirmStopDesc:"Web 控制台、消息适配器、所有正在进行的作业都会停止。需要重新启动后才能继续使用。",confirmRestart:"重启 agim 服务?",confirmRestartDesc:"进程会先停止再启动。进行中的作业会被取消;投递队列与已排队的提醒会保留。重启期间 Web 控制台不可达,通常 5-30 秒。"},toast:{started:"服务已启动",stopped:"服务已停止",restarted:"服务已重启"},ports:{title:"端口",subtitle:"agim 启动时监听的端口。留空使用默认值;改动需下次服务重启生效(保存后点下方「重启」按钮)。",webPort:"Web 端口",webPortHint:"聊天 UI + REST API 的 HTTP 服务端口。默认 {{default}}。",acpPort:"ACP 端口",acpPortHint:"Agent Communication Protocol 服务端口(远程 Agent 接入面)。默认 {{default}}。",invalidPort:"需为 1-65535 之间的数字。",restartRequired:"需重启生效",save:"保存",saving:"保存中…",discard:"放弃改动",toast:{saved:"端口已保存 — 重启 agim 以绑定新端口"}}},$_={title:"安全",subtitle:"工具沙盒、SSRF 拦截、发送方门禁、运行时审计。改动立即写入 env 文件;多数 native 工具读 process.env,下次工具调用即生效;exec 沙盒和发送方门禁需要「重启服务」生效。",diagnostics:{title:"运行时诊断",runningAsRoot:"以 root 运行",runningAsRootHelp:"tool 调用会拿到 root 权限。建议在 systemd unit 设 User=agim 后重启。",envFilePerms:"env 文件权限",envFilePermsLax:"过宽(group/world 可读)",envFilePermsOk:"0600(仅 owner 可读写)",bwrapAvailable:"bubblewrap 已装",bwrapMissing:"未装(apt install bubblewrap)",senderAllowlist:"发送方门禁",senderAllowlistOff:"未配置(开放访问)",senderAllowlistOn:"已配置",adminAllowlist:"管理员清单",adminAllowlistOff:"未配置(首次 setup 后填充)",adminAllowlistOn:"已配置"},sender:{title:"发送方门禁 (谁能跟 bot 说话)",description:"允许列表,逗号分隔 platform:userId 对,例如 telegram:8754479311,wechat-ilink:wxid_abc。设为 * 显式表示「所有人都允许」。空值 = 开放访问(保持向后兼容;启动日志 OPEN_IM_ACCESS)。",envKey:"IMHUB_ALLOWED_USERS",placeholder:"platform:userId,platform:userId"},exec:{title:"Native exec 工具",description:"对 native_exec 的沙盒与超时控制。每次 exec 调用还会经 IM 审批卡(除非已 autoallow 同 fingerprint)。",sandbox:"沙盒后端",sandboxNone:"无(直接 spawn)",sandboxBwrap:"bubblewrap(Linux only)",sandboxBwrapMissing:"bubblewrap 未装",sandboxNet:"沙盒内网络",sandboxNetOn:"允许(默认)",sandboxNetOff:"禁用(--unshare-net)",timeoutMs:"命令超时(毫秒,默认 60000)",maxOutput:"单流输出上限(字节,默认 32768)"},web:{title:"Native web 工具",description:"SSRF 防护与超时。CIDR 白名单可放行 Tailscale/100.64.0.0/10 这类私网。",allowPrivate:"允许所有私网(不推荐)",allowPrivateHelp:"= 1 时跳过所有私网检查。仅用于受信任的内网部署。",ssrfWhitelist:"SSRF CIDR 白名单",ssrfWhitelistPlaceholder:"100.64.0.0/10,10.20.0.0/16",timeoutMs:"fetch / search 超时(毫秒,默认 30000)"},fs:{title:"Native filesystem 工具",description:"fs 工具默认限制在 native 当前线程的 workspace 子树内。",restrict:"限制到 workspace",restrictOn:"ON(推荐)",restrictOff:"OFF(允许任意路径;sensitive-paths 黑名单仍生效)",timeoutMs:"fs 工具超时(毫秒,默认 60000)"},delegation:{title:"Native call_agent 上限",description:"一次对话内 mcp__imhub__call_agent 允许的最多次数。防止 native 死循环委托给 CLI agent。0 = 无限。",envKey:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN",valueLabel:"默认 2"},platformBlacklist:{title:"IM 平台黑名单",description:"逗号分隔的 IM 平台 id,列入后:CLI 向导不显示、web 后台不出现、注册时被直接拒绝。即使凭证仍在 env 文件里,进程也不会拉起这个适配器。默认空(不拦截)。常见 id:wechat-ilink / telegram / feishu / dingtalk / discord / email。",envKey:"IMHUB_PLATFORM_BLACKLIST",placeholder:"telegram,discord",currentLabel:"当前生效"},diagnosticsPlatformBlacklist:"IM 平台黑名单",savingToast:"已保存。",resetTitle:"清空 (使用默认值)"},V_={title:"管理员名单",subtitle:"可执行管理员级命令的 IM 用户(`/admin promote`、`/admin token` 等)。名单保存在 `IMHUB_ADMIN_USERS` 环境变量;仅当 agim Web 端口本地绑定时才能在此编辑。",configured:"名单已配置",notConfigured:"尚未配置名单 — 任何持有 CLI bootstrap token 的人都可自我提权。",bootstrapAvailable:"Bootstrap token 文件存在",bootstrapPath:"文件路径",empty:"暂无管理员。",col:{platform:"平台",userId:"用户 ID"},add:{title:"添加管理员",platform:"平台",userId:"用户 ID",submit:"添加"},remove:{label:"移除",confirmTitle:"确认移除该管理员?",confirmDescription:"该用户将失去所有管理员命令访问权限。可再次添加恢复。"},toast:{added:"已添加",removed:"已移除"}},W_={title:"Native LLM 后端",subtitle:"这些后端为进程内 native agent 及内部 introspection 调用方(记忆提取、意图分类、通知评估器、心跳)提供能力。后端元数据保存在 ~/.agim/config.json;API Key 保存在 ~/.agim/llm-secrets.json(0600)或 AGIM_LLM_SECRET_<NAME> 环境变量。",refresh:"刷新",backendsTitle:"后端 ({{count}})",backendsEmpty:"尚未配置 LLM 后端。请在下方添加。",rolesTitle:"角色绑定",addTitle:"添加后端",col:{name:"名称",provider:"提供商",model:"模型",baseUrl:"Base URL",apiKey:"API Key",actions:"操作"},secretMissing:"缺失",ping:"探测",remove:"删除",pinging:"探测中…",setKeyFirst:"请先设置 API Key",pingHint:"发送一次小型 chat 探测",removeConfirm:'删除后端 "{{name}}"?角色绑定与 API Key 将被清除。',removedToast:"已删除(同时清除 {{count}} 个角色绑定)。",roleUpdated:"已更新角色 {{role}}",unset:"(未设置)",unbound:"(未绑定)",roleHint:{cheap:"内部 introspection:记忆提取、意图分类、回退链第一阶段。",evaluator:"通知评估器 + router-compare 裁判 LLM。","native-chat":"/na agent 循环默认角色;/cc native 调用时使用。"},preset:"提供商预设",name:"名称",namePlaceholder:"如 deepseek-cheap",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",model:"模型",modelPlaceholder:"model-id",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"sk-...",addBackend:"添加后端",invalidPreset:"无效预设",nameRequired:"名称必填",baseUrlRequired:"baseUrl 必填",modelRequired:"model 必填",addedWithKey:'已添加 "{{name}}"(含 API Key)',addedNoKey:'已添加 "{{name}}"(请单独设置 Key)',presets:{deepseek:"DeepSeek",moonshot:"Moonshot Kimi",zhipu:"智谱 GLM",openai:"OpenAI",anthropic:"Anthropic",custom:"自定义"}},K_={title:"外部 MCP 服务器",subtitle:"这些服务器提供的工具会暴露给进程内 native agent(命名规则 mcp_<server>_<tool>)。CLI agent 使用各自的 MCP 配置,不会读取此列表。Header 可能包含 Bearer Token — 仅管理员可见。",refresh:"刷新",serversTitle:"服务器 ({{count}})",serversEmpty:"尚未配置 MCP 服务器。请在下方添加 — 常见选择:filesystem、github、postgres。",totalTools:"工具总数:{{count}}",addTitle:"添加服务器",col:{name:"名称",transport:"传输",target:"目标",runtime:"运行时",actions:"操作"},transportStdio:"stdio",transportSse:"SSE",transportHttp:"http",runtimeUnknown:"未知",runtimeConnected:"已连接 · {{count}} 个工具",runtimeConnectedOne:"已连接 · {{count}} 个工具",runtimeDisconnected:"未连接",health:"健康检查",remove:"删除",probing:"探测中…",removeConfirm:'删除 MCP 服务器 "{{name}}"?',removedToast:'已删除 "{{name}}"',nameRequired:"名称必填",commandRequired:"stdio 传输需要 command",urlRequired:"http/sse 传输需要 url",headersInvalid:"headers 必须是合法 JSON",addedToast:'已添加 "{{name}}"',nameLabel:"名称",namePlaceholder:"如 filesystem",transportLabel:"传输",transportStdioOption:"stdio(子进程)",transportHttpOption:"http / SSE",commandLabel:"命令",commandPlaceholder:"如 npx",argsLabel:"参数(空格分隔)",urlLabel:"URL",urlPlaceholder:"https://example.com/mcp",headersLabel:"Headers(JSON,可选)",headersPlaceholder:'{"Authorization":"Bearer …"}',addServer:"添加服务器"},q_={title:"Native Agent · 评估器 · 心跳",subtitle:"进程内 native agent 及两个 LLM 驱动门控(通知评估器、心跳)的运行时行为。LLM 后端与角色绑定在 /settings/llm;本页配置 agent 与门控的实际行为。",llmLink:"/settings/llm",refresh:"刷新",unsaved:"有未保存改动",discard:"放弃",save:"保存",savedToast:"已保存。",agentCard:"Native Agent(进程内)",evaluatorCard:"通知评估器",heartbeatCard:"心跳调度器",on:"开",off:"关",roleOverride:"角色覆盖",roleHint:"native 循环解析的 LLM 角色。默认 native-chat(回退 cheap)。需与 /settings/llm 中的角色绑定一致。",approvalMode:"审批模式",approvalHint:"native 循环中工具调用的门控方式。",modeReadOnly:"read-only(安全默认;仅内置工具)",modeAllowList:"allow-list(仅 autoAllow 条目)",modeAllowAll:"allow-all(所有工具,无门控)",modeDenyAll:"deny-all(禁止工具)",autoAllow:"自动允许工具前缀",autoAllowHint:"逗号分隔。名称以任一前缀开头的工具绕过门控(如 native_,mcp_filesystem_)。",denyList:"拒绝列表工具前缀",denyListHint:"逗号分隔。无论模式如何始终拒绝(如 mcp_shell_)。",evalDesc:"过滤例行/空的 agent 主动推送消息的 LLM 门控。使用 evaluator 角色。失败开放:LLM 错误或缺少后端 → 仍投递消息。",enableGate:"启用门控",filterViaLlm:"通过 LLM 过滤",evalSources:"门控来源",evalSourcesHint:"逗号分隔子集:push, notify, reminder, heartbeat。留空 = 默认 push,heartbeat。",hbDesc:"周期性主动唤醒循环。关闭后 /heartbeat bind 仍可保存绑定,但不执行扫描。三阶段 tick:DECIDE → EXECUTE → EVALUATE。",enableScheduler:"启用调度器",startScanLoop:"启动扫描循环",tickInterval:"Tick 间隔(毫秒)",tickHint:"扫描循环检查到期绑定的频率。默认 60000。",defaultInterval:"默认绑定间隔(分钟)",defaultIntervalHint:"绑定未指定时的 tick 间隔。默认 15。",runtimeCard:"运行参数(v1.2.126)",runtimeDesc:"Native agent 工具调用与重试的硬上限。所有键热生效,无需重启服务。留空使用默认值。",toolResultCap:"单次工具返回最大字符",toolResultCapHint:"IMHUB_NATIVE_TOOL_RESULT_MAX_CHARS。超出截断+附说明。默认 64000。",toolTimeoutMs:"单次工具超时(毫秒)",toolTimeoutHint:"IMHUB_NATIVE_TOOL_TIMEOUT_MS。默认 60000(60 秒)。",blankRetryMax:"空响应重试上限",blankRetryHint:"IMHUB_NATIVE_BLANK_RETRY_MAX。模型连续返回空文本时的重试次数。默认 1。",lengthRecoveryMax:"长度截断续写上限",lengthRecoveryHint:"IMHUB_NATIVE_LENGTH_RECOVERY_MAX。finishReason=length 时自动续写次数。默认 1。",a2aCard:"A2A 子 Agent 派生(v1.2.127)",a2aDesc:"模型调用 `mcp__imhub__call_agent` 时的深度 / 超时 / 同进程 / 单轮上限。native→native 默认走同进程快路径。所有键热生效。",a2aMaxDepth:"递归深度上限",a2aMaxDepthHint:"IMHUB_A2A_MAX_DEPTH。call_agent 嵌套调用最大层数。默认 1。",a2aTimeoutMs:"默认超时(毫秒)",a2aTimeoutMsHint:"IMHUB_A2A_TIMEOUT_DEFAULT_MS。默认 1800000(30 分钟)。",callAgentInProcess:"native→native 同进程",callAgentInProcessHint:"IMHUB_NATIVE_CALL_AGENT_IN_PROCESS。关闭则回退到子进程 CLI。默认开。",callAgentMaxPerTurn:"单轮调用上限",callAgentMaxPerTurnHint:"IMHUB_NATIVE_CALL_AGENT_MAX_PER_TURN。0 = 不限。默认 2。",criticCard:"早停 + 复盘(v1.2.127)",criticDesc:"语义死循环检测识别「3 次同意图但工具不同」的情形并早停。Critic 是可选的目标偏离检测器。",semanticStuckLoop:"语义死循环检测",semanticStuckLoopHint:"IMHUB_NATIVE_SEMANTIC_STUCK_LOOP。默认开;关闭即关掉 v1.2.122 的跨工具去重。",criticEnabled:"Goal Critic 复盘",criticEnabledHint:"IMHUB_NATIVE_CRITIC。默认关;开启后启用目标偏离早停。",criticRole:"Critic LLM role",criticRoleHint:"IMHUB_NATIVE_CRITIC_ROLE。可选 override(留空走主后端)。",planModeDefault:"PlanMode 默认状态",planModeDefaultHint:"IMHUB_NATIVE_PLAN_MODE。默认关;`/plan on` 在单线程内可独立切换不受此影响。",compactCard:"Auto-compact 自动摘要(v1.2.127)",compactDesc:"Head + summary + tail(OpenHands Condenser)。总字符数超过阈值时触发;KEEP_FIRST 保留原始 user goal。",compactTriggerChars:"触发字符数",compactTriggerCharsHint:"IMHUB_NATIVE_COMPACT_TRIGGER_CHARS。设为 0 禁用。默认 60000。",compactKeepTurns:"保留最后 N 对",compactKeepTurnsHint:"IMHUB_NATIVE_COMPACT_KEEP_TURNS。tail 保留的 user/assistant 对数。默认 6。",compactKeepFirst:"保留前 N 条 user 消息",compactKeepFirstHint:"IMHUB_NATIVE_COMPACT_KEEP_FIRST。head 保留原始 user 目标。默认 1。",compactSummaryChars:"摘要字符上限",compactSummaryCharsHint:"IMHUB_NATIVE_COMPACT_SUMMARY_CHARS。LLM 生成摘要的字符上限。默认 1500。",streamCard:"流式 + 迭代(v1.2.127)",streamDesc:"流式回传可在 IM 30 分钟硬超时时保留部分文本。max-iter 是工具循环的最坏上限。",streamPartial:"流式增量回写",streamPartialHint:"IMHUB_NATIVE_STREAM_PARTIAL。默认开;关闭走旧的非流式路径。",maxIter:"迭代上限",maxIterHint:"IMHUB_NATIVE_AGENT_MAX_ITER。范围 [1,100]。默认 20。"},G_={title:"Web 搜索 Provider",subtitle:"native_web_search 工具的后端链路。失败时按顺序回退到下一家。键留空 = 删除该值;填则覆盖。所有修改热生效。",refresh:"刷新",save:"保存",discard:"放弃",unsaved:"有未保存改动",savedToast:"已保存。下一次搜索即生效。",chainLabel:"当前生效链路:",chainEmpty:"无可用 provider",chainHint:"由 IMHUB_WEB_SEARCH_PROVIDERS 决定;只列出已启用且 available() 为真的项。",configured:"已配置",missingKey:"缺 API key",noKey:"无需 key",moveUp:"上移",moveDown:"下移",testBtn:"测试",clearKey:"清空",placeholderConfigured:"已保存(隐藏) — 不输入则保留",placeholderEnter:"输入新 key",keyHint:"提交后将以密文写入 ~/.agim/env 的 {{envKey}} 键。",testOk:"{{provider}} ✓ {{hits}} 条结果 / {{ms}} ms",testFail:"{{provider}} ✗ {{error}}"},Y_={title:"agim Skills",tab:{installed:"已安装",hot:"skillhub 热门"},reload:"从磁盘重新加载",subtitle:"由 src/core/skills/loader.ts 加载的 SKILL.md 文件。Tier-1 摘要(name + description)自动注入每个 agent 系统提示;完整正文通过 mcp__imhub__read_skill 按需读取。工作区 skill 按名称覆盖内置 skill。",reloadedToast:"已重新加载 — 磁盘上 {{count}} 个 skill",selectHint:"在左侧选择一个 skill,或点击「新建」创建。",emptyList:"尚未加载 skill。点击「新建」创建(保存到 ~/.agim/skills/<name>/SKILL.md)。",unavailable:"不可用",alwaysOn:"常驻",sourceWs:"ws",sourceBuiltin:"builtin",notFound:"未找到。",sourceWorkspace:"workspace",sourceBuiltinReadonly:"builtin(UI 只读)",builtinShadowHint:"内置 skill 仅供参考。保存将创建工作区 shadow 覆盖它。",delete:"删除",save:"保存",saveShadow:"保存(创建工作区 shadow)",savedToast:'已保存 "{{name}}"',deleteConfirm:'删除工作区 skill "{{name}}"?如有内置版本将重新可见。',deletedToast:'已删除 "{{name}}"',new:"新建",newTitle:"新建 skill",newName:"Skill 名称",newNamePlaceholder:"my-skill",newCreate:"创建",createdToast:'已创建 "{{name}}"',nameRequired:"名称必填",pathLabel:"工作区路径:",binsLabel:"依赖二进制:",envLabel:"依赖环境变量:",none:"无"},Q_={pageTitle:__,subtitle:N_,tabs:D_,agents:M_,policy:j_,messengers:F_,email:B_,viewerSettings:H_,workspaces:U_,service:z_,security:$_,admins:V_,llm:W_,mcp:K_,nativeAgent:q_,search:G_,agimSkills:Y_};Xe.use(up).use(Og).init({resources:{en:{common:XR,errors:WP,tasks:MI,approvals:aL,reminders:IL,memos:XL,memory:gO,skills:LO,workspace:VO,observability:a_,settings:O_},zh:{common:fP,errors:EI,tasks:GI,approvals:vL,reminders:zL,memos:aO,memory:AO,skills:MO,workspace:JO,observability:p_,settings:Q_}},lng:X_(),fallbackLng:"en",supportedLngs:["en","zh"],ns:["common","errors","tasks","approvals","reminders","memos","memory","skills","workspace","observability","settings"],defaultNS:"common",interpolation:{escapeValue:!1},react:{useSuspense:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"},detection:{order:[],caches:[]}});function X_(){try{const e=localStorage.getItem("im-hub-lang");if(e==="en"||e==="zh")return e}catch{}return(navigator.language||"en").toLowerCase().startsWith("zh")?"zh":"en"}function J_(e){Xe.language!==e&&Xe.changeLanguage(e)}function Z_(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var dp=e=>{const{present:t,children:n}=e,r=eN(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=Ye(r.ref,tN(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};dp.displayName="Presence";function eN(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),a=e?"mounted":"unmounted",[s,l]=Z_(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=ki(r.current);o.current=s==="mounted"?c:"none"},[s]),rt(()=>{const c=r.current,u=i.current;if(u!==e){const h=o.current,f=ki(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),rt(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const p=ki(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=f=>{f.target===t&&(o.current=ki(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function ki(e){return e?.animationName||"none"}function tN(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nN=Symbol("radix.slottable");function rN(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=nN,t}var[Eo]=ho("Tooltip",[vo]),js=vo(),fp="TooltipProvider",iN=700,wu="tooltip.open",[oN,hp]=Eo(fp),pp=e=>{const{__scopeTooltip:t,delayDuration:n=iN,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=g.useRef(!0),s=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),v.jsx(oN,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(c=>{s.current=c},[]),disableHoverableContent:i,children:o})};pp.displayName=fp;var mp="Tooltip",[ON,Co]=Eo(mp),Ga="TooltipTrigger",aN=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Co(Ga,n),o=hp(Ga,n),a=js(n),s=g.useRef(null),l=Ye(t,s,i.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),v.jsx(th,{asChild:!0,...a,children:v.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:je(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:je(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:je(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:je(e.onBlur,i.onClose),onClick:je(e.onClick,i.onClose)})})});aN.displayName=Ga;var sN="TooltipPortal",[_N,lN]=Eo(sN,{forceMount:void 0}),mr="TooltipContent",gp=g.forwardRef((e,t)=>{const n=lN(mr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Co(mr,e.__scopeTooltip);return v.jsx(dp,{present:r||a.open,children:a.disableHoverableContent?v.jsx(yp,{side:i,...o,ref:t}):v.jsx(cN,{side:i,...o,ref:t})})}),cN=g.forwardRef((e,t)=>{const n=Co(mr,e.__scopeTooltip),r=hp(mr,e.__scopeTooltip),i=g.useRef(null),o=Ye(t,i),[a,s]=g.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,h=g.useCallback(()=>{s(null),d(!1)},[d]),f=g.useCallback((m,p)=>{const y=m.currentTarget,b={x:m.clientX,y:m.clientY},x=pN(b,y.getBoundingClientRect()),w=mN(b,x),R=gN(p.getBoundingClientRect()),I=vN([...w,...R]);s(I),d(!0)},[d]);return g.useEffect(()=>()=>h(),[h]),g.useEffect(()=>{if(l&&u){const m=y=>f(y,u),p=y=>f(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",p),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",p)}}},[l,u,f,h]),g.useEffect(()=>{if(a){const m=p=>{const y=p.target,b={x:p.clientX,y:p.clientY},x=l?.contains(y)||u?.contains(y),w=!yN(b,a);x?h():w&&(h(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,a,c,h]),v.jsx(yp,{...e,ref:o})}),[uN,dN]=Eo(mp,{isInside:!1}),fN=rN("TooltipContent"),yp=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=Co(mr,n),c=js(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(wu,u),()=>document.removeEventListener(wu,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=h=>{h.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),v.jsx(As,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:v.jsxs(nh,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(fN,{children:r}),v.jsx(uN,{scope:n,isInside:!0,children:v.jsx(SA,{id:l.contentId,role:"tooltip",children:i||r})})]})})});gp.displayName=mr;var vp="TooltipArrow",hN=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=js(n);return dN(vp,n).isInside?null:v.jsx(rh,{...i,...r,ref:t})});hN.displayName=vp;function pN(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function mN(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function gN(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function yN(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o],l=t[a],c=s.x,u=s.y,d=l.x,h=l.y;u>r!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=!i)}return i}function vN(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),bN(t)}function bN(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var xN=pp,bp=gp;const wN=xN,SN=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(bp,{ref:r,sideOffset:t,className:Ie("z-50 overflow-hidden rounded-md","bg-text text-bg px-2 py-1 text-xs font-medium shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95",e),...n}));SN.displayName=bp.displayName;function kN(e){return v.jsx(Gv,{position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"border border-border bg-surface text-text shadow-md",title:"font-medium",description:"text-text-dim text-sm",actionButton:"bg-accent text-accent-fg rounded-md",cancelButton:"bg-surface-2 text-text rounded-md",error:"bg-danger-bg text-danger border-danger",success:"bg-success-bg text-success border-success",warning:"bg-warning-bg text-warning border-warning",info:"bg-info-bg text-info border-info"}},...e})}function EN({children:e}){const t=ar(r=>r.lang),{i18n:n}=St();return g.useEffect(()=>{n.language!==t&&J_(t)},[t,n]),v.jsx(v.Fragment,{children:e})}function CN({children:e}){return $T(),v.jsx(v.Fragment,{children:e})}function AN({children:e}){return g.useEffect(()=>xg(),[]),v.jsx(v.Fragment,{children:e})}function TN({children:e}){return v.jsx(xv,{client:ZT,children:v.jsx(EN,{children:v.jsx(CN,{children:v.jsx(AN,{children:v.jsxs(wN,{children:[e,v.jsx(kN,{})]})})})})})}const xp=document.getElementById("root");if(!xp)throw new Error("agim: #root not found in index.html");ia.createRoot(xp).render(v.jsx(z.StrictMode,{children:v.jsx(TN,{children:v.jsx(JT,{})})}));export{ma as $,th as A,at as B,Hg as C,As as D,vo as E,Of as F,Jv as G,LE as H,xd as I,sd as J,hv as K,kd as L,id as M,sl as N,PN as O,ih as P,AA as Q,mh as R,za as S,ep as T,Gy as U,v as V,Et as W,et as X,ov as Y,ev as Z,Qy as _,ba as a,Jy as a0,rv as a1,Yy as a2,pa as a3,Ot as a4,zn as a5,Ye as a6,Gc as a7,kE as a8,HE as a9,Ts as aa,wv as ab,bv as ac,pg as ad,St as ae,rh as b,bt as c,Ug as d,nh as e,dp as f,We as g,cA as h,Gg as i,Gi as j,Dn as k,qi as l,$a as m,Yg as n,Qg as o,ti as p,Jg as q,Xv as r,Y as s,Ie as t,je as u,ei as v,wE as w,LN as x,ho as y,ht as z};
199
+ //# sourceMappingURL=index-CGaI-i4K.js.map