@nextclaw/ui 0.19.4 → 0.20.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/assets/{abnfDiagram-VRR7QNED-DrbfiNNF.js → abnfDiagram-VRR7QNED-BcFJp_1X.js} +1 -1
  3. package/dist/assets/{aiden0z-pptx-renderer.es-DdLb2IVc.js → aiden0z-pptx-renderer.es-Dp2ezlQn.js} +1 -1
  4. package/dist/assets/api-C2iYhdTe.js +13 -0
  5. package/dist/assets/{appearance-settings-page-cTuZdROP.js → appearance-settings-page-BwQDQr0n.js} +1 -1
  6. package/dist/assets/{arc-BXlMc9B0.js → arc-CkgyPMyW.js} +1 -1
  7. package/dist/assets/architecture-TIHT7OUA-DO2x53FK.js +1 -0
  8. package/dist/assets/{architectureDiagram-ZJ3FMSHR-DXAJxxO0.js → architectureDiagram-ZJ3FMSHR-CMd4cIjI.js} +1 -1
  9. package/dist/assets/{blockDiagram-677ZJIJ3-i4Kz7zU0.js → blockDiagram-677ZJIJ3-Bz3tbhet.js} +1 -1
  10. package/dist/assets/book-open-C0IlT9zs.js +1 -0
  11. package/dist/assets/{c4Diagram-LMCZKHZV-BDc0TkPd.js → c4Diagram-LMCZKHZV-D9hFNAGv.js} +1 -1
  12. package/dist/assets/channel-nBvMaVyP.js +1 -0
  13. package/dist/assets/channels-list-page-B0z4bh8e.js +8 -0
  14. package/dist/assets/chunk-2Q5K7J3B-CJgqFDS4.js +1 -0
  15. package/dist/assets/{chunk-32BRIVSS-DuReei0Z.js → chunk-32BRIVSS-7NrjEITq.js} +1 -1
  16. package/dist/assets/{chunk-52WLFC77-D8APq0tm.js → chunk-52WLFC77-viIcqj9q.js} +1 -1
  17. package/dist/assets/{chunk-5FCAYU7R-BsPrNXNS.js → chunk-5FCAYU7R-Vsu4J-VM.js} +1 -1
  18. package/dist/assets/{chunk-5HE753X5-BRtkOPoJ.js → chunk-5HE753X5-C-w6CQZK.js} +1 -1
  19. package/dist/assets/{chunk-5JV3BV7I-ChPc8e8U.js → chunk-5JV3BV7I-CuKgJQ4W.js} +1 -1
  20. package/dist/assets/{chunk-5TONJI2A-CzTjlJGb.js → chunk-5TONJI2A-CYeiWZKb.js} +1 -1
  21. package/dist/assets/{chunk-5VM5RSS4-xsv_22jR.js → chunk-5VM5RSS4-DRCbfwIn.js} +1 -1
  22. package/dist/assets/{chunk-7BUUIJ7U-CwECujme.js → chunk-7BUUIJ7U-BvydOcm3.js} +1 -1
  23. package/dist/assets/{chunk-BIQX33UG-DQAm173p.js → chunk-BIQX33UG-RlppOXKo.js} +1 -1
  24. package/dist/assets/{chunk-C7G6YPKG-BkpajeQb.js → chunk-C7G6YPKG-DAizzYwr.js} +1 -1
  25. package/dist/assets/{chunk-CQNSW5MT-ND65pWRA.js → chunk-CQNSW5MT-5eChJHca.js} +1 -1
  26. package/dist/assets/{chunk-CYSBUYHQ-vMu6ijxG.js → chunk-CYSBUYHQ-YHPr53fv.js} +1 -1
  27. package/dist/assets/{chunk-EMLP6XTP-CEaeW3gH.js → chunk-EMLP6XTP-CK4D7Hz5.js} +1 -1
  28. package/dist/assets/{chunk-EX3LRPZG-a4ER-HDr.js → chunk-EX3LRPZG-BmlDFIRW.js} +1 -1
  29. package/dist/assets/{chunk-FWX5IMBZ-C_8fQssn.js → chunk-FWX5IMBZ-D0ksHZZ9.js} +2 -2
  30. package/dist/assets/{chunk-HOUHSVGY-CEvw-PEd.js → chunk-HOUHSVGY-DPkq8FCm.js} +1 -1
  31. package/dist/assets/{chunk-ICXQ74PX-BEtF0fGY.js → chunk-ICXQ74PX-FAatv5fC.js} +1 -1
  32. package/dist/assets/{chunk-JG7HCLWE-DGRrVp8-.js → chunk-JG7HCLWE-DLkIi4F7.js} +1 -1
  33. package/dist/assets/{chunk-JWPE2WC7-DRqpp_nM.js → chunk-JWPE2WC7-DawOjNE3.js} +1 -1
  34. package/dist/assets/{chunk-MOJQB5TN-BDEriOXs.js → chunk-MOJQB5TN-Di52TorW.js} +1 -1
  35. package/dist/assets/{chunk-MOZMSUNE-JWRNzdnw.js → chunk-MOZMSUNE-PfyK9w1-.js} +1 -1
  36. package/dist/assets/{chunk-OGEWGWER-DS2VTgCx.js → chunk-OGEWGWER-C3jdH3Ty.js} +1 -1
  37. package/dist/assets/{chunk-OSBZ3O6U-3LiYTBUB.js → chunk-OSBZ3O6U-CecHo-f0.js} +1 -1
  38. package/dist/assets/{chunk-PUDLZKDR-o9M2s_SO.js → chunk-PUDLZKDR-f3IJh3sN.js} +1 -1
  39. package/dist/assets/{chunk-Q4XR5HBZ-DTB7Ma2N.js → chunk-Q4XR5HBZ-DQFeUPxZ.js} +1 -1
  40. package/dist/assets/{chunk-QBLGF6JB-DpkxZJL5.js → chunk-QBLGF6JB-BhUeG0y2.js} +1 -1
  41. package/dist/assets/{chunk-R7FJI6CG-CRejkHJU.js → chunk-R7FJI6CG-C3XpZ-2u.js} +1 -1
  42. package/dist/assets/{chunk-RYQCIY6F-B1boBjLt.js → chunk-RYQCIY6F-CAqa5klQ.js} +1 -1
  43. package/dist/assets/{chunk-U6XO7XAA-DgKa97bj.js → chunk-U6XO7XAA-D_WXezeD.js} +1 -1
  44. package/dist/assets/{chunk-V7JOEXUC-DE56eh0N.js → chunk-V7JOEXUC-CZ70oOtp.js} +1 -1
  45. package/dist/assets/chunk-VAUOI2AC-BGvh3yIx.js +1 -0
  46. package/dist/assets/{chunk-VR4S4FIN-BzomPZq2.js → chunk-VR4S4FIN-B7AHEYYk.js} +1 -1
  47. package/dist/assets/{chunk-WYO6CB5R-C6gy8rSd.js → chunk-WYO6CB5R-Dn9To_OI.js} +2 -2
  48. package/dist/assets/chunk-XXDRQBXY-DaBxG5gs.js +1 -0
  49. package/dist/assets/{chunk-YOTPTUD7-BK98yfl9.js → chunk-YOTPTUD7-BYEgRBk3.js} +1 -1
  50. package/dist/assets/{chunk-ZGVPDNZ5-DFXAhwUT.js → chunk-ZGVPDNZ5-C6YtZDU0.js} +1 -1
  51. package/dist/assets/{chunk-ZIRB5QZD-Bbu6BiNC.js → chunk-ZIRB5QZD-DMuYtnHF.js} +1 -1
  52. package/dist/assets/classDiagram-OUVF2IWQ-P6N03G2R.js +1 -0
  53. package/dist/assets/classDiagram-v2-EOCWNBFH-B1_uLvMv.js +1 -0
  54. package/dist/assets/{config-split-page-DO1Oyb-r.js → config-split-page-VDTf3zZb.js} +1 -1
  55. package/dist/assets/confirm-dialog-BI_Vt2s_.js +5 -0
  56. package/dist/assets/{cose-bilkent-JH36ORCC-BV8KR4uF.js → cose-bilkent-JH36ORCC-Bc2Ex5Y3.js} +1 -1
  57. package/dist/assets/createLucideIcon-Bydi9Gc5.js +1 -0
  58. package/dist/assets/cynefin-VYW2F7L2-B-H8Qp-n.js +1 -0
  59. package/dist/assets/{cynefinDiagram-TSTJHNR4-Ckd6nU9t.js → cynefinDiagram-TSTJHNR4-DVysQoGz.js} +1 -1
  60. package/dist/assets/{dagre-D_T-FW5i.js → dagre-CMhQ1cAG.js} +1 -1
  61. package/dist/assets/{dagre-VKFMJZFB-CyDaQpD4.js → dagre-VKFMJZFB-RYyWpPJZ.js} +1 -1
  62. package/dist/assets/{desktop-update-config-XSV-DjJW.js → desktop-update-config-DVoD6NxG.js} +1 -1
  63. package/dist/assets/{diagram-FQU43EPY-CghnwS0H.js → diagram-FQU43EPY-BD6KONdF.js} +1 -1
  64. package/dist/assets/{diagram-G47NLZAW-DK4DJ3Kx.js → diagram-G47NLZAW-CGB2ptRR.js} +1 -1
  65. package/dist/assets/{diagram-NH7WQ7WH-CUgDkZCJ.js → diagram-NH7WQ7WH-DnkOI6cU.js} +1 -1
  66. package/dist/assets/{diagram-OA4YK3LP-vO2gyH6n.js → diagram-OA4YK3LP-DF82RZ7P.js} +1 -1
  67. package/dist/assets/{diagram-WEI45ONY-DbSBRDSr.js → diagram-WEI45ONY-Be2v7Ck9.js} +1 -1
  68. package/dist/assets/{dist-C-2H76Cv.js → dist-A5btQciA.js} +1 -1
  69. package/dist/assets/dist-CmHtkFbs.js +1 -0
  70. package/dist/assets/doc-browser-Cm_tMZ_C.js +1 -0
  71. package/dist/assets/doc-browser-Dto54tCf.js +1 -0
  72. package/dist/assets/{doc-browser-context-C0Bns1J6.js → doc-browser-context-Bxw0ora-.js} +1 -1
  73. package/dist/assets/{docx-preview-DfxIm9IB.js → docx-preview-BqwAjrj3.js} +1 -1
  74. package/dist/assets/{ebnfDiagram-CCIWWBDH-W7CAcK7r.js → ebnfDiagram-CCIWWBDH-CP98OYk8.js} +1 -1
  75. package/dist/assets/{erDiagram-Q63AITRT-LA0JWL8-.js → erDiagram-Q63AITRT-ZLlx8xfs.js} +1 -1
  76. package/dist/assets/eventmodeling-45OFAUF4-YVtShyFA.js +1 -0
  77. package/dist/assets/extensions-CG4voDCh.js +1 -0
  78. package/dist/assets/flowDiagram-23GEKE2U-BeKXabVO.js +1 -0
  79. package/dist/assets/{form-actions-CMxhPact.js → form-actions-lv47uGIB.js} +1 -1
  80. package/dist/assets/{ganttDiagram-NO4QXBWP-_PiTPavJ.js → ganttDiagram-NO4QXBWP-DXCDjHR2.js} +1 -1
  81. package/dist/assets/gitGraph-TEB2WS4Q-jTSiBj-p.js +1 -0
  82. package/dist/assets/{gitGraphDiagram-IHSO6WYX-DsRB1ZMU.js → gitGraphDiagram-IHSO6WYX-l2HWrTJp.js} +1 -1
  83. package/dist/assets/index-BTSwNDVi.js +109 -0
  84. package/dist/assets/index-QrdUWHfm.css +1 -0
  85. package/dist/assets/info-DKCQHKI2-BIporNWb.js +1 -0
  86. package/dist/assets/{infoDiagram-FWYZ7A6U-wIRraYx5.js → infoDiagram-FWYZ7A6U-D-DjX-bn.js} +1 -1
  87. package/dist/assets/{ishikawaDiagram-FXEZZL3T-CNzsrcrh.js → ishikawaDiagram-FXEZZL3T-y_Xy128F.js} +1 -1
  88. package/dist/assets/{journeyDiagram-5HDEW3XC-Dy9huHxy.js → journeyDiagram-5HDEW3XC-DJn5xYcQ.js} +1 -1
  89. package/dist/assets/{kanban-definition-HUTT4EX6-BOCIN365.js → kanban-definition-HUTT4EX6-DJVIOR21.js} +1 -1
  90. package/dist/assets/{line-BxsizOTs.js → line-Cos7PIOj.js} +1 -1
  91. package/dist/assets/{linear-C_YHf92I.js → linear-BtDLqtzF.js} +1 -1
  92. package/dist/assets/loader-circle-CkaqeEne.js +1 -0
  93. package/dist/assets/{map-CobcjgZ8.js → map-BKnQyvd0.js} +1 -1
  94. package/dist/assets/mcp-marketplace-page-BSk0qUOX.js +9 -0
  95. package/dist/assets/mcp-marketplace-page-BgZGc-S_.js +1 -0
  96. package/dist/assets/{mermaid-parser.core-D7lu2RbA.js → mermaid-parser.core-XUNZhr2W.js} +2 -2
  97. package/dist/assets/{mermaid.core-CbfW2Rk8.js → mermaid.core-ySrvolIe.js} +3 -3
  98. package/dist/assets/{mindmap-definition-LN4V7U3C-DUjGXlIC.js → mindmap-definition-LN4V7U3C-BypL9tei.js} +1 -1
  99. package/dist/assets/model-config-page-c8RnUGoH.js +1 -0
  100. package/dist/assets/{navigation-link-v3FaWcIr.js → navigation-link-D0agTj5t.js} +1 -1
  101. package/dist/assets/{ordinal-CjoUCHto.js → ordinal-CxxVWxYU.js} +1 -1
  102. package/dist/assets/packet-7NZHBO7P-CuFMADV0.js +1 -0
  103. package/dist/assets/{pegDiagram-2B236MQR-BQY2DgiP.js → pegDiagram-2B236MQR-D-U2KBGv.js} +1 -1
  104. package/dist/assets/pie-RZYD4A2V-XUeIXhM9.js +1 -0
  105. package/dist/assets/{pieDiagram-ENE6RG2P-D18owe4D.js → pieDiagram-ENE6RG2P-CBi3GusJ.js} +1 -1
  106. package/dist/assets/plus-BiMjkv3R.js +1 -0
  107. package/dist/assets/{privacy-settings-page-CYM1Dxwo.js → privacy-settings-page-CPkyTvEE.js} +1 -1
  108. package/dist/assets/providers-config-page-CGUEb5Dx.js +1 -0
  109. package/dist/assets/{quadrantDiagram-ABIIQ3AL-B8F7YoTA.js → quadrantDiagram-ABIIQ3AL-H0ZuvnZL.js} +1 -1
  110. package/dist/assets/radar-I7S5WNFK-D-NNGh1k.js +1 -0
  111. package/dist/assets/railroad-3IZDKUUU-C67_uDaM.js +1 -0
  112. package/dist/assets/railroad-abnf-AHOZXSZD-BZ8Yflnd.js +1 -0
  113. package/dist/assets/railroad-ebnf-EBAXGLYW-B7zO7RoK.js +1 -0
  114. package/dist/assets/railroad-peg-LSFZ7HO6-R63PTgLz.js +1 -0
  115. package/dist/assets/{railroadDiagram-RFXS5EU6-RU8GpxN5.js → railroadDiagram-RFXS5EU6-D7Y2EqSd.js} +1 -1
  116. package/dist/assets/react-BMYFkaGi.js +8 -0
  117. package/dist/assets/refresh-cw-DjgY2Eju.js +1 -0
  118. package/dist/assets/remote-1LxkpRED.js +1 -0
  119. package/dist/assets/{requirementDiagram-TGXJPOKE-ubPOmmNi.js → requirementDiagram-TGXJPOKE-BiXNX1NN.js} +1 -1
  120. package/dist/assets/rotate-cw-Dot4PVh0.js +1 -0
  121. package/dist/assets/{runtime-config-page-C7vksFVD.js → runtime-config-page-C6nzqTHg.js} +1 -1
  122. package/dist/assets/{sankeyDiagram-HTMAVEWB-8L_hXJWW.js → sankeyDiagram-HTMAVEWB-qzDeLztW.js} +1 -1
  123. package/dist/assets/save-B-jdTe_c.js +1 -0
  124. package/dist/assets/search-CEp2AIiV.js +1 -0
  125. package/dist/assets/{search-config-page-DKdEf7m9.js → search-config-page-Dp5guS5O.js} +1 -1
  126. package/dist/assets/{secrets-config-page-COlMqSfL.js → secrets-config-page-C7nRMjiv.js} +2 -2
  127. package/dist/assets/security-config-DvHUDxSg.js +1 -0
  128. package/dist/assets/{select-BACzapV3.js → select-BNA3cma8.js} +2 -2
  129. package/dist/assets/{sequenceDiagram-DBY2YBRQ-Dom6Qor5.js → sequenceDiagram-DBY2YBRQ-BtRbPQtL.js} +1 -1
  130. package/dist/assets/{sizeCapture-X5ZJPWSS-cZcFSpLJ.js → sizeCapture-X5ZJPWSS-CMYvM3SL.js} +1 -1
  131. package/dist/assets/skeleton-CbroEO8Q.js +1 -0
  132. package/dist/assets/{src-BE9E1xcR.js → src-Bw-mzbQb.js} +1 -1
  133. package/dist/assets/{stateDiagram-2N3HPSRC-CHrpxmGO.js → stateDiagram-2N3HPSRC-BJ-mFeOz.js} +1 -1
  134. package/dist/assets/stateDiagram-v2-6OUMAXLB-BE-HqxOK.js +1 -0
  135. package/dist/assets/{swimlanes-5IMT3BWC-D6nJS2xQ.js → swimlanes-5IMT3BWC-BsucVOO2.js} +2 -2
  136. package/dist/assets/swimlanesDiagram-G3AALYLV-Dr1H9LJH.js +8 -0
  137. package/dist/assets/{tag-chip-BnamTQVX.js → tag-chip-DmCNi4-9.js} +1 -1
  138. package/dist/assets/{timeline-definition-FHXFAJF6-DJNn-HQO.js → timeline-definition-FHXFAJF6-Bicewlzo.js} +1 -1
  139. package/dist/assets/treeView-QDETBFTQ-npJ5dbqS.js +1 -0
  140. package/dist/assets/treemap-6X3UGDF4-pYrBx6oa.js +1 -0
  141. package/dist/assets/{vennDiagram-L72KCM5P-CCEzHoXt.js → vennDiagram-L72KCM5P-BxOOnO9x.js} +1 -1
  142. package/dist/assets/wardley-OPB4EBWU-CmSRKLR8.js +1 -0
  143. package/dist/assets/{wardleyDiagram-EHGQE667-BhyVxVXt.js → wardleyDiagram-EHGQE667-Cl7NltMv.js} +1 -1
  144. package/dist/assets/x-BTo5-A8h.js +1 -0
  145. package/dist/assets/{xychartDiagram-FW5EYKEG-CacW_246.js → xychartDiagram-FW5EYKEG-DiMIxQ7N.js} +1 -1
  146. package/dist/index.html +23 -22
  147. package/package.json +8 -8
  148. package/src/app/components/layout/__tests__/sidebar.layout.test.tsx +4 -0
  149. package/src/app/configs/app-navigation.config.ts +6 -0
  150. package/src/app/index.tsx +7 -0
  151. package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +33 -1
  152. package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +1 -0
  153. package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-controller.test.tsx +18 -1
  154. package/src/features/chat/features/conversation/hooks/__tests__/use-session-run-queue.test.tsx +26 -0
  155. package/src/features/chat/features/conversation/hooks/use-session-conversation-controller.ts +4 -1
  156. package/src/features/chat/features/conversation/hooks/use-session-run-queue.ts +8 -2
  157. package/src/features/chat/features/message/components/__tests__/chat-message-observation-event.test.tsx +46 -0
  158. package/src/features/chat/features/message/components/chat-message-list.container.tsx +11 -0
  159. package/src/features/chat/features/message/components/chat-message-observation-event.tsx +92 -0
  160. package/src/features/chat/features/message/utils/__tests__/chat-message-timeline-compaction.utils.test.ts +38 -0
  161. package/src/features/chat/features/message/utils/__tests__/chat-message-timeline.utils.test.ts +52 -0
  162. package/src/features/chat/features/message/utils/__tests__/chat-message.utils.test.ts +34 -0
  163. package/src/features/chat/features/message/utils/chat-message-observation-event.utils.ts +81 -0
  164. package/src/features/chat/features/message/utils/chat-message-part.utils.ts +15 -1
  165. package/src/features/chat/features/message/utils/chat-message-timeline.utils.ts +62 -1
  166. package/src/features/chat/features/ncp/hooks/use-ncp-session-queries.ts +36 -2
  167. package/src/features/chat/features/session/components/__tests__/chat-sidebar-session-item.test.tsx +28 -0
  168. package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +10 -2
  169. package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +35 -0
  170. package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +26 -47
  171. package/src/features/chat/features/session/components/session-header/chat-session-more-actions-menu.tsx +73 -0
  172. package/src/features/chat/features/session/utils/__tests__/ncp-session-adapter.utils.test.ts +28 -0
  173. package/src/features/chat/features/session/utils/ncp-session-adapter.utils.ts +3 -1
  174. package/src/features/chat/features/session/utils/ncp-session-context-metadata.utils.ts +3 -4
  175. package/src/features/chat/features/workspace/components/__tests__/chat-session-child-sessions.test.tsx +27 -1
  176. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +13 -0
  177. package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +29 -0
  178. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +19 -0
  179. package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +36 -2
  180. package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +4 -0
  181. package/src/features/chat/features/workspace/components/child-sessions/chat-session-child-sessions.tsx +28 -17
  182. package/src/features/chat/features/workspace/components/overview/__tests__/chat-session-continuous-attention.test.tsx +67 -0
  183. package/src/features/chat/features/workspace/components/overview/chat-session-continuous-attention.tsx +234 -0
  184. package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +9 -7
  185. package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +9 -4
  186. package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +25 -0
  187. package/src/features/chat/managers/chat-thread.manager.ts +5 -7
  188. package/src/features/chat/stores/chat-thread.store.ts +7 -4
  189. package/src/features/extensions/hooks/use-extensions.ts +11 -0
  190. package/src/features/extensions/index.ts +1 -0
  191. package/src/features/extensions/pages/__tests__/extensions-config-page.test.tsx +34 -0
  192. package/src/features/extensions/pages/extensions-config-page.tsx +136 -0
  193. package/src/shared/lib/api/ncp-session.types.ts +38 -0
  194. package/src/shared/lib/api/runtime-control.types.ts +17 -0
  195. package/src/shared/lib/api/types.ts +6 -0
  196. package/src/shared/lib/api/utils/ncp-session.utils.ts +35 -1
  197. package/src/shared/lib/api/utils/runtime-control.utils.ts +8 -0
  198. package/src/shared/lib/i18n/locales/en-US/chat.json +40 -0
  199. package/src/shared/lib/i18n/locales/en-US/core.json +27 -0
  200. package/src/shared/lib/i18n/locales/zh-CN/chat.json +40 -0
  201. package/src/shared/lib/i18n/locales/zh-CN/core.json +27 -0
  202. package/dist/assets/api-CUSlBpt_.js +0 -13
  203. package/dist/assets/architecture-TIHT7OUA-Bq0i9WiE.js +0 -1
  204. package/dist/assets/book-open-BJ-xAIp9.js +0 -1
  205. package/dist/assets/channel-iCaZQ87u.js +0 -1
  206. package/dist/assets/channels-list-page-nRHOasWA.js +0 -8
  207. package/dist/assets/chunk-2Q5K7J3B-DFQtlnJS.js +0 -1
  208. package/dist/assets/chunk-VAUOI2AC-CF9A-TeE.js +0 -1
  209. package/dist/assets/chunk-XXDRQBXY-BRxdfVCU.js +0 -1
  210. package/dist/assets/classDiagram-OUVF2IWQ-Bo28fPi-.js +0 -1
  211. package/dist/assets/classDiagram-v2-EOCWNBFH-BOVN9wUz.js +0 -1
  212. package/dist/assets/confirm-dialog-CCae9Fr4.js +0 -5
  213. package/dist/assets/cynefin-VYW2F7L2-B7rF3JRp.js +0 -1
  214. package/dist/assets/dist-1N9UpL3c.js +0 -1
  215. package/dist/assets/doc-browser-BHFCZIoL.js +0 -1
  216. package/dist/assets/doc-browser-CRlpqMwH.js +0 -1
  217. package/dist/assets/eventmodeling-45OFAUF4-DzQLXa3s.js +0 -1
  218. package/dist/assets/flowDiagram-23GEKE2U-C81eexJZ.js +0 -1
  219. package/dist/assets/gitGraph-TEB2WS4Q-Dt3ZqpFD.js +0 -1
  220. package/dist/assets/index-DdYOaKm7.js +0 -109
  221. package/dist/assets/index-DxCGKhAw.css +0 -1
  222. package/dist/assets/info-DKCQHKI2-CCCE7dXC.js +0 -1
  223. package/dist/assets/loader-circle-B-UdXjl4.js +0 -1
  224. package/dist/assets/mcp-marketplace-page-BUIGtSda.js +0 -1
  225. package/dist/assets/mcp-marketplace-page-CStb8ml2.js +0 -9
  226. package/dist/assets/model-config-page-BkfUYm95.js +0 -1
  227. package/dist/assets/packet-7NZHBO7P-D19yoxFV.js +0 -1
  228. package/dist/assets/pie-RZYD4A2V-hMaJbLrn.js +0 -1
  229. package/dist/assets/plus-Dw9QFnKr.js +0 -1
  230. package/dist/assets/providers-config-page-fxL4I4bz.js +0 -1
  231. package/dist/assets/radar-I7S5WNFK-C8BkvScA.js +0 -1
  232. package/dist/assets/railroad-3IZDKUUU-CozZOitC.js +0 -1
  233. package/dist/assets/railroad-abnf-AHOZXSZD-BqIoFXFi.js +0 -1
  234. package/dist/assets/railroad-ebnf-EBAXGLYW-CD2e3dng.js +0 -1
  235. package/dist/assets/railroad-peg-LSFZ7HO6-DoKlRUOF.js +0 -1
  236. package/dist/assets/react-Dlz_IxoP.js +0 -8
  237. package/dist/assets/refresh-cw-CK4I5UFv.js +0 -1
  238. package/dist/assets/remote-B0pPgtC6.js +0 -1
  239. package/dist/assets/rotate-cw-Z48dmh13.js +0 -1
  240. package/dist/assets/save-Bo37cIFb.js +0 -1
  241. package/dist/assets/search-CZiEm7YD.js +0 -1
  242. package/dist/assets/security-config-CitLihXA.js +0 -1
  243. package/dist/assets/skeleton-B2PCAZJG.js +0 -1
  244. package/dist/assets/stateDiagram-v2-6OUMAXLB-b1pZQlDD.js +0 -1
  245. package/dist/assets/swimlanesDiagram-G3AALYLV-CowxgWVn.js +0 -8
  246. package/dist/assets/treeView-QDETBFTQ-BQlYkJbz.js +0 -1
  247. package/dist/assets/treemap-6X3UGDF4-DzTOd1bd.js +0 -1
  248. package/dist/assets/wardley-OPB4EBWU-D80jQc0y.js +0 -1
  249. package/dist/assets/x-BzYEzkLA.js +0 -1
  250. /package/dist/assets/{array-COEOjKUv.js → array-BQVzeGRt.js} +0 -0
  251. /package/dist/assets/{chunk-KEIR6QF5-D7oHAcry.js → chunk-KEIR6QF5-f9psyCXK.js} +0 -0
  252. /package/dist/assets/{chunk-Y2CYZVJY-08IUpgTP.js → chunk-Y2CYZVJY-D1mAU_Po.js} +0 -0
  253. /package/dist/assets/{config-hints-BoE41XDI.js → config-hints-nV5HPOvq.js} +0 -0
  254. /package/dist/assets/{cytoscape.esm-HifWufkp.js → cytoscape.esm-0uDtdD0l.js} +0 -0
  255. /package/dist/assets/{defaultLocale-CA-_SsC1.js → defaultLocale-DSWXGgt0.js} +0 -0
  256. /package/dist/assets/{dist-C60rvfy8.js → dist--ta5rX12.js} +0 -0
  257. /package/dist/assets/{graphlib-CGYCNsoJ.js → graphlib-CQ6QV4yP.js} +0 -0
  258. /package/dist/assets/{host-capabilities-DPNRAjIj.js → host-capabilities-Tk038i04.js} +0 -0
  259. /package/dist/assets/{init-C3plFVsG.js → init-Y6h9jGtZ.js} +0 -0
  260. /package/dist/assets/{jszip.min-CeYs17Gn.js → jszip.min-8hyJpgpx.js} +0 -0
  261. /package/dist/assets/{katex-DRThweSG.js → katex-ARhY9PS1.js} +0 -0
  262. /package/dist/assets/{middleware-D05fK5Sb.js → middleware-DXsbf9xI.js} +0 -0
  263. /package/dist/assets/{path-BKtKxQ6Y.js → path-10BjdyLh.js} +0 -0
  264. /package/dist/assets/{rough.esm-DurL7-u7.js → rough.esm-DxgC_14r.js} +0 -0
  265. /package/dist/assets/{xlsx-Sg8fZ6nH.js → xlsx-DrDuDNAa.js} +0 -0
@@ -0,0 +1,109 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-ySrvolIe.js","assets/preload-helper-D4M6sveU.js","assets/chunk-HOUHSVGY-DPkq8FCm.js","assets/src-Bw-mzbQb.js","assets/chunk-DseTPa7n.js","assets/chunk-Y2CYZVJY-D1mAU_Po.js","assets/chunk-WYO6CB5R-Dn9To_OI.js","assets/chunk-ICXQ74PX-FAatv5fC.js","assets/dist--ta5rX12.js","assets/chunk-Q4XR5HBZ-DQFeUPxZ.js","assets/chunk-52WLFC77-viIcqj9q.js","assets/line-Cos7PIOj.js","assets/path-10BjdyLh.js","assets/array-BQVzeGRt.js","assets/chunk-7BUUIJ7U-BvydOcm3.js","assets/chunk-C7G6YPKG-DAizzYwr.js","assets/chunk-OGEWGWER-C3jdH3Ty.js","assets/chunk-ZGVPDNZ5-C6YtZDU0.js","assets/rough.esm-DxgC_14r.js","assets/chunk-FWX5IMBZ-D0ksHZZ9.js","assets/chunk-VAUOI2AC-BGvh3yIx.js","assets/chunk-ZIRB5QZD-DMuYtnHF.js","assets/docx-preview-BqwAjrj3.js","assets/jszip.min-8hyJpgpx.js","assets/aiden0z-pptx-renderer.es-Dp2ezlQn.js","assets/doc-browser-Dto54tCf.js","assets/doc-browser-Cm_tMZ_C.js","assets/dist-CmHtkFbs.js","assets/react-BMYFkaGi.js","assets/dist-A5btQciA.js","assets/createLucideIcon-Bydi9Gc5.js","assets/search-CEp2AIiV.js","assets/book-open-C0IlT9zs.js","assets/navigation-link-D0agTj5t.js","assets/host-capabilities-Tk038i04.js","assets/plus-BiMjkv3R.js","assets/refresh-cw-DjgY2Eju.js","assets/x-BTo5-A8h.js","assets/doc-browser-context-Bxw0ora-.js","assets/middleware-DXsbf9xI.js","assets/model-config-page-c8RnUGoH.js","assets/api-C2iYhdTe.js","assets/loader-circle-CkaqeEne.js","assets/form-actions-lv47uGIB.js","assets/skeleton-CbroEO8Q.js","assets/config-hints-nV5HPOvq.js","assets/appearance-settings-page-BwQDQr0n.js","assets/select-BNA3cma8.js","assets/mcp-marketplace-page-BSk0qUOX.js","assets/confirm-dialog-BI_Vt2s_.js","assets/tag-chip-DmCNi4-9.js","assets/search-config-page-Dp5guS5O.js","assets/config-split-page-VDTf3zZb.js","assets/providers-config-page-CGUEb5Dx.js","assets/extensions-CG4voDCh.js","assets/channels-list-page-B0z4bh8e.js","assets/runtime-config-page-C6nzqTHg.js","assets/rotate-cw-Dot4PVh0.js","assets/save-B-jdTe_c.js","assets/desktop-update-config-DVoD6NxG.js","assets/security-config-DvHUDxSg.js","assets/secrets-config-page-C7nRMjiv.js","assets/privacy-settings-page-CPkyTvEE.js","assets/mcp-marketplace-page-BgZGc-S_.js"])))=>i.map(i=>d[i]);
2
+ import{i as e,n as t,t as n}from"./chunk-DseTPa7n.js";import{A as r,B as i,C as a,D as o,E as s,F as c,H as l,L as u,M as d,N as f,O as p,P as m,R as h,S as g,T as _,V as v,_ as y,a as b,b as x,c as S,f as C,g as w,h as T,i as E,j as D,k as O,n as k,o as A,p as ee,r as j,s as M,t as N,v as te,w as P,x as ne,y as re,z as ie}from"./react-BMYFkaGi.js";import{t as ae}from"./preload-helper-D4M6sveU.js";import{a as oe,c as se,d as ce,f as le,i as ue,l as de,n as fe,o as pe,r as me,s as he,t as ge,u as _e}from"./navigation-link-D0agTj5t.js";import{$ as ve,$t as ye,A as be,At as xe,B as Se,Bt as Ce,C as we,Cn as Te,Ct as Ee,D as De,Dn as F,E as Oe,En as ke,Et as Ae,F as je,Fn as Me,Gt as Ne,I as Pe,In as Fe,It as Ie,J as Le,Jt as Re,Kt as ze,L as Be,Lt as Ve,M as He,Mn as Ue,Mt as We,N as Ge,Nn as Ke,Nt as I,O as qe,P as Je,Pn as Ye,Pt as Xe,Q as Ze,R as Qe,Rt as $e,S as et,Sn as tt,St as eee,T as nt,Tn as tee,Tt as nee,V as ree,Wt as iee,X as rt,Xt as it,Y as at,Yt as ot,Z as st,Zt as ct,_ as lt,_t as ut,a as dt,an as ft,at as pt,b as mt,bn as ht,bt as gt,c as _t,cn as vt,ct as yt,d as bt,dn as xt,dt as St,en as Ct,et as wt,fn as Tt,ft as Et,g as Dt,gn as Ot,gt as kt,h as At,hn as jt,ht as Mt,i as Nt,in as Pt,it as Ft,j as It,jn as Lt,jt as Rt,k as zt,l as Bt,ln as L,lt as Vt,m as Ht,mn as R,mt as Ut,n as Wt,nn as Gt,nt as Kt,o as qt,on as Jt,ot as Yt,p as Xt,pn as Zt,pt as Qt,r as $t,rn as en,rt as tn,s as nn,sn as rn,st as an,t as on,tt as sn,u as cn,un as ln,ut as un,v as dn,vn as fn,vt as pn,w as mn,wn as hn,wt as gn,x as _n,xn as vn,xt as yn,y as bn,yn as xn,yt as aee,z as oee,zt as Sn}from"./api-C2iYhdTe.js";import{_ as Cn,a as wn,c as Tn,d as En,f as see,g as Dn,h as On,i as kn,l as An,m as jn,n as Mn,o as Nn,p as Pn,r as Fn,s as In,u as Ln,v as Rn}from"./mcp-marketplace-page-BSk0qUOX.js";import{a as zn,b as Bn,c as Vn,d as Hn,f as Un,h as Wn,i as Gn,l as Kn,m as qn,o as Jn,r as Yn,s as Xn,v as Zn,y as Qn}from"./dist-CmHtkFbs.js";import{C as $n,D as er,E as tr,O as nr,S as rr,T as ir,_ as ar,a as or,b as sr,c as cr,d as lr,f as ur,g as dr,h as fr,i as pr,l as mr,m as hr,n as gr,o as _r,p as vr,r as yr,s as br,t as xr,u as Sr,v as Cr,w as wr,x as cee,y as Tr}from"./select-BNA3cma8.js";import{t as Er}from"./dist-A5btQciA.js";import{a as Dr,c as Or,d as kr,f as Ar,g as jr,h as Mr,i as Nr,l as Pr,m as Fr,n as Ir,o as Lr,p as Rr,r as zr,s as Br,t as Vr,u as Hr}from"./confirm-dialog-BI_Vt2s_.js";import{t as z}from"./createLucideIcon-Bydi9Gc5.js";import{S as Ur,_ as Wr,a as Gr,b as Kr,c as qr,d as Jr,f as Yr,g as Xr,h as Zr,i as Qr,l as $r,m as ei,n as ti,o as B,p as ni,r as ri,s as ii,u as ai,v as oi,x as si,y as ci}from"./doc-browser-Cm_tMZ_C.js";import{n as li,t as ui}from"./search-CEp2AIiV.js";import{t as di}from"./book-open-C0IlT9zs.js";import{t as fi}from"./loader-circle-CkaqeEne.js";import{t as pi}from"./plus-BiMjkv3R.js";import{t as mi}from"./refresh-cw-DjgY2Eju.js";import{t as hi}from"./x-BTo5-A8h.js";import{t as gi}from"./host-capabilities-Tk038i04.js";import{n as _i,t as vi}from"./middleware-DXsbf9xI.js";import{t as yi}from"./skeleton-CbroEO8Q.js";import{_ as bi,a as xi,c as Si,d as Ci,g as wi,h as Ti,i as Ei,l as Di,n as Oi,o as ki,p as Ai,r as ji,s as Mi,t as Ni,u as Pi,v as Fi}from"./doc-browser-context-Bxw0ora-.js";import{t as Ii}from"./tag-chip-DmCNi4-9.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Li=n((e=>{var t=v();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}));function Ri(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function zi(e,t,n){let r=e.slice(0);return r[t]=n,r}var Bi=class extends Fe{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,Ue.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Me(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ri(e,n).forEach(e=>{e.destroy()}),Ri(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Ye(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Lt(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=zi(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&Ue.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},V=e(l(),1);function Vi({queries:e,...t},n){let r=F(n),i=tee(),a=hn(),o=V.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{fn(e),vn(e,a,r.getQueryCache().get(e.queryHash))}),Te(a);let[s]=V.useState(()=>new Bi(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;V.useSyncExternalStore(V.useCallback(e=>d?s.subscribe(Ue.batchCalls(e)):Ke,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),V.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>ht(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&ht(n,e)?xn(n,new Lt(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&tt({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}var Hi=z(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Ui=z(`AlarmClock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),Wi=z(`Archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),Gi=z(`ArrowDown`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Ki=z(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),qi=z(`ArrowUp`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),Ji=z(`Blocks`,[[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`path`,{d:`M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3`,key:`1fpvtg`}]]),Yi=z(`BookOpenText`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M16 12h2`,key:`7q9ll5`}],[`path`,{d:`M16 8h2`,key:`msurwy`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}],[`path`,{d:`M6 12h2`,key:`32wvfc`}],[`path`,{d:`M6 8h2`,key:`30oboj`}]]),Xi=z(`Bookmark`,[[`path`,{d:`m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z`,key:`1fy3hk`}]]),Zi=z(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Qi=z(`Braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),$i=z(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),ea=z(`Brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),ta=z(`BriefcaseBusiness`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),na=z(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),ra=z(`CalendarDays`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),ia=z(`ChartNoAxesColumnIncreasing`,[[`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`10`,key:`1vz5eb`}],[`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`4`,key:`cun8e5`}],[`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`16`,key:`hq0ia6`}]]),aa=z(`ChartNoAxesColumn`,[[`line`,{x1:`18`,x2:`18`,y1:`20`,y2:`10`,key:`1xfpm4`}],[`line`,{x1:`12`,x2:`12`,y1:`20`,y2:`4`,key:`be30l9`}],[`line`,{x1:`6`,x2:`6`,y1:`20`,y2:`14`,key:`1r4le6`}]]),oa=z(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),sa=z(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ca=z(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),la=z(`ChevronsUp`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),ua=z(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),da=z(`CircleDashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),fa=z(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),pa=z(`CirclePause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),ma=z(`CirclePlay`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polygon`,{points:`10 8 16 12 10 16 10 8`,key:`1cimsy`}]]),ha=z(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),ga=z(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),_a=z(`Cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),va=z(`CodeXml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),ya=z(`Command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),ba=z(`Compass`,[[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),xa=z(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Sa=z(`CornerDownRight`,[[`polyline`,{points:`15 10 20 15 15 20`,key:`1q7qjw`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),Ca=z(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),wa=z(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),Ta=z(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ea=z(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Da=z(`Expand`,[[`path`,{d:`m21 21-6-6m6 6v-4.8m0 4.8h-4.8`,key:`1c15vz`}],[`path`,{d:`M3 16.2V21m0 0h4.8M3 21l6-6`,key:`1fsnz2`}],[`path`,{d:`M21 7.8V3m0 0h-4.8M21 3l-6 6`,key:`hawz9i`}],[`path`,{d:`M3 7.8V3m0 0h4.8M3 3l6 6`,key:`u9ee12`}]]),Oa=z(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ka=z(`FileArchive`,[[`path`,{d:`M10 12v-1`,key:`v7bkov`}],[`path`,{d:`M10 18v-2`,key:`1cjy8d`}],[`path`,{d:`M10 7V6`,key:`dljcrl`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01`,key:`gkbcor`}],[`circle`,{cx:`10`,cy:`20`,r:`2`,key:`1xzdoj`}]]),Aa=z(`FileAudio2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2`,key:`17k7jt`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`3`,cy:`17`,r:`1`,key:`vo6nti`}],[`path`,{d:`M2 17v-3a4 4 0 0 1 8 0v3`,key:`1ggdre`}],[`circle`,{cx:`9`,cy:`17`,r:`1`,key:`bc1fq4`}]]),ja=z(`FileCode2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`m5 12-3 3 3 3`,key:`oke12k`}],[`path`,{d:`m9 18 3-3-3-3`,key:`112psh`}]]),Ma=z(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Na=z(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),Pa=z(`FilePlus2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M3 15h6`,key:`4e2qda`}],[`path`,{d:`M6 12v6`,key:`1u72j0`}]]),Fa=z(`FileSpreadsheet`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),Ia=z(`FileVideo2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`rect`,{width:`8`,height:`6`,x:`2`,y:`12`,rx:`1`,key:`1a6c1e`}],[`path`,{d:`m10 15.5 4 2.5v-6l-4 2.5`,key:`t7cp39`}]]),La=z(`File`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}]]),Ra=z(`Files`,[[`path`,{d:`M20 7h-3a2 2 0 0 1-2-2V2`,key:`x099mo`}],[`path`,{d:`M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z`,key:`18t6ie`}],[`path`,{d:`M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8`,key:`1nja0z`}]]),za=z(`FolderKanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),Ba=z(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Va=z(`FolderPlus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ha=z(`FolderTree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Ua=z(`FolderUp`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]),Wa=z(`FolderX`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`m9.5 10.5 5 5`,key:`ra9qjz`}],[`path`,{d:`m14.5 10.5-5 5`,key:`l2rkpq`}]]),Ga=z(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),lee=z(`Forward`,[[`polyline`,{points:`15 17 20 12 15 7`,key:`1w3sku`}],[`path`,{d:`M4 18v-2a4 4 0 0 1 4-4h12`,key:`jmiej9`}]]),uee=z(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Ka=z(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),qa=z(`Globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),dee=z(`Grid3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Ja=z(`HardDrive`,[[`line`,{x1:`22`,x2:`2`,y1:`12`,y2:`12`,key:`1y58io`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}],[`line`,{x1:`6`,x2:`6.01`,y1:`16`,y2:`16`,key:`sgf278`}],[`line`,{x1:`10`,x2:`10.01`,y1:`16`,y2:`16`,key:`1l4acy`}]]),fee=z(`Heart`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}]]),Ya=z(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),pee=z(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Xa=z(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Za=z(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),mee=z(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),hee=z(`Laptop`,[[`path`,{d:`M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16`,key:`tarvll`}]]),gee=z(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),_ee=z(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),vee=z(`Lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),yee=z(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),bee=z(`ListCollapse`,[[`path`,{d:`m3 10 2.5-2.5L3 5`,key:`i6eama`}],[`path`,{d:`m3 19 2.5-2.5L3 14`,key:`w2gmor`}],[`path`,{d:`M10 6h11`,key:`c7qv1k`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 18h11`,key:`11hvi2`}]]),xee=z(`ListTodo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),Qa=z(`LocateFixed`,[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),See=z(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),$a=z(`Maximize2`,[[`polyline`,{points:`15 3 21 3 21 9`,key:`mznyad`}],[`polyline`,{points:`9 21 3 21 3 15`,key:`1avn1i`}],[`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`,key:`ota7mn`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),eo=z(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),to=z(`MessageSquarePlus`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}]]),Cee=z(`MessageSquareQuote`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M8 12a2 2 0 0 0 2-2V8H8`,key:`1jfesj`}],[`path`,{d:`M14 12a2 2 0 0 0 2-2V8h-2`,key:`1dq9mh`}]]),no=z(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),ro=z(`MessageSquare`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),wee=z(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Tee=z(`Minimize2`,[[`polyline`,{points:`4 14 10 14 10 20`,key:`11kfnr`}],[`polyline`,{points:`20 10 14 10 14 4`,key:`rlmsce`}],[`line`,{x1:`14`,x2:`21`,y1:`10`,y2:`3`,key:`o5lafz`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),io=z(`Minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ao=z(`Monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),oo=z(`Newspaper`,[[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2`,key:`7pis2x`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M10 6h8v4h-8V6Z`,key:`smlsk5`}]]),so=z(`NotebookText`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M9.5 8h5`,key:`11mslq`}],[`path`,{d:`M9.5 12H16`,key:`ktog6x`}],[`path`,{d:`M9.5 16H14`,key:`p1seyn`}]]),co=z(`PackagePlus`,[[`path`,{d:`M16 16h6`,key:`100bgy`}],[`path`,{d:`M19 13v6`,key:`85cyf1`}],[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}]]),lo=z(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),uo=z(`PanelLeftClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),fo=z(`PanelLeftDashed`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 14v1`,key:`askpd8`}],[`path`,{d:`M9 19v2`,key:`16tejx`}],[`path`,{d:`M9 3v2`,key:`1noubl`}],[`path`,{d:`M9 9v1`,key:`19ebxg`}]]),po=z(`PanelLeftOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),mo=z(`PanelLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),ho=z(`PanelRightClose`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),go=z(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}]]),_o=z(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),vo=z(`PenLine`,[[`path`,{d:`M12 20h9`,key:`t2du7b`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`,key:`1ykcvy`}]]),yo=z(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),bo=z(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),xo=z(`Puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Eee=z(`Radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),So=z(`RefreshCcw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Co=z(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),wo=z(`Send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),To=z(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Eo=z(`Settings2`,[[`path`,{d:`M20 7h-9`,key:`3s1dr2`}],[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Do=z(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Oo=z(`ShieldAlert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),ko=z(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ao=z(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),jo=z(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Mo=z(`SquareArrowOutUpRight`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),No=z(`SquareCheck`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Po=z(`SquarePen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Fo=z(`SquareTerminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Io=z(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Lo=z(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Ro=z(`Store`,[[`path`,{d:`m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7`,key:`ztvudi`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}],[`path`,{d:`M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4`,key:`2ebpfo`}],[`path`,{d:`M2 7h20`,key:`1fcdvo`}],[`path`,{d:`M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7`,key:`6c3vgh`}]]),zo=z(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),Bo=z(`TextQuote`,[[`path`,{d:`M17 6H3`,key:`16j9eg`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 18H8`,key:`1wfozv`}],[`path`,{d:`M3 12v6`,key:`fv4c87`}]]),Vo=z(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Ho=z(`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`}]]),Uo=z(`Unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),Wo=z(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),Dee=z(`User`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Oee=z(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),Go=z(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Ko=z(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),qo=Li(),H=i(),Jo={active:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},ready:{dot:`bg-emerald-500`,text:`text-emerald-600`,bg:`bg-emerald-50`},inactive:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},setup:{dot:`bg-gray-300`,text:`text-gray-400`,bg:`bg-gray-100/80`},warning:{dot:`bg-amber-400`,text:`text-amber-600`,bg:`bg-amber-50`}};function Yo({status:e,label:t,className:n}){let r=Jo[e];return(0,H.jsxs)(`div`,{className:u(`inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-2 py-0.5`,r.bg,n),children:[(0,H.jsx)(`span`,{className:u(`h-1.5 w-1.5 rounded-full`,r.dot)}),(0,H.jsx)(`span`,{className:u(`text-[11px] font-medium`,r.text),children:t})]})}function Xo(){return Ot({queryKey:$o,queryFn:At,staleTime:5e3,refetchOnWindowFocus:!0})}function Zo(e){let{label:t,muted:n,value:r}=e;return(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:t}),(0,H.jsx)(`span`,{className:n?`text-right text-muted-foreground`:`text-right text-foreground`,children:r==null||r===``?`-`:String(r)})]})}function Qo(){let e=F9(),t=Xo(),n=t.data,r=ss(e=>e.actionLabel),i=(0,V.useMemo)(()=>ps(n),[n]),a=!!r,o=n?.runtime?.deviceName?.trim()||n?.settings.deviceName?.trim()||b(`remoteDeviceNameAuto`),s=!!(n?.account.loggedIn&&os(n)),{hero:c,issueHint:l}=i;return(0,V.useEffect)(()=>{e.remoteAccessManager.syncStatus(n)},[e,n]),t.isLoading&&!n?(0,H.jsx)(Pt,{title:b(`remotePageTitle`),description:b(`remotePageDescription`),children:(0,H.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:b(`remoteLoading`)})}):(0,H.jsx)(Pt,{title:b(`remotePageTitle`),description:b(`remotePageDescription`),children:(0,H.jsxs)(`div`,{className:`grid gap-7 xl:grid-cols-[1.2fr_0.8fr]`,children:[(0,H.jsx)(en,{title:c.title,description:c.description,actions:(0,H.jsx)(Yo,{status:c.badgeStatus,label:c.badgeLabel}),children:(0,H.jsx)(Gt,{children:(0,H.jsxs)(`div`,{className:`space-y-5 p-4`,children:[(0,H.jsxs)(Dn,{tone:`neutral`,children:[(0,H.jsx)(Zo,{label:b(`remoteSignedInAccount`),value:n?.account.email}),(0,H.jsx)(Zo,{label:b(`remoteDeviceName`),value:o}),(0,H.jsx)(Zo,{label:b(`remoteConnectionStatus`),value:c.badgeLabel}),(0,H.jsx)(Zo,{label:b(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?j(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[i.primaryAction?(0,H.jsxs)(L,{onClick:()=>{if(i.primaryAction?.kind===`reauthorize`){e.remoteAccessManager.reauthorizeRemoteAccess(n);return}if(i.primaryAction?.kind===`repair`){e.remoteAccessManager.repairRemoteAccess(n);return}e.remoteAccessManager.enableRemoteAccess(n)},disabled:a,children:[i.primaryAction.showRefreshIcon?(0,H.jsx)(So,{className:`mr-2 h-4 w-4`}):null,r||i.primaryAction.label]}):null,(0,H.jsxs)(L,{variant:`outline`,onClick:()=>void e.accountManager.openNextClawWeb(),disabled:a||!s,children:[(0,H.jsx)(Mo,{className:`mr-2 h-4 w-4`}),b(`remoteOpenDeviceList`)]}),n?.settings.enabled?(0,H.jsx)(L,{variant:`outline`,onClick:()=>void e.remoteAccessManager.disableRemoteAccess(n),disabled:a,children:b(`remoteDisable`)}):null]}),i.shouldShowIssueHint&&l?(0,H.jsx)(Dn,{tone:`warning`,title:l.title,description:l.body}):null,(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b(`remoteOpenWebHint`)})]})})}),(0,H.jsx)(en,{title:(0,H.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(hee,{className:`h-4 w-4 text-primary`}),b(`remoteDeviceSectionTitle`)]}),description:b(`remoteDeviceSectionDescription`),children:(0,H.jsx)(Gt,{children:(0,H.jsxs)(`div`,{className:`space-y-5 p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(Yo,{status:n?.account.loggedIn?`ready`:`inactive`,label:n?.account.loggedIn?b(`remoteAccountConnected`):b(`remoteAccountNotConnected`)}),(0,H.jsx)(Yo,{status:n?.settings.enabled?`active`:`inactive`,label:n?.settings.enabled?b(`remoteEnabled`):b(`remoteStateDisabled`)}),(0,H.jsx)(Yo,{status:n?.service.running?`active`:`inactive`,label:n?.service.running?b(`remoteServiceRunning`):b(`remoteServiceStopped`)})]}),(0,H.jsxs)(Dn,{tone:`neutral`,children:[(0,H.jsx)(Zo,{label:b(`remoteDeviceName`),value:o}),(0,H.jsx)(Zo,{label:b(`remoteConnectionStatus`),value:c.badgeLabel}),(0,H.jsx)(Zo,{label:b(`remoteLastConnectedAt`),value:n?.runtime?.lastConnectedAt?j(n.runtime.lastConnectedAt):`-`,muted:!0})]}),(0,H.jsx)(Dn,{tone:`neutral`,borderStyle:`dashed`,description:n?.account.loggedIn?b(`remoteOpenWebHint`):b(`remoteStatusNeedsSignInDescription`),className:`text-sm`})]})})})]})})}var $o=[`remote-status`],es=`https://platform.nextclaw.io`,ts=`https://nextclaw-platform-console.pages.dev`,ns=async()=>await Tt.fetchQuery({queryKey:$o,queryFn:At,staleTime:5e3}),rs=async()=>(await Tt.invalidateQueries({queryKey:$o}),await ns()),is=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function as(e){let t=e?.trim();if(!t)return;let n;try{n=new URL(t)}catch{return}if(n.hostname===`platform.nextclaw.io`||n.hostname===`nextclaw-platform-console.pages.dev`)return n.origin;if(n.hostname===`ai-gateway-api.nextclaw.io`)return es;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return ts}var os=e=>as(e?.account.apiBase)||as(e?.settings.platformApiBase)||as(e?.platformBase)||as(e?.account.platformBase)||void 0,ss=N(e=>({enabled:!1,deviceName:``,platformApiBase:``,advancedOpen:!1,draftTouched:!1,actionLabel:null,doctor:null,setEnabled:t=>e({enabled:t,draftTouched:!0}),setDeviceName:t=>e({deviceName:t,draftTouched:!0}),setPlatformApiBase:t=>e({platformApiBase:t,draftTouched:!0}),setAdvancedOpen:t=>e({advancedOpen:t}),hydrateDraft:({enabled:t,deviceName:n,platformApiBase:r})=>e({enabled:t,deviceName:n,platformApiBase:r,draftTouched:!1}),beginAction:t=>e({actionLabel:t}),finishAction:()=>e({actionLabel:null}),setDoctor:t=>e({doctor:t})})),cs=class{constructor(e){this.params=e,this.syncStatus=e=>{if(!e)return;let t=ss.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{ss.getState().setEnabled(e)},this.setDeviceName=e=>{ss.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{ss.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{ss.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await rs(),n=ss.getState(),r=await this.ensureRemoteAccount(t,n.platformApiBase);await this.applyEnabledState(!0,r)},this.disableRemoteAccess=async e=>{let t=e??await rs();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await rs(),n=(await this.ensureRemoteAccount(t)).service.running?`restart`:`start`;await this.runManagedAction({actionLabel:b(n===`restart`?`remoteActionRestarting`:`remoteActionStarting`),job:async()=>{await Xt(n);let e=await rs();this.hydrateDraftFromStatus(e)},successMessage:b(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await rs(),n=await this.params.accountManager.startBrowserSignInAndWait({status:t,apiBase:ss.getState().platformApiBase});await this.repairRemoteAccess(n)},this.saveAdvancedSettings=async e=>{let t=e??await rs(),n=ss.getState();await this.runManagedAction({actionLabel:b(`remoteActionSavingAdvanced`),job:async()=>{await mt({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await rs();this.hydrateDraftFromStatus(e)},successMessage:t.settings.enabled===n.enabled?b(`remoteSettingsSaved`):b(`remoteAdvancedSaved`)})},this.runDoctor=async()=>{await this.runManagedAction({actionLabel:b(`remoteDoctorRunning`),job:async()=>{let e=await Ht();ss.getState().setDoctor(e)},successMessage:b(`remoteDoctorCompleted`)})},this.startService=async()=>{await this.runServiceAction(`start`,b(`remoteActionStarting`))},this.restartService=async()=>{await this.runServiceAction(`restart`,b(`remoteActionRestarting`))},this.stopService=async()=>{await this.runServiceAction(`stop`,b(`remoteActionStopping`))},this.applyEnabledState=async(e,t)=>{let n=ss.getState();await this.runManagedAction({actionLabel:b(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await mt({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await rs();this.hydrateDraftFromStatus(r),e?await Xt(r.service.running?`restart`:`start`):t.service.running&&await Xt(`restart`);let i=await rs();this.hydrateDraftFromStatus(i)},successMessage:b(e?`remoteEnabledReady`:`remoteDisabledDone`)})},this.ensureRemoteAccount=async(e,t)=>e.account.loggedIn?e:await this.params.accountManager.ensureSignedIn({apiBase:t,status:e}),this.runServiceAction=async(e,t)=>{await this.runManagedAction({actionLabel:t,job:async()=>{let t=await Xt(e),n=await rs();this.hydrateDraftFromStatus(n),R.success(t.message)}})},this.hydrateDraftFromStatus=e=>{ss.getState().hydrateDraft({enabled:e.settings.enabled,deviceName:e.settings.deviceName,platformApiBase:e.settings.platformApiBase})},this.runManagedAction=async e=>{let{actionLabel:t,job:n,successMessage:r}=e;ss.getState().beginAction(t);try{await n(),r&&R.success(r)}catch(e){let t=e instanceof Error?e.message:b(`error`);throw R.error(t),e}finally{ss.getState().finishAction()}}}},ls=[/invalid or expired token/i,/missing bearer token/i,/token expired/i,/token is invalid/i,/run "nextclaw login"/i,/browser sign-in again/i];function us(e){return e?.runtime?.lastError?.trim()||``}function ds(e){let t=b(`remoteStatusIssueDetailGeneric`),n=us(e);return n?`${t} (${n})`:t}function fs(e){if(!e?.settings.enabled)return!1;let t=us(e);return ls.some(e=>e.test(t))}function ps(e){return fs(e)?{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteStateReauthorizationRequired`),title:b(`remoteStatusReauthorizationTitle`),description:b(`remoteStatusReauthorizationDescription`)},primaryAction:{kind:`reauthorize`,label:b(`remoteReauthorizeNow`),showRefreshIcon:!1},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:b(`remoteStatusReauthorizationHint`)},shouldShowIssueHint:!0,requiresReauthorization:!0}:e?.account.loggedIn?e.settings.enabled?e.service.running?e.runtime?.state===`connected`?{hero:{badgeStatus:`ready`,badgeLabel:b(`statusReady`),title:b(`remoteStatusReadyTitle`),description:b(`remoteStatusReadyDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:e.runtime?.state===`connecting`?{hero:{badgeStatus:`active`,badgeLabel:b(`connecting`),title:b(`remoteStatusConnectingTitle`),description:b(`remoteStatusConnectingDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteStateDisconnected`),title:b(`remoteStatusIssueTitle`),description:b(`remoteStatusIssueDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:ds(e)},shouldShowIssueHint:!!(e.settings.enabled&&e.account.loggedIn),requiresReauthorization:!1}:{hero:{badgeStatus:`warning`,badgeLabel:b(`remoteServiceStopped`),title:b(`remoteStatusNeedsServiceTitle`),description:b(`remoteStatusNeedsServiceDescription`)},primaryAction:{kind:`repair`,label:b(`remoteReconnectNow`),showRefreshIcon:!0},issueHint:{title:b(`remoteStatusRecoveryTitle`),body:b(`remoteStatusIssueDetailServiceStopped`)},shouldShowIssueHint:!0,requiresReauthorization:!1}:{hero:{badgeStatus:`inactive`,badgeLabel:b(`statusInactive`),title:b(`remoteStatusNeedsEnable`),description:b(`remoteStatusNeedsEnableDescription`)},primaryAction:{kind:`enable`,label:b(`remoteEnableNow`),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:`setup`,badgeLabel:b(`statusSetup`),title:b(`remoteStatusNeedsSignIn`),description:b(`remoteStatusNeedsSignInDescription`)},primaryAction:{kind:`sign-in-enable`,label:b(`remoteSignInAndEnable`),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}}var ms=N(e=>({panelOpen:!1,authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500,openPanel:()=>e({panelOpen:!0}),closePanel:()=>e({panelOpen:!1}),beginBrowserAuth:({sessionId:t,verificationUri:n,expiresAt:r,intervalMs:i,statusMessage:a})=>e({panelOpen:!0,authSessionId:t,authVerificationUri:n,authExpiresAt:r,authPollIntervalMs:i,authStatusMessage:a}),updateBrowserAuth:({statusMessage:t,intervalMs:n})=>e(e=>({authStatusMessage:t??e.authStatusMessage,authPollIntervalMs:n??e.authPollIntervalMs})),clearBrowserAuth:()=>e({authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500}),setAuthStatusMessage:t=>e({authStatusMessage:t})}));function hs({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,H.jsx)(`span`,{className:`text-gray-500`,children:e}),(0,H.jsx)(`span`,{className:`text-right text-gray-900`,children:t?.trim()||`-`})]})}function gs(e){let{email:t,username:n,role:r,canSubmitUsername:i,savingUsername:a,usernameDraft:o,onUsernameDraftChange:s,onSubmitUsername:c,onOpenDeviceList:l,onLogout:u}=e;return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(Dn,{tone:`success`,title:b(`accountPanelSignedInTitle`),description:b(`accountPanelSignedInDescription`)}),(0,H.jsxs)(Dn,{tone:`neutral`,children:[(0,H.jsx)(hs,{label:b(`remoteAccountEmail`),value:t}),(0,H.jsx)(hs,{label:b(`remoteAccountUsername`),value:n}),(0,H.jsx)(hs,{label:b(`remoteAccountRole`),value:r})]}),n?(0,H.jsx)(`p`,{className:`text-xs text-gray-500`,children:b(`remoteAccountUsernameLockedHelp`)}):(0,H.jsxs)(Dn,{tone:`warning`,title:b(`remoteAccountUsernameRequiredTitle`),description:b(`remoteAccountUsernameRequiredDescription`),children:[(0,H.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,H.jsx)(rn,{htmlFor:`account-panel-username`,children:b(`remoteAccountUsername`)}),(0,H.jsx)(vt,{id:`account-panel-username`,value:o,onChange:e=>s(e.target.value),placeholder:b(`remoteAccountUsernamePlaceholder`),autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1})]}),(0,H.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:(0,H.jsx)(L,{disabled:!i,onClick:()=>void c(),children:b(a?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,H.jsxs)(L,{onClick:()=>void l(),children:[(0,H.jsx)(Mo,{className:`mr-2 h-4 w-4`}),b(`remoteOpenDeviceList`)]}),(0,H.jsxs)(L,{variant:`outline`,onClick:()=>void u(),children:[(0,H.jsx)(See,{className:`mr-2 h-4 w-4`}),b(`remoteLogout`)]})]})]})}function _s(e){let{authSessionId:t,authExpiresAt:n,authStatusMessage:r,authVerificationUri:i,onStartBrowserSignIn:a,onResumeBrowserSignIn:o}=e;return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(Dn,{tone:`neutral`,title:b(`accountPanelSignedOutTitle`),description:b(`accountPanelSignedOutDescription`),children:t?(0,H.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,H.jsx)(hs,{label:b(`remoteBrowserAuthSession`),value:t}),(0,H.jsx)(hs,{label:b(`remoteBrowserAuthExpiresAt`),value:n?j(n):`-`})]}):null}),r?(0,H.jsx)(`p`,{className:`text-sm text-gray-600`,children:r}):null,(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,H.jsx)(L,{onClick:()=>void a(),children:b(t?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),i?(0,H.jsx)(L,{variant:`outline`,onClick:()=>void o(),children:b(`remoteBrowserAuthResume`)}):null]})]})}function vs(){let e=j9(),t=Xo(),n=ms(e=>e.panelOpen),r=ms(e=>e.authSessionId),i=ms(e=>e.authVerificationUri),a=ms(e=>e.authExpiresAt),o=ms(e=>e.authStatusMessage),s=t.data,[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(!1);(0,V.useEffect)(()=>{e.accountManager.syncRemoteStatus(s)},[e,s]);let f=!u&&c.trim().length>0&&!s?.account.username;return(0,H.jsx)(Ir,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,H.jsxs)(zr,{className:`max-w-xl`,children:[(0,H.jsxs)(Lr,{children:[(0,H.jsxs)(Br,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Za,{className:`h-5 w-5 text-primary`}),b(`accountPanelTitle`)]}),(0,H.jsx)(Nr,{children:b(`accountPanelDescription`)})]}),s?.account.loggedIn?(0,H.jsx)(gs,{email:s.account.email,username:s.account.username,role:s.account.role,canSubmitUsername:f,savingUsername:u,usernameDraft:c,onUsernameDraftChange:l,onSubmitUsername:async()=>{d(!0);try{await e.accountManager.updateUsername(c)}finally{d(!1)}},onOpenDeviceList:()=>e.accountManager.openNextClawWeb(`/account`),onLogout:()=>e.accountManager.logout()}):(0,H.jsx)(_s,{authSessionId:r,authExpiresAt:a,authStatusMessage:o,authVerificationUri:i,onStartBrowserSignIn:()=>e.accountManager.startBrowserSignIn(),onResumeBrowserSignIn:()=>e.accountManager.resumeBrowserSignIn()})]})})}var ys=V.forwardRef(({className:e,hover:t=!0,surface:n=`raised`,...r},i)=>(0,H.jsx)(`div`,{ref:i,className:u(`rounded-2xl border bg-card text-card-foreground transition-colors duration-base`,n===`raised`?`border-border shadow-card`:`border-border/75 shadow-none`,t&&n===`raised`&&`hover:border-primary/25 hover:shadow-card-hover`,t&&n===`flat`&&`hover:bg-muted/40`,e),...r}));ys.displayName=`Card`;var bs=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(`div`,{ref:n,className:u(`flex flex-col space-y-1.5 p-6`,e),...t}));bs.displayName=`CardHeader`;var xs=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(`h3`,{ref:n,className:u(`text-[15px] font-semibold leading-tight tracking-tight text-foreground`,e),...t}));xs.displayName=`CardTitle`;var Ss=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(`p`,{ref:n,className:u(`text-[13px] text-muted-foreground leading-relaxed`,e),...t}));Ss.displayName=`CardDescription`;var Cs=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(`div`,{ref:n,className:u(`p-6 pt-0`,e),...t}));Cs.displayName=`CardContent`;var ws=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(`div`,{ref:n,className:u(`flex items-center justify-between p-6 pt-0`,e),...t}));ws.displayName=`CardFooter`;function kee({username:e}){let t=$e(),[n,r]=(0,V.useState)(e??``),[i,a]=(0,V.useState)(``),o=n.trim().length>0&&i.length>0&&!t.isPending;return(0,H.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,H.jsxs)(ys,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,H.jsxs)(bs,{children:[(0,H.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:b(`authBrand`)}),(0,H.jsx)(xs,{className:`text-2xl`,children:b(`authLoginTitle`)}),(0,H.jsx)(Ss,{children:b(`authLoginDescription`)})]}),(0,H.jsx)(Cs,{children:(0,H.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),o&&t.mutate({username:n.trim(),password:i})},children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:b(`authUsername`)}),(0,H.jsx)(vt,{value:n,onChange:e=>r(e.target.value),placeholder:b(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:b(`authPassword`)}),(0,H.jsx)(vt,{type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:b(`authPasswordPlaceholder`)})]}),(0,H.jsx)(L,{type:`submit`,className:`w-full`,disabled:!o,children:t.isPending?b(`authLoggingIn`):b(`authLoginAction`)})]})})]})})}var Aee=class{constructor(){this.authPollTimerId=null,this.browserSignInCompletion=null,this.openAccountPanel=()=>{ms.getState().openPanel()},this.closeAccountPanel=()=>{ms.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),this.resolveBrowserSignIn(e),ms.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=e?.status??await ns();return t.account.loggedIn?t:(this.openAccountPanel(),await this.startBrowserSignInAndWait({apiBase:e?.apiBase,status:t}))},this.startBrowserSignInAndWait=async e=>{let t=this.createBrowserSignInCompletion();return await this.startBrowserSignIn(e),await t},this.startBrowserSignIn=async e=>{try{let t=e?.apiBase,n=await dn({apiBase:is(e?.status??await ns(),t)});ms.getState().beginBrowserAuth({sessionId:n.sessionId,verificationUri:n.verificationUri,expiresAt:n.expiresAt,intervalMs:n.intervalMs,statusMessage:b(`remoteBrowserAuthWaiting`)}),(await gi.openExternalUrl(n.verificationUri)).opened||ms.getState().setAuthStatusMessage(b(`remoteBrowserAuthPopupBlocked`)),this.scheduleBrowserAuthPoll()}catch(e){let t=e instanceof Error?e.message:b(`remoteBrowserAuthStartFailed`);this.rejectBrowserSignIn(e),R.error(`${b(`remoteBrowserAuthStartFailed`)}: ${t}`)}},this.resumeBrowserSignIn=async()=>{let e=ms.getState().authVerificationUri;e&&await gi.openExternalUrl(e)},this.logout=async()=>{try{await Dt(),this.rejectBrowserSignIn(Error(`Signed out before browser sign-in completed.`)),ms.getState().clearBrowserAuth(),await rs(),R.success(b(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:b(`remoteLogoutFailed`);R.error(`${b(`remoteLogoutFailed`)}: ${t}`)}},this.updateUsername=async e=>{try{await bn({username:e.trim()}),await rs(),R.success(b(`remoteAccountUsernameSetSuccess`))}catch(e){let t=e instanceof Error?e.message:b(`remoteAccountUsernameSetFailed`);R.error(`${b(`remoteAccountUsernameSetFailed`)}: ${t}`)}},this.openNextClawWeb=async(e=`/`)=>{let t=os(await ns());if(!t){R.error(b(`remoteOpenWebUnavailable`));return}let n=new URL(e,`${t.replace(/\/+$/,``)}/`).toString();await gi.openExternalUrl(n)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=ms.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=ms.getState();if(e.authSessionId)try{let t=await ns(),n=await lt({sessionId:e.authSessionId,apiBase:is(t)});if(n.status===`pending`){ms.getState().updateBrowserAuth({statusMessage:b(`remoteBrowserAuthWaiting`),intervalMs:n.nextPollMs??1500}),this.scheduleBrowserAuthPoll();return}if(n.status===`expired`){this.clearPollTimer(),this.rejectBrowserSignIn(Error(n.message||b(`remoteBrowserAuthExpired`))),ms.getState().clearBrowserAuth(),R.error(n.message||b(`remoteBrowserAuthExpired`));return}ms.getState().setAuthStatusMessage(b(`remoteBrowserAuthCompleted`));let r=await rs();this.clearPollTimer(),this.resolveBrowserSignIn(r),ms.getState().clearBrowserAuth(),R.success(b(`remoteLoginSuccess`))}catch(e){this.clearPollTimer(),this.rejectBrowserSignIn(e),ms.getState().clearBrowserAuth();let t=e instanceof Error?e.message:b(`remoteBrowserAuthPollFailed`);R.error(`${b(`remoteBrowserAuthPollFailed`)}: ${t}`)}},this.clearPollTimer=()=>{this.authPollTimerId!==null&&(window.clearTimeout(this.authPollTimerId),this.authPollTimerId=null)},this.createBrowserSignInCompletion=()=>(this.rejectBrowserSignIn(Error(`Browser sign-in was replaced by a newer request.`)),new Promise((e,t)=>{this.browserSignInCompletion={resolve:e,reject:t}})),this.resolveBrowserSignIn=e=>{let t=this.browserSignInCompletion;t&&(this.browserSignInCompletion=null,t.resolve(e))},this.rejectBrowserSignIn=e=>{let t=this.browserSignInCompletion;t&&(this.browserSignInCompletion=null,t.reject(e instanceof Error?e:Error(String(e))))},this.getBrowserAuthSummary=()=>{let e=ms.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?j(e.authExpiresAt):`-`}}}},jee=`nextclaw.app.viewport-layout`,Mee=1;function Ts(e){return typeof e!=`number`||!Number.isFinite(e)?`desktop`:e<=767?`mobile`:`desktop`}function Es(){let e=typeof window>`u`?null:window.innerWidth??null;return{mode:Ts(e),width:e,isSidebarCollapsed:!1,isMainSidebarAppGroupCollapsed:!1}}function Ds(e,t){if(!e||typeof e!=`object`)return null;let n=e[t];return typeof n==`boolean`?n:null}var Os=N()(_i(()=>Es(),{name:jee,version:Mee,storage:vi(()=>window.localStorage),partialize:e=>({isSidebarCollapsed:e.isSidebarCollapsed,isMainSidebarAppGroupCollapsed:e.isMainSidebarAppGroupCollapsed}),merge:(e,t)=>{let n=Ds(e,`isSidebarCollapsed`),r=Ds(e,`isMainSidebarAppGroupCollapsed`);return{...t,...n===null?{}:{isSidebarCollapsed:n},...r===null?{}:{isMainSidebarAppGroupCollapsed:r}}}})),ks=new class{constructor(){this.consumerCount=0,this.started=!1,this.attach=()=>(this.consumerCount+=1,this.consumerCount===1&&this.start(),()=>{this.consumerCount=Math.max(0,this.consumerCount-1),this.consumerCount===0&&this.stop()}),this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`resize`,this.handleViewportChange),window.addEventListener(`orientationchange`,this.handleViewportChange),this.syncFromWindow())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`resize`,this.handleViewportChange),window.removeEventListener(`orientationchange`,this.handleViewportChange),this.started=!1)},this.getSnapshot=()=>Os.getState(),this.setSidebarCollapsed=e=>{Os.setState({isSidebarCollapsed:e})},this.setMainSidebarAppGroupCollapsed=e=>{Os.setState({isMainSidebarAppGroupCollapsed:e})},this.collapseSidebarForDenseRightPanels=e=>{if(!e.isDocBrowserOpen||!e.isDocBrowserDocked||!e.isWorkspacePanelOpen)return;let t=this.getSnapshot();if(t.mode!==`desktop`||t.isSidebarCollapsed)return;let n=typeof t.width==`number`?t.width:typeof window>`u`?null:window.innerWidth;typeof n!=`number`||!Number.isFinite(n)||n>1800||this.setSidebarCollapsed(!0)},this.toggleSidebarCollapsed=()=>{Os.setState(e=>({isSidebarCollapsed:!e.isSidebarCollapsed}))},this.toggleMainSidebarAppGroupCollapsed=()=>{Os.setState(e=>({isMainSidebarAppGroupCollapsed:!e.isMainSidebarAppGroupCollapsed}))},this.resetForTests=()=>{this.consumerCount=0,this.stop(),Os.setState(Es())},this.handleViewportChange=()=>{this.syncFromWindow()},this.syncFromWindow=()=>{if(typeof window>`u`)return;let e=window.innerWidth??null;Os.setState({width:e,mode:Ts(e)})}}};function As({parentSessionLabel:e,onGoToParentSession:t}){if(!e)return null;let n=e.trim();return(0,H.jsx)(`div`,{className:`bg-background/75 px-4 py-2 backdrop-blur-sm sm:px-5`,children:(0,H.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center gap-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:[(0,H.jsx)(li,{className:`h-3.5 w-3.5`}),(0,H.jsxs)(`span`,{children:[b(`chatBackToParent`),n?` · ${n}`:``]})]})})}function js({layoutMode:e,actions:t,leading:n,onBackToList:r,projectBadge:i,sessionTypeBadge:a,shouldShow:o,title:s,titleContent:c}){let l=e===`mobile`;return(0,H.jsxs)(`div`,{"data-testid":`chat-conversation-header`,className:u(`bg-background/80 backdrop-blur-sm flex items-center justify-between shrink-0 overflow-hidden transition-colors duration-200`,l?`px-3 sm:px-3`:`px-4 sm:px-5`,o?`opacity-100`:`h-0 py-0 opacity-0`,o&&(l?`min-h-12 pb-2 pt-2`:`h-[52px]`)),style:l&&o?{paddingTop:`calc(env(safe-area-inset-top, 0px) + 0.5rem)`}:void 0,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-center gap-2`,children:[l&&r?(0,H.jsx)(B,{icon:(0,H.jsx)(li,{className:`h-4 w-4`}),label:b(`chat`),onClick:r,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`}):null,n,c??(0,H.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:s}),a,i]}),t]})}function Ms(){let e=F();return(0,V.useCallback)(async t=>{let{invalidateSessionSkills:n=!0,sessionKey:r,patch:i,successMessage:a}=t;try{we(e,await Qe(r,i)),n&&await e.invalidateQueries({queryKey:[`ncp-session-skills`,r]}),a!==null&&R.success(a??b(`configSavedApplied`))}catch(e){throw R.error(b(`configSaveFailed`)+`: `+(e instanceof Error?e.message:String(e))),e}},[e])}function Ns(){let e=Ms();return async t=>{await e({sessionKey:t.sessionKey,patch:{label:t.label},successMessage:b(`configSavedApplied`)})}}function Ps(){let e=Ms();return async t=>{let{persistToServer:n,projectRoot:r,sessionKey:i}=t,a=b(r?`chatSessionProjectUpdated`:`chatSessionProjectCleared`);if(!n){R.success(a);return}await e({sessionKey:i,patch:{projectRoot:r},successMessage:a})}}function Fs({icon:e,label:t,onClick:n,disabled:r=!1,destructive:i=!1}){return(0,H.jsxs)(`button`,{type:`button`,className:u(`flex w-full items-center gap-2 rounded-xl px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,i?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`),onClick:n,disabled:r,children:[(0,H.jsx)(e,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:t})]})}var Is={key:`slash`,marker:`/`};function Ls(){return`composer-${Math.random().toString(36).slice(2,10)}`}function Rs(e=``){return{id:Ls(),type:`text`,text:e}}function zs(e){let{data:t,label:n,previewUrl:r,tokenKey:i,tokenKind:a}=e;return{id:Ls(),type:`token`,tokenKind:a,tokenKey:i,label:n,previewUrl:r,data:t}}function Bs(e){return e.type===`text`?e.text.length:1}function Vs(){return[Rs(``)]}function Hs(e){return[Rs(e)]}function Us(e){let t=[];for(let n of e){if(n.type===`text`){if(n.text.length===0)continue;let e=t[t.length-1];if(e?.type===`text`){t[t.length-1]={...e,text:e.text+n.text};continue}}t.push(n)}return t.length===0?Vs():t}function Ws(e){return e.map(e=>e.type===`text`?e.text:``).join(``)}function Gs(e){return e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Ks(e,t){let n=[],r=new Set;for(let i of e)i.type!==`token`||i.tokenKind!==t||r.has(i.tokenKey)||(r.add(i.tokenKey),n.push(i.tokenKey));return n}function qs(e,t,n,r){let i=Math.max(0,n-t),a=Math.max(0,t+e.text.length-r),o=[];return i>0&&o.push({...e,text:e.text.slice(0,i)}),a>0&&o.push({...e,text:e.text.slice(e.text.length-a)}),o}function Js(e,t,n,r){return t<=n||e>=r}function Ys(e,t,n,r,i){return!n&&r>=i?(e.push(...t),!0):n}function Xs(e,t,n,r,i,a,o){let s=qs(t,n,r,i);s[0]&&e.push(s[0]);let c=o;return c||=(e.push(...a),!0),s[1]&&e.push(s[1]),c}function Zs(e,t,n,r,i,a){return!r&&i<=a?(e.push(...n),!0):(e.push(t),r)}function Qs(e,t,n,r){let i=Math.max(0,t),a=Math.max(i,n),o=[],s=0,c=!1;for(let t of e){let e=Bs(t),n=s,l=s+e;if(Js(n,l,i,a)){c=Ys(o,r,c,n,a),o.push(t),s=l;continue}c=t.type===`text`?Xs(o,t,n,i,a,r,c):Zs(o,t,r,c,i,n),s=l}return c||o.push(...r),Us(o)}function $s(e,t){return Us(e.filter(e=>e.type!==`token`||!t(e)))}function ec(e,t){return t===0||/\s/.test(e[t-1]??``)}function tc(e,t,n){if(!t||t.start!==t.end)return null;let r=Ws(e),i=t.end,a=r.slice(0,i),o=a.lastIndexOf(n.marker);if(o<0||!ec(a,o))return null;let s=a.slice(o+n.marker.length);return/[\s\uFFFC]/.test(s)?null:{key:n.key,marker:n.marker,query:s.trim().toLowerCase(),start:o,end:i}}function nc(e,t,n=[Is]){let r=null;for(let i of n){let n=tc(e,t,i);n&&(!r||n.start>r.start)&&(r=n)}return r}function rc(e,t){let n=tc(e,t,Is);return n?{query:n.query,start:n.start,end:n.end}:null}var ic=e=>`[data-item-index="${e}"]`;function ac(e){let{activeIndex:t,containerRef:n,getItemSelector:r,isEnabled:i,itemCount:a}=e,o=r??ic;(0,V.useEffect)(()=>{if(!i||a===0)return;let e=n.current;if(!e)return;let r=e.querySelector(o(t));typeof r?.scrollIntoView==`function`&&r.scrollIntoView({block:`nearest`,inline:`nearest`})},[t,n,o,i,a])}function oc(){let e=(0,V.useRef)(null),[t,n]=(0,V.useState)(null);return(0,V.useEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let r=()=>{n(t.getBoundingClientRect().width)};r();let i=new ResizeObserver(()=>r());return i.observe(t),()=>i.disconnect()},[]),{elementRef:e,width:t}}function U(...e){return h(ie(e))}var sc=V.forwardRef(({className:e,type:t,...n},r)=>(0,H.jsx)(`input`,{type:t,className:U(`flex h-9 w-full rounded-xl border border-border bg-card px-3.5 py-2 text-sm text-foreground file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/55 placeholder:font-normal focus:outline-none focus:ring-0 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));sc.displayName=`ChatInput`;var cc=Mr,lc=jr,uc=Ar,dc=V.forwardRef(({className:e,children:t,closeLabel:n,...r},i)=>(0,H.jsxs)(Fr,{children:[(0,H.jsx)(Rr,{className:`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,H.jsxs)(kr,{ref:i,className:U(`fixed left-[50%] top-[50%] z-[var(--z-modal,10050)] grid max-h-[min(42rem,calc(100vh-2rem))] w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-2xl border border-border bg-background p-6 text-foreground shadow-xl outline-none duration-200 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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`,e),...r,children:[t,(0,H.jsxs)(Hr,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none`,children:[(0,H.jsx)(hi,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:n})]})]})]}));dc.displayName=kr.displayName;var fc=({className:e,...t})=>(0,H.jsx)(`div`,{className:U(`flex flex-col gap-2 text-center sm:text-left`,e),...t}),pc=`Popover`,[mc,Nee]=Zn(pc,[Xn]),hc=Xn(),[gc,_c]=mc(pc),vc=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=hc(t),c=V.useRef(null),[l,u]=V.useState(!1),[d,f]=qn({prop:r,defaultProp:i??!1,onChange:a,caller:pc});return(0,H.jsx)(Jn,{...s,children:(0,H.jsx)(gc,{scope:t,contentId:Wn(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:V.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:V.useCallback(()=>u(!0),[]),onCustomAnchorRemove:V.useCallback(()=>u(!1),[]),modal:o,children:n})})};vc.displayName=pc;var yc=`PopoverAnchor`,bc=V.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=_c(yc,n),a=hc(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return V.useEffect(()=>(o(),()=>s()),[o,s]),(0,H.jsx)(Yn,{...a,...r,ref:t})});bc.displayName=yc;var xc=`PopoverTrigger`,Sc=V.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=_c(xc,n),a=hc(n),o=Qn(t,i.triggerRef),s=(0,H.jsx)(Hn.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Lc(i.open),...r,ref:o,onClick:Bn(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,H.jsx)(Yn,{asChild:!0,...a,children:s})});Sc.displayName=xc;var Cc=`PopoverPortal`,[wc,Tc]=mc(Cc,{forceMount:void 0}),Ec=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=_c(Cc,t);return(0,H.jsx)(wc,{scope:t,forceMount:n,children:(0,H.jsx)(Er,{present:n||a.open,children:(0,H.jsx)(Vn,{asChild:!0,container:i,children:r})})})};Ec.displayName=Cc;var Dc=`PopoverContent`,Oc=V.forwardRef((e,t)=>{let n=Tc(Dc,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=_c(Dc,e.__scopePopover);return(0,H.jsx)(Er,{present:r||a.open,children:a.modal?(0,H.jsx)(Ac,{...i,ref:t}):(0,H.jsx)(jc,{...i,ref:t})})});Oc.displayName=Dc;var kc=Un(`PopoverContent.RemoveScroll`),Ac=V.forwardRef((e,t)=>{let n=_c(Dc,e.__scopePopover),r=V.useRef(null),i=Qn(t,r),a=V.useRef(!1);return V.useEffect(()=>{let e=r.current;if(e)return ir(e)},[]),(0,H.jsx)(tr,{as:kc,allowPinchZoom:!0,children:(0,H.jsx)(Mc,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Bn(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Bn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Bn(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),jc=V.forwardRef((e,t)=>{let n=_c(Dc,e.__scopePopover),r=V.useRef(!1),i=V.useRef(!1);return(0,H.jsx)(Mc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Mc=V.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=_c(Dc,n),p=hc(n);return er(),(0,H.jsx)(nr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,H.jsx)(Kn,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,H.jsx)(zn,{"data-state":Lc(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),Nc=`PopoverClose`,Pc=V.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=_c(Nc,n);return(0,H.jsx)(Hn.button,{type:`button`,...r,ref:t,onClick:Bn(e.onClick,()=>i.onOpenChange(!1))})});Pc.displayName=Nc;var Fc=`PopoverArrow`,Ic=V.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=hc(n);return(0,H.jsx)(Gn,{...i,...r,ref:t})});Ic.displayName=Fc;function Lc(e){return e?`open`:`closed`}var Rc=vc,zc=bc,Bc=Sc,Vc=Ec,Hc=Oc,Uc=`2rem`;function Wc(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${Uc})))`}var Gc=Wc(`24rem`),Kc=Rc,qc=Bc,Jc=zc,Yc=V.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,collisionPadding:r=12,style:i,...a},o)=>(0,H.jsx)(Vc,{children:(0,H.jsx)(Hc,{ref:o,sideOffset:t,align:n,collisionPadding:r,className:U(`z-[var(--z-popover,50)] w-72 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=top]:slide-in-from-bottom-2 data-[side=right]:slide-in-from-left-2`,e),style:{maxHeight:Gc,...i},...a})}));Yc.displayName=Hc.displayName;var Xc=fr,Zc=cr,Qc=sr,$c=`2rem`;function el(e){return`min(${e}, max(0px, calc(var(--radix-select-content-available-height, 100vh) - ${$c})))`}var tl=el(`24rem`),nl=V.forwardRef(({className:e,children:t,...n},r)=>(0,H.jsxs)(Tr,{ref:r,className:U(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-0 focus:border-border disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,H.jsx)(mr,{asChild:!0,children:(0,H.jsx)($n,{className:`h-4 w-4 opacity-50`})})]}));nl.displayName=Tr.displayName;var rl=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(ar,{ref:n,className:U(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,H.jsx)(rr,{className:`h-4 w-4`})}));rl.displayName=ar.displayName;var il=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(dr,{ref:n,className:U(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,H.jsx)($n,{className:`h-4 w-4`})}));il.displayName=dr.displayName;var al=V.forwardRef(({className:e,children:t,collisionPadding:n=12,position:r=`popper`,style:i,viewportClassName:a,...o},s)=>(0,H.jsx)(hr,{children:(0,H.jsxs)(br,{ref:s,className:U(`relative z-50 flex max-h-96 min-w-[8rem] flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),collisionPadding:n,position:r,style:{maxHeight:tl,...i},...o,children:[(0,H.jsx)(rl,{}),(0,H.jsx)(cee,{className:U(`min-h-0 flex-1 overflow-y-auto overscroll-contain p-1`,r===`popper`&&`w-full min-w-[var(--radix-select-trigger-width)]`,a),children:t}),(0,H.jsx)(il,{})]})}));al.displayName=br.displayName;var ol=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(vr,{ref:n,className:U(`px-2 py-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,e),...t}));ol.displayName=vr.displayName;var sl=V.forwardRef(({className:e,children:t,...n},r)=>(0,H.jsxs)(Sr,{ref:r,className:U(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,e),...n,children:[(0,H.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(lr,{children:(0,H.jsx)(wr,{className:`h-4 w-4`})})}),(0,H.jsx)(ur,{children:t})]}));sl.displayName=Sr.displayName;var cl=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Cr,{ref:n,className:U(`-mx-1 my-1 h-px bg-border`,e),...t}));cl.displayName=Cr.displayName;var ll=ni,ul=ei,Pee=Zr,dl=V.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,H.jsx)(Yr,{children:(0,H.jsx)(Jr,{ref:r,sideOffset:t,className:U(`z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));dl.displayName=Jr.displayName;var fl={Dialog:cc,DialogContent:dc,DialogDescription:uc,DialogHeader:fc,DialogTitle:lc,Popover:Kc,PopoverAnchor:Jc,PopoverContent:Yc,PopoverTrigger:qc,Input:sc,Select:Xc,SelectContent:al,SelectGroup:Zc,SelectItem:sl,SelectLabel:ol,SelectSeparator:cl,SelectTrigger:nl,SelectValue:Qc,Tooltip:ul,TooltipContent:dl,TooltipProvider:ll,TooltipTrigger:Pee};function Fee({pathPreview:e}){return(0,H.jsxs)(`div`,{className:`rounded-lg border border-gray-200 bg-gray-50/70 px-3 py-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-gray-600`,children:[(0,H.jsx)(Ga,{"aria-hidden":`true`,className:`h-4 w-4 text-gray-400`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.rootLabel})]}),(0,H.jsx)(`div`,{className:`mt-2`,children:e.segments.map((e,t)=>{let n=e.kind===`directory`?Ga:La;return(0,H.jsxs)(`div`,{className:`relative flex min-w-0 items-center gap-2 py-1 text-xs text-gray-700`,style:{paddingLeft:`${(t+1)*18}px`},children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`absolute bottom-1/2 top-[-0.25rem] w-px bg-gray-200`,style:{left:`${t*18+7}px`}}),(0,H.jsx)(n,{"aria-hidden":`true`,className:`h-4 w-4 shrink-0 text-gray-400`}),(0,H.jsx)(`span`,{className:`truncate font-medium`,children:e.label})]},`${t}:${e.label}`)})})]})}var Iee=680,Lee=.82,Ree=560,pl=Wc(`24rem`),zee={back:li,"calendar-clock":na,command:ya,file:La,files:Ra,folder:Ga,inbox:Xa,"list-collapse":bee,"message-square-plus":to,"panel-app":Ur,project:za,skill:Or};function ml(e,t){return!t.sectionKeys||t.sectionKeys.length===0?!0:!!(e.sectionKey&&t.sectionKeys.includes(e.sectionKey))}function hl(e,t){return e?.length?e.some(e=>e.key===t)?t:e[0].key:null}function gl({icon:e}){let t=zee[e];return(0,H.jsx)(`span`,{"aria-hidden":`true`,"data-input-surface-icon":e,className:`inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-gray-100 text-gray-500`,children:(0,H.jsx)(t,{className:`h-3.5 w-3.5`})})}function _l({item:e,texts:t}){return e?(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.subtitle?(0,H.jsx)(`span`,{className:`inline-flex rounded-full bg-primary/10 px-2 py-0.5 text-[11px] font-semibold text-primary`,children:e.subtitle}):null,(0,H.jsx)(`span`,{className:`text-sm font-semibold text-gray-900`,children:e.title})]}),(0,H.jsx)(`p`,{className:`text-xs leading-5 text-gray-600`,children:e.description}),e.pathPreview?(0,H.jsx)(Fee,{pathPreview:e.pathPreview}):null,(0,H.jsx)(`div`,{className:`space-y-1`,children:e.detailLines.map(e=>(0,H.jsx)(`div`,{className:`min-w-0 break-all rounded-md bg-gray-50 px-2 py-1 text-[11px] leading-5 text-gray-600`,children:e},e))}),(0,H.jsx)(`div`,{className:`pt-1 text-[11px] text-gray-500`,children:e.hintLabel??t.itemHintLabel})]}):(0,H.jsx)(`div`,{className:`text-xs text-gray-500`,children:t.hintLabel})}function vl(e){let{activeIndex:t,event:n,isOpen:r,items:i,onOpenChange:a,onSelectItem:o,setActiveIndex:s}=e;return r?n.key===`Escape`?(n.preventDefault(),a(!1),!0):i.length===0?!1:n.key===`ArrowDown`?(n.preventDefault(),s(e=>(e+1)%i.length),!0):n.key===`ArrowUp`?(n.preventDefault(),s(e=>(e-1+i.length)%i.length),!0):n.key===`Enter`&&!n.shiftKey||n.key===`Tab`?(n.preventDefault(),o(i[t]),!0):!1:!1}var yl=(0,V.forwardRef)(function(e,t){let{Popover:n,PopoverAnchor:r,PopoverContent:i}=fl,{elementRef:a,width:o}=oc(),s=(0,V.useRef)(null),[c,l]=(0,V.useState)({index:0,itemsSignature:``}),{isOpen:u,isLoading:d,filterOptions:f,items:p,notice:m,texts:h,onSelectItem:g,onOpenChange:_,onDetailsPointerDown:v}=e,[y,b]=(0,V.useState)(f?.[0]?.key??null),x=(0,V.useMemo)(()=>hl(f,y),[y,f]),S=(0,V.useMemo)(()=>f?.find(e=>e.key===x)??null,[f,x]),C=(0,V.useMemo)(()=>f?.map(e=>({...e,count:p.filter(t=>ml(t,e)).length}))??[],[f,p]),w=(0,V.useMemo)(()=>S?p.filter(e=>ml(e,S)):p,[S,p]),T=(0,V.useMemo)(()=>w.map(e=>e.key).join(``),[w]),E=(0,V.useMemo)(()=>w.some(e=>!!e.sectionLabel?.trim()),[w]),D=c.itemsSignature===T?c.index:0,O=w.length===0?0:Math.min(D,w.length-1),k=w[O]??null,A=(0,V.useCallback)(e=>{b(e),l({index:0,itemsSignature:``})},[]),ee=(0,V.useCallback)(e=>{l(t=>{let n=t.itemsSignature===T?t.index:0;return{index:typeof e==`function`?e(n):e,itemsSignature:T}})},[T]),j=(0,V.useCallback)(e=>{e.selectionBehavior===`navigate`&&l({index:0,itemsSignature:``}),g(e)},[g]),M=(0,V.useMemo)(()=>{if(o)return Math.min(o>Ree?o*Lee:o,Iee)},[o]);return(0,V.useImperativeHandle)(t,()=>({handleKeyDown:e=>vl({activeIndex:O,event:e,isOpen:u,items:w,onOpenChange:_,onSelectItem:j,setActiveIndex:ee})}),[O,u,_,j,ee,w]),ac({containerRef:s,activeIndex:O,itemCount:w.length,isEnabled:u&&!d,getItemSelector:e=>`[data-input-surface-index="${e}"]`}),(0,H.jsxs)(n,{open:u,onOpenChange:_,children:[(0,H.jsx)(r,{asChild:!0,children:(0,H.jsx)(`div`,{ref:a,className:`pointer-events-none absolute bottom-0 left-3 right-3 top-0`})}),(0,H.jsx)(i,{side:`top`,align:`start`,sideOffset:10,className:`z-[70] flex max-w-[calc(100vw-1.5rem)] flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white/95 p-0 shadow-2xl backdrop-blur-md`,onOpenAutoFocus:e=>e.preventDefault(),style:{height:pl,maxHeight:pl,width:M?`${M}px`:void 0},children:(0,H.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[minmax(220px,300px)_minmax(0,1fr)]`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-col border-r border-gray-200`,children:[!d&&C.length>0?(0,H.jsx)(`div`,{className:`flex shrink-0 gap-0.5 overflow-x-auto px-2 pb-1.5 pt-2`,children:C.map(({count:e,key:t,label:n})=>{let r=t===x;return(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":r,onPointerDown:e=>e.preventDefault(),onClick:()=>A(t),className:`inline-flex h-7 shrink-0 items-center gap-1 rounded-md px-2 text-[11px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 ${r?`bg-gray-100 text-gray-900`:`text-gray-600 hover:bg-gray-100 hover:text-gray-900`}`,children:[(0,H.jsx)(`span`,{children:n}),(0,H.jsx)(`span`,{className:r?`text-gray-500`:`text-gray-400`,children:e})]},t)})}):null,!d&&m?(0,H.jsxs)(`div`,{className:`mx-2 mb-1.5 flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-2.5 py-2 text-xs leading-4 text-red-700`,children:[(0,H.jsx)(Pr,{"aria-hidden":`true`,className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{children:m.message})]}):null,(0,H.jsx)(`div`,{ref:s,role:`listbox`,"aria-label":h.sectionLabel,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain ${!d&&C.length>0?`px-2 pb-2`:`p-2`}`,children:d?(0,H.jsx)(`div`,{className:`p-2 text-xs text-gray-500`,children:h.loadingLabel}):(0,H.jsxs)(H.Fragment,{children:[E?null:(0,H.jsx)(`div`,{className:`mb-1 px-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:h.sectionLabel}),w.length===0?(0,H.jsx)(`div`,{className:`px-1.5 text-xs text-gray-400`,children:h.emptyLabel}):(0,H.jsx)(`div`,{children:w.map((e,t)=>{let{icon:n,key:r,sectionKey:i,sectionLabel:a,title:o,subtitle:s}=e,c=t===O,l=w[t-1];return(0,H.jsxs)(`div`,{children:[E&&a?.trim()&&l?.sectionKey!==i?(0,H.jsx)(`div`,{className:`px-1.5 pb-1 pt-1.5 text-[11px] font-semibold uppercase tracking-wide text-gray-500`,children:a}):null,(0,H.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":c,"data-input-surface-index":t,onPointerMove:e=>{e.pointerType!==`touch`&&ee(t)},onPointerDown:t=>{t.button>0||(t.preventDefault(),j(e))},onClick:t=>{t.detail===0&&j(e)},className:`flex w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-left leading-4 transition-colors ${c?`bg-gray-100 text-gray-900`:`text-gray-700 hover:bg-gray-100`}`,children:[n?(0,H.jsx)(gl,{icon:n}):null,(0,H.jsx)(`span`,{className:`truncate text-xs font-medium`,children:o}),(0,H.jsx)(`span`,{className:`truncate text-xs text-gray-500`,children:s})]})]},r)})})]})})]}),(0,H.jsx)(`div`,{className:`custom-scrollbar min-h-0 min-w-0 select-text overflow-y-auto overscroll-contain p-2.5`,onPointerDown:v,children:(0,H.jsx)(_l,{item:k,texts:h})})]})})]})});function bl(e){return`${e.key}:${e.marker}:${e.start}`}function xl(e,t){return t.type===`insert-text`&&e.query===``&&e.end===e.start+e.marker.length}function Sl(e,t,n){if(!t)return null;let r=bl(t);return e===r?e:xl(t,n)?r:null}function Cl(e){let{children:t,inputSurface:n,onInputSurfaceTriggerChange:r,onSelectItem:i,triggerSpecs:a=[Is]}=e,o=(0,V.useRef)(null),s=(0,V.useRef)(!1),c=(0,V.useRef)(null),[l,u]=(0,V.useState)(null),d=!!n&&l!==null,f=(0,V.useCallback)((e,t)=>{c.current=e,u(e),r?.(e?t:null)},[r]),p=(0,V.useCallback)((e,t,n)=>{let r=nc(e,t,a),i=Sl(c.current,r,n);f(i,i?r:null)},[f,a]),m=(0,V.useCallback)(e=>o.current?.handleKeyDown(e)??!1,[]),h=(0,V.useCallback)(e=>{!e&&!s.current&&f(null,null)},[f]);return(0,H.jsxs)(H.Fragment,{children:[t((0,V.useMemo)(()=>({onInputSurfaceKeyDown:m,onInputSurfaceOpenChange:h,onInputSurfaceSnapshotChange:p}),[m,h,p])),n&&d?(0,H.jsx)(yl,{ref:o,isOpen:d,isLoading:n.isLoading,filterOptions:n.filterOptions,items:n.items,notice:n.notice,texts:n.texts,onSelectItem:e=>{e.selectionBehavior!==`navigate`&&f(null,null),i(e)},onOpenChange:h,onDetailsPointerDown:()=>{s.current=!0,requestAnimationFrame(()=>{s.current=!1})}},l):null]})}var wl=xt(`inline-flex items-center justify-center whitespace-nowrap rounded-full text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-border bg-card text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,secondary:`bg-muted text-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,ghost:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`,primary:`bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm`,subtle:`bg-muted text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,"primary-outline":`border border-primary/30 text-primary hover:bg-primary hover:text-primary-foreground`},size:{default:`h-9 px-4 py-2`,sm:`h-8 px-3 text-xs`,lg:`h-11 px-5 text-[14px]`,xl:`h-12 px-6 text-[15px]`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),Tl=V.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,H.jsx)(`button`,{className:U(wl({variant:t,size:n,className:e})),ref:i,...r}));Tl.displayName=`ChatButton`;function El(){return(0,H.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`chat-stop-icon`,className:`block h-3 w-3 rounded-[2px] bg-foreground shadow-[inset_0_0_0_1px_hsl(var(--border))]`})}function Dl({contextWindow:e}){let{Tooltip:t,TooltipContent:n,TooltipProvider:r,TooltipTrigger:i}=fl,a=Math.max(0,Math.min(1,e.ratio)),o=Math.round(a*360);return(0,H.jsx)(r,{delayDuration:0,children:(0,H.jsxs)(t,{children:[(0,H.jsx)(i,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,"aria-label":e.label,title:e.label,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[7px] rounded-full`,style:{background:`conic-gradient(hsl(var(--muted-foreground)) ${o}deg, hsl(var(--border)) 0deg)`}}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-[10px] rounded-full bg-card`})]})}),(0,H.jsx)(n,{side:`top`,className:`max-w-[18rem]`,children:(0,H.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-5 font-semibold text-foreground`,children:[(0,H.jsx)(`span`,{children:e.label}),(0,H.jsx)(`span`,{children:e.percentLabel})]}),e.details.map(e=>(0,H.jsxs)(V.Fragment,{children:[e.dividerBefore?(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`my-2 border-t border-border/70`,"data-testid":`context-window-detail-divider`}):null,(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-5 text-muted-foreground`,children:[(0,H.jsx)(`span`,{children:e.label}),(0,H.jsx)(`span`,{className:`font-medium text-foreground`,children:e.value})]})]},e.label))]})})]})})}function Ol({children:e,label:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=fl;return(0,H.jsx)(i,{delayDuration:250,children:(0,H.jsxs)(n,{children:[(0,H.jsx)(a,{asChild:!0,children:(0,H.jsx)(`span`,{className:`inline-flex`,children:e})}),(0,H.jsx)(r,{side:`top`,className:`text-xs`,children:t})]})})}function kl({isSending:e,canStopGeneration:t,sendDisabled:n,stopDisabled:r,stopHint:i,sendButtonLabel:a,sendIcon:o=`send`,stopButtonLabel:s,contextWindow:c,onSend:l,onStop:u}){return(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[c?(0,H.jsx)(Dl,{contextWindow:c}):null,!e||!n?(0,H.jsx)(Ol,{label:a,children:(0,H.jsx)(Tl,{size:`icon`,className:`h-8 w-8 rounded-full`,"aria-label":a,onClick:()=>void l(),disabled:n,children:o===`continue`?(0,H.jsx)(bo,{"data-testid":`chat-continue-input-icon`,className:`h-4 w-4`}):(0,H.jsx)(qi,{className:`h-5 w-5`})})}):t?(0,H.jsx)(Ol,{label:s,children:(0,H.jsx)(Tl,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":s,onClick:()=>void u(),disabled:r,children:(0,H.jsx)(El,{})})}):(0,H.jsx)(Ol,{label:i,children:(0,H.jsx)(Tl,{size:`icon`,variant:`outline`,className:`h-8 w-8 rounded-full`,"aria-label":s,disabled:!0,children:(0,H.jsx)(El,{})})})]})}function Al(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>[e.label,e.key,e.description].filter(e=>typeof e==`string`&&e.trim().length>0).join(` `).toLowerCase().includes(n)):e}var jl=Wc(`20rem`),Ml=`flex w-full items-center gap-3 rounded-lg px-2.5 py-2 text-left text-sm text-foreground transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50`;function Nl(e){let{Input:t}=fl,{onBack:n,picker:r}=e,i=(0,V.useRef)(null),a=(0,V.useId)(),[o,s]=(0,V.useState)(``),[c,l]=(0,V.useState)(0),u=(0,V.useMemo)(()=>new Set(r.selectedKeys),[r.selectedKeys]),d=(0,V.useMemo)(()=>r.groups?.filter(e=>e.options.length>0)??[],[r.groups]),f=(0,V.useMemo)(()=>d.length===0?null:d.map(e=>({...e,options:Al(e.options,o)})).filter(e=>e.options.length>0),[d,o]),p=(0,V.useMemo)(()=>f===null?Al(r.options,o):f.flatMap(e=>e.options),[f,r.options,o]),m=p.length===0?0:Math.min(c,p.length-1);ac({containerRef:i,activeIndex:m,itemCount:p.length,isEnabled:p.length>0,getItemSelector:e=>`[data-skill-index="${e}"]`});let h=e=>{if(u.has(e)){r.onSelectedKeysChange(r.selectedKeys.filter(t=>t!==e));return}r.onSelectedKeysChange([...r.selectedKeys,e])};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`shrink-0 space-y-1.5 p-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:n,className:`inline-flex h-7 items-center gap-1 rounded-md pr-2 text-sm font-medium text-foreground transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40`,children:[(0,H.jsx)(oa,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{children:r.title})]}),(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground/60`}),(0,H.jsx)(t,{value:o,onChange:e=>{s(e.target.value),l(0)},onKeyDown:e=>{if(p.length!==0){if(e.key===`ArrowDown`){e.preventDefault(),l(Math.min(m+1,p.length-1));return}if(e.key===`ArrowUp`){e.preventDefault(),l(Math.max(m-1,0));return}if(e.key===`Enter`){e.preventDefault();let t=p[m];t&&h(t.key)}}},placeholder:r.searchPlaceholder,role:`combobox`,"aria-controls":a,"aria-expanded":`true`,"aria-autocomplete":`list`,"aria-activedescendant":p[m]?`${a}-option-${m}`:void 0,className:`h-8 rounded-lg border-0 bg-muted/45 pl-7 text-xs shadow-none`})]})]}),(0,H.jsx)(`div`,{ref:i,id:a,role:`listbox`,"aria-multiselectable":`true`,className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain px-1.5 pb-1`,children:r.isLoading?(0,H.jsx)(`div`,{className:`p-4 text-xs text-muted-foreground`,children:r.loadingLabel}):p.length===0?(0,H.jsx)(`div`,{className:`p-4 text-center text-xs text-muted-foreground`,children:r.emptyLabel}):(0,H.jsx)(`div`,{children:(()=>{let e=f??[{key:`all-skills`,options:p}],t=0;return e.map(e=>(0,H.jsxs)(`div`,{children:[e.label?(0,H.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-medium text-muted-foreground/80`,children:e.label}):null,e.options.map(e=>{let n=t;t+=1;let r=u.has(e.key),i=n===m;return(0,H.jsxs)(`button`,{type:`button`,id:`${a}-option-${n}`,role:`option`,"aria-selected":r,"aria-label":e.label,"data-skill-index":n,onMouseEnter:()=>l(n),onClick:()=>h(e.key),className:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors ${i?`bg-[var(--interaction-hover)]`:`hover:bg-[var(--interaction-hover)]`}`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`truncate text-sm text-foreground`,children:e.label}),(0,H.jsx)(`div`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description||e.key})]}),r?(0,H.jsx)(wr,{className:`h-4 w-4 shrink-0 text-foreground/70`}):null]},e.key)})]},e.key))})()})}),r.manageHref&&r.manageLabel?(0,H.jsx)(`div`,{className:`shrink-0 px-2 pb-2 pt-1`,children:(0,H.jsxs)(`a`,{href:r.manageHref,className:`inline-flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,children:[r.manageLabel,(0,H.jsx)(fe,{className:`h-3 w-3`})]})}):null]})}function Pl(e){let{Popover:t,PopoverContent:n,PopoverTrigger:r,Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=fl,{accessories:c,label:l,picker:u}=e,[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(`actions`);return(0,H.jsxs)(t,{open:d,onOpenChange:e=>{f(e),e||m(`actions`)},children:[(0,H.jsx)(o,{children:(0,H.jsxs)(i,{children:[(0,H.jsx)(s,{asChild:!0,children:(0,H.jsx)(`span`,{className:`inline-flex`,children:(0,H.jsx)(r,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":l,className:`relative inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40`,children:(0,H.jsx)(pi,{className:`h-4 w-4`})})})})}),(0,H.jsx)(a,{side:`top`,children:(0,H.jsx)(`p`,{className:`text-xs`,children:l})})]})}),(0,H.jsx)(n,{side:`top`,align:`start`,className:p===`skills`?`flex w-[min(340px,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border-border/80 p-0 shadow-md`:`w-[min(220px,calc(100vw-1rem))] rounded-xl border-border/80 p-1.5 shadow-md`,style:{maxHeight:jl},children:p===`actions`?(0,H.jsxs)(H.Fragment,{children:[c.map(e=>(0,H.jsxs)(`button`,{type:`button`,"aria-label":e.label,disabled:e.disabled,onClick:()=>{e.onClick?.(),f(!1)},className:Ml,children:[e.icon===`paperclip`?(0,H.jsx)(go,{className:`h-4 w-4`}):null,(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label})]},e.key)),u?(0,H.jsxs)(`button`,{type:`button`,onClick:()=>m(`skills`),className:Ml,children:[(0,H.jsx)(Or,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:u.title}),(0,H.jsx)(sa,{className:`h-4 w-4 shrink-0 text-muted-foreground/60`})]}):null]}):u?(0,H.jsx)(Nl,{picker:u,onBack:()=>m(`actions`)}):null})]})}function Fl(e,t){let n=0;for(let r of t)if(r===e[n]&&(n+=1,n===e.length))return!0;return e.length===0}function Il(e,t){let n=e.filter(Boolean).join(` `).toLowerCase(),r=n.replace(/[\s/_.-]+/g,``);return t.split(/\s+/).filter(Boolean).every(e=>{let t=e.replace(/[\s/_.-]+/g,``);return n.includes(e)||Fl(t,r)})}function Ll(e,t,n){let r=n.trim().toLowerCase();return e.groups.filter(e=>e.options.length>0).filter(e=>t===`all`||e.key===t).map(e=>({...e,options:r?e.options.filter(e=>Il([e.label,e.value,e.description],r)):e.options})).filter(e=>e.options.length>0)}function Rl({discovery:e,onOpen:t}){return(0,H.jsx)(`div`,{className:`shrink-0 border-t border-border/60 px-1.5 py-1`,children:(0,H.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,onClick:t,children:[(0,H.jsx)(Or,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.summaryLabel}),(0,H.jsx)(`span`,{className:`shrink-0 font-medium text-primary`,children:e.viewLabel})]})})}function zl({discovery:e,open:t,onOpenChange:n,renderOption:r,restoreFocusRef:i}){let{Dialog:a,DialogContent:o,DialogDescription:s,DialogHeader:c,DialogTitle:l,Input:u}=fl,[d,f]=(0,V.useState)(``),[p,m]=(0,V.useState)(`all`),[h,g]=(0,V.useState)(null),[_,v]=(0,V.useState)(()=>new Set),y=(0,V.useMemo)(()=>e.groups.filter(e=>e.options.length>0),[e.groups]),b=p===`all`||y.some(e=>e.key===p)?p:`all`,x=(0,V.useMemo)(()=>Ll(e,b,d),[e,d,b]),S=e=>{n(e),e||(f(``),m(`all`),g(null),v(new Set))},C=async t=>{if(!(h||_.has(t))){g(t);try{await e.onSelect(t),v(e=>new Set(e).add(t))}catch{return}finally{g(null)}}};return(0,H.jsx)(a,{open:t,onOpenChange:S,children:(0,H.jsxs)(o,{closeLabel:e.closeLabel,className:`flex h-[calc(100vh-1rem)] max-h-[42rem] w-[calc(100%-1rem)] max-w-2xl flex-col gap-0 overflow-hidden p-0 sm:h-[min(42rem,calc(100vh-2rem))]`,onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()},children:[(0,H.jsxs)(c,{className:`shrink-0 gap-1 border-b border-border/70 px-5 pb-4 pt-5 text-left`,children:[(0,H.jsx)(l,{className:`pr-8 text-lg font-semibold text-foreground`,children:e.groupLabel}),(0,H.jsx)(s,{className:`text-sm text-muted-foreground`,children:e.summaryLabel}),(0,H.jsxs)(`div`,{className:`relative pt-3`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-3 top-[1.375rem] h-4 w-4 text-muted-foreground/60`}),(0,H.jsx)(u,{autoFocus:!0,value:d,onChange:e=>f(e.currentTarget.value),placeholder:e.searchPlaceholder,className:`h-9 rounded-xl border-0 bg-muted/45 pl-9 text-sm shadow-none`})]}),(0,H.jsxs)(`div`,{role:`tablist`,"aria-label":e.groupLabel,className:`custom-scrollbar flex gap-1 overflow-x-auto overscroll-contain pt-2`,children:[(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":b===`all`,className:`shrink-0 rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${b===`all`?`bg-foreground text-background`:`bg-muted/55 text-muted-foreground hover:bg-muted hover:text-foreground`}`,onClick:()=>m(`all`),children:e.allGroupLabel}),y.map(e=>(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":b===e.key,className:`shrink-0 rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${b===e.key?`bg-foreground text-background`:`bg-muted/55 text-muted-foreground hover:bg-muted hover:text-foreground`}`,onClick:()=>m(e.key),children:e.label},e.key))]})]}),(0,H.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain px-3 py-2`,children:[x.length===0?(0,H.jsx)(`p`,{className:`px-3 py-10 text-center text-sm text-muted-foreground`,children:e.searchEmptyLabel}):null,x.map(t=>(0,H.jsxs)(`div`,{children:[b===`all`?(0,H.jsx)(`div`,{className:`px-3 pb-1 pt-3 text-xs font-medium text-muted-foreground`,children:t.label}):null,t.options.map(t=>{let n=_.has(t.value);return(0,H.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-xl px-3 py-2 hover:bg-[var(--interaction-hover)]`,children:[(0,H.jsx)(`div`,{className:`min-w-0 overflow-hidden`,title:t.label,children:r(t)}),(0,H.jsxs)(`button`,{type:`button`,disabled:h!==null||n,className:`inline-flex h-8 min-w-16 shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-lg bg-primary/10 px-3 text-xs font-medium text-primary transition-colors hover:bg-primary/15 disabled:cursor-default disabled:bg-muted disabled:text-muted-foreground`,onClick:()=>void C(t.value),children:[h===t.value?(0,H.jsx)(fi,{className:`h-3.5 w-3.5 animate-spin`}):null,n?e.addedLabel:e.actionLabel]})]},t.value)})]},t.key))]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-border/70 px-5 py-3`,children:[(0,H.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-2 text-xs text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,onClick:()=>{e.onDismiss(),S(!1)},children:e.dismissLabel}),(0,H.jsx)(`button`,{type:`button`,className:`rounded-lg bg-foreground px-4 py-2 text-xs font-medium text-background transition-opacity hover:opacity-85`,onClick:()=>S(!1),children:e.doneLabel})]})]})})}function Bl({icon:e,className:t=``}){return e===`sparkles`?(0,H.jsx)(Or,{className:`h-3.5 w-3.5 shrink-0 text-primary ${t}`}):e===`brain`?(0,H.jsx)(ea,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground ${t}`}):null}var Vl={model:`min-w-0 max-w-[18rem]`,"session-type":`shrink-0`,thinking:`shrink-0`},Hl={model:`w-[min(340px,calc(100vw-1rem))]`,"session-type":`w-[220px]`,thinking:`w-[180px]`},Ul=Wc(`18rem`),Wl=el(`18rem`);function Gl(e){return e.key===`model`&&e.selectedLabel&&e.selectedLabel.split(`/`).slice(1).join(`/`).trim()||e.selectedLabel}function Kl(e){return e.groups?.filter(e=>e.options.length>0)??(e.options.length>0?[{key:`${e.key}-default`,options:e.options}]:[])}function ql({item:e}){let t=Gl(e);return e.selectedLabel?(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,H.jsx)(Bl,{icon:e.icon,className:e.key===`model`?`hidden [@container_nextclaw-chat-input-bar_(max-width:440px)]:block`:void 0}),(0,H.jsx)(`span`,{className:`nextclaw-chat-toolbar-mobile-label truncate sm:hidden [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:t}),(0,H.jsx)(`span`,{className:`nextclaw-chat-toolbar-label hidden truncate sm:inline [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`,children:t})]}):e.loading?(0,H.jsx)(`div`,{className:`h-3 w-24 animate-pulse rounded bg-muted`}):(0,H.jsx)(`span`,{className:`truncate`,children:e.placeholder})}function Jl({option:e}){return e.description?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,H.jsx)(`span`,{className:`block truncate text-sm font-normal text-foreground`,children:e.label}),(0,H.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:e.description})]}):(0,H.jsx)(`span`,{className:`block truncate text-sm font-normal text-foreground`,children:e.label})}function Yl({item:e}){let{Input:t,Popover:n,PopoverContent:r,PopoverTrigger:i,Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=fl,[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(``),h=(0,V.useRef)(null),g=Kl(e),_=(0,V.useMemo)(()=>{let e=p.trim().toLowerCase();return e?g.map(t=>({...t,options:t.options.filter(t=>Il([t.label,t.value,t.description],e))})).filter(e=>e.options.length>0):g},[g,p]),v=g.some(e=>e.options.length>0),y=_.some(e=>e.options.length>0),{discovery:b,optionAction:x}=e,S=new Set(x?.activeValues??[]),C=t=>{if(u(t),t){e.onOpen?.();return}m(``)};return(0,H.jsxs)(n,{open:l,onOpenChange:C,children:[(0,H.jsx)(i,{asChild:!0,children:(0,H.jsxs)(`button`,{ref:h,type:`button`,"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,disabled:e.disabled,className:`nextclaw-chat-toolbar-select-trigger inline-flex h-8 w-auto items-center justify-between rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50 sm:px-3 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 ${Vl[e.key]??``}`,children:[(0,H.jsx)(ql,{item:e}),(0,H.jsx)($n,{className:`ml-1 h-3.5 w-3.5 shrink-0 text-muted-foreground/70 [@container_nextclaw-chat-input-bar_(max-width:440px)]:hidden`})]})}),(0,H.jsxs)(r,{className:`flex flex-col overflow-hidden rounded-2xl border-border/80 p-0 shadow-md ${Hl[e.key]??``}`,style:{maxHeight:Ul},children:[(0,H.jsxs)(`div`,{className:`relative shrink-0 px-2 pb-1 pt-1.5`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-[18px] top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60`}),(0,H.jsx)(t,{value:p,onChange:e=>m(e.currentTarget.value),placeholder:e.search?.placeholder??e.placeholder,className:`h-7 rounded-lg border-0 bg-muted/45 pl-7 text-xs shadow-none`})]}),(0,H.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto overscroll-contain`,children:[v?null:e.loading?(0,H.jsxs)(`div`,{className:`space-y-2 px-2 py-1`,children:[(0,H.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,H.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,H.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,H.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.emptyLabel}):null,v&&!y?(0,H.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:e.search?.emptyLabel??e.emptyLabel}):null,(0,H.jsx)(`div`,{className:`px-1.5 pb-0.5`,children:_.map(t=>(0,H.jsxs)(`div`,{children:[t.label?(0,H.jsx)(`div`,{className:`px-2 pb-0.5 pt-1.5 text-[11px] font-medium text-muted-foreground/80`,children:t.label}):null,t.options.map(t=>{let n=e.value===t.value,r=S.has(t.value),i=r?x?.activeLabel:x?.inactiveLabel;return(0,H.jsxs)(`div`,{className:`group flex items-center gap-1 rounded-lg hover:bg-[var(--interaction-hover)]`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-1.5 rounded-lg px-2 py-1 text-left leading-4`,onClick:()=>{e.onValueChange(t.value),C(!1)},children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(Jl,{option:t})}),n?(0,H.jsx)(wr,{className:`h-4 w-4 shrink-0 text-foreground/70`}):null]}),x&&i?(0,H.jsx)(s,{children:(0,H.jsxs)(a,{children:[(0,H.jsx)(c,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":i,"aria-pressed":r,className:`mr-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-[background-color,color,opacity] hover:bg-card hover:text-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 ${r?``:`opacity-0 group-hover:opacity-100 group-focus-within:opacity-100`}`,onClick:e=>{e.stopPropagation(),x.onToggle(t.value,!r)},children:(0,H.jsx)(Lo,{className:`h-3.5 w-3.5 ${r?`fill-current text-foreground`:``}`})})}),(0,H.jsx)(o,{side:`left`,children:(0,H.jsx)(`p`,{className:`text-xs`,children:i})})]})}):null]},t.value)})]},t.key))})]}),b?(0,H.jsx)(Rl,{discovery:b,onOpen:()=>{C(!1),f(!0)}}):null,e.manageHref&&e.manageLabel?(0,H.jsx)(`div`,{className:`shrink-0 px-1.5 pb-1.5 pt-0.5`,children:(0,H.jsxs)(`a`,{href:e.manageHref,className:`inline-flex w-full items-center gap-1.5 rounded-lg px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground`,children:[e.manageLabel,(0,H.jsx)(fe,{className:`h-3 w-3`})]})}):null]}),b?(0,H.jsx)(zl,{discovery:b,open:d,onOpenChange:f,restoreFocusRef:h,renderOption:e=>(0,H.jsx)(Jl,{option:e})}):null]})}function Xl({item:e}){if(e.search)return(0,H.jsx)(Yl,{item:e});let{Select:t,SelectContent:n,SelectGroup:r,SelectItem:i,SelectLabel:a,SelectSeparator:o,SelectTrigger:s,SelectValue:c}=fl,l=Kl(e),u=l.some(e=>e.options.length>0);return(0,H.jsxs)(t,{value:e.value,onValueChange:e.onValueChange,disabled:e.disabled,children:[(0,H.jsx)(s,{"aria-label":e.selectedLabel?`${e.placeholder}: ${e.selectedLabel}`:e.placeholder,title:e.selectedLabel,className:`nextclaw-chat-toolbar-select-trigger h-8 w-auto rounded-lg border-0 bg-transparent px-2 text-xs font-medium text-muted-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus:ring-0 sm:px-3 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!basis-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!justify-center [@container_nextclaw-chat-input-bar_(max-width:440px)]:!max-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!min-w-8 [@container_nextclaw-chat-input-bar_(max-width:440px)]:!px-0 ${Vl[e.key]??``}`,children:e.selectedLabel||e.loading?(0,H.jsx)(ql,{item:e}):(0,H.jsx)(c,{placeholder:e.placeholder})}),(0,H.jsxs)(n,{className:Hl[e.key]??``,style:{maxHeight:Wl},children:[u?null:e.loading?(0,H.jsxs)(`div`,{className:`space-y-2 px-3 py-2`,children:[(0,H.jsx)(`div`,{className:`h-3 w-36 animate-pulse rounded bg-muted`}),(0,H.jsx)(`div`,{className:`h-3 w-28 animate-pulse rounded bg-muted`}),(0,H.jsx)(`div`,{className:`h-3 w-32 animate-pulse rounded bg-muted`})]}):e.emptyLabel?(0,H.jsx)(`div`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:e.emptyLabel}):null,l.map((e,t)=>(0,H.jsxs)(`div`,{children:[t>0?(0,H.jsx)(o,{}):null,(0,H.jsxs)(r,{children:[e.label?(0,H.jsx)(a,{children:e.label}):null,e.options.map(e=>(0,H.jsx)(i,{value:e.value,className:`py-1.5`,children:(0,H.jsx)(Jl,{option:e})},e.value))]})]},e.key))]})]})}function Zl({actions:e,accessories:t=[],addMenuLabel:n,selects:r,skillPicker:i,trailingSelects:a=[]}){let o=n??i?.title??t[0]?.label;return(0,H.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-2 px-3 pb-3`,children:[(0,H.jsxs)(`div`,{className:`nextclaw-chat-toolbar-leading-controls flex min-w-0 flex-1 flex-wrap items-center gap-1 overflow-hidden`,children:[o?(0,H.jsx)(Pl,{label:o,accessories:t,picker:i}):null,r.map(e=>(0,H.jsx)(Xl,{item:e},e.key))]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-end gap-1`,children:[a.length>0?(0,H.jsx)(`div`,{className:`nextclaw-chat-toolbar-trailing-selects flex min-w-0 items-center gap-1`,children:a.map(e=>(0,H.jsx)(Xl,{item:e},e.key))}):null,(0,H.jsx)(kl,{...e})]})]})}var Ql=(0,V.createContext)(null);function $l(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function eu(){let e=(0,V.useContext)(Ql);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function W(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function tu(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var nu=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,ru=nu&&`documentMode`in document?document.documentMode:null,iu=nu&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),au=nu&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ou=!(!nu||!(`InputEvent`in window)||ru)&&`getTargetRanges`in new window.InputEvent(`input`),su=nu&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,cu=nu&&/Android/.test(navigator.userAgent),lu=nu&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!cu,uu=nu&&/^(?=.*Chrome).*/i.test(navigator.userAgent),du=nu&&cu&&uu,fu=nu&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&iu&&!uu,pu=0,mu=1,hu=2,gu=1,_u=2,vu=3,yu=4,bu=5,xu=6,Su=lu||su||fu?`\xA0`:`​`,Cu=`
3
+
4
+ `,wu=au?`\xA0`:Su,Tu={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Eu={directionless:1,unmergeable:2},Du={center:2,end:6,justify:4,left:1,right:3,start:5},Ou={[_u]:`center`,[xu]:`end`,[yu]:`justify`,[gu]:`left`,[vu]:`right`,[bu]:`start`},ku={normal:0,segmented:2,token:1},Au={[pu]:`normal`,[hu]:`segmented`,[mu]:`token`},ju=`$config`;function Mu(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(J(o)&&Mu(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var Nu=!1,Pu=0;function Fu(e){Pu=e.timeStamp}function Iu(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&kh(e,n)!==void 0}function Lu(e,t,n){let r=hg(sg(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&Hh(t,o,i,a,!1)}function Ru(e,t,n){if(K(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return bh(t)&&n.isAttached()}function zu(e,t,n,r){for(let i=e;i&&!Ag(i);i=ng(i)){let e=kh(i,t);if(e!==void 0){let t=Dh(e,n);if(t)return Km(t)||!_g(i)?void 0:[i,t]}else if(i===r)return[r,Ph(n)]}}function Bu(e,t,n){Nu=!0;let r=performance.now()-Pu>100;try{Bm(e,()=>{let i=q()||function(e){return e.getEditorState().read(()=>{let e=q();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=zu(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&G(g)&&bh(p)&&Ru(i,p,g)&&Lu(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=Oh(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Iu(r,a,e)){if(au){let e=(_g(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Iu(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Iu(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&Fh(i),au&&eg(e)&&i.insertRawText(u))})}finally{Nu=!1}}function Vu(e){let t=e._observer;t!==null&&Bu(e,t.takeRecords(),t)}function Hu(e){(function(e){Pu===0&&sg(e).addEventListener(`textInput`,Fu,!0)})(e),e._observer=new MutationObserver((t,n)=>{Bu(e,t,n)})}var Uu=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Xu).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Wu(e,t){return new Uu(e,t)}function Gu(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=Mg(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var Ku=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState;this.size=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return Yu(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=Yu(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function qu(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Ku(t,Ju(t));return t.__state=n,n}function Ju(e){return e.__state?e.__state.sharedNodeState:uh(Cg(),e.getType()).sharedNodeState}function Yu(e){if(e)for(let t in e)return e}function Xu(e){return e}function Zu(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function Qu(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function $u(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ed(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&Zu(n,e,t)||t&&Zu(n,t,e)||e&&Qu(n,e,t)||t&&Qu(n,t,e))}(c,l))}function td(e,t){let n=e.mergeWithSibling(t),r=Dm()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function nd(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&G(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(ed(t,r)){r=td(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&G(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(ed(r,n)){r=td(r,n);break}break}n.remove()}}else r.remove()}function rd(e){return id(e.anchor),id(e.focus),e}function id(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),G(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!J(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd=``,gd=null,_d=null,vd=!1,yd=!1;function bd(e,t){let n=dd.get(e);if(t!==null){let n=Rd(e);n.parentNode===t&&t.removeChild(n)}if(fd.has(e)||od._keyToDOMMap.delete(e),J(n)){let e=Md(n,dd);xd(e,0,e.length-1,null)}n!==void 0&&Zh(md,sd,cd,n,`destroyed`)}function xd(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&bd(t,r)}}function Sd(e,t){e.setProperty(`text-align`,t)}var Cd=`40px`;function wd(e,t){let n=ad.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(od._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||Cd;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function Td(e,t){let n=e.style;t===0?Sd(n,``):t===1?Sd(n,`left`):t===2?Sd(n,`center`):t===3?Sd(n,`right`):t===4?Sd(n,`justify`):t===5?Sd(n,`start`):t===6&&Sd(n,`end`)}function Ed(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(Jm(e))return null;let n=e.getParentOrThrow();return Jm(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Dd(e,t){let n=fd.get(e);n===void 0&&W(60);let r=n.createDOM(ad,od);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,od),G(n)?r.setAttribute(`data-lexical-text`,`true`):Km(n)&&r.setAttribute(`data-lexical-decorator`,`true`),J(n)){let e=n.__indent,t=n.__size;if(Ed(r,n),e!==0&&wd(r,e),t!==0){let e=t-1;Od(Md(n,fd),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&Td(r,i),n.isInline()||Ad(null,n,r)}else{let t=n.getTextContent();if(Km(n)){let t=n.decorate(od,ad);t!==null&&Pd(e,t),r.contentEditable=`false`}hd+=t}return t!==null&&t.insertChild(r),Zh(md,sd,cd,n,`created`),r}function Od(e,t,n,r,i){let a=hd;hd=``;let o=n;for(;o<=r;++o){Dd(e[o],i);let t=fd.get(e[o]);t!==null&&G(t)?gd===null&&(gd=t.getFormat(),_d=t.getStyle()):J(t)&&o<r&&!t.isInline()&&(hd+=Cu)}i.element.__lexicalTextContent=hd,hd=a+hd}function kd(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return vp(e)?`line-break`:Km(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function Ad(e,t,n){let r=kd(e,dd),i=kd(t,fd);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function jd(e,t,n){var r;gd=null,_d=null,function(e,t,n){let r=hd,i=e.__size,a=t.__size;hd=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)Nd(n,o);else{let e=Rd(n),t=Dd(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}bd(n,null)}let i=fd.get(r);G(i)&&gd===null&&(gd=i.getFormat(),_d=i.getStyle())}else{let r=Md(e,dd),s=Md(t,fd);if(r.length!==i&&W(227),s.length!==a&&W(228),i===0)a!==0&&Od(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;xd(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else (function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Fd(Nd(r,a.element)),d++,f++;else{if(l===void 0&&(l=Id(n,f)),c===void 0)c=Id(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=Fd(Rd(e)),bd(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=tg(od,r);e!==u&&a.withBefore(u).insertChild(e),u=Fd(Nd(r,a.element)),d++,f++}else Dd(r,a.withBefore(u)),f++}let i=fd.get(r);i!==null&&G(i)?gd===null&&(gd=i.getFormat(),_d=i.getStyle()):J(i)&&f<=s&&!i.isInline()&&(hd+=Cu)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:od.getElementByKey(e);Od(n,0,f,s,a.withBefore(t))}else m&&!p&&xd(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=hd,hd=r+hd}(e,t,t.getDOMSlot(n)),r=t,gd==null||gd===r.__textFormat||yd||r.setTextFormat(gd),function(e){_d==null||_d===e.__textStyle||yd||e.setTextStyle(_d)}(t)}function Md(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&W(101),n.push(r),r=e.__next}return n}function Nd(e,t){let n=dd.get(e),r=fd.get(e);n!==void 0&&r!==void 0||W(61);let i=vd||ud.has(e)||ld.has(e),a=tg(od,e);if(n===r&&!i){let e;if(J(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return hd+=e,a}if(n!==r&&i&&Zh(md,sd,cd,r,`updated`),r.updateDOM(n,a,ad)){let n=Dd(e,null);return t===null&&W(62),t.replaceChild(n,a),bd(e,null),n}if(J(n)){J(r)||W(334,e);let t=r.__indent;(vd||t!==n.__indent)&&wd(a,t);let o=r.__format;if((vd||o!==n.__format)&&Td(a,o),i)jd(n,r,a),Jm(r)||r.isInline()||Ad(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),hd+=t}if((vd||r.__dir!==n.__dir)&&(Ed(a,r),Jm(r)&&!vd))for(let e of r.getChildren())J(e)&&Ed(tg(od,e.getKey()),e)}else{let t=r.getTextContent();if(Km(r)){let t=r.decorate(od,ad);t!==null&&Pd(e,t)}hd+=t}if(!yd&&Jm(r)&&r.__cachedText!==hd){let e=r.getWritable();e.__cachedText=hd,r=e}return a}function Pd(e,t){let n=od._pendingDecorators,r=od._decorators;if(n===null){if(r[e]===t)return;n=jh(od)}n[e]=t}function Fd(e){let t=e.nextSibling;return t!==null&&t===od._blockCursorElement&&(t=t.nextSibling),t}function Id(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function Ld(e,t,n,r,i,a){hd=``,vd=r===2,od=n,ad=n._config,sd=n._nodes,cd=od._listeners.mutation,ld=i,ud=a,dd=e._nodeMap,fd=t._nodeMap,yd=t._readOnly,pd=new Map(n._keyToDOMMap);let o=new Map;return md=o,Nd(`root`,null),od=void 0,sd=void 0,ld=void 0,ud=void 0,dd=void 0,fd=void 0,ad=void 0,pd=void 0,md=void 0,o}function Rd(e){let t=pd.get(e);return t===void 0&&W(75,e),t}function zd(e){return{type:e}}var Bd=zd(`SELECTION_CHANGE_COMMAND`),Vd=zd(`CLICK_COMMAND`),Hd=zd(`BEFORE_INPUT_COMMAND`),Ud=zd(`INPUT_COMMAND`),Wd=zd(`COMPOSITION_START_COMMAND`),Gd=zd(`COMPOSITION_END_COMMAND`),Kd=zd(`DELETE_CHARACTER_COMMAND`),qd=zd(`INSERT_LINE_BREAK_COMMAND`),Jd=zd(`INSERT_PARAGRAPH_COMMAND`),Yd=zd(`CONTROLLED_TEXT_INSERTION_COMMAND`),Xd=zd(`PASTE_COMMAND`),Zd=zd(`REMOVE_TEXT_COMMAND`),Qd=zd(`DELETE_WORD_COMMAND`),$d=zd(`DELETE_LINE_COMMAND`),ef=zd(`FORMAT_TEXT_COMMAND`),tf=zd(`UNDO_COMMAND`),nf=zd(`REDO_COMMAND`),rf=zd(`KEYDOWN_COMMAND`),af=zd(`KEY_ARROW_RIGHT_COMMAND`),of=zd(`MOVE_TO_END`),sf=zd(`KEY_ARROW_LEFT_COMMAND`),cf=zd(`MOVE_TO_START`),lf=zd(`KEY_ARROW_UP_COMMAND`),uf=zd(`KEY_ARROW_DOWN_COMMAND`),df=zd(`KEY_ENTER_COMMAND`),ff=zd(`KEY_SPACE_COMMAND`),pf=zd(`KEY_BACKSPACE_COMMAND`),mf=zd(`KEY_ESCAPE_COMMAND`),hf=zd(`KEY_DELETE_COMMAND`),gf=zd(`KEY_TAB_COMMAND`),_f=zd(`DROP_COMMAND`),vf=zd(`DRAGSTART_COMMAND`),yf=zd(`DRAGOVER_COMMAND`),bf=zd(`DRAGEND_COMMAND`),xf=zd(`COPY_COMMAND`),Sf=zd(`CUT_COMMAND`),Cf=zd(`SELECT_ALL_COMMAND`),wf=zd(`FOCUS_COMMAND`),Tf=zd(`BLUR_COMMAND`),Ef=zd(`KEY_MODIFIER_COMMAND`),Df=Object.freeze({}),Of=[[`keydown`,function(e,t){kf=e.timeStamp,Af=e.key,!t.isComposing()&&Y(t,rf,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;vg(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&Bm(t,()=>{fh(n)||(If=!0)})}],[`compositionstart`,function(e,t){Y(t,Wd,e)}],[`compositionend`,function(e,t){au?Rf=!0:su||!lu&&!fu?Y(t,Gd,e):(zf=!0,Bf=e.data)}],[`input`,function(e,t){e.stopPropagation(),Bm(t,()=>{t.dispatchCommand(Ud,e)},{event:e}),Mf=null}],[`click`,function(e,t){Bm(t,()=>{let n=q(),r=hg(sg(t)),i=om();if(r){if(K(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!Jm(a)&&Nh().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=Pg(a,e=>J(e)&&!e.isInline());J(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(_g(n)||bh(n))&&Fh(am(i,r,t,e))}}Y(t,Vd,e)})}],[`cut`,Df],[`copy`,Df],[`dragstart`,Df],[`dragover`,Df],[`dragend`,Df],[`paste`,Df],[`focus`,Df],[`blur`,Df],[`drop`,Df]];ou&&Of.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||au&&eg(t)||n!==`insertCompositionText`&&Y(t,Hd,e)}(e,t)]);var kf=0,Af=null,jf=0,Mf=null,Nf=new WeakMap,Pf=new WeakMap,Ff=!1,If=!1,Lf=!1,Rf=!1,zf=!1,Bf=``,Vf=null,Hf=[0,``,0,`root`,0];function Uf(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=Dm(),l=hg(sg(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!G(s)||(!i&&(!ou||jf<r+50)||s.isDirty()&&p<2||Lh(n))&&a.offset!==o.offset&&!s.isComposing()||yh(s)||s.isDirty()&&p>1||(i||!ou)&&f!==null&&!s.isComposing()&&u!==xh(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=vh(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(G(t)||J(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function Wf(e,t){return bh(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Gf(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;Ff&&(Ff=!1,Wf(r,i)&&Wf(a,o)&&!Vf)||Bm(t,()=>{if(!n)return void Fh(null);if(!mh(t,r,a))return;let s=q();if(Vf&&K(s)&&s.isCollapsed()){let e=s.anchor,t=Vf.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=Vf.clone(),Fh(s))}if(Vf=null,K(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=sg(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=Hf,f=Nh(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)Kf(s,o,c);else if(n.type===`text`)G(r)||W(141),qf(s,r);else if(n.type===`element`&&!p){J(r)||W(259);let e=n.getNode();e.isEmpty()?function(e,t){Kf(e,t.getTextFormat(),t.getTextStyle())}(s,e):Kf(s,s.format,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(G(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}Y(t,Bd,void 0)})}function Kf(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function qf(e,t){Kf(e,t.getFormat(),t.getStyle())}function Jf(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function Yf(e){let t=e.inputType,n=Jf(e),r=Dm(),i=q();if(t===`deleteContentBackward`){if(i===null){let e=om();if(!K(e))return!0;Fh(e.clone())}if(K(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,Af===`MediaLast`&&a<kf+30&&r.isComposing()&&t){if(Th(null),kf=0,setTimeout(()=>{Bm(r,()=>{Th(null)})},30),K(i)){let e=i.anchor.getNode();e.markDirty(),G(e)||W(142),qf(i,e)}}else{Th(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=du&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!Km($h(i.anchor,!0))),!c){Y(r,Kd,!0);let e=q();du&&K(e)&&e.isCollapsed()&&(Vf=e,setTimeout(()=>Vf=null))}}return!0}}var a;if(!K(i))return!0;let o=e.data;Mf!==null&&Vh(!1,r,Mf),i.dirty&&Mf===null||!i.isCollapsed()||Jm(i.anchor.getNode())||n===null||i.applyDOMRange(n),Mf=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
5
+ `)e.preventDefault(),Y(r,qd,!1);else if(o===Cu)e.preventDefault(),Y(r,Jd,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&Uf(i,n,o,e.timeStamp,!0)?(e.preventDefault(),Y(r,Yd,o)):Mf=o;return jf=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:Y(r,Yd,e);break;case`insertFromComposition`:Th(null),Y(r,Yd,e);break;case`insertLineBreak`:Th(null),Y(r,qd,!1);break;case`insertParagraph`:Th(null),Lf&&!su?(Lf=!1,Y(r,qd,!1)):Y(r,Jd,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:Y(r,Xd,e);break;case`deleteByComposition`:(function(e,t){return e!==t||J(e)||J(t)||!vh(e)||!vh(t)})(l,u)&&Y(r,Zd,e);break;case`deleteByDrag`:case`deleteByCut`:Y(r,Zd,e);break;case`deleteContent`:Y(r,Kd,!1);break;case`deleteWordBackward`:Y(r,Qd,!0);break;case`deleteWordForward`:Y(r,Qd,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:Y(r,$d,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:Y(r,$d,!1);break;case`formatStrikeThrough`:Y(r,ef,`strikethrough`);break;case`formatBold`:Y(r,ef,`bold`);break;case`formatItalic`:Y(r,ef,`italic`);break;case`formatUnderline`:Y(r,ef,`underline`);break;case`historyUndo`:Y(r,tf,void 0);break;case`historyRedo`:Y(r,nf,void 0)}return!0}function Xf(e){if(_g(e.target)&&fh(e.target))return!0;let t=Dm(),n=q(),r=e.data,i=Jf(e);if(r!=null&&K(n)&&Uf(n,i,r,e.timeStamp,!1)){Rf&&=($f(t,r),!1);let i=n.anchor.getNode(),a=hg(sg(t));if(a===null)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;ou&&!n.isCollapsed()&&G(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===Bh(a.anchorNode)||Y(t,Yd,r);let l=r.length;au&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),du&&t.isComposing()&&(kf=0,Th(null))}else Vh(!1,t,r===null?void 0:r),Rf&&=($f(t,r||void 0),!1);return function(){wm(),Vu(Dm())}(),!0}function Zf(e){let t=Dm(),n=q();if(K(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();Th(r.key),ig(pp),(e.timeStamp<kf+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||G(i)&&i.getStyle()!==n.style)&&Y(t,Yd,wu)}return!0}function Qf(e){return $f(Dm(),e.data),ig(mp),!0}function $f(e,t){let n=e._compositionKey;if(Th(null),n!==null&&t!=null){if(t===``){let t=Dh(n),r=xh(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&G(t)){let n=hg(sg(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),Hh(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
6
+ `){let t=q();if(K(t)||Kp(t)){if(K(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}Y(e,df,null);return}}}Vh(!0,e,t)}function ep(e){let t=Dm();if(e.key==null)return!0;if(zf){if(Jh(e))return Bm(t,()=>{$f(t,Bf)}),zf=!1,Bf=``,!0;zf=!1,Bf=``}if(function(e){return Gh(e,`ArrowRight`,{shiftKey:`any`})}(e))Y(t,af,e);else if(function(e){return Gh(e,`ArrowRight`,Kh)}(e))Y(t,of,e);else if(function(e){return Gh(e,`ArrowLeft`,{shiftKey:`any`})}(e))Y(t,sf,e);else if(function(e){return Gh(e,`ArrowLeft`,Kh)}(e))Y(t,cf,e);else if(function(e){return Gh(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))Y(t,lf,e);else if(function(e){return Gh(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))Y(t,uf,e);else if(function(e){return Gh(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))Lf=!0,Y(t,df,e);else if(function(e){return e.key===` `}(e))Y(t,ff,e);else if(function(e){return iu&&Gh(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),Lf=!0,Y(t,qd,!0);else if(function(e){return Gh(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))Lf=!1,Y(t,df,e);else if(function(e){return Gh(e,`Backspace`,{shiftKey:`any`})||iu&&Gh(e,`h`,{ctrlKey:!0})}(e))Jh(e)?Y(t,pf,e):(e.preventDefault(),Y(t,Kd,!0));else if(function(e){return e.key===`Escape`}(e))Y(t,mf,e);else if(function(e){return Gh(e,`Delete`,{})||iu&&Gh(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?Y(t,hf,e):(e.preventDefault(),Y(t,Kd,!1));else if(function(e){return Gh(e,`Backspace`,qh)}(e))e.preventDefault(),Y(t,Qd,!0);else if(function(e){return Gh(e,`Delete`,qh)}(e))e.preventDefault(),Y(t,Qd,!1);else if(function(e){return iu&&Gh(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),Y(t,$d,!0);else if(function(e){return iu&&(Gh(e,`Delete`,{metaKey:!0})||Gh(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),Y(t,$d,!1);else if(function(e){return Gh(e,`b`,Kh)}(e))e.preventDefault(),Y(t,ef,`bold`);else if(function(e){return Gh(e,`u`,Kh)}(e))e.preventDefault(),Y(t,ef,`underline`);else if(function(e){return Gh(e,`i`,Kh)}(e))e.preventDefault(),Y(t,ef,`italic`);else if(function(e){return Gh(e,`Tab`,{shiftKey:`any`})}(e))Y(t,gf,e);else if(function(e){return Gh(e,`z`,Kh)}(e))e.preventDefault(),Y(t,tf,void 0);else if(function(e){return iu?Gh(e,`z`,{metaKey:!0,shiftKey:!0}):Gh(e,`y`,{ctrlKey:!0})||Gh(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),Y(t,nf,void 0);else{let n=t._editorState._selection;n===null||K(n)?Yh(e)&&(e.preventDefault(),Y(t,Cf,e)):function(e){return Gh(e,`c`,Kh)}(e)?(e.preventDefault(),Y(t,xf,e)):function(e){return Gh(e,`x`,Kh)}(e)?(e.preventDefault(),Y(t,Sf,e)):Yh(e)&&(e.preventDefault(),Y(t,Cf,e))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Ef,e),!0}function tp(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var np=new Map;function rp(e){let t=gg(e.target);if(t===null)return;let n=gh(t.anchorNode);if(n===null)return;If&&(If=!1,Bm(n,()=>{let r=om(),i=t.anchorNode;(_g(i)||bh(i))&&Fh(am(r,t,n,e))}));let r=Rh(n),i=r[r.length-1],a=i._key,o=np.get(a),s=o||i;s!==n&&Gf(t,s,!1),Gf(t,n,!0),n===i?o&&np.delete(a):np.set(a,n)}function ip(e){e._lexicalHandled=!0}function ap(e){return!0===e._lexicalHandled}function op(e){let t=Nf.get(e);if(t===void 0)return;let n=Pf.get(t);if(n===void 0)return;let r=n-1;r>=0||W(164),Nf.delete(e),Pf.set(t,r),r===0&&t.removeEventListener(`selectionchange`,rp);let i=_h(e);hh(i)?(function(e){if(e._parentEditor!==null){let t=Rh(e),n=t[t.length-1]._key;np.get(n)===e&&np.delete(n)}else np.delete(e._key)}(i),e.__lexicalEditor=null):i&&W(198);let a=tp(e);for(let e=0;e<a.length;e++)a[e]();e.__lexicalEventHandles=[]}function sp(e,t,n){wm();let r=e.__key,i=e.getParent();if(i===null)return;let a=function(e){let t=q();if(!K(t)||!J(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return ag(i,e)&&n.set(e.__key,0,`element`),ag(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(K(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(lm(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(lm(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Kp(a)&&t&&e.isSelected()&&e.selectPrevious();if(K(a)&&t&&!o){let t=e.getIndexWithinParent();Ch(e),sm(a,i,t,-1)}else Ch(e);n||lg(i)||i.canBeEmpty()||!i.isEmpty()||sp(i,t),t&&a&&Jm(i)&&i.isEmpty()&&i.selectEnd()}var cp=Symbol.for(`ephemeral`);function lp(e){return e[cp]||!1}var up=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Mg(this);return e===void 0&&W(64,this.name),e}static clone(e){W(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,`__state`,{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Kee(this,e)}getType(){return this.__type}isInline(){W(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=Dh(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){let t=e||q();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(G(this))return n;if(K(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Km(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:Dh(e)}getParentOrThrow(){let e=this.getParent();return e===null&&W(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(lg(t))return J(e)||e===this&&Km(e)||W(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&W(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:Dh(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:Dh(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=J(this)?this:this.getParent(),n=J(e)?e:e.getParent(),r=t&&n?f_(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=f_(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?l_(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&W(279),!1)))}isParentOf(e){let t=f_(this,e);return t!==null&&t.type===`ancestor`}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=J(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&W(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=Dm()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(lp(this))return this;let e=Dh(this.__key);return e===null&&W(113),e}getWritable(){if(lp(this))return this;wm();let e=Em(),t=Dm(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=q();if(o!==null&&o.setCachedNodes(null),a.has(r))return wh(i),i;let s=Dg(i);return a.add(r),wh(s),n.set(r,s),s}getTextContent(){return``}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){W(70)}updateDOM(e,t,n){W(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){W(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of Ju(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&qu(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){sp(this,!0,e)}replace(e,t){wm();let n=q();n!==null&&(n=n.clone()),dg(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size;Ch(o);let l=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,f=r.__next,p=r.__parent;if(sp(r,!1,!0),l===null?s.__first=a:l.getWritable().__next=a,o.__prev=d,u===null?s.__last=a:u.getWritable().__prev=a,o.__next=f,o.__parent=p,s.__size=c,t&&(J(this)&&J(o)||W(139),this.getChildren().forEach(e=>{o.append(e)})),K(n)){Fh(n);let e=n.anchor,t=n.focus;e.key===i&&Up(e,o),t.key===i&&Up(t,o)}return Eh()===i&&Th(a),o}insertAfter(e,t=!0){wm(),dg(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.getParent(),a=q(),o=!1,s=!1;if(i!==null){let t=e.getIndexWithinParent();if(Ch(r),K(a)){let e=i.__key,n=a.anchor,r=a.focus;o=n.type===`element`&&n.key===e&&n.offset===t+1,s=r.type===`element`&&r.key===e&&r.offset===t+1}}let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&K(a)){let e=this.getIndexWithinParent();sm(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){wm(),dg(this,e);let n=this.getWritable(),r=e.getWritable(),i=r.__key;Ch(r);let a=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),s=n.__prev,c=this.getIndexWithinParent();a===null?o.__first=i:a.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=s,r.__next=n.__key,r.__parent=n.__parent;let l=q();return t&&K(l)&&sm(l,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return nh()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){wm();let n=this.getPreviousSibling(),r=this.getParentOrThrow();if(n===null)return r.select(0,0);if(J(n))return n.select();if(!G(n)){let e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){wm();let n=this.getNextSibling(),r=this.getParentOrThrow();if(n===null)return r.select();if(J(n))return n.select(0,0);if(!G(n)){let e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}},dp=`history-merge`,fp=`skip-dom-selection`,pp=`composition-start`,mp=`composition-end`,hp=class e extends up{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
7
+ `}createDOM(){return document.createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){let t=e.parentElement;if(t!==null&&xg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&yp(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&yp(n))return!0}}return!1}(e)||function(e){let t=e.parentElement;if(t!==null&&xg(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&yp(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&yp(r))return!0}return!1}(e)?null:{conversion:gp,priority:0}}}static importJSON(e){return _p().updateFromJSON(e)}};function gp(e){return{node:_p()}}function _p(){return ug(new hp)}function vp(e){return e instanceof hp}function yp(e){return bh(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function bp(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function xp(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Sp(e,t,n,r,i){let a=r.classList,o=Xh(i,`base`);o!==void 0&&a.add(...o),o=Xh(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in Tu){let r=Tu[e];if(o=Xh(i,e),o!==void 0)if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}function Cp(e,t,n){let r=t.firstChild,i=n.isComposing(),a=e+(i?Su:``);if(r==null)t.textContent=a;else{let e=r.nodeValue;if(e!==a)if(i||au){let[t,n,i]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(e,a);n!==0&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=a}}function wp(e,t,n,r,i,a){Cp(i,e,t);let o=a.theme.text;o!==void 0&&Sp(0,0,r,e,o)}function Tp(e,t){let n=document.createElement(t);return n.appendChild(e),n}var Ep=class e extends up{__text;__format;__style;__mode;__detail;static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return Au[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Eh()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=Tu[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Sh(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=bp(0,n),i=xp(0,n),a=r===null?i:r,o=document.createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=document.createElement(i),o.appendChild(s)),wp(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&(o.style.cssText=c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=bp(0,i),s=bp(0,a),c=xp(0,i),l=xp(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??W(48);let i=document.createElement(l);return wp(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??W(49)),Cp(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Sp(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(t.style.cssText=p),!1}static importDOM(){return{"#text":()=>({conversion:jp,priority:0}),b:()=>({conversion:Op,priority:0}),code:()=>({conversion:Pp,priority:0}),em:()=>({conversion:Pp,priority:0}),i:()=>({conversion:Pp,priority:0}),mark:()=>({conversion:Pp,priority:0}),s:()=>({conversion:Pp,priority:0}),span:()=>({conversion:Dp,priority:0}),strong:()=>({conversion:Pp,priority:0}),sub:()=>({conversion:Pp,priority:0}),sup:()=>({conversion:Pp,priority:0}),u:()=>({conversion:Pp,priority:0})}}static importJSON(e){return Fp().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return _g(t)||W(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=Tp(t,`b`)),this.hasFormat(`italic`)&&(t=Tp(t,`i`)),this.hasFormat(`strikethrough`)&&(t=Tp(t,`s`)),this.hasFormat(`underline`)&&(t=Tp(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?Tu[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Eu[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Sh(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=ku[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){wm();let n=e,r=t,i=q(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!K(i))return nm(o,n,o,r,`text`,`text`);{let e=Eh();e!==i.anchor.key&&e!==i.focus.key||Th(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=q();if(r&&K(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){wm();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=Eh(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=q();if(K(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=Fp(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=$u(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=Fp(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=$u(t,n);let a=n.__key;i===r&&Th(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&wh(t),n!==null&&wh(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),K(v)&&sm(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||W(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;Eh()===r&&Th(n);let o=q();if(K(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&um(i,t,n,e,a),s!==null&&s.key===r&&um(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function Dp(e){return{forChild:Ip(e.style),node:null}}function Op(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Ip(t.style,n?void 0:`bold`),node:null}}var kp=new WeakMap;function Ap(e){if(!_g(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function jp(e){let t=e;e.parentElement===null&&W(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=kp.get(n))===void 0&&!Ap(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)kp.set(r[e],i);return i}(t)!==null){let e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){let r=e[n];r===`
8
+ `||r===`\r
9
+ `?t.push(_p()):r===` `?t.push(Rp()):r!==``&&t.push(Fp(r))}return{node:t}}if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Mp(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Mp(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:Fp(n)}}function Mp(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,_g(n)){let e=n.style.display;if(e===``&&!bg(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(bh(n))return n;if(n.nodeName===`BR`)return null}}var Np={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Pp(e){let t=Np[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Ip(e.style,t),node:null}}function Fp(e=``){return ug(new Ep(e))}function G(e){return e instanceof Ep}function Ip(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>G(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var Lp=class e extends Ep{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=Xh(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return Rp().updateFromJSON(e)}setTextContent(e){return e!==` `&&e!==``&&tu(126),super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||W(286),this}setDetail(e){return e!==2&&W(127),this}setMode(e){return e!==`normal`&&W(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Rp(){return ug(new Lp)}function zp(e){return e instanceof Lp}var Bp=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:c_(S_(p_(this,`next`)),S_(p_(e,`next`)))<0}getNode(){let e=Dh(this.key);return e===null&&W(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,Cm()||(Eh()===a&&Th(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}};function Vp(e,t,n){return new Bp(e,t,n)}function Hp(e,t){let n=t.__key,r=e.offset,i=`element`;if(G(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!J(t)){let e=t.getNextSibling();if(G(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Up(e,t){if(J(t)){let n=t.getLastDescendant();J(n)||G(n)?Hp(e,n):Hp(e,t)}else Hp(e,t)}var Wp=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Kp(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes(),n=t.length,r=t[n-1],i;if(G(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=Dh(e);t!==null&&n.push(t)}return Cm()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes();if((q()||om())===this&&e[0]){let t=Yg(e[0],`next`);h_(o_(t,t))}for(let t of e)t.remove()}};function K(e){return e instanceof Gp}var Gp=class e{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!K(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(Gg(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;J(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),Wg(e.focus)&&J(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=$g(e.focus.origin,`previous`);Gg(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=t_(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!J(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=S_(e.anchor),r=S_(e.anchor.getFlipped()),i=e=>Ug(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(T_(__(this),`next`));return Cm()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`)}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=Jp(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(J(d)&&!d.isInline())l||(c+=`
10
+ `),l=!d.isEmpty();else if(l=!1,G(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else !Km(d)&&!vp(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=Dm(),n=t.getEditorState()._selection,r=tm(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),rd(this)}clone(){let t=this.anchor,n=this.focus;return new e(Vp(t.key,t.offset,t.type),Vp(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Sh(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=Tu[e];return(this.format&t)!==0}insertRawText(e){let t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){let r=t[e];r===`
11
+ `||r===`\r
12
+ `?n.push(_p()):r===` `?n.push(Rp()):n.push(Fp(r))}this.insertNodes(n)}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=Fp();if(o.setFormat(n),o.setStyle(r),rh(a))a.splice(0,0,[o]);else{let e=Jm(i)?nh().append(o):o;a===null?i.append(e):a.insertBefore(e)}e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&m_(o,S_(p_(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];G(d)||W(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(yh(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling();if(G(t)&&t.canInsertTextBefore()&&!yh(t)||(t=Fp(),t.setFormat(r),t.setStyle(i),p.canInsertTextAfter()?d.insertAfter(t):p.insertAfter(t)),t.select(0,0),d=t,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(yh(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling();if(G(t)&&!yh(t)||(t=Fp(),t.setFormat(r),p.canInsertTextBefore()?d.insertBefore(t):p.insertBefore(t)),t.select(),d=t,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){let e=Fp(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||J(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),em(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(vh(d)){let t=Fp(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(zp(d)){let t=Fp(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=Fp(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=J(d)?d:d.getParentOrThrow(),r=J(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c)if(G(m)&&!vh(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=Fp(m.getTextContent());m.replace(e),m=e}Jm(o.getNode())||o.type!==`text`||(m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||J(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(vh(d))if(s===f)d.select();else{let t=Fp(e);t.select(),d.replace(t)}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=q()===this;g_(this,x_(__(this))),e&&q()!==this&&Fh(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Th(null);let n=this.getNodes(),r=[];for(let e of n)G(e)&&r.push(e);let i=t=>{n.forEach(n=>{if(J(n)){let r=n.getFormatFlags(e,t);n.setTextFormat(r)}})},a=r.length;if(a===0)return this.toggleFormat(e),Th(null),void i(t);let o=this.anchor,s=this.focus,c=this.isBackward(),l=c?s:o,u=c?o:s,d=0,f=r[0],p=l.type===`element`?0:l.offset;if(l.type===`text`&&p===f.getTextContentSize()&&(d=1,f=r[1],p=0),f==null)return;let m=f.getFormatFlags(e,t);i(m);let h=a-1,g=r[h],_=u.type===`text`?u.offset:g.getTextContentSize();if(f.is(g)){if(p===_)return;if(yh(f)||p===0&&_===f.getTextContentSize())f.setFormat(m);else{let e=f.splitText(p,_),t=p===0?e[0]:e[1];t.setFormat(m),l.type===`text`&&l.set(t.__key,0,`text`),u.type===`text`&&u.set(t.__key,_-p,`text`)}this.format=m;return}p===0||yh(f)||([,f]=f.splitText(p),p=0),f.setFormat(m);let v=g.getFormatFlags(e,m);_>0&&(_===g.getTextContentSize()||yh(g)||([g]=g.splitText(_)),g.setFormat(v));for(let t=d+1;t<h;t++){let n=r[t],i=n.getFormatFlags(e,v);n.setFormat(i)}l.type===`text`&&l.set(f.__key,p,`text`),u.type===`text`&&u.set(g.__key,_,`text`),this.format=m|v}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key===`root`){this.insertParagraph();let t=q();return K(t)||W(134),t.insertNodes(e)}let t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Pg(t,Sg),r=e[e.length-1];if(J(n)&&`__language`in n){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=mm(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some(e=>(J(e)||Km(e))&&!e.isInline())){J(n)||W(211,t.constructor.name,t.getType());let i=mm(this);n.splice(i,0,e),r.selectEnd();return}let i=function(e){let t=nh(),n=null;for(let r=0;r<e.length;r++){let i=e[r],a=vp(i);if(a||Km(i)&&i.isInline()||J(i)&&i.isInline()||G(i)||i.isParentRequired()){if(n===null&&(n=i.createParentElementNode(),t.append(n),a))continue;n!==null&&n.append(i)}else t.append(i),n=null}return t}(e),a=i.getLastDescendant(),o=i.getChildren(),s=!J(n)||!n.isEmpty()?this.insertParagraph():null,c=o[o.length-1],l=o[0];var u;J(u=l)&&Sg(u)&&!u.isEmpty()&&J(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(J(n)||W(211,t.constructor.name,t.getType()),n.append(...l.getChildren()),l=o[1]),l&&(n===null&&W(212,t.constructor.name,t.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||W(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(n,l));let d=Pg(a,Sg);s&&J(d)&&(s.canMergeWhenEmpty()||Sg(c))&&(d.append(...s.getChildren()),s.remove()),J(n)&&n.isEmpty()&&n.remove(),a.selectEnd();let f=J(n)?n.getLastChild():null;vp(f)&&d!==n&&f.remove()}insertParagraph(){if(this.anchor.key===`root`){let e=nh();return Nh().splice(this.anchor.offset,0,[e]),e.select(),e}let e=mm(this),t=Pg(this.anchor.getNode(),Sg);J(t)||W(213);let n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){let t=_p();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=Jp(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(G(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(G(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),G(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(gm(this,e,t,n))return;let r=e===`move`,i=Dm(),a=hg(sg(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();if(s===null||o===null||!J(c)||c.isInline()||c.canBeEmpty()||mg(o,i,s),this.dirty){let e=tg(i,this.anchor.key),t=tg(i,this.focus.key);this.anchor.type===`text`&&(e=xh(e)),this.focus.type===`text`&&(t=xh(t)),e&&t&&dm(a,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=a.getRangeAt(0),n=this.anchor.getNode(),i=Jm(n)?n:cg(n);if(this.applyDOMRange(e),this.dirty=!0,!r){let n=this.getNodes(),r=[],o=!1;for(let e=0;e<n.length;e++){let t=n[e];ag(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){let e=r[0];J(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{let e=r[r.length-1];J(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}a.anchorNode===e.startContainer&&a.anchorOffset===e.startOffset||function(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}(this)}}n===`lineboundary`&&gm(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&J(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(J(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=i_(p_(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(Gg(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(J(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=S_(t);g_(this,o_(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(Wg(t)){if(J(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Km(t.origin)){if(!t.origin.isIsolated())if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&J(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=im();e.add(t.origin.getKey()),Fh(e)}else t.origin.remove();return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return g_(this,o_(!t.origin.isEmpty()&&n.isEmpty()?v_(Yg(n,t.direction)):r.anchor,t)),this.removeText()}}let i=this.focus;if(this.modify(`extend`,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&Yp(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void Zp(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void Zp(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(Lh(e)||Xp(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&Jm(e.getParent())&&e.getPreviousSibling()===null&&Yp(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify(`extend`,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify(`extend`,e,`word`)}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}};function Kp(e){return e instanceof Wp}function qp(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Jp(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[qp(n),qp(r)]}function Yp(e,t){for(let n=t;n;n=n.getParent()){if(J(n)){if(n.collapseAtStart(e))return!0;if(lg(n))break}if(n.getPreviousSibling())break}return!1}var Xp=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function Zp(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Qp(e,t,n,r){let i,a=t;if(_g(e)){let o=!1,s=e.childNodes,c=s.length,l=r._blockCursorElement;a===c&&(o=!0,a=c-1);let u=s[a],d=!1;if(u===l)u=s[a+1],d=!0;else if(l!==null){let n=l.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,l)&&a--}if(i=Ih(u),G(i))a=Zg(i,o?`next`:`previous`);else{let s=Ih(e);if(s===null)return null;if(J(s)){let c=r.getElementByKey(s.getKey());c===null&&W(214);let l=s.getDOMSlot(c);[s,a]=l.resolveChildIndex(s,c,e,t),J(s)||W(215),o&&a>=s.getChildrenSize()&&(a=Math.max(0,s.getChildrenSize()-1));let u=s.getChildAtIndex(a);if(J(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=o?u.getLastDescendant():u.getFirstDescendant();e===null?s=u:(u=e,s=J(u)?u:u.getParentOrThrow()),a=0}G(u)?(i=u,s=null,a=Zg(u,o?`next`:`previous`)):u!==s&&o&&!d&&(J(s)||W(216),a=Math.min(s.getChildrenSize(),a+1))}else{let n=s.getIndexWithinParent();a=t===0&&Km(s)&&Ih(e)===s?n:n+1,s=s.getParentOrThrow()}if(J(s))return Vp(s.__key,a,`element`)}}else i=Ih(e);return G(i)?Vp(i.__key,Zg(i,a,`clamp`),`text`):null}function $p(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&J(a)&&a.isInline()){let t=a.getPreviousSibling();G(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else J(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):G(r)&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&J(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&J(a)&&a.isInline()&&!a.canInsertTextAfter()){let t=a.getNextSibling();G(t)&&e.set(t.__key,0,`text`)}}}function em(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);$p(e,n,r),$p(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function tm(e,t,n,r,i,a){if(e===null||n===null||!mh(i,e,n))return null;let o=Qp(e,t,K(a)?a.anchor:null,i);if(o===null)return null;let s=Qp(n,r,K(a)?a.focus:null,i);if(s===null)return null;if(o.type===`element`&&s.type===`element`){let t=Ih(e),r=Ih(n);if(Km(t)&&Km(r))return null}return em(o,s),[o,s]}function nm(e,t,n,r,i,a){let o=Em(),s=new Gp(Vp(e,t,i),Vp(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function rm(){return new Gp(Vp(`root`,0,`element`),Vp(`root`,0,`element`),0,``)}function im(){return new Wp(new Set)}function am(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Nu&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(K(e)&&!c)return e.clone();if(t===null)return null;if(l=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,(s||o===void 0)&&K(e)&&!mh(n,l,u))return e.clone();let p=tm(l,d,u,f,n,e);if(p===null)return null;let[m,h]=p,g=0,_=``;if(K(e)){let t=e.anchor;if(m.key===t.key)g=e.format,_=e.style;else{let e=m.getNode();G(e)?(g=e.getFormat(),_=e.getStyle()):J(e)&&(g=e.getTextFormat(),_=e.getTextStyle())}}return new Gp(m,h,g,_)}function q(){return Em()._selection}function om(){return Dm()._editorState._selection}function sm(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),cm(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}cm(e)}function cm(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!J(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(G(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}return}if(J(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(G(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(J(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(G(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}function lm(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,G(i)?s=`text`:J(i)&&(s=`element`)):(a=r.__key,G(r)?(o=r.getTextContentSize(),s=`text`):J(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function um(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function dm(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function fm(e,t,n){let r=tg(e,t.getKey());if(J(t)){let e=t.getDOMSlot(r);return[e.element,n+e.getFirstChildOffset()]}return[r,n]}function pm(e,t,n,r,i,a,o){let s=r.anchorNode,c=r.focusNode,l=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(`collaboration`)&&d!==a||d!==null&&ph(d))return;if(!K(t))return void(e!==null&&mh(n,s,c)&&r.removeAllRanges());let f=t.anchor,p=t.focus,m=f.getNode(),h=p.getNode(),[g,_]=fm(n,m,f.offset),[v,y]=fm(n,h,p.offset),b=t.format,x=t.style,S=t.isCollapsed(),C=g,w=v,T=!1;var E,D,O,k,A;if((f.type===`text`?(C=xh(g),T=m.getFormat()!==b||m.getStyle()!==x):K(e)&&e.anchor.type===`text`&&(T=!0),p.type===`text`&&(w=xh(v)),C!==null&&w!==null)&&(S&&(e===null||T||K(e)&&(e.format!==b||e.style!==x))&&(E=b,D=x,O=_,k=f.key,A=performance.now(),Hf=[E,D,O,k,A]),l!==_||u!==y||s!==C||c!==w||r.type===`Range`&&S||(d!==null&&a.contains(d)||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0}),f.type===`element`))){if(dm(r,C,_,w,y),!au||!t.isCollapsed()||a===null||i.has(`skip-selection-focus`)||document.activeElement!==null&&a.contains(document.activeElement)||a.focus({preventScroll:!0}),!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===document.activeElement){let e=K(t)&&t.anchor.type===`element`?C.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(e!==null){let t;if(e instanceof Text){let n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=rg(n),i=og(r);if(r===null||i===null)return;let{top:a,bottom:o}=t,s=0,c=0,l=n;for(;l!==null;){let t=l===r.body;if(t){s=0,c=sg(e).innerHeight;let t=i.getComputedStyle(r.documentElement),n=parseFloat(t.scrollPaddingTop),a=parseFloat(t.scrollPaddingBottom);isFinite(n)&&(s+=n),isFinite(a)&&(c-=a)}else{let e=l.getBoundingClientRect();s=e.top,c=e.bottom}let n=0;if(a<s?n=-(s-a):o>c&&(n=o-c),n!==0)if(t)i.scrollBy(0,n);else{let e=l.scrollTop;l.scrollTop+=n;let t=l.scrollTop-e;a-=t,o-=t}if(t)break;l=ng(l)}})(n,t,a)}}Ff=!0}}function mm(e){let t=e;e.isCollapsed()||t.removeText();let n=q();K(n)&&(t=n),K(t)||W(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!Sg(i);){let e=i;if([i,a]=hm(i,a),e.is(i))break}return a}function hm(e,t){let n=e.getParent();if(!n){let e=nh();return Nh().append(e),e.select(),[Nh(),0]}if(G(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!J(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new Gp(Vp(e.__key,t,`element`),Vp(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function gm(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=p_(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!C_(c)){for(let e of c){l=!1;let{origin:t}=e;if(!Km(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of i_(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(Gg(e))e.origin.isInline()||(c=e);else{if(J(e.origin))continue;Km(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&Km(c.origin)&&c.origin.isKeyboardSelectable()){let e=im();return e.add(c.origin.getKey()),Fh(e),!0}return c=S_(c),s&&m_(e.anchor,c),m_(e.focus,c),l||!o}var _m=null,vm=null,ym=!1,bm=!1,xm=0,Sm={characterData:!0,childList:!0,subtree:!0};function Cm(){return ym||_m!==null&&_m._readOnly}function wm(){ym&&W(13)}function Tm(){xm>99&&W(14)}function Em(){return _m===null&&W(195,Om()),_m}function Dm(){return vm===null&&W(196,Om()),vm}function Om(){let e=0,t=new Set,n=sh.version;if(typeof window<`u`)for(let r of document.querySelectorAll(`[contenteditable]`)){let i=_h(r);if(hh(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function km(){return vm}function Am(e,t,n){let r=t.__type,i=uh(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function jm(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Mm(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Nm(e,t){let n=e.type,r=t.get(n);r===void 0&&W(17,n);let i=r.klass;e.type!==i.getType()&&W(18,i.name);let a=i.importJSON(e),o=e.children;if(J(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Nm(o[e],t);a.append(n)}return a}function Pm(e,t,n){let r=_m,i=ym,a=vm;_m=t,ym=!0,vm=e;try{return n()}finally{_m=r,ym=i,vm=a}}function Fm(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return;let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=_m,u=ym,d=vm,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){vm=e,_m=n,ym=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=Ld(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),bm)throw t;ih(e,null,r,n),Hu(e),e._dirtyType=2,bm=!0,Fm(e,a),bm=!1;return}finally{p.observe(r,Sm),e._updating=f,_m=l,ym=u,vm=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags,y=e._deferred;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=jh(e)),delete r[a])}(e,n);let b=i?null:hg(sg(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){vm=e,_m=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&mg(t,e,r),pm(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(K(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(document.activeElement)){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())pg(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&pg(t)){let n=t.getPreviousSibling();(n===null||pg(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=e.getElementByKey(a.__key);r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=document.createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=A_(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&mg(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,Sm),vm=d,_m=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),K(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(Bd,void 0);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,Im(`decorator`,e,!0,x)),function(e,t,n){let r=Mh(t),i=Mh(n);r!==i&&Im(`textcontent`,e,!0,i)}(e,t||a,n),Im(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),function(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,y),function(e){let t=e._updates;if(t.length!==0){let n=t.shift();if(n){let[t,r]=n;zm(e,t,r)}}}(e)}function Im(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function Lm(e,t,n,r){let i=Rh(e),a;for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t!==void 0){let e=Array.from(t),i=e.length,a=!1;if(Bm(s,()=>{for(let t=0;t<i;t++)if(e[t](n,r))return void(a=!0)}),a)return a}}}return a&&a.update(()=>{Lm(a,t,n,r)}),!1}function Rm(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&W(191),a._flushSync=!0),o&&e._deferred.push(o),Mm(e,i.tag)),a==null?zm(e,n,i):n()}}return r}function zm(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,Mm(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=Ym(c||s),l=!0),c._flushSync=o;let u=_m,d=ym,f=vm,p=e._updating;_m=c,ym=!1,e._updating=!0,vm=e;let m=e._headless||e.getRootElement()===null;lh(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=hg(sg(e));return K(n)||n==null?am(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=Rm(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(K(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);G(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&nd(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=Eh(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);G(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&nd(r),r!==void 0&&jm(r,a)&&Am(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){xm++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&jm(c,a)&&Am(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,xm++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Rm(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(J(t)&&Mu(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of o)a.delete(e);for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(i.has(e)||n.delete(e),a.delete(e))}}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(K(i)){let e=c._nodeMap,t=i.anchor.key,n=i.focus.key;e.get(t)!==void 0&&e.get(n)!==void 0||W(19)}else Kp(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Fm(e);return}finally{_m=u,ym=d,vm=f,e._updating=p,xm=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,Fm(e)):l&&Wee(()=>{Fm(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Bm(e,t,n){vm===e&&n===void 0?t():zm(e,t,n)}var Vm=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&W(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&W(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&W(224),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(fu||su||lu);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=document.createElement(`br`);if(n.insertBefore(i,r),e){let e=document.createElement(`img`);e.setAttribute(`data-lexical-linebreak`,`true`),e.style.cssText=`display: inline !important; border: 0px !important; margin: 0px !important;`,e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}let i=Hm(t,n);i.push(r);let a=Hm(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Hm(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&W(225),n.reverse()}var Um=class extends up{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return Ou[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=Dm()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[],t=this.getFirstChild();for(;t!==null;){if(G(t)&&e.push(t),J(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;J(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;J(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return J(e)&&e.getLastDescendant()||e||null}let r=t[e];return J(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:Dh(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&W(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:Dh(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&W(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=``,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),J(i)&&r!==n-1&&!i.isInline()&&(e+=Cu)}return e}getTextContentSize(){let e=0,t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),J(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=Du[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=Tu[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Sh(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){wm();let n=q(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(G(e)||J(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(G(e)||J(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return K(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):nm(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e===``?0:Du[e],this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){lp(this)&&W(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||W(226,String(e),String(t),String(r));let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0)if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&W(100);let t=e.getNextSibling(),n=e.__key;Ch(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,Ch(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&W(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=q();if(K(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;Wm(r,t,n)&&lm(r,r.getNode(),this,l,c),Wm(i,t,n)&&lm(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||lg(this)||this.remove()}}return i}getDOMSlot(e){return new Vm(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(_g(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||lg(this)||this.getChildren().some(G)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=this.getDOMSlot(e),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function J(e){return e instanceof Um}function Wm(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var Gm=class extends up{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Km(e){return e instanceof Gm}var qm=class e extends Um{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){W(51)}getTextContent(){let e=this.__cachedText;return!Cm()&&Dm()._dirtyType!==0||e===null?super.getTextContent():e}remove(){W(52)}replace(e){W(53)}insertBefore(e){W(54)}insertAfter(e){W(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)J(e)||Km(e)||W(282);return super.splice(e,t,n)}static importJSON(e){return Nh().updateFromJSON(e)}collapseAtStart(){return!0}};function Jm(e){return e instanceof qm}function Ym(e){return new $m(new Map(e._nodeMap))}function Xm(){return new $m(new Map([[`root`,new qm]]))}function Zm(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&W(130,n.name),J(e)){let r=t.children;Array.isArray(r)||W(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=Zm(i[e]);r.push(t)}}return t}function Qm(e){return e instanceof $m}var $m=class e{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Pm(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Pm(null,this,()=>({root:Zm(Nh())}))}},eh=class extends Um{static getType(){return`artificial`}createDOM(e){return document.createElement(`div`)}},th=class e extends Um{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=document.createElement(`p`),n=Xh(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Bee,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(_g(t)){this.isEmpty()&&t.append(document.createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return nh().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(G);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=nh();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||G(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function Bee(e){let t=nh();if(e.style&&(t.setFormat(e.style.textAlign),kg(e,t)),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in Du&&t.setFormat(n)}return{node:t}}function nh(){return ug(new th)}function rh(e){return e instanceof th}function ih(e,t,n,r){let i=e._keyToDOMMap;i.clear(),e._editorState=Xm(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;let a=e._observer;a!==null&&(a.disconnect(),e._observer=null),t!==null&&(t.textContent=``),n!==null&&(n.textContent=``,i.set(`root`,n))}function Vee(e){let t=new Set,n=new Set,r=e;for(;r;){let{ownNodeConfig:e}=Mg(r),i=r.transform;if(!n.has(i)){n.add(i);let e=r.transform();e&&t.add(e)}if(e){let n=e.$transform;n&&t.add(n),r=e.extends}else{let e=Object.getPrototypeOf(r);r=e.prototype instanceof up&&e!==up?e:void 0}}return t}function ah(e){let t=e||{},n=km(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Xm(),s=t.namespace||(i===null?zh():i._config.namespace),c=t.editorState,l=[qm,Ep,hp,Lp,th,eh,...t.nodes||[]],{onError:u,html:d}=t,f=t.editable===void 0||t.editable,p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let e=0;e<l.length;e++){let t=l[e],n=null,r=null;if(typeof t!=`function`){let e=t;t=e.replace,n=e.with,r=e.withKlass||null}Mg(t);let i=t.getType(),a=Vee(t);p.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:Gu(l[e]),transforms:a})}}let m=new sh(o,i,p,{disableEvents:a,namespace:s,theme:r},u||console.error,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(p,d?d.import:void 0),f,e);return c!==void 0&&(m._pendingEditorState=c,m._dirtyType=2),function(e){e.registerCommand(Hd,Yf,0),e.registerCommand(Ud,Xf,0),e.registerCommand(Wd,Zf,0),e.registerCommand(Gd,Qf,0),e.registerCommand(rf,ep,0)}(m),m}function Hee(e,t){let n=e.get(t);e.delete(t),n&&n()}function oh(e,t,n){return e.set(t,n),Hee.bind(null,e,t)}var sh=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,a,o,s){this._createEditorArgs=s,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=zh(),this._onError=i,this._htmlConversions=a,this._editable=o,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return oh(this._listeners.update,e)}registerEditableListener(e){return oh(this._listeners.editable,e)}registerDecoratorListener(e){return oh(this._listeners.decorator,e)}registerTextContentListener(e){return oh(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return M_(oh(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&W(35);let r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);let i=r.get(e);i===void 0&&W(36,String(e));let a=i[n];return a.add(t),()=>{a.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&W(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=Eg(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=Eg(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=Dh(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:dp}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Y(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=Xh(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,ih(this,t,e,r),t!==null&&(this._config.disableEvents||op(t),n!=null&&t.classList.remove(...n)),e!==null){let t=og(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Hu(this),this._updateTags.add(dp),Fm(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;Nf.set(e,n);let r=Pf.get(n)??0;r<1&&n.addEventListener(`selectionchange`,rp),Pf.set(n,r+1),e.__lexicalEditor=t;let i=tp(e);for(let n=0;n<Of.length;n++){let[r,a]=Of[n],o=typeof a==`function`?e=>{ap(e)||(ip(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(ap(e))return;ip(e);let n=t.isEditable();switch(r){case`cut`:return n&&Y(t,Sf,e);case`copy`:return Y(t,xf,e);case`paste`:return n&&Y(t,Xd,e);case`dragstart`:return n&&Y(t,vf,e);case`dragover`:return n&&Y(t,yf,e);case`dragend`:return n&&Y(t,bf,e);case`focus`:return n&&Y(t,wf,e);case`blur`:return n&&Y(t,Tf,e);case`drop`:return n&&Y(t,_f,e)}};e.addEventListener(r,o),i.push(()=>{e.removeEventListener(r,o)})}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(dp),Fm(this);Im(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&W(38);let n=e;n._readOnly&&(n=Ym(e),n._selection=e._selection?e._selection.clone():null),Vu(this);let r=this._pendingEditorState,i=this._updateTags,a=t===void 0?null:t.tag;r===null||r.isEmpty()||(a!=null&&i.add(a),Fm(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,a!=null&&i.add(a),this._updating||Fm(this)}parseEditorState(e,t){return function(e,t,n){let r=Xm(),i=_m,a=ym,o=vm,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,_m=r,ym=!1,vm=t,lh(null);try{let i=t._nodes;Nm(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,_m=i,ym=a,vm=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(e){return Fm(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):zm(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Bm(this,()=>{let r=q(),i=Nh();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||Fh(r.clone()),ig(`focus`),Yee(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=hg(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Im(`editable`,this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}};sh.version=`0.43.0+prod.esm`;var ch=null;function lh(e){ch=e}var Uee=1;function uh(e,t){let n=dh(e,t);return n===void 0&&W(30,t),n}function dh(e,t){return e._nodes.get(t)}var Wee=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function fh(e){return Km(Ah(e))}function ph(e){let t=document.activeElement;if(!_g(t))return!1;let n=t.nodeName;return Km(Ah(e))&&(n===`INPUT`||n===`TEXTAREA`||t.contentEditable===`true`&&_h(t)==null)}function mh(e,t,n){let r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!ph(t)&&gh(t)===e}catch{return!1}}function hh(e){return e instanceof sh}function gh(e){let t=e;for(;t!=null;){let e=_h(t);if(hh(e))return e;t=ng(t)}return null}function _h(e){return e?e.__lexicalEditor:null}function vh(e){return zp(e)||e.isToken()}function yh(e){return vh(e)||e.isSegmented()}function bh(e){return vg(e)&&e.nodeType===3}function Gee(e){return vg(e)&&e.nodeType===9}function xh(e){let t=e;for(;t!=null;){if(bh(t))return t;t=t.firstChild}return null}function Sh(e,t,n){let r=Tu[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~Tu.superscript:t===`superscript`?i&=~Tu.subscript:t===`lowercase`?(i&=~Tu.uppercase,i&=~Tu.capitalize):t===`uppercase`?(i&=~Tu.lowercase,i&=~Tu.capitalize):t===`capitalize`&&(i&=~Tu.lowercase,i&=~Tu.uppercase),i}function Kee(e,t){let n=function(){let e=ch;return ch=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);wm(),Tm();let r=Dm(),i=Em(),a=``+ Uee++;i._nodeMap.set(a,e),J(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType=1,e.__key=a}function Ch(e){let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function wh(e){Tm(),lp(e)&&W(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent,r=Em(),i=Dm(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent}}(n,a,o);let s=t.__key;i._dirtyType=1,J(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function Th(e){wm();let t=Dm(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=Dh(n);e!==null&&e.getWritable()}if(e!==null){let t=Dh(e);t!==null&&t.getWritable()}}}function Eh(){return Cm()?null:Dm()._compositionKey}function Dh(e,t){let n=(t||Em())._nodeMap.get(e);return n===void 0?null:n}function Oh(e,t){let n=kh(e,Dm());return n===void 0?null:Dh(n,t)}function kh(e,t){return e[`__lexicalKey_${t._key}`]}function Ah(e,t){let n=e;for(;n!=null;){let e=Oh(n,t);if(e!==null)return e;n=ng(n)}return null}function jh(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Mh(e){return e.read(()=>Nh().getTextContent())}function Nh(){return Ph(Em())}function Ph(e){return e._nodeMap.get(`root`)}function Fh(e){wm();let t=Em();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Ih(e){let t=Dm(),n=function(e,t){let n=e;for(;n!=null;){let e=kh(n,t);if(e!==void 0)return e;n=ng(n)}return null}(e,t);return n===null?e===t.getRootElement()?Dh(`root`):null:Dh(n)}function Lh(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Rh(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function zh(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function Bh(e){return bh(e)?e.nodeValue:null}function Vh(e,t,n){let r=hg(sg(t));if(r===null)return;let i=r.anchorNode,{anchorOffset:a,focusOffset:o}=r;if(i!==null){let t=Bh(i),r=Ah(i);if(t!==null&&G(r)){if((t===Su||t===wu)&&n){let e=n.length;t=n,a=e,o=e}t!==null&&Hh(r,t,a,o,e)}}}function Hh(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=t;if((o||i)&&(t.endsWith(Su)&&(s=t.slice(0,-Su.length)),i)){let e=wu,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){if(s===``){if(Th(null),lu||su||fu)a.remove();else{let e=Dm();setTimeout(()=>{e.update(()=>{a.isAttached()&&a.remove()})},20)}return}let t=a.getParent(),i=om(),c=a.getTextContentSize(),l=Eh(),u=a.getKey();if(a.isToken()||l!==null&&u===l&&!o||K(i)&&(t!==null&&!t.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===e.__key&&i.anchor.offset===0&&!a.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===c&&!a.canInsertTextAfter()&&!o))return void a.markDirty();let d=q();if(!K(d)||n===null||r===null)return void Uh(a,s,d);if(d.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=Fp(a.getTextContent());a.replace(e),a=e}Uh(a,s,d)}}}function Uh(e,t,n){if(e.setTextContent(t),K(n)){let t=e.getKey();for(let r of[`anchor`,`focus`]){let i=n[r];i.type===`text`&&i.key===t&&(i.offset=Zg(e,i.offset,`clamp`))}}}function Wh(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function qee(e,t){return Wh(e,t,`altKey`)&&Wh(e,t,`ctrlKey`)&&Wh(e,t,`shiftKey`)&&Wh(e,t,`metaKey`)}function Gh(e,t,n){if(!qee(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;let r=`Key`+t.toUpperCase();return e.code===r}var Kh={ctrlKey:!iu,metaKey:iu},qh={altKey:iu,ctrlKey:!iu};function Jh(e){return e.key===`Backspace`}function Yh(e){return Gh(e,`a`,Kh)}function Jee(e){let t=Nh();if(K(e)){let t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),rd(e),e}{let e=t.select(0,t.getChildrenSize());return Fh(rd(e)),e}}function Xh(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=A_(i);return n[t]=e,e}return i}function Zh(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&W(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function Qh(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function $h(e,t){let n=e.offset;if(e.type===`element`)return Qh(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?Qh(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function eg(e){let t=sg(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function Y(e,t,n){return Lm(e,t,n,e)}function tg(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&W(75,t),n}function ng(e){let t=e.assignedSlot||e.parentElement;return yg(t)?t.host:t}function rg(e){return Gee(e)?e:_g(e)?e.ownerDocument:null}function ig(e){wm(),Dm()._updateTags.add(e)}function Yee(e){wm(),Dm()._deferred.push(e)}function ag(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function og(e){let t=rg(e);return t?t.defaultView:null}function sg(e){let t=e._window;return t===null&&W(78),t}function cg(e){let t=e.getParentOrThrow();for(;t!==null;){if(lg(t))return t;t=t.getParentOrThrow()}return t}function lg(e){return Jm(e)||J(e)&&e.isShadowRoot()}function ug(e){let t=Dm(),n=e.getType(),r=dh(t,n);r===void 0&&W(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||W(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||W(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&W(203,e.constructor.name,n,r.name,r.getType()),t}return e}function dg(e,t){!Jm(e.getParent())||J(t)||Km(t)||W(99)}function fg(e){let t=Dh(e);return t===null&&W(63,e),t}function pg(e){return(Km(e)||J(e)&&!e.canBeEmpty())&&!e.isInline()}function mg(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function hg(e){return nu?(e||window).getSelection():null}function gg(e){let t=og(e);return t?t.getSelection():null}function _g(e){return vg(e)&&e.nodeType===1}function vg(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function yg(e){return vg(e)&&e.nodeType===11}function bg(e){let t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,`i`);return e.nodeName.match(t)!==null}function xg(e){let t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,`i`);return e.nodeName.match(t)!==null}function Sg(e){if(Km(e)&&!e.isInline())return!0;if(!J(e)||lg(e))return!1;let t=e.getFirstChild(),n=t===null||vp(t)||G(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Cg(){return Dm()}var wg=new WeakMap,Tg=new Map;function Eg(e){if(!e._readOnly&&e.isEmpty())return Tg;e._readOnly||W(192);let t=wg.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),wg.set(e,t)),t}function Dg(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Og(e){return(t=Dg(e))[cp]=!0,t;var t}function kg(e,t){let n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Ag(e){return!0===e.__lexicalUnmanaged}function jg(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==up[t]}function Mg(e){let t=ju in e.prototype?e.prototype[ju]():void 0,n=function(e){if(!(e===up||e.prototype instanceof up)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{sh.version&&(n=JSON.parse(sh.version))}catch{}W(290,e.name,t,n)}return e===Gm||e===Um||e===up}(e),r=!n&&jg(e,`getType`)?e.getType():void 0,i,a=r;if(t)if(r)i=t[r];else for(let[e,n]of Object.entries(t))a=e,i=n;if(!n&&a&&(jg(e,`getType`)||(e.getType=()=>a),jg(e,`clone`)||(e.clone=t=>(lh(t),new e)),jg(e,`importJSON`)||(e.importJSON=i&&i.$importJSON||(t=>new e().updateFromJSON(t))),!jg(e,`importDOM`)&&i)){let{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:a}}function Ng(e){let t=Cg();return wm(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var Pg=(e,t)=>{let n=e;for(;n!=null&&!Jm(n);){if(t(n))return n;n=n.getParent()}return null},Fg={next:`previous`,previous:`next`},Ig=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return s_({hasNext:Wg,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Yg(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Yg(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&W(263,Array.from(o).join(` `))}else i.insert(e);i=Yg(e,this.direction)}for(let e of o.values())e.remove();return this}},Lg=class e extends Ig{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:$g(e,this.direction)}getParentCaret(e=`root`){return Yg(Bg(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=zg(this.direction);return Yg(this.getNodeAtCaret(),e)||$g(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Rg={root:Jm,shadowRoot:lg};function zg(e){return Fg[e]}function Bg(e,t=`root`){return Rg[t](e)?null:e}var Vg=class e extends Ig{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Yg(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return J(this.origin)?$g(this.origin,this.direction):null}getParentCaret(e=`root`){return Yg(Bg(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=zg(this.direction);return Yg(this.getNodeAtCaret(),e)||$g(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Hg)&&this.direction===t.direction&&this.origin.is(t.origin)}},Hg=class e extends Ig{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Xg(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return Yg(Bg(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Xg(this.origin,zg(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Vg||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Yg(this.origin,this.direction)}};function Ug(e){return e instanceof Hg}function Wg(e){return e instanceof Vg}function Gg(e){return e instanceof Lg}var Kg={next:class extends Hg{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Hg{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},qg={next:class extends Vg{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Vg{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Jg={next:class extends Lg{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Lg{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Yg(e,t){return e?new qg[t](e):null}function Xg(e,t,n){return e?new Kg[t](e,Zg(e,n)):null}function Zg(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&tu(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Qg(e,t){return new r_(e,t)}function $g(e,t){return J(e)?new Jg[t](e):null}function e_(e){return e&&e.getChildCaret()||e}function t_(e){return e&&e_(e.getAdjacentCaret())}var n_=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return Ug(t)?function(e,t){let{direction:n,origin:r}=e;return Qg(e,Zg(r,t===`focus`?zg(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[Qg(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=Ug(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Ug(n),i=t=>t.isSameNodeCaret(n)?null:t_(t)||t.getParentCaret(e);return s_({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},r_=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Xg(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function i_(e){return o_(e,Yg(Nh(),e.direction))}function a_(e){return o_(e,e)}function o_(e,t){return e.direction!==t.direction&&W(265),new n_(e,t,e.direction)}function s_(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function c_(e,t){let n=f_(e.origin,t.origin);switch(n===null&&W(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return l_(n)}}function l_(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function u_(e,t){return t.is(e)}function d_(e){return J(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function f_(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=d_(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=d_(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(u_(e,r)||W(276),{commonAncestor:r,type:`ancestor`}):i===null?(u_(t,r)||W(277),{commonAncestor:r,type:`descendant`}):((J(a)||u_(e,a))&&(J(i)||u_(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||W(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function p_(e,t){let{type:n,key:r,offset:i}=e,a=fg(e.key);return n===`text`?(G(a)||W(266,a.getType(),r),Xg(a,t,i)):(J(a)||W(267,a.getType(),r),E_(a,e.offset,t))}function m_(e,t){let{origin:n,direction:r}=t,i=r===`next`;Ug(t)?e.set(n.getKey(),t.offset,`text`):Wg(t)?G(n)?e.set(n.getKey(),Zg(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),`element`):(Gg(t)&&J(n)||W(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function h_(e){let t=q(),n=K(t)?t:rm();return g_(n,e),Fh(n),n}function g_(e,t){m_(e.anchor,t.anchor),m_(e.focus,t.focus)}function __(e){let{anchor:t,focus:n}=e,r=p_(t,`next`),i=p_(n,`next`),a=c_(r,i)<=0?`next`:`previous`;return o_(w_(r,a),w_(i,a))}function v_(e){let{direction:t,origin:n}=e,r=Yg(n,zg(t)).getNodeAtCaret();return r?Yg(r,t):$g(n.getParentOrThrow(),t)}function y_(e,t=`root`){let n=[e];for(let r=Gg(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(v_(r));return n}function b_(e){return!!e&&e.origin.isAttached()}function x_(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=T_(e,r),o=y_(a.anchor,n),s=y_(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(Gg(e))c.add(e.origin.getKey());else if(Wg(e)){let{origin:t}=e;J(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=v_(Yg(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=Fp(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Xg(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(b_(e)){u=S_(e);break}for(let e of s)if(b_(e)){d=S_(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c;for(c=0;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(lg(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,Sg),d=u&&l(o,e=>n.has(e.getKey())&&Sg(e));return u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;$g(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}let p=[u,d,...o,...s].find(b_);if(p)return a_(w_(S_(p),e.direction));W(269,JSON.stringify(o.map(e=>e.origin.__key)))}function S_(e){let t=function(e){let t=e;for(;Gg(t);){let e=t_(t);if(!Gg(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(G(t.origin))return Ug(t)?t:Xg(t.origin,n,n);let r=t.getAdjacentCaret();return Wg(r)&&G(r.origin)?Xg(r.origin,n,zg(n)):t}function C_(e){return Ug(e)&&e.offset!==Zg(e.origin,e.direction)}function w_(e,t){return e.direction===t?e:e.getFlipped()}function T_(e,t){return e.direction===t?e:o_(w_(e.focus,t),w_(e.anchor,t))}function E_(e,t,n){let r=$g(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return w_(r,n)}function D_(e){return e}function O_(e){return e}function k_(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function A_(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function j_(e,...t){let n=A_(...t);n.length>0&&e.classList.add(...n)}function M_(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function N_(){return Nh().getTextContent()}function P_(e,t=!0){if(e)return!1;let n=N_();return t&&(n=n.trim()),n===``}function F_(e){if(!P_(e,!1))return!1;let t=Nh().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(Km(n))return!1;if(J(n)){if(!rh(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!G(n))return!1}}}return!0}function I_(e){return()=>F_(e)}function L_(e){let t=Cg().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function R_(e){return L_(Jm(e)?e:e.getParentOrThrow())}function z_(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!yh(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=Jp(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=Og(t)),t.__text=p)}}return t}function B_(e){let t=V_(e);return t!==null&&t.writingMode===`vertical-rl`}function V_(e){let t=e.anchor.getNode();return J(t)?L_(t):R_(t)}function H_(e,t){let n=B_(e)?!t:t;W_(e)&&(n=!n);let r=p_(e.focus,n?`previous`:`next`);if(C_(r))return!1;for(let e of i_(r)){if(Gg(e))return!e.origin.isInline();if(!J(e.origin)){if(Km(e.origin))return!0;break}}return!1}function U_(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function W_(e){let t=V_(e);return t!==null&&t.direction===`rtl`}function G_(e,t,n){let r=W_(e),i;i=B_(e)||r?!n:n,U_(e,t,i,`character`)}var K_=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,q_=K_&&`documentMode`in document?document.documentMode:null;K_&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),K_&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),!(!K_||!(`InputEvent`in window)||q_)&&`getTargetRanges`in new window.InputEvent(`input`),K_&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,K_&&/Android/.test(navigator.userAgent),K_&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),K_&&/^(?=.*Chrome).*/i.test(navigator.userAgent),K_&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);function J_(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}var Y_=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?V.useLayoutEffect:V.useEffect;function X_({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g=`textbox`,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,w]=(0,V.useState)(e.isEditable()),T=(0,V.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),E=(0,V.useMemo)(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(S,T),[T,S]);return Y_(()=>(w(e.isEditable()),e.registerEditableListener(e=>{w(e)})),[e]),(0,H.jsx)(`div`,{"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":C&&g===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:E,role:g,spellCheck:_,style:v,tabIndex:y,...x})}var Z_=(0,V.forwardRef)(X_);function Q_(e){return e.getEditorState().read(I_(e.isComposing()))}var $_=(0,V.forwardRef)(ev);function ev(e,t){let{placeholder:n,...r}=e,[i]=eu();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Z_,{editor:i,...r,ref:t}),n!=null&&(0,H.jsx)(tv,{editor:i,content:n})]})}function tv({content:e,editor:t}){let n=function(e){let[t,n]=(0,V.useState)(()=>Q_(e));return Y_(()=>{function t(){n(Q_(e))}return t(),M_(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=(0,V.useState)(t.isEditable());if((0,V.useLayoutEffect)(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,H.jsx)(`div`,{"aria-hidden":!0,children:a})}var nv=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,rv=nv?V.useLayoutEffect:V.useEffect,iv={tag:dp};function av({initialConfig:e,children:t}){let n=(0,V.useMemo)(()=>{let{theme:t,namespace:n,nodes:r,onError:i,editorState:a,html:o}=e,s=$l(null,t),c=ah({editable:e.editable,html:o,namespace:n,nodes:r,onError:e=>i(e,c),theme:t});return function(e,t){if(t!==null){if(t===void 0)e.update(()=>{let t=Nh();if(t.isEmpty()){let n=nh();t.append(n);let r=nv?document.activeElement:null;(q()!==null||r!==null&&r===e.getRootElement())&&n.select()}},iv);else if(t!==null)switch(typeof t){case`string`:{let n=e.parseEditorState(t);e.setEditorState(n,iv);break}case`object`:e.setEditorState(t,iv);break;case`function`:e.update(()=>{Nh().isEmpty()&&t(e)},iv)}}}(c,a),[c,s]},[]);return rv(()=>{let t=e.editable,[r]=n;r.setEditable(t===void 0||t)},[]),(0,H.jsx)(Ql.Provider,{value:n,children:t})}var ov=(0,V.createContext)(null),sv={didCatch:!1,error:null},cv=class extends V.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=sv}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;t!==null&&(this.props.onReset?.({args:e,reason:`imperative-api`}),this.setState(sv))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:n}=this.state,{resetKeys:r}=this.props;n&&t.error!==null&&lv(e.resetKeys,r)&&(this.props.onReset?.({next:r,prev:e.resetKeys,reason:`keys`}),this.setState(sv))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:a}=this.state,o=e;if(i){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof t==`function`)o=t(e);else if(n)o=(0,V.createElement)(n,e);else if(r!==void 0)o=r;else throw a}return(0,V.createElement)(ov.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}};function lv(e=[],t=[]){return e.length!==t.length||e.some((e,n)=>!Object.is(e,t[n]))}function uv({children:e,onError:t}){return(0,H.jsx)(cv,{fallback:(0,H.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}),onError:t,children:e})}var dv=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?V.useLayoutEffect:V.useEffect;function fv(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function pv(){return function(e){let[t]=eu(),n=(0,V.useMemo)(()=>e(t),[t,e]),[r,i]=(0,V.useState)(()=>n.initialValueFn()),a=(0,V.useRef)(r);return dv(()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t(e=>{a.current=e,i(e)})},[n,e]),r}(fv)}var mv=Symbol.for(`preact-signals`);function hv(){if(bv>1)return void bv--;let e,t=!1;for(function(){let e=yv;for(yv=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();_v!==void 0;){let n=_v;for(_v=void 0,xv++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Ev(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(xv=0,bv--,t)throw e}var gv,_v;function vv(e){let t=gv;gv=void 0;try{return e()}finally{gv=t}}var yv,bv=0,xv=0,Sv=0,Cv=0;function wv(e){if(gv===void 0)return;let t=e.n;return t===void 0||t.t!==gv?(t={i:0,S:e,p:gv.s,n:void 0,t:gv,e:void 0,x:void 0,r:t},gv.s!==void 0&&(gv.s.n=t),gv.s=t,e.n=t,32&gv.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=gv.s,t.n=void 0,gv.s.n=t,gv.s=t),t):void 0}function Tv(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Ev(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Dv(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ov(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function kv(e,t){Tv.call(this,void 0),this.x=e,this.s=void 0,this.g=Cv-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Av(e){let t=e.m;if(e.m=void 0,typeof t==`function`){bv++;let n=gv;gv=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,jv(e),t}finally{gv=n,hv()}}}function jv(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Av(e)}function Mv(e){if(gv!==this)throw Error(`Out-of-order effect`);Ov(this),gv=e,this.f&=-2,8&this.f&&jv(this),hv()}function Nv(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function Pv(e,t){let n=new Nv(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}Tv.prototype.brand=mv,Tv.prototype.h=function(){return!0},Tv.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?vv(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},Tv.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&vv(()=>{var e;(e=this.Z)==null||e.call(this)}))}},Tv.prototype.subscribe=function(e){return Pv(()=>{let t=this.value,n=gv;gv=void 0;try{e(t)}finally{gv=n}},{name:`sub`})},Tv.prototype.valueOf=function(){return this.value},Tv.prototype.toString=function(){return this.value+``},Tv.prototype.toJSON=function(){return this.value},Tv.prototype.peek=function(){let e=gv;gv=void 0;try{return this.value}finally{gv=e}},Object.defineProperty(Tv.prototype,`value`,{get(){let e=wv(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(xv>100)throw Error(`Cycle detected`);(function(e){bv!==0&&xv===0&&e.l!==Sv&&(e.l=Sv,yv={S:e,v:e.v,i:e.i,o:yv})})(this),this.v=e,this.i++,Cv++,bv++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{hv()}}}}),kv.prototype=new Tv,kv.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cv))return!0;if(this.g=Cv,this.f|=1,this.i>0&&!Ev(this))return this.f&=-2,!0;let e=gv;try{Dv(this),gv=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return gv=e,Ov(this),this.f&=-2,!0},kv.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Tv.prototype.S.call(this,e)},kv.prototype.U=function(e){if(this.t!==void 0&&(Tv.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},kv.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(kv.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=wv(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Nv.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},Nv.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,Av(this),Dv(this),bv++;let e=gv;return gv=this,Mv.bind(this,e)},Nv.prototype.N=function(){2&this.f||(this.f|=2,this.u=_v,_v=this)},Nv.prototype.d=function(){this.f|=8,1&this.f||jv(this)},Nv.prototype.dispose=function(){this.d()};function Fv(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}Wu(`format`,{parse:e=>typeof e==`number`?e:0});function Iv(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Lv(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)n[e]=Lv(n[e],r[e]);return e}return t}var Rv=0,zv=1,Bv=2,Vv=3,Hv=4,Uv=5,Wv=6,Gv=7;function Kv(e){return e.id===Rv}function qv(e){return e.id===Bv}function Jv(e){return function(e){return e.id===zv}(e)||Iv(305,String(e.id),String(zv)),Object.assign(e,{id:Bv})}var Yv=new Set,Xv=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Rv}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):k_;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;qv(t)||Iv(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:Vv,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:Hv,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==Hv&&Iv(307,String(t.id),String(Uv)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:Uv,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==Uv&&Iv(308,String(n.id),String(Uv));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:Wv})}(n),()=>{let e=this.state;e.id!==Gv&&Iv(309,String(n.id),String(Gv)),this.state=function(e){return Object.assign(e,{id:Uv})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==Wv&&Iv(310,String(t.id),String(Wv)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:Gv})}(t),n}getSignal(){return this._signal===void 0&&Iv(311),this._signal}getInitResult(){this.extension.init===void 0&&Iv(312,this.extension.name);let e=this.state;return function(e){return e.id>=Hv}(e)||Iv(313,String(e.id),String(Hv)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=Vv}(e)||Iv(314,String(e.id),String(Vv)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Iv(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&Iv(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=Gv}(e)||Iv(316,String(e.id),String(Gv)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Yv}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=Uv})(e)||Iv(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},Zv={tag:dp};function Qv(){let e=Nh();e.isEmpty()&&e.append(nh())}var $v=D_({config:O_({setOptions:Zv,updateOptions:Zv}),init:({$initialEditorState:e=Qv})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Qm(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[qm,Ep,hp,Lp,th]}),ey=Symbol.for(`@lexical/extension/LexicalBuilder`);function ty(){}function ny(e){throw e}function ry(e){return Array.isArray(e)?e:[e]}var iy=`0.43.0+prod.esm`,ay=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=iy,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[ry($v)];for(let e of t)n.push(ry(e));return new e(n)}static maybeFromEditor(t){let n=t[ey];return n&&(n.PACKAGE_VERSION!==iy&&Iv(292,n.PACKAGE_VERSION,iy),n instanceof e||Iv(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&Iv(294),n}constructEditor(){let{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),r=Object.assign(ah({...n,...t?{onError:e=>{t(e,r)}}:{}}),{[ey]:this});for(let e of this.sortedExtensionReps())e.build(r);return r}buildEditor(){let e=ty;function t(){try{e()}finally{e=ty}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=M_(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&Iv(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&Iv(296);let[t]=ry(e);typeof t.name!=`string`&&Iv(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&Iv(298,t.name),!n){n=new Xv(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&Iv(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&Iv(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=ry(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(qv(i))return;let a=n.extension.name;var o;Kv(i)||Iv(300,a,r||`[unknown]`),Kv(o=i)||Iv(304,String(o.id),String(Rv)),i=Object.assign(o,{id:zv}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=Jv(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Kv(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&Iv(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return M_(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of Fv(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&Iv(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&Lv(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=ny,e}},oy=class e extends Gm{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return cy().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:sy,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let t=document.createElement(`hr`);return j_(t,e.theme.hr),t}getTextContent(){return`
13
+ `}isInline(){return!1}updateDOM(){return!1}};function sy(){return{node:cy()}}function cy(){return Ng(oy)}var ly=D_({name:`@lexical/react/ReactProvider`}),uy=e(v(),1);function dy(e){let t=window.location.origin,n=n=>{if(n.origin!==t)return;let r=e.getRootElement();if(document.activeElement!==r)return;let i=n.data;if(typeof i==`string`){let t;try{t=JSON.parse(i)}catch{return}if(t&&t.protocol===`nuanria_messaging`&&t.type===`request`){let r=t.payload;if(r&&r.functionId===`makeChanges`){let t=r.args;if(t){let[r,i,a,o,s]=t;e.update(()=>{let e=q();if(K(e)){let t=e.anchor,c=t.getNode(),l=0,u=0;if(G(c)&&r>=0&&i>=0&&(l=r,u=r+i,e.setTextNodeRange(c,l,c,u)),l===u&&a===``||(e.insertRawText(a),c=t.getNode()),G(c)){l=o,u=o+s;let t=c.getTextContentSize();l=l>t?t:l,u=u>t?t:u,e.setTextNodeRange(c,l,c,u)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener(`message`,n,!0),()=>{window.removeEventListener(`message`,n,!0)}}function fy(e,t){if(typeof document>`u`||typeof window>`u`&&global.window===void 0)throw Error(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.`);let n=document.createElement(`div`),r=Nh().getChildren();for(let i=0;i<r.length;i++)py(e,r[i],n,t);return n.innerHTML}function py(e,t,n,r=null){let i=r===null||t.isSelected(r),a=J(t)&&t.excludeFromCopy(`html`),o=t;r!==null&&G(t)&&(o=z_(r,t,`clone`));let s=J(o)?o.getChildren():[],c=dh(e,o.getType()),l;l=c&&c.exportDOM!==void 0?c.exportDOM(e,o):o.exportDOM(e);let{element:u,after:d}=l;if(!u)return!1;let f=document.createDocumentFragment();for(let n=0;n<s.length;n++){let a=s[n],o=py(e,a,f,r);!i&&J(t)&&o&&t.extractWithChild(a,r,`html`)&&(i=!0)}if(i&&!a){if((_g(u)||yg(u))&&u.append(f),n.append(u),d){let e=d.call(o,u);e&&(yg(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(f);return i}function my(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function hy(e,t=q()){return t??my(166),K(t)&&t.isCollapsed()||t.getNodes().length===0?``:fy(e,t)}function gy(e,t){let n=e.getData(`text/plain`)||e.getData(`text/uri-list`);n!=null&&t.insertRawText(n)}var _y=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,vy=_y&&`documentMode`in document?document.documentMode:null,yy=_y&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),by=!(!_y||!(`InputEvent`in window)||vy)&&`getTargetRanges`in new window.InputEvent(`input`),xy=_y&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Sy=_y&&/Android/.test(navigator.userAgent),Cy=_y&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Sy,wy=_y&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ty=_y&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&yy&&!wy;function Ey(e,t){t.update(()=>{if(e!==null){let n=J_(e,KeyboardEvent)?null:e.clipboardData,r=q();if(r!==null&&!r.isCollapsed()&&n!=null){e.preventDefault();let i=hy(t);i!==null&&n.setData(`text/html`,i),n.setData(`text/plain`,r.getTextContent())}}})}function Xee(e){return M_(e.registerCommand(Kd,e=>{let t=q();return!!K(t)&&(t.deleteCharacter(e),!0)},0),e.registerCommand(Qd,e=>{let t=q();return!!K(t)&&(t.deleteWord(e),!0)},0),e.registerCommand($d,e=>{let t=q();return!!K(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(Yd,e=>{let t=q();if(!K(t))return!1;if(typeof e==`string`)t.insertText(e);else{let n=e.dataTransfer;if(n!=null)gy(n,t);else{let n=e.data;n&&t.insertText(n)}}return!0},0),e.registerCommand(Zd,()=>{let e=q();return!!K(e)&&(e.removeText(),!0)},0),e.registerCommand(qd,e=>{let t=q();return!!K(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(Jd,()=>{let e=q();return!!K(e)&&(e.insertLineBreak(),!0)},0),e.registerCommand(sf,e=>{let t=q();if(!K(t))return!1;let n=e,r=n.shiftKey;return!!H_(t,!0)&&(n.preventDefault(),G_(t,r,!0),!0)},0),e.registerCommand(af,e=>{let t=q();if(!K(t))return!1;let n=e,r=n.shiftKey;return!!H_(t,!1)&&(n.preventDefault(),G_(t,r,!1),!0)},0),e.registerCommand(pf,t=>!!K(q())&&(!xy||navigator.language!==`ko-KR`)&&(t.preventDefault(),e.dispatchCommand(Kd,!0)),0),e.registerCommand(hf,t=>!!K(q())&&(t.preventDefault(),e.dispatchCommand(Kd,!1)),0),e.registerCommand(df,t=>{if(!K(q()))return!1;if(t!==null){if((xy||Cy||Ty)&&by)return!1;t.preventDefault()}return e.dispatchCommand(qd,!1)},0),e.registerCommand(Cf,()=>(Jee(),!0),0),e.registerCommand(xf,t=>!!K(q())&&(Ey(t,e),!0),0),e.registerCommand(Sf,t=>!!K(q())&&(function(e,t){Ey(e,t),t.update(()=>{let e=q();K(e)&&e.removeText()})}(t,e),!0),0),e.registerCommand(Xd,t=>!!K(q())&&(function(e,t){e.preventDefault(),t.update(()=>{let t=q(),n=J_(e,ClipboardEvent)?e.clipboardData:null;n!=null&&K(t)&&gy(n,t)},{tag:`paste`})}(t,e),!0),0),e.registerCommand(_f,e=>!!K(q())&&(e.preventDefault(),!0),0),e.registerCommand(vf,e=>!!K(q())&&(e.preventDefault(),!0),0))}function Zee(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Dy=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?V.useLayoutEffect:V.useEffect;function Qee({editor:e,ErrorBoundary:t}){return function(e,t){let[n,r]=(0,V.useState)(()=>e.getDecorators());return Dy(()=>e.registerDecoratorListener(e=>{(0,uy.flushSync)(()=>{r(e)})}),[e]),(0,V.useEffect)(()=>{r(e.getDecorators())},[e]),(0,V.useMemo)(()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,H.jsx)(t,{onError:t=>e._onError(t),children:(0,H.jsx)(V.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,uy.createPortal)(s,c,o))}return r},[t,n,e])}(e,t)}function $ee({editor:e,ErrorBoundary:t}){return function(e){let t=ay.maybeFromEditor(e);if(t&&t.hasExtensionByName(ly.name)){for(let e of[`@lexical/plain-text`,`@lexical/rich-text`])t.hasExtensionByName(e)&&Zee(320,e);return!0}return!1}(e)?null:(0,H.jsx)(Qee,{editor:e,ErrorBoundary:t})}function Oy(e){return e.getEditorState().read(I_(e.isComposing()))}function ete({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=eu();return function(e){Dy(()=>M_(Xee(e),dy(e)),[e])}(r),(0,H.jsxs)(H.Fragment,{children:[e,(0,H.jsx)(tte,{content:t}),(0,H.jsx)($ee,{editor:r,ErrorBoundary:n})]})}function tte({content:e}){let[t]=eu(),n=function(e){let[t,n]=(0,V.useState)(()=>Oy(e));return Dy(()=>{function t(){n(Oy(e))}return t(),M_(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),r=pv();return n?typeof e==`function`?e(r):e:null}var ky=[`mx-[2px]`,`inline-flex`,`h-6`,`max-w-full`,`items-center`,`gap-1.5`,`rounded-[7px]`,`border`,`border-border/70`,`bg-background/80`,`px-1.5`,`align-middle`,`text-[11px]`,`font-medium`,`leading-none`,`text-foreground`].join(` `),nte=new Set([`c`,`cpp`,`css`,`go`,`html`,`java`,`js`,`jsx`,`md`,`php`,`py`,`rb`,`rs`,`sh`,`sql`,`svelte`,`swift`,`ts`,`tsx`,`vue`]),rte=new Set([`graphql`,`json`,`toml`,`xml`,`yaml`,`yml`]),ite=new Set([`avif`,`bmp`,`gif`,`heic`,`heif`,`ico`,`jpeg`,`jpg`,`png`,`svg`,`tif`,`tiff`,`webp`]),ate=new Set([`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]),ote=new Set([`avi`,`m4v`,`mkv`,`mov`,`mp4`,`webm`,`wmv`]),ste=new Set([`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]),cte=new Set([`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]),lte=new Set([`doc`,`docx`,`odt`,`pages`,`pdf`,`rtf`,`txt`]);function ute(e){return/\.([a-z0-9]{1,16})$/i.exec(e.trim())?.[1]?.toLowerCase()??``}function dte(e){let t=ute(e);return rte.has(t)?{icon:Na,name:`data-file`}:ite.has(t)?{icon:Ma,name:`image-file`}:ate.has(t)?{icon:Aa,name:`audio-file`}:ote.has(t)?{icon:Ia,name:`video-file`}:ste.has(t)?{icon:Fa,name:`sheet-file`}:cte.has(t)?{icon:ka,name:`archive-file`}:nte.has(t)?{icon:ja,name:`code-file`}:lte.has(t)?{icon:Cn,name:`document-file`}:{icon:La,name:`file`}}function fte(e,t){return e===`skill`?{icon:Or,name:`skill`}:e===`panel_app`?{icon:Ur,name:`panel-app`}:e===`ui_resource`?t.startsWith(`nextclaw://panel-app`)?{icon:Ur,name:`panel-app`}:t.startsWith(`nextclaw://docs`)?{icon:Yi,name:`docs`}:t.startsWith(`nextclaw://apps`)?{icon:Ji,name:`apps`}:{icon:Ta,name:`web-resource`}:e===`project`?{icon:za,name:`project`}:e===`workspace_directory`?{icon:Ga,name:`directory`}:e===`workspace_excerpt`?{icon:Bo,name:`excerpt`}:e===`conversation_excerpt`?{icon:Cee,name:`conversation-excerpt`}:e===`workspace_file`||e===`file`?dte(t):{icon:yee,name:`reference`}}function Ay({className:e,kind:t,source:n}){let r=fte(t,n??``),i=r.icon;return(0,H.jsx)(i,{"aria-hidden":`true`,className:U(`h-3 w-3`,e),"data-reference-icon":r.name})}function jy(e){return Array.from(e).length}function pte(e){let{characterCountTemplate:t,endLine:n,excerpt:r,startLine:i}=e,a=i?i===n||!n?`L${i}`:`L${i}–${n}`:null,o=t?.replace(`{count}`,String(jy(r)));return{characterCountLabel:o,location:a,metricLabel:a??o}}function My({excerpt:e,kind:t,label:n,metricLabel:r,source:i}){let a=e?.replace(/\s+/g,` `).trim()??``,o=Array.from(a),s=o.length>64?`${o.slice(0,64).join(``).trimEnd()}…`:a;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-muted-foreground`,"data-reference-kind":t,children:(0,H.jsx)(Ay,{kind:t,source:i??n})}),(0,H.jsx)(`span`,{className:e?`max-w-[10rem] shrink truncate`:`max-w-[16rem] truncate`,children:n}),r?(0,H.jsx)(`span`,{className:`shrink-0 text-[10px] font-normal text-muted-foreground`,children:r}):null,s?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0 text-muted-foreground/60`,children:`·`}),(0,H.jsx)(`span`,{className:`min-w-[3rem] max-w-[14rem] truncate font-normal text-foreground/70`,children:s})]}):null]})}function Ny({children:e,characterCountLabel:t,excerpt:n,kind:r=`workspace_file`,label:i,location:a,path:o}){let{Tooltip:s,TooltipContent:c,TooltipProvider:l,TooltipTrigger:u}=fl;return(0,H.jsx)(l,{delayDuration:300,children:(0,H.jsxs)(s,{children:[(0,H.jsx)(u,{asChild:!0,children:e}),(0,H.jsxs)(c,{side:`top`,align:`start`,collisionPadding:12,className:`w-fit min-w-[min(14rem,calc(100vw-1.5rem))] max-w-[min(28rem,calc(100vw-1.5rem))] p-0 text-left`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 border-b border-border/70 px-3 py-2`,children:[(0,H.jsx)(Ay,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`,kind:r,source:o??i}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:o||i}),a?(0,H.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:a}):null,t?(0,H.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:t}):null]}),(0,H.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words px-3 py-2.5 font-mono text-[11px] font-normal leading-5 text-popover-foreground`,children:n})]})]})})}var Py=(0,V.createContext)({});function Fy({children:e,excerptCharacterCountTemplate:t,removeTokenLabel:n}){return(0,H.jsx)(Py.Provider,{value:{excerptCharacterCountTemplate:t,removeTokenLabel:n},children:e})}function Iy(e){let t=[`selection:bg-transparent`,`selection:text-current`,`group/composer-token`,`data-[composer-selected=true]:shadow-[0_0_0_2px_var(--interaction-selection,Highlight)]`];return e===`file`?[`mx-[2px] inline-flex h-6 items-center gap-1.5 rounded-[7px] border px-1.5 align-middle leading-none`,...t,`max-w-[min(100%,17rem)]`,`border-border`,`bg-muted`,`text-foreground`].join(` `):[ky,...t].join(` `)}function Ly({data:e,label:t}){let{excerptCharacterCountTemplate:n}=(0,V.useContext)(Py),r=typeof e?.excerpt==`string`?e.excerpt:``,i=typeof e?.path==`string`?e.path:null,a=typeof e?.startLine==`number`?e.startLine:null,{characterCountLabel:o,location:s,metricLabel:c}=pte({characterCountTemplate:n,endLine:typeof e?.endLine==`number`?e.endLine:null,excerpt:r,startLine:a}),l=(0,H.jsx)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:(0,H.jsx)(My,{excerpt:r,kind:`workspace_excerpt`,label:t,metricLabel:c,source:i})});return r?(0,H.jsx)(Ny,{excerpt:r,characterCountLabel:o,label:t,location:s,path:i,children:l}):l}function Ry({data:e,label:t}){let n=typeof e?.excerpt==`string`?e.excerpt:``,r=(0,H.jsx)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:(0,H.jsx)(My,{excerpt:n,kind:`conversation_excerpt`,label:t})});return n?(0,H.jsx)(Ny,{excerpt:n,kind:`conversation_excerpt`,label:t,children:r}):r}function zy({children:e,onRemove:t}){let{removeTokenLabel:n}=(0,V.useContext)(Py),[r,i]=(0,V.useState)(!1),[a,o]=(0,V.useState)(!1);if(!n)return e;let s=r||a,{Tooltip:c,TooltipContent:l,TooltipProvider:u,TooltipTrigger:d}=fl;return(0,H.jsxs)(`span`,{className:`relative -mx-1.5 inline-flex h-full min-w-0 items-center px-1.5`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||i(!1)},onFocus:()=>i(!0),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[(0,H.jsx)(`span`,{className:`inline-flex h-full min-w-0 items-center gap-1.5 ${s?`[mask-image:linear-gradient(to_right,black_calc(100%_-_2.5rem),transparent_calc(100%_-_1.25rem))] [-webkit-mask-image:linear-gradient(to_right,black_calc(100%_-_2.5rem),transparent_calc(100%_-_1.25rem))]`:``}`,"data-composer-token-content":`true`,children:e}),(0,H.jsx)(u,{delayDuration:300,children:(0,H.jsxs)(c,{children:[(0,H.jsx)(d,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":n,className:`${s?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`} absolute right-0.5 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full border border-border/70 bg-transparent text-muted-foreground transition-[background-color,border-color,color,opacity] hover:border-border hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.preventDefault(),e.stopPropagation(),t()},children:(0,H.jsx)(hi,{"aria-hidden":`true`,className:`h-3 w-3`})})}),(0,H.jsx)(l,{side:`top`,className:`text-xs`,children:n})]})})]})}function By({data:e,label:t,onRemove:n,previewUrl:r,tokenKey:i,tokenKind:a}){let[o,s]=(0,V.useState)(!1),c;if(a===`workspace_excerpt`)c=(0,H.jsx)(Ly,{data:e,label:t});else if(a===`conversation_excerpt`)c=(0,H.jsx)(Ry,{data:e,label:t});else if(a!==`file`){let n=e?.reference&&typeof e.reference==`object`?e.reference:null;c=(0,H.jsx)(My,{kind:a,label:t,source:typeof e?.path==`string`?e.path:a===`ui_resource`&&typeof n?.uri==`string`?n.uri:i})}else c=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`relative inline-flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden rounded-[4px] bg-card text-muted-foreground ring-1 ring-border`,children:[(0,H.jsx)(Ay,{className:`h-3 w-3`,kind:`file`,source:t}),r&&!o?(0,H.jsx)(`img`,{alt:``,className:`absolute inset-0 h-full w-full object-cover`,onError:()=>s(!0),src:r}):null]}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] font-medium text-foreground`,children:t})]});return(0,H.jsx)(zy,{onRemove:n,children:c})}var Vy=class e extends Gm{static getType(){return`chat-composer-token`}static clone(t){return new e(t.__composerId,t.__tokenKind,t.__tokenKey,t.__label,t.__previewUrl,t.__data,t.__key)}static importJSON(e){return Hy({composerId:e.composerId,data:e.data,label:e.label,previewUrl:e.previewUrl,tokenKey:e.tokenKey,tokenKind:e.tokenKind})}constructor(e,t,n,r,i,a,o){super(o),this.applyTokenDom=e=>{e.contentEditable=`false`,e.dataset.composerNodeId=this.__composerId,e.dataset.composerNodeType=`token`,e.dataset.composerTokenKind=this.__tokenKind,e.dataset.composerTokenKey=this.__tokenKey,e.dataset.composerLabel=this.__label,this.__tokenKind===`workspace_excerpt`||this.__tokenKind===`conversation_excerpt`?e.removeAttribute(`title`):e.title=this.__label,e.className=Iy(this.__tokenKind)},this.createDOM=(e,t)=>{let n=document.createElement(`span`);return this.applyTokenDom(n),n},this.updateDOM=(e,t)=>(this.applyTokenDom(t),!1),this.decorate=e=>{let t=this.getKey();return(0,H.jsx)(By,{data:this.__data,label:this.__label,onRemove:()=>{e.update(()=>{let e=Dh(t);Uy(e)&&(e.selectNext(),e.remove())}),e.focus()},previewUrl:this.__previewUrl,tokenKey:this.__tokenKey,tokenKind:this.__tokenKind})},this.exportJSON=()=>({composerId:this.__composerId,data:this.__data,label:this.__label,previewUrl:this.__previewUrl,tokenKey:this.__tokenKey,tokenKind:this.__tokenKind,type:`chat-composer-token`,version:1}),this.getComposerId=()=>this.getLatest().__composerId,this.getTokenKind=()=>this.getLatest().__tokenKind,this.getTokenKey=()=>this.getLatest().__tokenKey,this.getLabel=()=>this.getLatest().__label,this.getPreviewUrl=()=>this.getLatest().__previewUrl,this.getData=()=>this.getLatest().__data,this.getTextContent=()=>``,this.isInline=()=>!0,this.isIsolated=()=>!0,this.isKeyboardSelectable=()=>!1,this.__composerId=e,this.__tokenKind=t,this.__tokenKey=n,this.__label=r,this.__previewUrl=i,this.__data=a}};function Hy(e){let{composerId:t,data:n,label:r,previewUrl:i,tokenKey:a,tokenKind:o}=e;return ug(new Vy(t,o,a,r,i,n))}function Uy(e){return e instanceof Vy}function Wy(e,t){let n=t.selection?.start??0,r=t.selection?.end??0,i=new Set,a=0;for(let e of t.nodes){let t=e.type===`text`?e.text.length:1;e.type===`token`&&n<a+t&&r>a&&i.add(e.id),a+=t}e.querySelectorAll(`[data-composer-node-type="token"]`).forEach(e=>{let t=i.has(e.dataset.composerNodeId??``);if(e.dataset.composerSelected!==String(t)){if(e.dataset.composerSelected=String(t),t){e.style.setProperty(`background-color`,`var(--interaction-selection)`,`important`),e.style.setProperty(`border-color`,`var(--interaction-selection-border)`,`important`);return}e.style.removeProperty(`background-color`),e.style.removeProperty(`border-color`)}})}var Gy=`nextclaw-chat-composer-external-update`;function Ky(){let e=Nh(),t=e.getFirstChild();if(!J(t))return{descriptors:[],paragraphKey:e.getKey(),paragraphSize:0,totalLength:0};let n=t.getChildren(),r=[],i=0;for(let[e,t]of n.entries()){if(G(t)){let n=t.getTextContent();r.push({index:e,key:t.getKey(),length:n.length,node:t,start:i,text:n,type:`text`}),i+=n.length;continue}if(Uy(t)){r.push({index:e,key:t.getKey(),length:1,node:t,start:i,type:`token`}),i+=1;continue}r.push({index:e,key:t.getKey(),length:t.getTextContent().length,node:t,start:i,type:`linebreak`}),i+=t.getTextContent().length}return{descriptors:r,paragraphKey:t.getKey(),paragraphSize:n.length,totalLength:i}}function qy(e){let{descriptors:t,paragraphKey:n,paragraphSize:r,totalLength:i}=Ky(),a=Math.max(0,Math.min(e,i));if(t.length===0)return{key:n,offset:0,type:`element`};for(let e of t){let r=e.start+e.length;if(e.type===`text`&&a>=e.start&&a<=r)return{key:e.key,offset:a-e.start,type:`text`};if(e.type!==`text`){if(a===e.start)return{key:n,offset:e.index,type:`element`};if(a===r){let r=t[e.index+1];return r?.type===`text`&&r.length===0?{key:r.key,offset:0,type:`text`}:{key:n,offset:e.index+1,type:`element`}}}}return{key:n,offset:r,type:`element`}}function Jy(e){let{descriptors:t,paragraphKey:n,totalLength:r}=Ky();if(e.key===n){let n=t[e.offset-1];return n?n.start+n.length:0}let i=t.find(t=>t.key===e.key);return i?i.start+Math.min(e.offset,i.length):r}function Yy(e){if(e.type===`element`)return Jy(e);let{descriptors:t,totalLength:n}=Ky(),r=t.find(t=>t.key===e.key);return r?r.start+Math.min(e.offset,r.length):n}function Xy(){let{descriptors:e}=Ky(),t=[],n=``,r=``,i=()=>{n.length!==0&&(t.push({id:r,type:`text`,text:n}),n=``,r=``)};for(let a of e){if(a.type===`text`){n.length===0&&(r=a.key),n+=a.text;continue}if(a.type===`linebreak`){n.length===0&&(r=a.key),n+=`
14
+ `;continue}i();let e=a.node;t.push({id:e.getComposerId(),data:e.getData(),label:e.getLabel(),previewUrl:e.getPreviewUrl(),tokenKey:e.getTokenKey(),tokenKind:e.getTokenKind(),type:`token`})}return i(),Us(t)}function Zy(e){return e.read(()=>{let e=q(),t=Xy();return K(e)?{nodes:t,selection:{start:Math.min(Yy(e.anchor),Yy(e.focus)),end:Math.max(Yy(e.anchor),Yy(e.focus))}}:{nodes:t,selection:null}})}function Qy(e){let t=q();if(!K(t))return!1;let n=[];for(let t of e){if(t.type===`token`){n.push(Hy({composerId:t.id,data:t.data,label:t.label,previewUrl:t.previewUrl,tokenKey:t.tokenKey,tokenKind:t.tokenKind}));continue}let e=t.text.split(`
15
+ `);for(let[t,r]of e.entries())r&&n.push(Fp(r)),t<e.length-1&&n.push(_p())}return n.length===0?!1:(t.insertNodes(n),!0)}function $y(e,t){let n=Nh();n.clear();let r=nh();n.append(r);for(let t of Us(e)){if(t.type===`token`){r.append(Hy({composerId:t.id,data:t.data,label:t.label,previewUrl:t.previewUrl,tokenKey:t.tokenKey,tokenKind:t.tokenKind}));continue}let e=t.text.split(`
16
+ `);for(let[t,n]of e.entries())n.length>0&&r.append(Fp(n)),t<e.length-1&&r.append(_p())}if(Uy(r.getLastChild())&&r.append(Fp(``)),!t)return;let i=rm(),a=qy(t.start),o=qy(t.end);i.anchor.set(a.key,a.offset,a.type),i.focus.set(o.key,o.offset,o.type),Fh(i)}function eb(e,t,n,r=!1){e.update(()=>{$y(t,n)},{tag:r?[Gy,fp]:Gy})}function tb(e,t,n=!1){e.update(()=>{let e=rm(),n=qy(t.start),r=qy(t.end);e.anchor.set(n.key,n.offset,n.type),e.focus.set(r.key,r.offset,r.type),Fh(e)},{tag:n?[Gy,fp]:Gy})}function nb(e){return e.reduce((e,t)=>e+Bs(t),0)}function rb(e){let{data:t,label:n,nodes:r,previewUrl:i,selection:a,tokenKey:o,tokenKind:s,trigger:c}=e,l=nb(r),[u,d]=a?[Math.min(a.start,a.end),Math.max(a.start,a.end)]:[l,l],f=c?.start??u;return{nodes:Qs(r,f,c?.end??d,[zs({label:n,data:t,previewUrl:i,tokenKey:o,tokenKind:s})]),selection:{start:f+1,end:f+1}}}function ib(e){let{data:t,label:n,nodes:r,selection:i,tokenKey:a,tokenKind:o,triggerSpecs:s}=e;return Ks(r,o).includes(a)?{nodes:Us(r),selection:i}:rb({label:n,data:t,nodes:r,selection:i,tokenKey:a,tokenKind:o,trigger:nc(r,i,s??[Is])})}function ab(e){let{item:t,nodes:n,selection:r,triggerSpecs:i}=e,a=t.tokenKind??(t.value?`skill`:void 0),o=t.tokenKey??t.value;if(!a||!o){let e=nc(n,r,i??[Is]);return e?{nodes:Us(Qs(n,e.start,e.end,[])),selection:{start:e.start,end:e.start}}:{nodes:Us(n),selection:r}}return ib({data:t.data,label:t.title,nodes:n,selection:r,tokenKey:o,tokenKind:a,triggerSpecs:i})}function ob(e){return e.map(e=>e.type===`text`?`text:${e.text}`:`token:${e.tokenKind}:${e.tokenKey}:${e.label}:${e.previewUrl??``}:${JSON.stringify(e.data??null)}`).join(``)}function sb(e){let{label:t,nodes:n,previewUrl:r,selection:i,tokenKey:a}=e;return rb({label:t,nodes:n,previewUrl:r,selection:i,tokenKey:a,tokenKind:`file`})}function cb(e){let{label:t,nodes:n,selection:r,tokenKey:i}=e;return Ks(n,`skill`).includes(i)?{nodes:Us(n),selection:r}:rb({label:t,nodes:n,selection:r,tokenKey:i,tokenKind:`skill`,trigger:rc(n,r)})}function lb(e){let{nextKeys:t,nodes:n,options:r,selection:i}=e,a=Ks(n,`skill`),o=new Map(r.map(e=>[e.key,e])),s=t.find(e=>!a.includes(e));if(s)return cb({label:o.get(s)?.label??s,nodes:n,selection:i,tokenKey:s});let c=a.find(e=>!t.includes(e));return c?{nodes:$s(n,e=>e.tokenKind===`skill`&&e.tokenKey===c),selection:i}:{nodes:Us(n),selection:i}}function ub(e){if(e.key!==`Backspace`&&e.key!==`Delete`)return!1;let t=q();if(K(t)&&!t.isCollapsed())return!1;let n=null;if(K(t)){let{anchor:r}=t,i=r.getNode();if(r.type===`element`&&J(i)){let t=e.key===`Backspace`?r.offset-1:r.offset;n=i.getChildAtIndex(t)}else e.key===`Backspace`&&r.offset===0?n=i.getPreviousSibling():e.key===`Delete`&&r.offset===i.getTextContentSize()&&(n=i.getNextSibling())}else if(e.key===`Backspace`){let e=Nh().getFirstChild();n=J(e)?e.getLastChild():null}return G(n)&&n.getTextContentSize()===0&&(n=e.key===`Backspace`?n.getPreviousSibling():n.getNextSibling()),Uy(n)?(e.preventDefault(),n.remove(),!0):!1}function db(e){let{canStopGeneration:t,isComposing:n,isSending:r,key:i,metaKey:a=!1,ctrlKey:o=!1,shiftKey:s}=e;return n?{type:`noop`}:i===`Escape`?r&&t?{type:`stop-generation`}:{type:`noop`}:i===`Enter`&&!s?a||o?{type:`send-alternate`}:{type:`send-message`}:{type:`noop`}}function fb(e){let{actions:t,isComposing:n,nativeEvent:r}=e,i=db({canStopGeneration:t.canStopGeneration,isComposing:n,isSending:t.isSending,key:r.key,metaKey:r.metaKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey});switch(i.type!==`noop`&&r.preventDefault(),i.type){case`stop-generation`:return t.onStop(),!0;case`send-message`:return t.onSend(),!0;case`send-alternate`:return(t.onAlternateSend??t.onSend)(),!0;case`noop`:return!1}}var pb=`application/x-nextclaw-chat-composer+json`,mb=1,hb=1e6,gb=1e3,_b=1e5;function vb(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function yb(e){return typeof e==`string`&&e.length>0&&e.length<=_b?e:null}function bb(e){return e===void 0?void 0:typeof e==`string`&&e.length<=_b?e:null}function xb(e){return zs({data:e.data,label:e.label,previewUrl:e.previewUrl,tokenKey:e.tokenKey,tokenKind:e.tokenKind})}function Sb(e,t,n){let r=Math.max(0,Math.min(t,n)),i=Math.max(r,Math.max(t,n)),a=[],o=0;for(let t of e){let e=o,n=e+Bs(t);if(o=n,n<=r||e>=i)continue;if(t.type===`token`){a.push(xb(t));continue}let s=Math.max(0,r-e),c=Math.min(t.text.length,i-e);c>s&&a.push(Rs(t.text.slice(s,c)))}return a.length>0?Us(a):[]}function Cb(e){return e.type===`text`?{type:`text`,text:e.text}:{type:`token`,tokenKind:e.tokenKind,tokenKey:e.tokenKey,label:e.label,previewUrl:e.previewUrl,data:e.data}}function wb(e){let t={version:mb,nodes:e.map(Cb)};return JSON.stringify(t)}function Tb(e){if(!vb(e))return null;if(e.type===`text`){let t=bb(e.text);return typeof t==`string`?Rs(t):null}if(e.type!==`token`)return null;let t=yb(e.tokenKind),n=yb(e.tokenKey),r=yb(e.label),i=bb(e.previewUrl),a=e.data===void 0?void 0:vb(e.data)?e.data:null;return!t||!n||!r||i===null||a===null?null:zs({data:a,label:r,previewUrl:i,tokenKey:n,tokenKind:t})}function Eb(e){if(!e||e.length>hb)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!vb(t)||t.version!==mb||!Array.isArray(t.nodes)||t.nodes.length===0||t.nodes.length>gb)return null;let n=[];for(let e of t.nodes){let t=Tb(e);if(!t)return null;n.push(t)}return Us(n)}function Db(e){if(e.tokenKind!==`workspace_excerpt`||typeof e.data?.excerpt!=`string`)return null;let t=typeof e.data.startLine==`number`?e.data.startLine:null,n=typeof e.data.endLine==`number`?e.data.endLine:null,r=t?t===n||!n?` L${t}`:` L${t}–${n}`:``;return`[${e.label}${r}]\n${e.data.excerpt}`}function Ob(e){return e.tokenKind===`conversation_excerpt`&&typeof e.data?.excerpt==`string`?`[${e.label}]\n${e.data.excerpt}`:null}function kb(e){return e.map(e=>e.type===`text`?e.text:Db(e)??Ob(e)??`@${e.label}`).join(``)}function Ab(e){return!!(e&&`clipboardData`in e)}var jb=class{constructor(e){this.editor=e,this.register=()=>M_(this.editor.registerCommand(xf,e=>this.handleCopy(e,!1),3),this.editor.registerCommand(Sf,e=>this.handleCopy(e,!0),3),this.editor.registerCommand(Xd,this.handlePaste,3)),this.handleCopy=(e,t)=>{if(!Ab(e)||!e.clipboardData)return!1;let n=Zy(this.editor.getEditorState());if(!n.selection||n.selection.start===n.selection.end)return!1;let r=Sb(n.nodes,n.selection.start,n.selection.end);if(!r.some(e=>e.type===`token`))return!1;try{e.clipboardData.setData(`text/plain`,kb(r)),e.clipboardData.setData(pb,wb(r))}catch{return e.preventDefault(),!0}if(e.preventDefault(),t){let e=q();K(e)&&e.removeText()}return!0},this.handlePaste=e=>{if(!Ab(e))return!1;let t=e.clipboardData?.getData(pb);if(!t)return!1;let n=Eb(t);return!n||!Qy(n)?!1:(e.preventDefault(),!0)}}};function Mb(e){return{current:e}}function Nb(e){return e.reduce((e,t)=>e+(t.type===`text`?t.text.length:1),0)}var Pb=class{constructor(){this.pendingOwnerSignatureRef=Mb(null),this.pendingSelectionRef=Mb(null),this.selectionRef=Mb(null),this.shouldFocusAfterSyncRef=Mb(!1),this.editorSignatureRef=Mb(``),this.lastPublishedSignatureRef=Mb(``),this.pendingInputSurfaceReasonRef=Mb(null),this.editor=null,this.runtime=null,this.configureRuntime=e=>{this.runtime=e},this.bindEditor=e=>{this.editor=e;let t=ob(Zy(e.getEditorState()).nodes);return this.editorSignatureRef.current=t,this.lastPublishedSignatureRef.current=t,()=>{this.editor===e&&(this.editor=null)}},this.registerEditorListeners=e=>M_(e.registerUpdateListener(({editorState:e,tags:t})=>{let n=this.getRuntime();this.handleEditorUpdate(e,n.callbacks,t)}),e.registerCommand(Bd,()=>{let t=this.getRuntime();return this.handleSelectionChange(e,t.callbacks),!1},0),e.registerCommand(Tf,()=>(this.getRuntime().callbacks.onInputSurfaceOpenChange?.(!1),!1),0),e.registerCommand(rf,e=>{let t=this.getRuntime();return this.handleKeyDown({actions:t.actions,callbacks:t.callbacks,event:e})},3),new jb(e).register()),this.syncExternalState=(e,t)=>{if(e.isComposing())return;let n=ob(t),r=this.pendingSelectionRef.current,i=this.pendingOwnerSignatureRef.current;if(i){if(n===i)this.pendingOwnerSignatureRef.current=null;else if(n!==this.editorSignatureRef.current)return}let a=n!==this.editorSignatureRef.current;if(!a&&!r)return;let o=e.getRootElement()!==document.activeElement;if(a?(this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n,eb(e,t,r,o)):r&&tb(e,r,o),r&&(this.selectionRef.current=r,this.pendingSelectionRef.current=null),this.shouldFocusAfterSyncRef.current){this.shouldFocusAfterSyncRef.current=!1;let t=this.selectionRef.current;e.focus(()=>{t&&tb(e,t)})}},this.publishSnapshot=(e,t,n)=>{this.selectionRef.current=e.selection,this.pendingSelectionRef.current=e.selection,n?.focusAfterSync&&(this.shouldFocusAfterSyncRef.current=!0);let r=ob(e.nodes),{editor:i}=this;if(this.pendingOwnerSignatureRef.current=r,i){this.editorSignatureRef.current=r;let t=i.getRootElement()!==document.activeElement;eb(i,e.nodes,e.selection,t)}t.onInputSurfaceSnapshotChange?.(e.nodes,e.selection,n?.inputSurfaceReason??{type:`programmatic`}),r!==this.lastPublishedSignatureRef.current&&(this.lastPublishedSignatureRef.current=r,t.onNodesChange(e.nodes))},this.focusComposer=()=>{let{editor:e}=this;if(!e)return;e.getRootElement()?.focus({preventScroll:!0});let t=this.selectionRef.current;t&&tb(e,t),e.focus()},this.focusComposerAtEnd=e=>{let{editor:t}=this;if(!t)return;let n=e??Zy(t.getEditorState()).nodes,r=Nb(n),i={start:r,end:r};if(this.selectionRef.current=i,t.getRootElement()?.focus({preventScroll:!0}),e){let n=ob(e);this.editorSignatureRef.current=n,this.lastPublishedSignatureRef.current=n,eb(t,e,i)}else tb(t,i);t.focus(()=>{let e=this.selectionRef.current;ob(Zy(t.getEditorState()).nodes)!==ob(n)||e?.start!==i.start||e?.end!==i.end||tb(t,i)})},this.readComposerSnapshot=e=>{let{editor:t}=this;if(!t)return{nodes:e,selection:this.selectionRef.current};let n=Zy(t.getEditorState());return this.selectionRef.current=n.selection,n},this.createHandle=()=>{let e=(e,t=[Is])=>{let{callbacks:n}=this.getRuntime();n.onInputSurfaceItemSelect?.(e),this.publishRuntimeSnapshot(n=>ab({item:e,nodes:n.nodes,selection:n.selection,triggerSpecs:t}),{focusAfterSync:!0})};return{insertToken:e=>{this.publishRuntimeSnapshot(t=>ib({data:e.data,label:e.label,nodes:t.nodes,selection:t.selection,tokenKey:e.tokenKey,tokenKind:e.tokenKind,triggerSpecs:[]}),{focusAfterSync:!0})},insertInputSurfaceItem:e,insertSlashItem:t=>{e(t)},insertFileToken:(e,t,n)=>{this.publishRuntimeSnapshot(r=>sb({label:t,nodes:r.nodes,previewUrl:n,selection:r.selection,tokenKey:e}),{focusAfterSync:!0})},insertFileTokens:e=>{this.publishRuntimeSnapshot(t=>e.reduce((e,t)=>sb({label:t.label,nodes:e.nodes,previewUrl:t.previewUrl,selection:e.selection,tokenKey:t.tokenKey}),t),{focusAfterSync:!0})},focusComposer:this.focusComposer,focusComposerAtEnd:this.focusComposerAtEnd,syncSelectedSkills:(e,t)=>{this.publishRuntimeSnapshot(n=>lb({nextKeys:e,nodes:n.nodes,options:t,selection:n.selection}),{})}}},this.handleKeyDown=e=>{let{actions:t,callbacks:n,event:r}=e,i=r.isComposing||(this.editor?.isComposing()??!1);return r.key.length===1&&!i&&!r.altKey&&!r.ctrlKey&&!r.metaKey?this.pendingInputSurfaceReasonRef.current={type:`insert-text`,text:r.key}:!i&&(r.key===`Backspace`||r.key===`Delete`)?this.pendingInputSurfaceReasonRef.current={type:`delete-content`}:!i&&r.key===`Enter`&&r.shiftKey&&(this.pendingInputSurfaceReasonRef.current={type:`insert-text`,text:`
17
+ `}),n.onInputSurfaceKeyDown?.(r)?(this.pendingInputSurfaceReasonRef.current=null,!0):!i&&ub(r)?!0:fb({actions:t,isComposing:i,nativeEvent:r})},this.handleEditorUpdate=(e,t,n)=>{let r=Zy(e),i=this.editor?.getRootElement();i&&Wy(i,r);let a=ob(r.nodes),o=this.editorSignatureRef.current;this.editorSignatureRef.current=a,!(n.has(`nextclaw-chat-composer-external-update`)&&a===o||this.editor?.isComposing()&&!n.has(`composition-end`))&&(this.selectionRef.current=r.selection,t.onInputSurfaceSnapshotChange?.(r.nodes,r.selection,this.consumeInputSurfaceReason()??{type:`sync`}),a!==this.lastPublishedSignatureRef.current&&(this.lastPublishedSignatureRef.current=a,t.onNodesChange(r.nodes)))},this.handleSelectionChange=(e,t)=>{let n=Zy(e.getEditorState()),r=e.getRootElement();r&&Wy(r,n),!e.isComposing()&&(this.selectionRef.current=n.selection,t.onInputSurfaceSnapshotChange?.(n.nodes,n.selection,{type:`selection`}))},this.consumeInputSurfaceReason=()=>{let e=this.pendingInputSurfaceReasonRef.current;return this.pendingInputSurfaceReasonRef.current=null,e},this.publishRuntimeSnapshot=(e,t)=>{let{callbacks:n,fallbackNodes:r}=this.getRuntime();this.publishSnapshot(e(this.readComposerSnapshot(r)),n,t)},this.getRuntime=()=>{if(!this.runtime)throw Error(`ChatComposerLexicalOwner runtime has not been configured.`);return this.runtime}}};function Fb({disabled:e,nodes:t,owner:n}){let[r]=eu();return(0,V.useLayoutEffect)(()=>n.bindEditor(r),[r,n]),(0,V.useLayoutEffect)(()=>{r.setEditable(!e),n.syncExternalState(r,t)},[e,r,t,n]),(0,V.useEffect)(()=>n.registerEditorListeners(r),[r,n]),null}var Ib=(0,V.forwardRef)(function({actions:e,disabled:t,nodes:n,excerptCharacterCountTemplate:r,onFilesAdd:i,onInputSurfaceItemSelect:a,onInputSurfaceKeyDown:o,onInputSurfaceOpenChange:s,onInputSurfaceSnapshotChange:c,onNodesChange:l,placeholder:u,removeTokenLabel:d},f){let[p]=(0,V.useState)(()=>new Pb),m=(0,V.useMemo)(()=>({onInputSurfaceItemSelect:a,onInputSurfaceKeyDown:o,onInputSurfaceOpenChange:s,onInputSurfaceSnapshotChange:c,onNodesChange:l}),[a,o,s,c,l]);return p.configureRuntime({actions:e,callbacks:m,fallbackNodes:n}),(0,V.useImperativeHandle)(f,()=>p.createHandle(),[p]),(0,H.jsx)(av,{initialConfig:(0,V.useMemo)(()=>({editable:!t,editorState:()=>{$y(n,null)},namespace:`NextClawChatComposerLexical`,nodes:[Vy],onError:e=>{throw e},theme:{}}),[t,n]),children:(0,H.jsxs)(Fy,{excerptCharacterCountTemplate:r,removeTokenLabel:d,children:[(0,H.jsx)(`div`,{className:`px-3 py-2 sm:px-4 sm:py-2.5`,children:(0,H.jsx)(`div`,{className:`min-h-11 sm:min-h-[60px]`,children:(0,H.jsx)(ete,{contentEditable:(0,H.jsx)($_,{className:`nextclaw-chat-composer min-h-7 max-h-[188px] w-full overflow-y-auto whitespace-pre-wrap break-words bg-transparent py-0.5 text-sm leading-6 text-foreground outline-none selection:bg-[var(--interaction-selection,Highlight)] selection:text-current`,onPaste:e=>{let t=Array.from(e.clipboardData.files??[]);t.length>0&&i&&(e.preventDefault(),i(t))}}),placeholder:(0,H.jsx)(`div`,{className:`pointer-events-none absolute left-3 top-2 select-none text-sm leading-6 text-muted-foreground/60 sm:left-4 sm:top-2.5`,children:u}),ErrorBoundary:uv})})}),(0,H.jsx)(Fb,{disabled:t,nodes:n,owner:p})]})})});Ib.displayName=`LexicalChatInputBarTokenizedComposer`;var Lb=120;function Rb(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=Lb?t:`${t.slice(0,Lb-1)}…`}function zb({hint:e}){return e?e.loading?(0,H.jsx)(`div`,{className:`px-4 pb-2`,children:(0,H.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2`,children:[(0,H.jsx)(`span`,{className:`h-3 w-28 animate-pulse rounded bg-muted-foreground/20`}),(0,H.jsx)(`span`,{className:`h-3 w-16 animate-pulse rounded bg-muted-foreground/20`})]})}):(0,H.jsx)(`div`,{className:`px-4 pb-2`,children:(0,H.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-lg px-3 py-1.5 text-xs ${e.tone===`warning`?`border-amber-200 bg-amber-50 text-amber-800`:`border-border bg-muted text-muted-foreground`}`,children:[e.text?(0,H.jsx)(`span`,{children:e.text}):null,e.actionLabel&&e.onAction?(0,H.jsx)(`button`,{type:`button`,onClick:e.onAction,className:`font-semibold underline-offset-2 hover:underline`,children:e.actionLabel}):null]})}):null}function Bb({sendError:e,sendErrorDetailsLabel:t}){let n=e?.trim()??``;if(!n)return null;let{Popover:r,PopoverContent:i,PopoverTrigger:a}=fl,o=Rb(n),s=t?.trim()||`Details`;return(0,H.jsx)(`div`,{className:`px-3 pb-2 sm:px-4`,children:(0,H.jsxs)(`div`,{"aria-live":`polite`,className:`flex min-w-0 items-start justify-between gap-3 rounded-lg border border-red-200/80 bg-red-50/80 px-3 py-2 text-xs text-red-700`,role:`status`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate leading-5`,title:n,children:o}),(0,H.jsxs)(r,{children:[(0,H.jsx)(a,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:`inline-flex h-7 shrink-0 items-center rounded-md border border-red-200/80 bg-background px-2 text-xs font-medium text-red-700 transition-colors hover:bg-red-100`,children:s})}),(0,H.jsxs)(i,{align:`end`,className:`w-[min(32rem,calc(100vw-1.5rem))] border-red-100/80 p-0`,children:[(0,H.jsx)(`div`,{className:`border-b border-red-100 bg-red-50/80 px-4 py-2 text-xs font-semibold text-red-700`,children:s}),(0,H.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words px-4 py-3 text-xs leading-relaxed text-red-700`,children:n})]})]})]})})}var Vb=(0,V.forwardRef)(function({composer:e,hint:t,inputSurface:n,sendError:r,sendErrorDetailsLabel:i,slashMenu:a,surface:o,toolbar:s,topSlot:c},l){let u=(0,V.useRef)(null),d=n??(a?{isLoading:a.isLoading,filterOptions:a.filterOptions,items:a.items,onSelectItem:a.onSelectItem,texts:{loadingLabel:a.texts.slashLoadingLabel,sectionLabel:a.texts.slashSectionLabel,emptyLabel:a.texts.slashEmptyLabel,hintLabel:a.texts.slashHintLabel,itemHintLabel:a.texts.slashSkillHintLabel}}:null),f=(0,V.useMemo)(()=>s.skillPicker?{...s,skillPicker:{...s.skillPicker,onSelectedKeysChange:e=>{u.current?.syncSelectedSkills(e,s.skillPicker?.options??[]),s.skillPicker?.onSelectedKeysChange(e)}}}:s,[s]);return(0,V.useImperativeHandle)(l,()=>({insertInputSurfaceToken:t=>u.current?.insertInputSurfaceItem({key:`resolved-token:${t.tokenKind}:${t.tokenKey}`,title:t.label,subtitle:``,description:``,detailLines:[],tokenKind:t.tokenKind,tokenKey:t.tokenKey,data:t.data},e.inputSurfaceTriggerSpecs),insertToken:e=>u.current?.insertToken(e),insertFileToken:(e,t,n)=>u.current?.insertFileToken(e,t,n),insertFileTokens:e=>u.current?.insertFileTokens(e),focusComposer:()=>u.current?.focusComposer(),focusComposerAtEnd:e=>u.current?.focusComposerAtEnd(e)}),[e.inputSurfaceTriggerSpecs]),(0,H.jsx)(`div`,{className:o===`embedded`?`bg-transparent px-0 py-0`:`bg-background px-3 pb-3 pt-2 sm:px-4 sm:pb-4 sm:pt-2`,children:(0,H.jsx)(`div`,{className:`nextclaw-chat-input-bar-shell mx-auto w-full max-w-[min(1120px,100%)] [container:nextclaw-chat-input-bar/inline-size]`,children:(0,H.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-card shadow-card`,children:[c?(0,H.jsx)(`div`,{className:`px-3 pb-0 pt-2 sm:px-4 sm:pt-2.5`,children:c}):null,(0,H.jsx)(`div`,{className:`relative`,children:(0,H.jsx)(Cl,{inputSurface:d,onInputSurfaceTriggerChange:e.onInputSurfaceTriggerChange,onSelectItem:t=>{if(t.selectionBehavior===`navigate`||t.selectionBehavior===`action`){d?.onSelectItem?.(t);return}u.current?.insertInputSurfaceItem(t,e.inputSurfaceTriggerSpecs)},triggerSpecs:e.inputSurfaceTriggerSpecs,children:({onInputSurfaceKeyDown:t,onInputSurfaceOpenChange:n,onInputSurfaceSnapshotChange:r})=>(0,H.jsx)(Ib,{ref:u,nodes:e.nodes,placeholder:e.placeholder,excerptCharacterCountTemplate:e.excerptCharacterCountTemplate,removeTokenLabel:e.removeTokenLabel,disabled:e.disabled,onInputSurfaceItemSelect:d?.onSelectItem,actions:s.actions,onNodesChange:e.onNodesChange,onFilesAdd:e.onFilesAdd,onInputSurfaceSnapshotChange:r,onInputSurfaceOpenChange:n,onInputSurfaceKeyDown:t})})}),(0,H.jsx)(zb,{hint:t}),(0,H.jsx)(Bb,{sendError:r,sendErrorDetailsLabel:i}),(0,H.jsx)(Zl,{...f})]})})})});Vb.displayName=`ChatInputBar`;function Hb({assistantIcon:e,role:t,size:n=`default`}){let r=n===`compact`,i=r?`h-7 w-7`:`h-8 w-8`,a=r?`h-3.5 w-3.5`:`h-4 w-4`;return t===`user`?(0,H.jsx)(`div`,{"data-testid":`chat-message-avatar-user`,className:U(`nextclaw-chat-message-avatar-user flex shrink-0 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm`,i),children:(0,H.jsx)(Dee,{className:a})}):t===`tool`?(0,H.jsx)(`div`,{"data-testid":`chat-message-avatar-tool`,className:U(`flex shrink-0 items-center justify-center rounded-full bg-accent text-accent-foreground shadow-sm ring-1 ring-border`,i),children:(0,H.jsx)(Ko,{className:a})}):(0,H.jsx)(`div`,{"data-testid":`chat-message-avatar-assistant`,className:U(`flex shrink-0 items-center justify-center rounded-full bg-muted text-foreground shadow-sm ring-1 ring-border`,i),children:e??(0,H.jsx)(Zi,{className:U(r?`h-4 w-4`:`h-[18px] w-[18px]`,`text-current`),strokeWidth:2.5})})}function Ub(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Wb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gb=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kb={};function qb(e,t){return((t||Kb).jsx?Gb:Wb).test(e)}var Jb=/[ \t\n\f\r]/g;function Yb(e){return typeof e==`object`?e.type===`text`?Xb(e.value):!1:Xb(e)}function Xb(e){return e.replace(Jb,``)===``}var Zb=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Zb.prototype.normal={},Zb.prototype.property={},Zb.prototype.space=void 0;function Qb(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Zb(n,r,t)}function $b(e){return e.toLowerCase()}var ex=class{constructor(e,t){this.attribute=t,this.property=e}};ex.prototype.attribute=``,ex.prototype.booleanish=!1,ex.prototype.boolean=!1,ex.prototype.commaOrSpaceSeparated=!1,ex.prototype.commaSeparated=!1,ex.prototype.defined=!1,ex.prototype.mustUseProperty=!1,ex.prototype.number=!1,ex.prototype.overloadedBoolean=!1,ex.prototype.property=``,ex.prototype.spaceSeparated=!1,ex.prototype.space=void 0;var tx=t({boolean:()=>X,booleanish:()=>rx,commaOrSpaceSeparated:()=>sx,commaSeparated:()=>ox,number:()=>Z,overloadedBoolean:()=>ix,spaceSeparated:()=>ax}),nx=0,X=cx(),rx=cx(),ix=cx(),Z=cx(),ax=cx(),ox=cx(),sx=cx();function cx(){return 2**++nx}var lx=Object.keys(tx),ux=class extends ex{constructor(e,t,n,r){let i=-1;if(super(e,t),dx(this,`space`,r),typeof n==`number`)for(;++i<lx.length;){let e=lx[i];dx(this,lx[i],(n&tx[e])===tx[e])}}};ux.prototype.defined=!0;function dx(e,t,n){n&&(e[t]=n)}function fx(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ux(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[$b(r)]=r,n[$b(a.attribute)]=r}return new Zb(t,n,e.space)}var px=fx({properties:{ariaActiveDescendant:null,ariaAtomic:rx,ariaAutoComplete:null,ariaBusy:rx,ariaChecked:rx,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:ax,ariaCurrent:null,ariaDescribedBy:ax,ariaDetails:null,ariaDisabled:rx,ariaDropEffect:ax,ariaErrorMessage:null,ariaExpanded:rx,ariaFlowTo:ax,ariaGrabbed:rx,ariaHasPopup:null,ariaHidden:rx,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ax,ariaLevel:Z,ariaLive:null,ariaModal:rx,ariaMultiLine:rx,ariaMultiSelectable:rx,ariaOrientation:null,ariaOwns:ax,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:rx,ariaReadOnly:rx,ariaRelevant:null,ariaRequired:rx,ariaRoleDescription:ax,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:rx,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function mx(e,t){return t in e?e[t]:t}function hx(e,t){return mx(e,t.toLowerCase())}var gx=fx({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ox,acceptCharset:ax,accessKey:ax,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:ax,autoFocus:X,autoPlay:X,blocking:ax,capture:null,charSet:null,checked:X,cite:null,className:ax,cols:Z,colSpan:null,content:null,contentEditable:rx,controls:X,controlsList:ax,coords:Z|ox,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:ix,draggable:rx,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:ax,height:Z,hidden:ix,high:Z,href:null,hrefLang:null,htmlFor:ax,httpEquiv:ax,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:ax,itemRef:ax,itemScope:X,itemType:ax,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,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:X,optimum:Z,pattern:null,ping:ax,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:ax,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:ax,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:rx,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:rx,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ax,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:rx,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:X,disableRemotePlayback:X,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:hx}),_x=fx({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:sx,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:ax,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:ox,g2:ox,glyphName:ox,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:sx,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ax,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sx,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sx,rev:sx,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sx,requiredFeatures:sx,requiredFonts:sx,requiredFormats:sx,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:sx,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:sx,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:sx,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:mx}),vx=fx({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()}}),yx=fx({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:hx}),bx=fx({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),xx={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`},Sx=/[A-Z]/g,Cx=/-[a-z]/g,wx=/^data[-\w.:]+$/i;function Tx(e,t){let n=$b(t),r=t,i=ex;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&wx.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Cx,Dx);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Cx.test(e)){let n=e.replace(Sx,Ex);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ux}return new i(r,t)}function Ex(e){return`-`+e.toLowerCase()}function Dx(e){return e.charAt(1).toUpperCase()}var Ox=Qb([px,gx,vx,yx,bx],`html`),kx=Qb([px,_x,vx,yx,bx],`svg`);function Ax(e){return e.join(` `).trim()}var jx=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
18
+ `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Mx=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(jx());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Nx=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Px=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Mx()),r=Nx();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Fx=Lx(`end`),Ix=Lx(`start`);function Lx(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Rx(e){let t=Ix(e),n=Fx(e);if(t&&n)return{start:t,end:n}}function zx(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Vx(e.position):`start`in e||`end`in e?Vx(e):`line`in e||`column`in e?Bx(e):``}function Bx(e){return Hx(e&&e.line)+`:`+Hx(e&&e.column)}function Vx(e){return Bx(e&&e.start)+`-`+Bx(e&&e.end)}function Hx(e){return e&&typeof e==`number`?e:1}var Ux=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=zx(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ux.prototype.file=``,Ux.prototype.name=``,Ux.prototype.reason=``,Ux.prototype.message=``,Ux.prototype.stack=``,Ux.prototype.column=void 0,Ux.prototype.line=void 0,Ux.prototype.ancestors=void 0,Ux.prototype.cause=void 0,Ux.prototype.fatal=void 0,Ux.prototype.place=void 0,Ux.prototype.ruleId=void 0,Ux.prototype.source=void 0;var Wx=e(Px(),1),Gx={}.hasOwnProperty,Kx=new Map,qx=/[A-Z]/g,Jx=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Yx=new Set([`td`,`th`]),Xx=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Zx(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=cS(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=sS(n,t.jsx,t.jsxs)}let 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`?kx:Ox,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Qx(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Qx(e,t,n){if(t.type===`element`)return $x(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return eS(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return nS(e,t,n);if(t.type===`mdxjsEsm`)return tS(e,t);if(t.type===`root`)return rS(e,t,n);if(t.type===`text`)return iS(e,t)}function $x(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=kx,e.schema=i),e.ancestors.push(t);let a=mS(e,t.tagName,!1),o=lS(e,t),s=dS(e,t);return Jx.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!Yb(e):!0})),aS(e,o,a,t),oS(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function eS(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}hS(e,t.position)}function tS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hS(e,t.position)}function nS(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=kx,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:mS(e,t.name,!0),o=uS(e,t),s=dS(e,t);return aS(e,o,a,t),oS(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rS(e,t,n){let r={};return oS(r,dS(e,t)),e.create(t,e.Fragment,r,n)}function iS(e,t){return t.value}function aS(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oS(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function sS(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function cS(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Ix(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function lS(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Gx.call(t.properties,i)){let a=fS(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Yx.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function uS(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else hS(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else hS(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function dS(e,t){let n=[],r=-1,i=e.passKeys?new Map:Kx;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Qx(e,a,o);s!==void 0&&n.push(s)}return n}function fS(e,t,n){let r=Tx(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ub(n):Ax(n)),r.property===`style`){let t=typeof n==`object`?n:pS(e,String(n));return e.stylePropertyNameCase===`css`&&(t=gS(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?xx[r.property]||r.property:r.attribute,n]}}function pS(e,t){try{return(0,Wx.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Ux("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Xx+`#cannot-parse-style-attribute`,r}}function mS(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=qb(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=qb(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Gx.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);hS(e)}function hS(e,t){let n=new Ux("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=Xx+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function gS(e){let t={},n;for(n in e)Gx.call(e,n)&&(t[_S(n)]=e[n]);return t}function _S(e){let t=e.replace(qx,vS);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function vS(e){return`-`+e.toLowerCase()}var yS={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`]},bS={};function xS(e,t){let n=t||bS;return SS(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function SS(e,t,n){if(wS(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 CS(e.children,t,n)}return Array.isArray(e)?CS(e,t,n):``}function CS(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=SS(e[i],t,n);return r.join(``)}function wS(e){return!!(e&&typeof e==`object`)}var TS=document.createElement(`i`);function ES(e){let t=`&`+e+`;`;TS.innerHTML=t;let n=TS.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function DS(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function OS(e,t){return e.length>0?(DS(e,e.length,0,t),e):t}var kS={}.hasOwnProperty;function AS(e){let t={},n=-1;for(;++n<e.length;)jS(t,e[n]);return t}function jS(e,t){let n;for(n in t){let r=(kS.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){kS.call(r,a)||(r[a]=[]);let e=i[a];MS(r[a],Array.isArray(e)?e:e?[e]:[])}}}function MS(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);DS(e,0,0,r)}function NS(e,t){let 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 PS(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var FS=KS(/[A-Za-z]/),IS=KS(/[\dA-Za-z]/),LS=KS(/[#-'*+\--9=?A-Z^-~]/);function RS(e){return e!==null&&(e<32||e===127)}var zS=KS(/\d/),BS=KS(/[\dA-Fa-f]/),VS=KS(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function HS(e){return e!==null&&(e<0||e===32)}function US(e){return e===-2||e===-1||e===32}var WS=KS(/\p{P}|\p{S}/u),GS=KS(/\s/);function KS(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function qS(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&IS(e.charCodeAt(n+1))&&IS(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function JS(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return US(r)?(e.enter(n),s(r)):t(r)}function s(r){return US(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var YS={tokenize:XS};function XS(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),JS(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var ZS={tokenize:$S},QS={tokenize:eC};function $S(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return DS(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(QS,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(QS,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;DS(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function eC(e,t,n){return JS(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function tC(e){if(e===null||HS(e)||GS(e))return 1;if(WS(e))return 2}function nC(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var rC={name:`attention`,resolveAll:iC,tokenize:aC};function iC(e,t){let n=-1,r,i,a,o,s,c,l,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;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};oC(d,-c),oC(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=OS(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=OS(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=OS(l,nC(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=OS(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=OS(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,DS(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function aC(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=tC(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=tC(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function oC(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var sC={name:`autolink`,tokenize:cC};function cC(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return FS(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||IS(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||IS(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||RS(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):LS(t)?(e.consume(t),l):n(t)}function u(e){return IS(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||IS(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var lC={partial:!0,tokenize:uC};function uC(e,t,n){return r;function r(t){return US(t)?JS(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var dC={continuation:{tokenize:pC},exit:mC,name:`blockQuote`,tokenize:fC};function fC(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return US(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function pC(e,t,n){let r=this;return i;function i(t){return US(t)?JS(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(dC,t,n)(r)}}function mC(e){e.exit(`blockQuote`)}var hC={name:`characterEscape`,tokenize:gC};function gC(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return VS(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var _C={name:`characterReference`,tokenize:vC};function vC(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=IS,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=BS,u):(e.enter(`characterReferenceValue`),a=7,o=zS,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===IS&&!ES(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var yC={partial:!0,tokenize:SC},bC={concrete:!0,name:`codeFenced`,tokenize:xC};function xC(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),US(t)?JS(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(yC,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):US(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),JS(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&US(t)?JS(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(yC,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),US(t)?JS(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),US(t)?JS(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function SC(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var CC={name:`codeIndented`,tokenize:TC},wC={partial:!0,tokenize:EC};function TC(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),JS(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Q(t)?e.attempt(wC,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function EC(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):JS(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Q(e)?i(e):n(e)}}var DC={name:`codeText`,previous:kC,resolve:OC,tokenize:AC};function OC(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 kC(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function AC(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var jC=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&MC(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),MC(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),MC(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);MC(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);MC(this.left,t.reverse())}}};function MC(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 NC(e){let t={},n=-1,r,i,a,o,s,c,l,u=new jC(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`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,PC(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[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 DS(e,0,1/0,u.slice(0)),!l}function PC(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var FC={resolve:LC,tokenize:RC},IC={partial:!0,tokenize:zC};function LC(e){return NC(e),e}function RC(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Q(t)?e.check(IC,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function zC(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),JS(e,a,`linePrefix`)}function a(i){if(i===null||Q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function BC(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||RS(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||HS(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||RS(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function VC(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!US(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function HC(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),JS(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function UC(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):US(i)?JS(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var WC={name:`definition`,tokenize:KC},GC={partial:!0,tokenize:qC};function KC(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return VC.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=PS(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return HS(t)?UC(e,l)(t):l(t)}function l(t){return BC(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(GC,d,d)(t)}function d(t){return US(t)?JS(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qC(e,t,n){return r;function r(t){return HS(t)?UC(e,i)(t):n(t)}function i(t){return HC(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return US(t)?JS(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var JC={name:`hardBreakEscape`,tokenize:YC};function YC(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var XC={name:`headingAtx`,resolve:ZC,tokenize:QC};function ZC(e,t){let n=e.length-2,r=3,i,a;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},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},DS(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function QC(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||HS(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):US(n)?JS(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||HS(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $C=`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`.split(`.`),ew=[`pre`,`script`,`style`,`textarea`],tw={concrete:!0,name:`htmlFlow`,resolveTo:iw,tokenize:aw},nw={partial:!0,tokenize:sw},rw={partial:!0,tokenize:ow};function iw(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 aw(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):FS(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):FS(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return FS(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||HS(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ew.includes(l)?(i=1,r.interrupt?t(s):O(s)):$C.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||IS(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return US(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||FS(t)?(e.consume(t),b):US(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||IS(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):US(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):US(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||HS(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||US(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Q(t)?O(t):US(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(nw,re,k)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(rw,A,re)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||Q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return ew.includes(n)?(e.consume(t),ne):O(t)}return FS(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function ow(e,t,n){let r=this;return i;function i(t){return Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function sw(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(lC,t,n)}}var cw={name:`htmlText`,tokenize:lw};function lw(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):FS(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):FS(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Q(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Q(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):Q(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return FS(t)?(e.consume(t),S):n(t)}function S(t){return t===45||IS(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,M(t)):US(t)?(e.consume(t),C):j(t)}function w(t){return t===45||IS(t)?(e.consume(t),w):t===47||t===62||HS(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||FS(t)?(e.consume(t),E):Q(t)?(o=T,M(t)):US(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||IS(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Q(t)?(o=D,M(t)):US(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Q(t)?(o=O,M(t)):US(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):Q(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||HS(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||HS(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return US(t)?JS(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var uw={name:`labelEnd`,resolveAll:mw,resolveTo:hw,tokenize:gw},dw={tokenize:_w},fw={tokenize:vw},pw={tokenize:yw};function mw(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&DS(e,0,e.length,n),e}function hw(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=OS(s,e.slice(a+1,a+r+3)),s=OS(s,[[`enter`,u,t]]),s=OS(s,nC(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=OS(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=OS(s,e.slice(o+1)),s=OS(s,[[`exit`,c,t]]),DS(e,a,e.length,s),e}function gw(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(PS(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(dw,u,o?u:d)(t):t===91?e.attempt(fw,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(pw,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function _w(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return HS(t)?UC(e,a)(t):a(t)}function a(t){return t===41?u(t):BC(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return HS(t)?UC(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?HC(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return HS(t)?UC(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function vw(e,t,n){let r=this;return i;function i(t){return VC.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(PS(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function yw(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var bw={name:`labelStartImage`,resolveAll:uw.resolveAll,tokenize:xw};function xw(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Sw={name:`labelStartLink`,resolveAll:uw.resolveAll,tokenize:Cw};function Cw(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var ww={name:`lineEnding`,tokenize:Tw};function Tw(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),JS(e,t,`linePrefix`)}}var Ew={name:`thematicBreak`,tokenize:Dw};function Dw(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),US(t)?JS(e,s,`whitespace`)(t):s(t))}}var Ow={continuation:{tokenize:Mw},exit:Pw,name:`list`,tokenize:jw},kw={partial:!0,tokenize:Fw},Aw={partial:!0,tokenize:Nw};function jw(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:zS(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ew,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return zS(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(lC,r.interrupt?n:u,e.attempt(kw,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return US(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Mw(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(lC,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,JS(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!US(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Aw,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,JS(e,e.attempt(Ow,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Nw(e,t,n){let r=this;return JS(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Pw(e){e.exit(this.containerState.type)}function Fw(e,t,n){let r=this;return JS(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!US(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Iw={name:`setextUnderline`,resolveTo:Lw,tokenize:Rw};function Lw(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Rw(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),US(t)?JS(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var zw={tokenize:Bw};function Bw(e){let t=this,n=e.attempt(lC,r,e.attempt(this.parser.constructs.flowInitial,i,JS(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FC,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Vw={resolveAll:Gw()},Hw=Ww(`string`),Uw=Ww(`text`);function Ww(e){return{resolveAll:Gw(e===`text`?Kw:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Gw(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Kw(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var qw=t({attentionMarkers:()=>tT,contentInitial:()=>Yw,disable:()=>nT,document:()=>Jw,flow:()=>Zw,flowInitial:()=>Xw,insideSpan:()=>eT,string:()=>Qw,text:()=>$w}),Jw={42:Ow,43:Ow,45:Ow,48:Ow,49:Ow,50:Ow,51:Ow,52:Ow,53:Ow,54:Ow,55:Ow,56:Ow,57:Ow,62:dC},Yw={91:WC},Xw={[-2]:CC,[-1]:CC,32:CC},Zw={35:XC,42:Ew,45:[Iw,Ew],60:tw,61:Iw,95:Ew,96:bC,126:bC},Qw={38:_C,92:hC},$w={[-5]:ww,[-4]:ww,[-3]:ww,33:bw,38:_C,42:rC,60:[sC,cw],91:Sw,92:[JC,hC],93:uw,95:rC,96:DC},eT={null:[rC,Vw]},tT={null:[42,95]},nT={null:[]};function rT(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=OS(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=nC(a,l.events,l),l.events):[]}function f(e,t){return aT(p(e),t)}function p(e){return iT(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&DS(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function iT(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function aT(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
19
+ `;break;case-3:o=`\r
20
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function oT(e){let t={constructs:AS([qw,...(e||{}).extensions||[]]),content:n(YS),defined:[],document:n(ZS),flow:n(zw),lazy:{},string:n(Hw),text:n(Uw)};return t;function n(e){return n;function n(n){return rT(t,e,n)}}}function sT(e){for(;!NC(e););return e}var cT=/[\0\t\n\r]/g;function lT(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(cT.lastIndex=u,c=cT.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var uT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dT(e){return e.replace(uT,fT)}function fT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return NS(n.slice(t?2:1),t?16:10)}return ES(n)||e}var pT={}.hasOwnProperty;function mT(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),hT(n)(sT(oT(n).document().write(lT()(e,t,!0))))}function hT(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(be),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ge),blockQuote:a(de),characterEscape:T,characterReference:T,codeFenced:a(fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(fe,o),codeText:a(pe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(me),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(he),hardBreakEscape:a(_e),hardBreakTrailing:a(_e),htmlFlow:a(ve,o),htmlFlowData:T,htmlText:a(ve,o),htmlTextData:T,image:a(ye),label:o,link:a(be),listItem:a(Se),listItemValue:f,listOrdered:a(xe,d),listUnordered:a(xe),paragraph:a(Ce),reference:ie,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ge),strong:a(we),thematicBreak:a(Ee)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ue,autolinkProtocol:le,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:se,characterReference:ce,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:te,labelText:N,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ae,resourceDestinationString:P,resourceTitleString:ne,resource:re,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};_T(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];pT.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||yT).call(a,void 0,e[0])}for(r.position={start:gT(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:gT(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:gT(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||yT).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+zx({start:e.start,end:e.end})+`): it’s not open`);n.position.end=gT(e.end)}function u(){return xS(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=PS(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Te(),n.position={start:gT(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=gT(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=gT(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=dT(t),n.identifier=PS(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function ie(){this.data.referenceType=`collapsed`}function ae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=PS(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function oe(e){this.data.characterReferenceType=e.type}function se(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=NS(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=ES(t);let i=this.stack[this.stack.length-1];i.value+=r}function ce(e){let t=this.stack.pop();t.position.end=gT(e.end)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function de(){return{type:`blockquote`,children:[]}}function fe(){return{type:`code`,lang:null,meta:null,value:``}}function pe(){return{type:`inlineCode`,value:``}}function me(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function he(){return{type:`emphasis`,children:[]}}function ge(){return{type:`heading`,depth:0,children:[]}}function _e(){return{type:`break`}}function ve(){return{type:`html`,value:``}}function ye(){return{type:`image`,title:null,url:``,alt:null}}function be(){return{type:`link`,title:null,url:``,children:[]}}function xe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Se(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ce(){return{type:`paragraph`,children:[]}}function we(){return{type:`strong`,children:[]}}function Te(){return{type:`text`,value:``}}function Ee(){return{type:`thematicBreak`}}}function gT(e){return{line:e.line,column:e.column,offset:e.offset}}function _T(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?_T(e,r):vT(e,r)}}function vT(e,t){let n;for(n in t)if(pT.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function yT(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+zx({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zx({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+zx({start:t.start,end:t.end})+`) is still open`)}function bT(e){let t=this;t.parser=n;function n(n){return mT(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function xT(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ST(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
21
+ `}]}function CT(e,t){let n=t.value?t.value+`
22
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function wT(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TT(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ET(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=qS(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={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(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function DT(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OT(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function kT(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function AT(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kT(e,t);let i={src:qS(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function jT(e,t){let n={src:qS(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function MT(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function NT(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return kT(e,t);let i={href:qS(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function PT(e,t){let n={href:qS(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function FT(e,t,n){let r=e.all(t),i=n?IT(n):LT(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
23
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
24
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function IT(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=LT(n[r])}return t}function LT(e){return e.spread??e.children.length>1}function RT(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function zT(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BT(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mte(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VT(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Ix(t.children[1]),o=Fx(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function HT(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function UT(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var WT=9,GT=32;function KT(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(qT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(qT(t.slice(i),i>0,!1)),a.join(``)}function qT(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===WT||t===GT;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===WT||t===GT;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function JT(e,t){let n={type:`text`,value:KT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function YT(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var XT={blockquote:xT,break:ST,code:CT,delete:wT,emphasis:TT,footnoteReference:ET,heading:DT,html:OT,imageReference:AT,image:jT,inlineCode:MT,linkReference:NT,link:PT,listItem:FT,list:RT,paragraph:zT,root:BT,strong:mte,table:VT,tableCell:UT,tableRow:HT,text:JT,thematicBreak:YT,toml:ZT,yaml:ZT,definition:ZT,footnoteDefinition:ZT};function ZT(){}var QT=typeof self==`object`?self:globalThis,$T=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new QT[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new QT[a](o),i)};return r},eE=e=>$T(new Map,e)(0),tE=``,{toString:nE}={},{keys:rE}=Object,iE=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=nE.call(e).slice(8,-1);switch(n){case`Array`:return[1,tE];case`Object`:return[2,tE];case`Date`:return[3,tE];case`RegExp`:return[4,tE];case`Map`:return[5,tE];case`Set`:return[6,tE];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},aE=([e,t])=>e===0&&(t===`function`||t===`symbol`),oE=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=iE(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of rE(r))(e||!aE(iE(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(aE(iE(n))||aE(iE(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!aE(iE(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},sE=(e,{json:t,lossy:n}={})=>{let r=[];return oE(!(t||n),!!t,new Map,r)(e),r},cE=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?eE(sE(e,t)):structuredClone(e):(e,t)=>eE(sE(e,t));function lE(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function uE(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function dE(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||lE,r=e.options.footnoteBackLabel||uE,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=qS(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...cE(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
25
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
26
+ `}]}}var fE=(function(e){if(e==null)return _E;if(typeof e==`function`)return gE(e);if(typeof e==`object`)return Array.isArray(e)?pE(e):mE(e);if(typeof e==`string`)return hE(e);throw Error(`Expected function, string, or object as test`)});function pE(e){let t=[],n=-1;for(;++n<e.length;)t[n]=fE(e[n]);return gE(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function mE(e){let t=e;return gE(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function hE(e){return gE(t);function t(t){return t&&t.type===e}}function gE(e){return t;function t(t,n,r){return!!(vE(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function _E(){return!0}function vE(e){return typeof e==`object`&&!!e&&`type`in e}function yE(e){return e}var bE=[];function xE(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=fE(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+yE(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=bE,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=SE(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function SE(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?bE:[e]}function CE(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),xE(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var wE={}.hasOwnProperty,TE={};function EE(e,t){let n=t||TE,r=new Map,i=new Map,a={all:s,applyData:OE,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...XT,...n.handlers},one:o,options:n,patch:DE,wrap:AE};return CE(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(wE.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=cE(n);return r.children=a.all(e),r}return cE(e)}return(a.options.unknownHandler||kE)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=jE(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=jE(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function DE(e,t){e.position&&(t.position=Rx(e))}function OE(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,cE(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function kE(e,t){let n=t.data||{},r=`value`in t&&!(wE.call(n,`hProperties`)||wE.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 AE(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
27
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
28
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
29
+ `}),n}function jE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ME(e,t){let n=EE(e,t),r=n.one(e,void 0),i=dE(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
30
+ `},i)),a}function NE(e,t){return e&&`run`in e?async function(n,r){let i=ME(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ME(n,{file:r,...e||t})}}function PE(e){if(e)throw e}var FE=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function IE(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function LE(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?RE(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function RE(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var zE={basename:BE,dirname:VE,extname:HE,join:UE,sep:`/`};function BE(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);KE(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function VE(e){if(KE(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function HE(e){KE(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function UE(...e){let t=-1,n;for(;++t<e.length;)KE(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:WE(n)}function WE(e){KE(e);let t=e.codePointAt(0)===47,n=GE(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function GE(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function KE(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var qE={cwd:JE};function JE(){return`/`}function YE(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function XE(e){if(typeof e==`string`)e=new URL(e);else if(!YE(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return ZE(e)}function ZE(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var QE=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],$E=class{constructor(e){let t;t=e?YE(e)?{path:e}:typeof e==`string`||rD(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:qE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<QE.length;){let e=QE[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)QE.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?zE.basename(this.path):void 0}set basename(e){tD(e,`basename`),eD(e,`basename`),this.path=zE.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?zE.dirname(this.path):void 0}set dirname(e){nD(this.basename,`dirname`),this.path=zE.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?zE.extname(this.path):void 0}set extname(e){if(eD(e,`extname`),nD(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=zE.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){YE(e)&&(e=XE(e)),tD(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?zE.basename(this.path,this.extname):void 0}set stem(e){tD(e,`stem`),eD(e,`stem`),this.path=zE.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Ux(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function eD(e,t){if(e&&e.includes(zE.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+zE.sep+"`")}function tD(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nD(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function rD(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var iD=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),aD=e(FE(),1),oD={}.hasOwnProperty,sD=new class e extends iD{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=LE()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,aD.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(uD(`data`,this.frozen),this.namespace[e]=t,this):oD.call(this.namespace,e)&&this.namespace[e]||void 0:e?(uD(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=pD(e),n=this.parser||this.Parser;return cD(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),cD(`process`,this.parser||this.Parser),lD(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=pD(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);hD(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),cD(`processSync`,this.parser||this.Parser),lD(`processSync`,this.compiler||this.Compiler),this.process(e,r),fD(`processSync`,`process`,t),n;function r(e,r){t=!0,PE(e),n=r}}run(e,t,n){dD(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=pD(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),fD(`runSync`,`run`,n),r;function i(e,t){PE(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=pD(t),r=this.compiler||this.Compiler;return lD(`stringify`,r),dD(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(uD(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,aD.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];IE(o)&&IE(r)&&(r=(0,aD.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function cD(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function lD(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function uD(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dD(e){if(!IE(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function fD(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function pD(e){return mD(e)?e:new $E(e)}function mD(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function hD(e){return typeof e==`string`||gD(e)}function gD(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var _D=[],vD={allowDangerousHtml:!0},yD=/^(https?|ircs?|mailto|xmpp)$/i,bD=[{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 xD(e){let t=SD(e),n=CD(e);return wD(t.runSync(t.parse(n),n),e)}function SD(e){let t=e.rehypePlugins||_D,n=e.remarkPlugins||_D,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vD}:vD;return sD().use(bT).use(n).use(NE,r).use(t)}function CD(e){let t=e.children||``,n=new $E;return typeof t==`string`?n.value=t:``+t,n}function wD(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||TD;for(let e of bD)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return CE(e,l),Zx(e,{Fragment:H.Fragment,components:i,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in yS)if(Object.hasOwn(yS,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=yS[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function TD(e){let 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||yD.test(e.slice(0,t))?e:``}function ED(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function DD(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function OD(e,t,n){let r=fE((n||{}).ignore||[]),i=kD(t),a=-1;for(;++a<i.length;)xE(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function kD(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([AD(e[0]),jD(e[1])])}return t}function AD(e){return typeof e==`string`?new RegExp(DD(e),`g`):e}function jD(e){return typeof e==`function`?e:function(){return e}}var MD=`phrasing`,ND=[`autolink`,`link`,`image`,`label`];function PD(){return{transforms:[HD],enter:{literalAutolink:ID,literalAutolinkEmail:LD,literalAutolinkHttp:LD,literalAutolinkWww:LD},exit:{literalAutolink:VD,literalAutolinkEmail:BD,literalAutolinkHttp:RD,literalAutolinkWww:zD}}}function FD(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:MD,notInConstruct:ND},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:MD,notInConstruct:ND},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:MD,notInConstruct:ND}]}}function ID(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function LD(e){this.config.enter.autolinkProtocol.call(this,e)}function RD(e){this.config.exit.autolinkProtocol.call(this,e)}function zD(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function BD(e){this.config.exit.autolinkEmail.call(this,e)}function VD(e){this.exit(e)}function HD(e){OD(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,UD],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,WD]],{ignore:[`link`,`linkReference`]})}function UD(e,t,n,r,i){let a=``;if(!qD(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!GD(n)))return!1;let o=KD(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function WD(e,t,n,r){return!qD(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function GD(e){let 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 KD(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=ED(e,`(`),a=ED(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function qD(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||GS(n)||WS(n))&&(!t||n!==47)}rO.peek=nO;function JD(){this.buffer()}function YD(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function XD(){this.buffer()}function ZD(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function QD(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=PS(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $D(e){this.exit(e)}function eO(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=PS(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tO(e){this.exit(e)}function nO(){return`[`}function rO(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function iO(){return{enter:{gfmFootnoteCallString:JD,gfmFootnoteCall:YD,gfmFootnoteDefinitionLabelString:XD,gfmFootnoteDefinition:ZD},exit:{gfmFootnoteCallString:QD,gfmFootnoteCall:$D,gfmFootnoteDefinitionLabelString:eO,gfmFootnoteDefinition:tO}}}function aO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:rO},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
31
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?sO:oO))),s(),o}}function oO(e,t,n){return t===0?e:sO(e,t,n)}function sO(e,t,n){return(n?``:` `)+e}var cO=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];pO.peek=mO;function lO(){return{canContainEols:[`delete`],enter:{strikethrough:dO},exit:{strikethrough:fO}}}function uO(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:cO}],handlers:{delete:pO}}}function dO(e){this.enter({type:`delete`,children:[]},e)}function fO(e){this.exit(e)}function pO(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function mO(){return`~`}function hte(e){return e.length}function gte(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||hte,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=_te(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=hO(r[d]);else{let e=hO(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
32
+ `)}function _te(e){return e==null?``:String(e)}function hO(e){let 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 vte(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),yte);return i(),o}function yte(e,t,n){return`>`+(n?``:` `)+e}function bte(e,t){return gO(e,t.inConstruct,!0)&&!gO(e,t.notInConstruct,!1)}function gO(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 _O(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
33
+ `&&bte(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
34
+ `}function xte(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ste(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 Cte(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wte(e,t,n,r){let i=Cte(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Ste(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Tte);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(xte(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
35
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
36
+ `),a&&(u+=s.move(a+`
37
+ `)),u+=s.move(c),l(),u}function Tte(e,t,n){return(n?``:` `)+e}function vO(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ete(e,t,n,r){let i=vO(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
38
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Dte(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yO(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function bO(e,t,n){let r=tC(e),i=tC(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}}xO.peek=Ote;function xO(e,t,n,r){let i=Dte(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=bO(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=yO(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=bO(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+yO(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ote(e,t,n){return n.options.emphasis||`*`}function kte(e,t){let n=!1;return CE(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&xS(e)&&(t.options.setext||n))}function Ate(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(kte(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
39
+ `,after:`
40
+ `});return r(),t(),o+`
41
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
42
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
43
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=yO(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}SO.peek=jte;function SO(e){return e.value||``}function jte(){return`<`}CO.peek=Mte;function CO(e,t,n,r){let i=vO(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Mte(){return`!`}wO.peek=Nte;function wO(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Nte(){return`!`}TO.peek=Pte;function TO(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Pte(){return"`"}function EO(e,t){let n=xS(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))}DO.peek=Fte;function DO(e,t,n,r){let i=vO(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(EO(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Fte(e,t,n){return EO(e,n)?`<`:`[`}OO.peek=Ite;function OO(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ite(){return`[`}function kO(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Lte(e){let t=kO(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Rte(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function AO(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function zte(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Rte(n):kO(n),s=e.ordered?o===`.`?`)`:`.`:Lte(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),AO(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Bte(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Vte(e,t,n,r){let i=Bte(n),a=n.bulletCurrent||kO(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Hte(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Ute=fE([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Wte(e,t,n,r){return(e.children.some(function(e){return Ute(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Gte(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jO.peek=Kte;function jO(e,t,n,r){let i=Gte(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=bO(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=yO(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=bO(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+yO(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Kte(e,t,n){return n.options.strong||`*`}function qte(e,t,n,r){return n.safe(e.value,r)}function Jte(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Yte(e,t,n){let r=(AO(n)+(n.options.ruleSpaces?` `:``)).repeat(Jte(n));return n.options.ruleSpaces?r.slice(0,-1):r}var MO={blockquote:vte,break:_O,code:wte,definition:Ete,emphasis:xO,hardBreak:_O,heading:Ate,html:SO,image:CO,imageReference:wO,inlineCode:TO,link:DO,linkReference:OO,list:zte,listItem:Vte,paragraph:Hte,root:Wte,strong:jO,text:qte,thematicBreak:Yte};function Xte(){return{enter:{table:Zte,tableData:PO,tableHeader:PO,tableRow:$te},exit:{codeText:ene,table:Qte,tableData:NO,tableHeader:NO,tableRow:NO}}}function Zte(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Qte(e){this.exit(e),this.data.inTable=void 0}function $te(e){this.enter({type:`tableRow`,children:[]},e)}function NO(e){this.exit(e)}function PO(e){this.enter({type:`tableCell`,children:[]},e)}function ene(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,tne));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function tne(e,t){return t===`|`?t:e}function nne(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
44
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
45
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return gte(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=MO.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function rne(){return{exit:{taskListCheckValueChecked:FO,taskListCheckValueUnchecked:FO,paragraph:ane}}}function ine(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:one}}}function FO(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function ane(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function one(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=MO.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function sne(){return[PD(),iO(),lO(),Xte(),rne()]}function cne(e){return{extensions:[FD(),aO(e),uO(),nne(e),ine()]}}var lne={tokenize:hne,partial:!0},IO={tokenize:gne,partial:!0},LO={tokenize:_ne,partial:!0},RO={tokenize:vne,partial:!0},une={tokenize:yne,partial:!0},zO={name:`wwwAutolink`,tokenize:pne,previous:WO},BO={name:`protocolAutolink`,tokenize:mne,previous:GO},VO={name:`emailAutolink`,tokenize:fne,previous:KO},HO={};function dne(){return{text:HO}}for(var UO=48;UO<123;)HO[UO]=VO,UO++,UO===58?UO=65:UO===91&&(UO=97);HO[43]=VO,HO[45]=VO,HO[46]=VO,HO[95]=VO,HO[72]=[VO,BO],HO[104]=[VO,BO],HO[87]=[VO,zO],HO[119]=[VO,zO];function fne(e,t,n){let r=this,i,a;return o;function o(t){return!qO(t)||!KO.call(r,r.previous)||JO(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return qO(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(une,u,l)(t):t===45||t===95||IS(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&FS(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function pne(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!WO.call(r,r.previous)||JO(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(lne,e.attempt(IO,e.attempt(LO,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function mne(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&GO.call(r,r.previous)&&!JO(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(FS(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||RS(t)||HS(t)||GS(t)||WS(t)?n(t):e.attempt(IO,e.attempt(LO,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function hne(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function gne(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(RO,c,s)(t):t===null||HS(t)||GS(t)||t!==45&&WS(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function _ne(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(RO,t,a)(o):o===null||HS(o)||GS(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function vne(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||HS(o)||GS(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||HS(e)||GS(e)?t(e):r(e)}function a(e){return FS(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):FS(t)?(e.consume(t),o):n(t)}}function yne(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return IS(e)?n(e):t(e)}}function WO(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||HS(e)}function GO(e){return!FS(e)}function KO(e){return!(e===47||qO(e))}function qO(e){return e===43||e===45||e===46||e===95||IS(e)}function JO(e){let t=e.length,n=!1;for(;t--;){let 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}var bne={tokenize:One,partial:!0};function xne(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Tne,continuation:{tokenize:Ene},exit:Dne}},text:{91:{name:`gfmFootnoteCall`,tokenize:wne},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Sne,resolveTo:Cne}}}}function Sne(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=PS(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Cne(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`;let 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++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function wne(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||HS(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(PS(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return HS(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Tne(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||HS(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=PS(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return HS(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),JS(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Ene(e,t,n){return e.check(lC,t,e.attempt(bne,t,n))}function Dne(e){e.exit(`gfmFootnoteDefinition`)}function One(e,t,n){let r=this;return JS(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function kne(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&DS(o,o.length,0,nC(s,e.slice(r+1,n),t)),DS(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),DS(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=tC(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=tC(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Ane=class{constructor(){this.map=[]}add(e,t,n){jne(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function jne(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 YO(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`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 XO(){return{flow:{null:{name:`table`,tokenize:ZO,resolveAll:QO}}}}function ZO(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):US(t)?JS(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||HS(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,US(t)?JS(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return US(t)?JS(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return US(t)?JS(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):US(n)?JS(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||HS(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function QO(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Ane;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(ek(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.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,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=$O(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=$O(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=$O(f,t,o,i,n,d)):(o[0]=o[1],d=$O(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&ek(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=YO(t.events,n))}return e}function $O(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},tk(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=tk(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=tk(t.events,n[2]),a=tk(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},tk(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function ek(e,t,n,r,i){let a=[],o=tk(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function tk(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var nk={name:`tasklistCheck`,tokenize:ik};function rk(){return{text:{91:nk}}}function ik(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return HS(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):US(r)?e.check({tokenize:ak},t,n)(r):n(r)}}function ak(e,t,n){return JS(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function ok(e){return AS([dne(),xne(),kne(e),XO(),rk()])}var sk={};function ck(e){let t=this,n=e||sk,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ok(n)),a.push(sne()),o.push(cne(n))}function lk({characterCountLabel:e,excerpt:t,kind:n,label:r,location:i,path:a,tooltip:o,onClick:s}){let{Tooltip:c,TooltipContent:l,TooltipProvider:u,TooltipTrigger:d}=fl,f=!!s,p=U(ky,`nextclaw-chat-inline-token mx-[0.08em]`,f?`cursor-pointer transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`:`cursor-default`),m=a||o,h=(0,H.jsx)(My,{excerpt:t,kind:n,label:r,metricLabel:i??e,source:m}),g=f?(0,H.jsx)(`button`,{type:`button`,className:p,onClick:e=>{e.preventDefault(),e.stopPropagation(),s?.()},children:h}):(0,H.jsx)(`span`,{className:p,children:h});return(n===`workspace_excerpt`||n===`conversation_excerpt`)&&t?(0,H.jsx)(Ny,{characterCountLabel:e,excerpt:t,kind:n===`conversation_excerpt`?n:`workspace_file`,label:r,location:i,path:m,children:g}):(0,H.jsx)(u,{delayDuration:250,children:(0,H.jsxs)(c,{children:[(0,H.jsx)(d,{asChild:!0,children:g}),(0,H.jsx)(l,{side:`top`,className:`max-w-[24rem] break-all text-xs`,children:o})]})})}function uk(){return typeof navigator<`u`&&typeof navigator.clipboard?.writeText==`function`}function dk(e){if(typeof document>`u`)return;let t=document.getSelection();t&&(t.removeAllRanges(),e.forEach(e=>t.addRange(e)))}function fk(){let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e:null,n=t?{input:t,start:t.selectionStart,end:t.selectionEnd}:null,r=document.getSelection();return{activeElement:e,activeInputSelection:n,ranges:r?Array.from({length:r.rangeCount},(e,t)=>r.getRangeAt(t).cloneRange()):[]}}function pk(e){let t=document.createElement(`textarea`);return t.value=e,t.setAttribute(`readonly`,``),t.setAttribute(`aria-hidden`,`true`),Object.assign(t.style,{fontSize:`12pt`,left:`-9999px`,opacity:`0`,pointerEvents:`none`,position:`fixed`,top:`0`}),t}function mk(e){try{e.focus({preventScroll:!0})}catch{e.focus()}}function hk(e){mk(e),e.select(),e.setSelectionRange(0,e.value.length)}function gk(){try{return typeof document.execCommand==`function`&&document.execCommand(`copy`)}catch{return!1}}function _k(e){if(!e.activeInputSelection)return!1;let{input:t,start:n,end:r}=e.activeInputSelection;return n===null||r===null?!1:(t.setSelectionRange(n,r),!0)}function vk(e){e.activeElement&&mk(e.activeElement),_k(e)||dk(e.ranges)}function yk(e){if(typeof document>`u`||!document.body)return!1;let t=fk(),n=pk(e);document.body.appendChild(n),hk(n);let r=gk();return n.remove(),vk(t),r}async function bk(e){if(!e)return!1;if(uk())try{return await navigator.clipboard.writeText(e),!0}catch{return yk(e)}return yk(e)}var xk=1300;function Sk(e){let[t,n]=(0,V.useState)(!1),r=(0,V.useCallback)(async()=>{e.text&&(await bk(e.text)?n(!0):n(!1))},[e.text]);return(0,V.useEffect)(()=>{if(!t||typeof window>`u`)return;let r=window.setTimeout(()=>n(!1),e.resetDelayMs??xk);return()=>window.clearTimeout(r)},[t,e.resetDelayMs]),{copied:t,copy:r}}var Ck=e(n(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,ee=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:`\\\\[\\s\\S]`,relevance:0},M={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[j]},N={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[j]},te={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},P=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},ne=P(`//`,`$`),re=P(`/\\*`,`\\*/`),ie=P(`#`,`$`),ae={scope:`number`,begin:D,relevance:0},oe={scope:`number`,begin:O,relevance:0},se={scope:`number`,begin:k,relevance:0},ce={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},le={scope:`title`,begin:T,relevance:0},ue={scope:`title`,begin:E,relevance:0},de={begin:`\\.\\s*`+E,relevance:0},fe=Object.freeze({__proto__:null,APOS_STRING_MODE:M,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:se,BINARY_NUMBER_RE:k,COMMENT:P,C_BLOCK_COMMENT_MODE:re,C_LINE_COMMENT_MODE:ne,C_NUMBER_MODE:oe,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ie,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:de,NUMBER_MODE:ae,NUMBER_RE:D,PHRASAL_WORDS_MODE:te,QUOTE_STRING_MODE:N,REGEXP_MODE:ce,RE_STARTERS_RE:A,SHEBANG:ee,TITLE_MODE:le,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:ue});function pe(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function me(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function he(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=pe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ge(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function _e(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ve(e,t){e.relevance===void 0&&(e.relevance=1)}var ye=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},be=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],xe=`keyword`;function Se(e,t,n=xe){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,Se(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,Ce(n[0],n[1])]})}}function Ce(e,t){return t?Number(t):we(e)?0:1}function we(e){return be.includes(e.toLowerCase())}var Te={},Ee=e=>{console.error(e)},De=(e,...t)=>{console.log(`WARN: ${e}`,...t)},F=(e,t)=>{Te[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Te[`${e}/${t}`]=!0)},Oe=Error();function ke(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function Ae(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ee(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Oe;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Ee(`beginScope must be object`),Oe;ke(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function je(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ee(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Oe;if(typeof e.endScope!=`object`||e.endScope===null)throw Ee(`endScope must be object`),Oe;ke(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Me(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ne(e){Me(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),Ae(e),je(e)}function Pe(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[me,_e,Ne,ye].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[he,ge,ve].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=Se(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ie(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Fe(e){return e?e.endsWithParent||Fe(e.starts):!1}function Ie(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Fe(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Le=`11.11.1`,Re=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},ze=i,Be=a,Ve=Symbol(`nomatch`),He=7,Ue=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=M(n[1]);return t||(De(s.replace(`{}`,n[1])),De(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||M(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(F(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),F(`10.7.0`,`Please use highlight(code, options) instead.
46
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ie(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ie(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){j.addText(N);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(N),n=``;for(;t;){n+=N.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(j.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=He&&(te+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(N)}n+=N.substring(e),j.addText(n)}function f(){if(N===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){j.addText(N);return}e=v(A.subLanguage,N,!0,ee[A.subLanguage]),ee[A.subLanguage]=e._top}else e=S(N,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(te+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),N=``}function m(e,t){e!==``&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(N=i,d(),N=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&j.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(N,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),N=``):e.beginScope._multi&&(h(e.beginScope,t),N=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(N+=e[0],1):(re=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?N+=t:(n.excludeBegin&&(N+=t),p(),!n.returnBegin&&!n.excludeBegin&&(N=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return Ve;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?N+=t:(a.returnEnd||a.excludeEnd||(N+=t),p(),a.excludeEnd&&(N=t));do A.scope&&j.closeNode(),!A.skip&&!A.subLanguage&&(te+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(N+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(N+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==Ve)return e}if(r.type===`illegal`&&a===``)return N+=`
47
+ `,1;if(ne>1e5&&ne>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return N+=a,a.length}let D=M(e);if(!D)throw Ee(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Pe(D),k=``,A=a||O,ee={},j=new l.__emitter(l);w();let N=``,te=0,P=0,ne=0,re=!1;try{if(D.__emitTokens)D.__emitTokens(n,j);else{for(A.matcher.considerAll();;){ne++,re?re=!1:A.matcher.considerAll(),A.matcher.lastIndex=P;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(P,e.index),e);P=e.index+t}E(n.substring(P))}return j.finalize(),k=j.toHTML(),{language:e,value:k,relevance:te,illegal:!1,_emitter:j,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:ze(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:P,context:n.slice(P-100,P+100),mode:t.mode,resultSoFar:k},_emitter:j};if(o)return{language:e,value:ze(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:A};throw t}}function b(e){let t={value:ze(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(M).filter(te).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(M(e.language).supersetOf===t.language)return 1;if(M(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ie(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Re(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ie(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Be(l,e)}let E=()=>{k(),F(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),F(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(Ee(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Ee(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&N(i.aliases,{languageName:n})}function ee(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function M(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function N(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function te(e){let t=M(e);return t&&!t.disableAutodetect}function P(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function ne(e){P(e),a.push(e)}function re(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ie(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ae(e){return F(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),F(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ae,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:ee,listLanguages:j,getLanguage:M,registerAliases:N,autoDetection:te,inherit:Be,addPlugin:ne,removePlugin:re}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Le,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in fe)typeof fe[e]==`object`&&n(fe[e]);return Object.assign(e,fe),e},We=Ue({});We.newInstance=()=>Ue({}),t.exports=We,We.HighlightJS=We,We.default=We}))()).default;function wk(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var Tk=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ek=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Dk=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),Ok=[...Ek,...Dk],kk=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Ak=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),jk=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Mk=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Nk(e){let t=e.regex,n=Tk(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Ak.join(`|`)+`)`},{begin:`:(:)?(`+jk.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Mk.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:kk.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Ok.join(`|`)+`)\\b`}]}}function Pk(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}var Fk=`[A-Za-z$_][0-9A-Za-z$_]*`,Ik=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Lk=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Rk=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),zk=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Bk=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Vk=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],Hk=[].concat(Bk,Rk,zk);function Uk(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Fk,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Fk,keyword:Ik,literal:Lk,built_in:Hk,"variable.language":Vk},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Rk,...zk]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Bk,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ee=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ee,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Wk(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function Gk(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Kk(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function qk(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function Jk(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var Yk=`[A-Za-z$_][0-9A-Za-z$_]*`,Xk=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Zk=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Qk=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),$k=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],eA=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],tA=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],nA=[].concat(eA,Qk,$k);function rA(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Yk,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Yk,keyword:Xk,literal:Zk,built_in:nA,"variable.language":tA},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Qk,...$k]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...eA,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ee=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ee,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function iA(e){let t=e.regex,n=rA(e),r=Yk,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:Yk,keyword:Xk.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:Zk,built_in:nA.concat(i),"variable.language":tA},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function aA(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function oA(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var sA=new Set([`text`,`txt`,`plain`,`plaintext`,`none`,`output`]),cA=[`typescript`,`javascript`,`json`,`bash`,`shell`,`python`,`css`,`xml`,`markdown`,`yaml`,`sql`,`diff`],lA=4,uA=[{name:`typescript`,language:iA,aliases:[`ts`,`tsx`]},{name:`javascript`,language:Uk,aliases:[`js`,`jsx`,`mjs`,`cjs`]},{name:`json`,language:Wk,aliases:[`jsonc`]},{name:`bash`,language:wk,aliases:[`sh`,`zsh`]},{name:`shell`,language:qk,aliases:[`console`,`terminal`]},{name:`python`,language:Kk,aliases:[`py`]},{name:`css`,language:Nk},{name:`xml`,language:aA,aliases:[`html`,`svg`]},{name:`markdown`,language:Gk,aliases:[`md`,`mdx`]},{name:`yaml`,language:oA,aliases:[`yml`]},{name:`sql`,language:Jk},{name:`diff`,language:Pk,aliases:[`patch`]}];function dA(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function fA(e){return e.trim().toLowerCase()}var pA=new class{constructor(){this.highlight=(e,t)=>{let n=fA(t);if(!e||sA.has(n))return this.createPlainTextResult(e,n||`text`);if(this.engine.getLanguage(n)){let t=this.engine.highlight(e,{language:n,ignoreIllegals:!0});return{html:t.value,language:t.language??n,highlighted:!0}}let r=this.engine.highlightAuto(e,cA);return r.language&&r.relevance>=lA?{html:r.value,language:r.language,highlighted:!0}:this.createPlainTextResult(e,n||`text`)},this.createPlainTextResult=(e,t)=>({html:dA(e),language:t,highlighted:!1}),this.engine=Ck.newInstance(),uA.forEach(e=>{this.engine.registerLanguage(e.name,e.language),e.aliases&&this.engine.registerAliases(e.aliases,{languageName:e.name})})}},mA=/language-([a-z0-9-]+)/i;function hA(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(hA).join(``):``}function gA(e){let t=hA(e);return t.endsWith(`
48
+ `)?t.slice(0,-1):t}function _A(e){return(e?mA.exec(e):null)?.[1]?.toLowerCase()||`text`}function vA({className:e,children:t,texts:n}){let r=(0,V.useMemo)(()=>_A(e),[e]),i=(0,V.useMemo)(()=>gA(t),[t]),a=(0,V.useMemo)(()=>pA.highlight(i,r),[i,r]),o=(0,V.useMemo)(()=>{let t=`language-${a.language}`;return U(`hljs`,e,e?.includes(`language-`)?void 0:t)},[e,a.language]),{copied:s,copy:c}=Sk({text:i});return(0,H.jsxs)(`div`,{className:`chat-codeblock`,children:[(0,H.jsxs)(`div`,{className:`chat-codeblock-toolbar`,children:[(0,H.jsx)(`span`,{className:`chat-codeblock-language`,children:r}),(0,H.jsxs)(`button`,{type:`button`,className:`chat-codeblock-copy`,onClick:()=>void c(),"aria-label":s?n.copiedCodeLabel:n.copyCodeLabel,children:[s?(0,H.jsx)(wr,{className:`h-3.5 w-3.5`}):(0,H.jsx)(xa,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:s?n.copiedCodeLabel:n.copyCodeLabel})]})]}),(0,H.jsx)(`pre`,{children:(0,H.jsx)(`code`,{className:o,"data-highlighted":a.highlighted?`true`:`false`,dangerouslySetInnerHTML:{__html:a.html}})})]})}var yA=`nextclaw-inline`,bA=/language-([a-z0-9-]+)/i,xA=new Set([`auto`,`source`,`rendered`]),SA=32,CA=64*1024;function wA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function TA(e){return typeof e==`string`&&e.trim().length>0?e.trim():void 0}function EA(e){return Number.isInteger(e)&&Number(e)>0?Number(e):void 0}function DA(e){let t=TA(e);return t&&xA.has(t)?t:void 0}function OA(e){let{payload:t}=e;return wA(t)?t:null}function kA(e,t){return e===null||typeof e==`string`||typeof e==`boolean`?!0:typeof e==`number`?Number.isFinite(e):t>=SA||typeof e!=`object`?!1:(Array.isArray(e)?e:Object.values(e)).every(e=>kA(e,t+1))}function AA(e){if(e!==void 0)return!wA(e)||!kA(e,0)?null:new TextEncoder().encode(JSON.stringify(e)).byteLength<=CA?e:null}function jA(e){let t=OA(e);if(!t)return null;let n=TA(t.path);if(!n)return null;let r=DA(t.viewer),i=AA(t.params);return i===null||i&&(r===`source`||!/\.html?$/i.test(n))?null:{type:`file`,payload:{path:n,line:EA(t.line),column:EA(t.column),viewer:r,params:i??void 0}}}function MA(e){let t=OA(e);if(!t)return null;let n=TA(t.url);return n?{type:`url`,payload:{url:n}}:null}function NA(e){let t=OA(e);if(!t)return null;let n=TA(t.appId);if(!n)return null;let r=AA(t.params);return r===null?null:{type:`panel_app`,payload:{appId:n,path:TA(t.path),params:r??void 0}}}function PA(e){let t=OA(e);return!t||!(`value`in t)?null:{type:`json`,payload:{value:t.value}}}function FA(e){if(!wA(e))return null;let t=TA(e.type);return t===`file`?jA(e):t===`url`?MA(e):t===`panel_app`?NA(e):t===`json`?PA(e):null}function IA(e){return(e?bA.exec(e):null)?.[1]?.toLowerCase()===yA}function LA(e){let t=e.endsWith(`
49
+ `)?e.slice(0,-1):e,n;try{n=JSON.parse(t)}catch{return null}if(!wA(n))return null;let r=FA(n.target);return r?{target:r,title:TA(n.title),description:TA(n.description)}:null}function RA(e){if(e.title)return e.title;if(e.target.type===`file`){let t=e.target.payload.path.split(`/`).filter(Boolean);return t[t.length-1]??e.target.payload.path}return e.target.type===`url`?e.target.payload.url:e.target.type===`panel_app`?e.target.payload.appId:`JSON`}function zA(e){return e.target.type===`file`?e.target.payload.path:e.target.type===`url`?e.target.payload.url:e.target.type===`panel_app`?e.target.payload.appId:JSON.stringify(e.target.payload.value,null,2)}function BA({display:e}){let t=`h-3.5 w-3.5 shrink-0 text-muted-foreground`;return e.target.type===`file`?(0,H.jsx)(Cn,{className:t,"aria-hidden":!0}):e.target.type===`url`?(0,H.jsx)(qa,{className:t,"aria-hidden":!0}):e.target.type===`panel_app`?(0,H.jsx)(Ur,{className:t,"aria-hidden":!0}):(0,H.jsx)(va,{className:t,"aria-hidden":!0})}function VA(e){return e.length>1200?`${e.slice(0,1200)}\n...`:e}function HA({display:e}){let t=RA(e),n=zA(e),r=e.target.type===`json`?VA(n):n;return(0,H.jsxs)(`section`,{className:U(`my-2 max-w-full border-l-2 border-border bg-muted/30 px-3 py-2`,`text-xs leading-relaxed text-foreground`),"data-nextclaw-inline-display":`true`,"data-nextclaw-inline-display-type":e.target.type,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(BA,{display:e}),(0,H.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:t})]}),e.description?(0,H.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[12px] text-muted-foreground`,children:e.description}):null,(0,H.jsx)(`pre`,{className:U(`mt-1 max-h-40 overflow-auto whitespace-pre-wrap break-words`,`font-mono text-[11px] leading-relaxed text-muted-foreground`),children:r})]})}function UA({display:e,renderInlineDisplay:t}){let n=t?.(e);return n==null?(0,H.jsx)(HA,{display:e}):(0,H.jsx)(H.Fragment,{children:n})}var WA=.5,GA=4,KA=.25;function qA({actions:e,className:t}){return(0,H.jsx)(`div`,{"data-chat-message-preview-toolbar":`true`,className:U(`absolute right-2 top-2 z-10 flex items-center gap-0.5 rounded-lg bg-black/55 p-1 text-white opacity-80 shadow-lg backdrop-blur-md transition-opacity duration-150 hover:opacity-100 focus-within:opacity-100`,t),children:e.map(e=>(0,H.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,disabled:e.disabled,className:`inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/80 disabled:cursor-not-allowed disabled:opacity-40`,onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onSelect()},children:e.icon},e.id))})}function JA({actions:e=[],children:t,closeLabel:n,label:r,onClose:i,resetZoomLabel:a=`Reset zoom`,zoomInLabel:o=`Zoom in`,zoomOutLabel:s=`Zoom out`}){let c=(0,V.useRef)(null),[l,u]=(0,V.useState)(!1),[d,f]=(0,V.useState)({scale:1,x:0,y:0}),p=(0,V.useCallback)(()=>{f({scale:1,x:0,y:0})},[]),m=(0,V.useCallback)((e,t={x:0,y:0})=>{f(n=>{let r=typeof e==`function`?e(n.scale):e,i=Math.min(GA,Math.max(WA,r));if(i<=1)return{scale:i,x:0,y:0};let a=i/n.scale;return{scale:i,x:t.x-(t.x-n.x)*a,y:t.y-(t.y-n.y)*a}})},[]);(0,V.useEffect)(()=>{let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=e=>{if(e.key===`Escape`){e.preventDefault(),i();return}e.key===`+`||e.key===`=`?(e.preventDefault(),m(e=>e+KA)):e.key===`-`?(e.preventDefault(),m(e=>e-KA)):e.key===`0`&&(e.preventDefault(),p())};return window.addEventListener(`keydown`,t),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,t)}},[m,i,p]);let h=e=>{d.scale<=1||e.button!==0||(e.currentTarget.setPointerCapture(e.pointerId),c.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,x:d.x,y:d.y},u(!0))},g=e=>{let t=c.current;!t||t.pointerId!==e.pointerId||f(n=>({...n,x:t.x+e.clientX-t.startX,y:t.y+e.clientY-t.startY}))},_=e=>{c.current?.pointerId===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),c.current=null,u(!1))},v=e=>{e.preventDefault();let t=e.currentTarget.getBoundingClientRect();m(t=>t+(e.deltaY<0?KA:-KA),{x:e.clientX-t.left-t.width/2,y:e.clientY-t.top-t.height/2})},y=`${Math.round(d.scale*100)}%`,b=[...e,{id:`close`,label:n,icon:(0,H.jsx)(hi,{className:`h-4 w-4`,strokeWidth:2}),onSelect:i}];return(0,uy.createPortal)((0,H.jsxs)(`div`,{role:`dialog`,"aria-label":r,"aria-modal":`true`,className:`fixed inset-0 z-[var(--z-modal,10050)] overflow-hidden bg-black/90 backdrop-blur-[2px]`,onClick:i,children:[(0,H.jsx)(qA,{actions:b,className:`right-4 top-4 opacity-100`}),(0,H.jsx)(`div`,{"data-chat-message-lightbox-viewport":`true`,className:U(`absolute inset-0 flex touch-none select-none items-center justify-center overflow-hidden p-6 sm:p-12`,d.scale>1&&(l?`cursor-grabbing`:`cursor-grab`)),onClick:e=>e.stopPropagation(),onDoubleClick:()=>{d.scale===1?m(2):p()},onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,onWheel:v,children:(0,H.jsx)(`div`,{"data-chat-message-lightbox-content":`true`,className:U(`flex h-full w-full items-center justify-center will-change-transform`,!l&&`transition-transform duration-150 ease-out`),style:{transform:`translate3d(${d.x}px, ${d.y}px, 0) scale(${d.scale})`},children:t})}),(0,H.jsxs)(`div`,{className:`absolute bottom-5 left-1/2 z-10 flex -translate-x-1/2 items-center gap-0.5 rounded-xl bg-black/60 p-1 text-white shadow-xl backdrop-blur-md`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":s,title:s,disabled:d.scale<=WA,className:`inline-flex h-9 w-9 items-center justify-center rounded-lg transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/80 disabled:cursor-not-allowed disabled:opacity-40`,onClick:e=>{e.stopPropagation(),m(e=>e-KA)},children:(0,H.jsx)(io,{className:`h-4 w-4`,strokeWidth:2})}),(0,H.jsx)(`output`,{"aria-label":y,className:`inline-flex h-9 min-w-16 items-center justify-center px-2 text-xs font-medium tabular-nums`,children:y}),(0,H.jsx)(`button`,{type:`button`,"aria-label":o,title:o,disabled:d.scale>=GA,className:`inline-flex h-9 w-9 items-center justify-center rounded-lg transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/80 disabled:cursor-not-allowed disabled:opacity-40`,onClick:e=>{e.stopPropagation(),m(e=>e+KA)},children:(0,H.jsx)(pi,{className:`h-4 w-4`,strokeWidth:2})}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`mx-0.5 h-5 w-px bg-white/20`}),(0,H.jsx)(`button`,{type:`button`,"aria-label":a,title:a,disabled:d.scale===1&&d.x===0&&d.y===0,className:`inline-flex h-9 w-9 items-center justify-center rounded-lg transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-white/80 disabled:cursor-not-allowed disabled:opacity-40`,onClick:e=>{e.stopPropagation(),p()},children:(0,H.jsx)(Co,{className:`h-4 w-4`,strokeWidth:2})})]})]}),document.body)}var YA=200,XA=null;function ZA(){return XA??=ae(()=>import(`./mermaid.core-ySrvolIe.js`).then(e=>e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),XA}function QA(){if(typeof document>`u`)return`default`;let e=document.documentElement;return e.getAttribute(`data-theme-appearance`)===`dark`||e.classList.contains(`dark`)?`dark`:`default`}function $A(){let[e,t]=(0,V.useState)(QA);return(0,V.useEffect)(()=>{let e=document.documentElement,n=new MutationObserver(()=>t(QA()));return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme-appearance`]}),()=>n.disconnect()},[]),e}function ej({isStreaming:e,source:t,texts:n}){let r=(0,V.useId)().replace(/[^a-zA-Z0-9_-]/g,``),i=(0,V.useRef)(0),a=$A(),o=t.trim(),s=`${a}:${o}`,c=(0,V.useRef)({isFinal:!e,key:s,source:o,theme:a}),l=(0,V.useRef)(null),u=(0,V.useRef)(!1),d=(0,V.useRef)(Date.now()),f=(0,V.useRef)(!0),[p,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(null),[_,v]=(0,V.useState)(null),y=n.mermaidDiagramLabel??`Mermaid diagram`,b=n.mermaidExpandLabel??`Expand diagram`,x=n.attachmentCloseLabel??`Close preview`,S=n.mermaidLoadingLabel??`Rendering diagram…`,C=n.mermaidRenderErrorLabel??`Diagram could not be rendered`,{copied:w,copy:T}=Sk({text:o}),E=w?n.copiedCodeLabel:n.copyCodeLabel,D=(0,V.useCallback)(e=>{if(!f.current||u.current)return;if(l.current!==null){if(!e)return;window.clearTimeout(l.current),l.current=null}let t=Date.now()-d.current,n=e?0:Math.max(0,YA-t);l.current=window.setTimeout(()=>{l.current=null,g(c.current)},n)},[]);(0,V.useEffect)(()=>(f.current=!0,()=>{f.current=!1,l.current!==null&&(window.clearTimeout(l.current),l.current=null)}),[]),(0,V.useEffect)(()=>{c.current={isFinal:!e,key:s,source:o,theme:a},D(!e)},[e,o,s,D,a]),(0,V.useEffect)(()=>{if(!h)return;let e=!0;return(async()=>{u.current=!0,d.current=Date.now();try{let t=await ZA();if(!e||!f.current)return;i.current+=1;let n=`nextclaw-mermaid-${r}-${i.current}`;t.initialize({securityLevel:`strict`,startOnLoad:!1,suppressErrorRendering:!0,theme:h.theme});let a=await t.parse(h.source,{suppressErrors:!0});if(!e||!f.current)return;if(!a)throw Error(`Invalid Mermaid diagram`);let{svg:o}=await t.render(n,h.source);e&&f.current&&c.current.theme===h.theme&&v({key:h.key,status:`rendered`,svg:o})}catch{e&&f.current&&h.isFinal&&c.current.key===h.key&&v({key:h.key,status:`error`})}finally{u.current=!1;let t=c.current;e&&f.current&&(t.key!==h.key||t.isFinal!==h.isFinal)&&D(t.isFinal)}})(),()=>{e=!1}},[r,h,D]);let O=_?.key===s?_:null;if(O?.status===`error`)return(0,H.jsxs)(`div`,{"data-chat-mermaid-error":`true`,className:`my-3 overflow-hidden rounded-xl border border-border bg-muted/25`,children:[(0,H.jsx)(`div`,{className:`border-b border-border px-3 py-2 text-xs text-muted-foreground`,children:C}),(0,H.jsx)(vA,{className:`language-mermaid`,texts:n,children:o})]});let k=_?.status===`rendered`?_:null;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`figure`,{"aria-label":y,"aria-busy":!O,"data-chat-mermaid-diagram":`true`,"data-chat-mermaid-pending":!k||void 0,"data-chat-mermaid-updating":!O||void 0,className:k?`group/mermaid relative my-3 min-h-24 overflow-auto py-2`:`my-3 flex min-h-14 items-center justify-center rounded-xl bg-muted/20 px-3 py-2`,children:k?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":b,title:b,className:`relative block min-w-full cursor-zoom-in border-0 bg-transparent p-0 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>m(!0),children:(0,H.jsx)(`span`,{className:`block min-w-fit [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:k.svg}})}),(0,H.jsx)(qA,{actions:[{id:`copy-source`,label:E,icon:w?(0,H.jsx)(wr,{className:`h-4 w-4`,strokeWidth:2}):(0,H.jsx)(xa,{className:`h-4 w-4`,strokeWidth:2}),onSelect:()=>void T()},{id:`expand`,label:b,icon:(0,H.jsx)(Da,{className:`h-4 w-4`,strokeWidth:2}),onSelect:()=>m(!0)}]})]}):(0,H.jsxs)(`div`,{role:`status`,className:`inline-flex items-center gap-2 text-xs font-medium text-muted-foreground/80`,children:[(0,H.jsx)(fi,{"aria-hidden":`true`,className:`h-3.5 w-3.5 animate-spin motion-reduce:animate-none`}),(0,H.jsx)(`span`,{children:S})]})}),p&&k?(0,H.jsx)(JA,{closeLabel:x,label:y,onClose:()=>m(!1),zoomInLabel:n.previewZoomInLabel,zoomOutLabel:n.previewZoomOutLabel,resetZoomLabel:n.previewResetZoomLabel,actions:[{id:`copy-source`,label:E,icon:w?(0,H.jsx)(wr,{className:`h-4 w-4`,strokeWidth:2}):(0,H.jsx)(xa,{className:`h-4 w-4`,strokeWidth:2}),onSelect:()=>void T()}],children:(0,H.jsx)(`div`,{"data-chat-mermaid-expanded-canvas":`true`,className:`h-full w-full overflow-hidden rounded-xl bg-background p-4 shadow-2xl [&_svg]:mx-auto [&_svg]:!h-full [&_svg]:!w-full [&_svg]:!max-w-none`,dangerouslySetInnerHTML:{__html:k.svg}})}):null]})}function tj({alt:e,expandLabel:t,closeLabel:n,resetZoomLabel:r,sizeLabel:i,src:a,zoomInLabel:o,zoomOutLabel:s}){let[c,l]=(0,V.useState)(!1),u=()=>l(!0);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{"data-chat-message-image-preview":!0,className:`group/image relative block w-fit max-w-[min(100%,32rem)] overflow-hidden rounded-lg`,children:[(0,H.jsx)(`button`,{type:`button`,className:`block w-fit max-w-[min(100%,32rem)] text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:u,onDoubleClick:e=>{e.preventDefault(),u()},"aria-label":t,children:(0,H.jsx)(`img`,{src:a,alt:e,className:`block h-auto w-auto max-h-[26rem] max-w-full rounded-lg bg-transparent object-contain`})}),(0,H.jsx)(qA,{actions:[{id:`expand`,label:t,icon:(0,H.jsx)(Da,{className:`h-4 w-4`,strokeWidth:2}),onSelect:u}]}),i?(0,H.jsx)(`span`,{className:`pointer-events-none absolute inset-x-0 bottom-0 flex items-end justify-start bg-gradient-to-t from-black/50 via-black/15 to-transparent px-2.5 pb-2 pt-8 opacity-0 transition-opacity duration-150 group-hover/image:opacity-100 group-focus-within/image:opacity-100`,children:(0,H.jsx)(`span`,{className:`inline-flex items-center rounded-md bg-black/40 px-1.5 py-0.5 text-[10px] font-medium text-white/95 backdrop-blur-sm`,children:i})}):null]}),c?(0,H.jsx)(JA,{closeLabel:n,label:e,onClose:()=>l(!1),resetZoomLabel:r,zoomInLabel:o,zoomOutLabel:s,children:(0,H.jsx)(`img`,{src:a,alt:e,className:`max-h-full max-w-full object-contain shadow-2xl`})}):null]})}var nj=new Set([`http:`,`https:`,`mailto:`,`tel:`]),rj=/^[a-zA-Z][a-zA-Z\d+.-]*:/,ij=/^[a-z]:[\\/]/i,aj=/^\/[a-z]:[\\/]/i,oj=`file:`;function sj(e){return!e.startsWith(`//`)&&!rj.test(e)}function cj(e){let t=Number(e);return Number.isSafeInteger(t)&&t>0?t:void 0}function lj(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==oj||t.hostname&&t.hostname.toLowerCase()!==`localhost`)return null;let n;try{n=decodeURIComponent(t.pathname)}catch{return null}return aj.test(n)&&(n=n.slice(1)),n?{path:n,query:t.searchParams,fragment:t.hash.slice(1)}:null}function uj(e){let t=e.indexOf(`#`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):``,i=n.indexOf(`?`),a=i>=0?n.slice(0,i):n,o=i>=0?n.slice(i+1):``,s;try{s=decodeURIComponent(a)}catch{return null}return s?{path:s,query:new URLSearchParams(o),fragment:r}:null}function dj(e){let t=/^L(\d+)(?:C(\d+))?(?:-L\d+(?:C\d+)?)?$/i.exec(e),n=cj(t?.[1]);return{line:n,column:n?cj(t?.[2]):void 0}}function fj(e){if(ij.test(e)||sj(e))return e;try{let t=new URL(e);return nj.has(t.protocol)||t.protocol===oj&&lj(e)?e:``}catch{return``}}function pj(e){return e&&fj(e)||null}function mj(e){return/^https?:\/\//i.test(e)}function hj(e){let t=e.toLowerCase().startsWith(oj)?lj(e):uj(e),n=t?.path;if(!n||n.startsWith(`#`)||n.startsWith(`//`)||!ij.test(n)&&rj.test(n))return null;let r=t.query.get(`viewer`),i=dj(t.fragment),a=/^(.*?)(?::(\d+)(?::(\d+))?)$/.exec(n),o=a?.[1]??n,s=i.line??cj(a?.[2]),c=i.column??(s?cj(a?.[3]):void 0);return{path:o,label:o.split(/[\\/]/).filter(Boolean).pop()??o,viewMode:`preview`,...r===`source`||r===`rendered`?{previewViewer:r}:{},...typeof s==`number`?{line:s}:{},...typeof c==`number`?{column:c}:{}}}var gj=`data-chat-inline-token-kind`,_j=`data-chat-inline-token-key`,vj=`data-chat-inline-token-ref`,yj=`data-chat-inline-token-name`,bj=`data-chat-inline-token-source`,xj=`data-chat-inline-token-path`,Sj=`data-chat-inline-token-label`,Cj=`data-chat-inline-token-raw-text`,wj=`data-chat-inline-token-excerpt`,Tj=`data-chat-inline-token-message-id`,Ej=`data-chat-inline-token-role`,Dj=`data-chat-inline-token-start-line`,Oj=`data-chat-inline-token-end-line`;function kj(e){return e.filter(e=>e.rawText).sort((e,t)=>t.rawText.length-e.rawText.length)}function Aj(e){let t={[gj]:e.kind,[Sj]:e.label,[Cj]:e.rawText};return`ref`in e?(t[vj]=e.ref,t[yj]=e.name,e.source&&(t[bj]=e.source),e.path&&(t[xj]=e.path)):(t[_j]=e.key,e.kind===`workspace_excerpt`&&`path`in e?(t[xj]=e.path,t[wj]=e.excerpt,e.startLine!==null&&(t[Dj]=String(e.startLine)),e.endLine!==null&&(t[Oj]=String(e.endLine))):e.kind===`conversation_excerpt`&&`messageId`in e&&(t[wj]=e.excerpt,t[Tj]=e.messageId,t[Ej]=e.role)),{type:`chatInlineToken`,data:{hName:`span`,hProperties:t,hChildren:[{type:`text`,value:e.label}]}}}function jj(e,t,n){let r=null;for(let i of n){let n=e.indexOf(i.rawText,t);n<0||(!r||n<r.index||n===r.index&&i.rawText.length>r.token.rawText.length)&&(r={index:n,token:i})}return r}var Mj=class{constructor(e){this.tokens=e,this.occurrenceCounts=new Map,this.transform=e=>e.type===`code`||e.type===`inlineCode`||!e.children?e:{...e,children:e.children.flatMap(e=>e.type===`text`&&typeof e.value==`string`?this.splitTextNode(e.value):[this.transform(e)])},this.splitTextNode=e=>{let t=[],n=0;for(;n<e.length;){let r=jj(e,n,this.tokens);if(!r){t.push({type:`text`,value:e.slice(n)});break}r.index>n&&t.push({type:`text`,value:e.slice(n,r.index)});let i=this.tokens.filter(e=>e.rawText===r.token.rawText),a=this.occurrenceCounts.get(r.token.rawText)??0,o=i[Math.min(a,i.length-1)]??r.token;this.occurrenceCounts.set(r.token.rawText,a+1),t.push(Aj(o)),n=r.index+r.token.rawText.length}return t.length>0?t:[{type:`text`,value:e}]}}};function Nj(e){let t=kj(e);return()=>e=>t.length>0?new Mj(t).transform(e):e}function Pj(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:null}function Fj(e){let t=Pj(e,bj);return t===`builtin`||t===`global`||t===`project`||t===`workspace`?t:null}function Ij(e,t){let n=Number(Pj(e,t));return Number.isInteger(n)&&n>0?n:null}function Lj(e){let t=Pj(e,gj),n=Pj(e,Sj),r=Pj(e,Cj);if(t===`skill`&&n&&r){let i=Pj(e,vj),a=Pj(e,yj);return i&&a?{kind:t,ref:i,name:a,source:Fj(e),path:Pj(e,xj),label:n,rawText:r}:null}let i=Pj(e,_j);if(t===`workspace_excerpt`&&i&&n&&r){let a=Pj(e,xj),o=Pj(e,wj);return a&&o?{kind:t,key:i,path:a,label:n,excerpt:o,startLine:Ij(e,Dj),endLine:Ij(e,Oj),rawText:r}:null}if(t===`conversation_excerpt`&&i&&n&&r){let a=Pj(e,wj),o=Pj(e,Tj),s=Pj(e,Ej);return a&&o&&(s===`assistant`||s===`user`)?{kind:t,key:i,messageId:o,role:s,label:n,excerpt:a,rawText:r}:null}return t&&i&&n&&r?{kind:t,key:i,label:n,rawText:r}:null}var Rj=14e4;function zj(e){return e.length<=Rj?e:`${e.slice(0,Rj)}\n\n...`}function Bj(e){let t=0;for(let n of e?.children??[]){if(n.type===`text`){let e=n.value??``;if(e.trim().length>0||e.includes(`
50
+ `)||e.includes(`\r`))return!1;continue}if(n.tagName!==`img`)return!1;t+=1}return t>=3}var Vj=(0,V.createContext)(null);function Hj(){let e=(0,V.useContext)(Vj);if(!e)throw Error(`Chat message Markdown renderer requires its runtime context`);return e}var Uj={p:function({node:e,children:t}){let{inline:n}=Hj();return n?(0,H.jsx)(H.Fragment,{children:t}):(0,H.jsx)(`p`,{"data-chat-image-row":Bj(e)?`three-column`:void 0,children:t})},span:function({node:e,children:t,...n}){let{onInlineTokenClick:r,texts:i}=Hj(),a=Lj(n);if(a){let e=`excerpt`in a?a:null,t=a.kind===`workspace_excerpt`&&`path`in a?a:null;return(0,H.jsx)(lk,{characterCountLabel:t?i.excerptCharacterCountTemplate?.replace(`{count}`,String(jy(t.excerpt))):void 0,excerpt:e?.excerpt,kind:a.kind,label:a.label,location:t?.startLine?t.startLine===t.endLine||!t.endLine?`L${t.startLine}`:`L${t.startLine}–${t.endLine}`:void 0,path:t?.path,tooltip:`ref`in a?a.name:a.key,onClick:r&&a.kind!==`conversation_excerpt`?()=>r(a):void 0})}return(0,H.jsx)(`span`,{...n,children:t})},a:function({node:e,href:t,children:n,...r}){let{onFileOpen:i}=Hj(),a=pj(t),o=a?mj(a):!1,s=o?null:a?hj(a):null,c=e=>{if(!a){e.preventDefault();return}!i||!s||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),i(s))};return(0,H.jsx)(`a`,{...r,className:U(r.className,!a&&`chat-link-invalid`),href:a??`#`,"aria-disabled":!a||void 0,onClick:c,target:o?`_blank`:void 0,rel:o?`noreferrer noopener`:void 0,children:n})},table:function({node:e,children:t,...n}){return(0,H.jsx)(`div`,{className:`chat-table-wrap`,children:(0,H.jsx)(`table`,{...n,children:t})})},input:function({node:e,type:t,checked:n,...r}){return t===`checkbox`?(0,H.jsx)(`input`,{...r,type:`checkbox`,checked:n,readOnly:!0,disabled:!0,className:`chat-task-checkbox`}):(0,H.jsx)(`input`,{...r,type:t})},img:function({node:e,src:t,alt:n}){let{resolveFileContentUrl:r,texts:i}=Hj(),a=pj(t);if(!a)return null;let o=hj(a),s=o&&r?r(o):a;return s?(0,H.jsx)(tj,{alt:n||``,closeLabel:i.attachmentCloseLabel??`Close preview`,expandLabel:i.attachmentExpandLabel??`Expand image`,resetZoomLabel:i.previewResetZoomLabel,sizeLabel:null,src:s,zoomInLabel:i.previewZoomInLabel,zoomOutLabel:i.previewZoomOutLabel}):null},code:function({node:e,className:t,children:n,...r}){let{isStreaming:i,renderInlineDisplay:a,texts:o}=Hj(),s=String(n??``);if(!t&&!s.includes(`
51
+ `))return(0,H.jsx)(`code`,{...r,className:U(`chat-inline-code`,t),children:n});let c=IA(t)?LA(s):null;return c?(0,H.jsx)(UA,{display:c,renderInlineDisplay:a}):t?.split(` `).includes(`language-mermaid`)?(0,H.jsx)(ej,{isStreaming:i,source:s,texts:o}):(0,H.jsx)(vA,{className:t,texts:o,children:n})}};function Wj({text:e,role:t,texts:n,inline:r=!1,isStreaming:i=!1,inlineTokens:a,onFileOpen:o,onInlineTokenClick:s,resolveFileContentUrl:c,renderInlineDisplay:l}){let u=t===`user`,d=a?.length?[ck,Nj(a)]:[ck],f=r?`span`:`div`;return(0,H.jsx)(Vj.Provider,{value:{inline:r,isStreaming:i,isUser:u,onFileOpen:o,onInlineTokenClick:s,renderInlineDisplay:l,resolveFileContentUrl:c,texts:n},children:(0,H.jsx)(f,{className:U(`chat-markdown`,u?`chat-markdown-user`:`chat-markdown-assistant`),children:(0,H.jsx)(xD,{skipHtml:!0,remarkPlugins:d,components:Uj,urlTransform:fj,children:zj(e)})})})}var Gj={archive:`bg-muted text-muted-foreground`,audio:`bg-muted text-muted-foreground`,code:`bg-muted text-muted-foreground`,data:`bg-muted text-muted-foreground`,document:`bg-muted text-muted-foreground`,generic:`bg-muted text-muted-foreground`,image:`bg-muted text-muted-foreground`,pdf:`bg-muted text-muted-foreground`,sheet:`bg-muted text-muted-foreground`,video:`bg-muted text-muted-foreground`},Kj=new Set([`c`,`cpp`,`css`,`go`,`html`,`java`,`js`,`jsx`,`md`,`php`,`py`,`rb`,`rs`,`sh`,`sql`,`svg`,`ts`,`tsx`]),qj=new Set([`graphql`,`json`,`toml`,`xml`,`yaml`,`yml`]),Jj=new Set([`avif`,`bmp`,`gif`,`heic`,`heif`,`ico`,`jpeg`,`jpg`,`png`,`svg`,`tif`,`tiff`,`webp`]),Yj=new Set([`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]),Xj=new Set([`avi`,`m4v`,`mov`,`mp4`,`mkv`,`webm`,`wmv`]),Zj=new Set([`doc`,`docx`,`odt`,`pages`,`rtf`,`txt`]),Qj=new Set([`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]),$j=new Set([`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]);function eM(e){if(!Number.isFinite(e)||e==null||e<0)return null;if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=n>=10||r===0?0:1;return`${n.toFixed(i).replace(/\.0$/,``)} ${t[r]}`}function tM(e,t){let n=nM(e);if(n)return n.toUpperCase();let r=(t.split(`/`)[1]??``).split(/[+.;-]/)[0]?.trim();return r?r.slice(0,6).toUpperCase():`FILE`}function nM(e){return/\.([a-z0-9]{1,12})$/i.exec(e.trim())?.[1]?.toLowerCase()??``}function rM(e){return typeof e==`string`&&/^data:image\//i.test(e.trim())}function iM(e){return Jj.has(e)?e===`jpg`||e===`jpeg`?`image/jpeg`:e===`svg`?`image/svg+xml`:`image/${e}`:Yj.has(e)?e===`mp3`?`audio/mpeg`:e===`m4a`?`audio/mp4`:e===`weba`?`audio/webm`:`audio/${e}`:Xj.has(e)?e===`mov`?`video/quicktime`:e===`m4v`?`video/mp4`:`video/${e}`:e===`pdf`?`application/pdf`:null}function aM(e){let t=nM(e);return t?iM(t):null}function oM(e){let t=e.mimeType.trim().toLowerCase();return t.length>0&&t!==`application/octet-stream`?t:aM(e.label)}function sM(e){let t=e.mimeType.trim().toLowerCase(),n=nM(e.label);return e.isImage||t.startsWith(`image/`)||Jj.has(n)||rM(e.dataUrl)}function cM(e,t){let n=nM(e),r=t.toLowerCase();return r.startsWith(`image/`)||Jj.has(n)?`image`:r.startsWith(`audio/`)||Yj.has(n)?`audio`:r.startsWith(`video/`)||Xj.has(n)?`video`:r.includes(`pdf`)||n===`pdf`?`pdf`:$j.has(n)||/(zip|tar|gzip|rar|compressed|archive)/.test(r)?`archive`:Qj.has(n)||/(spreadsheet|sheet|excel|csv)/.test(r)?`sheet`:qj.has(n)||/(json|xml|yaml|toml)/.test(r)?`data`:Kj.has(n)||/(javascript|typescript|jsx|tsx|css|html)/.test(r)?`code`:Zj.has(n)||/(msword|document|opendocument|rtf|text\/)/.test(r)?`document`:`generic`}function lM(e){let t=cM(e.label,e.mimeType),n=eM(e.sizeBytes);return{category:t,extension:tM(e.label,e.mimeType),sizeLabel:n}}var uM={archive:`Archive`,audio:`Audio`,code:`Code file`,data:`Data file`,document:`Document`,generic:`File`,image:`Image`,pdf:`PDF document`,sheet:`Spreadsheet`,video:`Video`},dM={archive:ka,audio:Aa,code:ja,data:Na,document:Cn,generic:La,image:Ma,pdf:Cn,sheet:Fa,video:Ia};function fM(e,t){return t?.attachmentCategoryLabels?.[e]??uM[e]}function pM(e,t,n){return(0,H.jsx)(`div`,{className:U(`mt-0.5 text-[11px] leading-4`,n?`text-foreground/55`:`text-muted-foreground`),children:t?`${e} · ${t}`:e})}function mM(e,t,n){return(0,H.jsx)(`span`,{className:U(`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-medium`,n?t?`bg-black/5 text-foreground/75`:`bg-muted text-muted-foreground`:t?`bg-black/[0.03] text-foreground/45`:`bg-muted/70 text-muted-foreground/70`),children:e})}function hM(e){let{label:t,href:n,isUser:r,onOpen:i}=e,a=U(`inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors`,r?`bg-black/5 text-foreground/75 hover:bg-black/10 hover:text-foreground`:`bg-muted text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-foreground`);return i?(0,H.jsx)(`button`,{type:`button`,className:a,onClick:e=>{e.preventDefault(),e.stopPropagation(),i()},children:t}):n?(0,H.jsx)(`a`,{href:n,target:`_blank`,rel:`noreferrer`,className:a,children:t}):mM(t,r,!1)}function gM({category:e,isUser:t}){let n=dM[e];return(0,H.jsx)(`div`,{className:U(`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,t?`bg-black/5 text-foreground/70`:Gj[e]),children:(0,H.jsx)(n,{className:U(`h-4 w-4`,t?`text-foreground/70`:`text-current`),strokeWidth:2})})}function _M(e){let{category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:o}=e;return(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 px-2.5 py-2`,children:[(0,H.jsx)(gM,{category:t,isUser:a}),(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`truncate text-[13px] font-medium leading-5`,children:n.label}),pM(r,i,a)]}),o]})})]})}function vM(e){let{category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,shellClasses:o,actionLabel:s,onOpen:c}=e;if(!n.dataUrl||t!==`audio`&&t!==`video`)return null;let l=oM(n);return(0,H.jsxs)(`div`,{className:o,children:[_M({category:t,file:n,categoryLabel:r,sizeLabel:i,isUser:a,action:hM({label:s,href:n.dataUrl,isUser:a,onOpen:c?()=>c(n):void 0})}),(0,H.jsx)(`div`,{className:`px-2.5 pb-2.5`,children:t===`audio`?(0,H.jsx)(`audio`,{controls:!0,preload:`metadata`,"aria-label":n.label,className:`block w-full`,children:(0,H.jsx)(`source`,{src:n.dataUrl,...l?{type:l}:{}})}):(0,H.jsx)(`div`,{className:U(`overflow-hidden rounded-lg`,a?`bg-black/10`:`bg-muted ring-1 ring-border/70`),children:(0,H.jsx)(`video`,{controls:!0,preload:`metadata`,playsInline:!0,"aria-label":n.label,className:`block max-h-[28rem] w-full bg-black`,children:(0,H.jsx)(`source`,{src:n.dataUrl,...l?{type:l}:{}})})})})]})}function yM({file:e,isUser:t=!1,texts:n,onOpen:r}){let{category:i,sizeLabel:a}=lM(e),o=sM(e)&&!!e.dataUrl,s=i===`audio`&&!!e.dataUrl,c=i===`video`&&!!e.dataUrl,l=!!e.dataUrl,u=l?n?.attachmentOpenLabel??`Open`:n?.attachmentAttachedLabel??`Attached`,d=n?.attachmentExpandLabel??`Expand image`,f=n?.attachmentCloseLabel??`Close preview`,p=fM(i,n),m=U(`block overflow-hidden rounded-xl border transition-colors`,t?`border-black/8 bg-black/[0.03] text-foreground`:`border-border/70 bg-card text-card-foreground`,l&&(t?`hover:bg-black/[0.05]`:`hover:bg-muted/50`));if(o&&e.dataUrl)return(0,H.jsx)(tj,{alt:e.label,expandLabel:d,closeLabel:f,resetZoomLabel:n?.previewResetZoomLabel,sizeLabel:a,src:e.dataUrl,zoomInLabel:n?.previewZoomInLabel,zoomOutLabel:n?.previewZoomOutLabel});if(s||c)return vM({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,shellClasses:m,actionLabel:u,onOpen:r});let h=_M({category:i,file:e,categoryLabel:p,sizeLabel:a,isUser:t,action:mM(u,t,l)});return!l||!e.dataUrl?(0,H.jsx)(`div`,{className:m,children:h}):r?(0,H.jsx)(`button`,{type:`button`,className:U(m,`group w-full text-left`),onClick:()=>r(e),children:h}):(0,H.jsx)(`a`,{href:e.dataUrl,target:`_blank`,rel:`noreferrer`,className:U(m,`group`),children:h})}function bM({group:e,indexOffset:t,isUser:n,texts:r,onOpen:i}){return(0,H.jsx)(`div`,{"data-chat-message-image-row":`three-column`,"data-chat-message-wide-content":`true`,className:`grid w-full grid-cols-3 items-start gap-3`,children:e.items.map(({index:e,part:a})=>(0,H.jsx)(yM,{file:a.file,isUser:n,texts:r,onOpen:i},`file-${t+e}`))})}function xM(e){return!!(e?.kind===`part`&&e.part.type===`file`&&e.part.file.isImage&&e.part.file.dataUrl)}function SM(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(!xM(r)){r&&t.push(r),n+=1;continue}let i=n,a=[];for(;xM(e[n]);)a.push(e[n]),n+=1;if(a.length<3){t.push(...a);continue}t.push({kind:`image-group`,key:`image-group-${i}`,items:a})}return t}function CM(e){let{isInProgress:t}=e,[n,r]=(0,V.useState)(t),[i,a]=(0,V.useState)(!1),o=(0,V.useRef)(t);(0,V.useEffect)(()=>{let e=o.current;!e&&t?(r(!0),a(!1)):e&&!t&&!i&&r(!1),o.current=t},[t,i]);function s(e){e.preventDefault();let i=!n;if(r(i),!i){a(!1);return}t&&a(!0)}return{isOpen:n,onSummaryClick:s}}var wM=10;function TM({contentRef:e,contentVersion:t,hasContent:n,isLoading:r,resetKey:i,scrollRef:a,stickyThresholdPx:o}){let[s,c]=(0,V.useState)(!0),l=(0,V.useRef)(!0),u=(0,V.useRef)(null),d=(0,V.useRef)(!1),f=(0,V.useRef)(null),p=(0,V.useCallback)(e=>{l.current=e,c(e)},[]),m=(0,V.useCallback)(e=>e.scrollHeight-e.scrollTop-e.clientHeight<=(o??wM),[o]),h=(0,V.useCallback)(()=>{let e=f.current;e!==null&&(cancelAnimationFrame(e),f.current=null)},[]),g=(0,V.useCallback)((e=`auto`)=>{a.current&&(h(),f.current=requestAnimationFrame(()=>{f.current=null;let t=a.current;t&&(typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:e}):t.scrollTop=t.scrollHeight)}))},[h,a]),_=(0,V.useCallback)(()=>{p(!0),g()},[g,p]),v=(0,V.useCallback)(()=>{let e=a.current;if(!e)return;let t=m(e);t||h(),p(t)},[h,m,a,p]);return(0,V.useEffect)(()=>{u.current!==i&&(u.current=i,p(!0),d.current=!0)},[i,p]),(0,V.useEffect)(()=>h,[h]),(0,V.useEffect)(()=>{let t=e?.current;if(!t||!n||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{l.current&&g()});return r.observe(t),()=>r.disconnect()},[e,n,g,i]),(0,V.useLayoutEffect)(()=>{!d.current||r||!n||(d.current=!1,g())},[n,r,g]),(0,V.useLayoutEffect)(()=>{!l.current||!n||g()},[t,n,g]),{isAtBottom:s,onScroll:v,scrollToBottom:_}}var EM=`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-current`,DM=`group/process-row flex w-full min-w-0 items-center gap-1.5 py-0 text-[0.925rem] font-normal leading-[1.72] text-muted-foreground/80`;function OM({children:e,className:t}){return(0,H.jsx)(`span`,{className:U(EM,t),children:e})}function kM({position:e}){return(0,H.jsx)(`span`,{"aria-hidden":`true`,"data-tool-workflow-rail":`true`,className:U(`pointer-events-none absolute left-[0.575em] w-px -translate-x-1/2 bg-border/70`,e===`first`?`bottom-0 top-[0.86em]`:e===`last`?`top-0 h-[0.86em]`:`inset-y-0`)})}function AM({children:e,className:t,interactive:n=!1,onClick:r,role:i,tabIndex:a,onKeyDown:o}){return(0,H.jsx)(`div`,{"data-chat-process-meta-row":`true`,className:U(DM,n?`cursor-pointer transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`:null,t),onClick:r,role:i,tabIndex:a,onKeyDown:o,children:e})}function jM({label:e,openGroup:t,open:n=!1,icon:r,className:i,leadingIconClassName:a,labelClassName:o,onClick:s}){return(0,H.jsxs)(`button`,{type:`button`,"data-chat-process-meta-row":`true`,className:U(DM,`m-0 w-full border-0 bg-transparent p-0 text-left shadow-none transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,i),"aria-expanded":n,onClick:s,children:[r?(0,H.jsx)(OM,{className:U(`relative z-[1] rounded-sm`,a),children:(0,H.jsx)(r,{className:`h-[1.05em] w-[1.05em]`,strokeWidth:2.25})}):null,(0,H.jsx)(`span`,{className:U(`min-w-0 shrink truncate`,o),children:e}),(0,H.jsx)(`span`,{className:U(`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-muted-foreground/80 transition-opacity`,n?`opacity-100`:`opacity-0 group-hover/process-row:opacity-100 focus-visible:opacity-100`),children:(0,H.jsx)(sa,{className:U(`h-[1.05em] w-[1.05em] transition-transform`,n&&`rotate-90`),strokeWidth:2.25})})]})}function MM(e,t,n){let r=Array.from(t).length;return(n??`${e} · {count}`).split(`{count}`).join(String(r))}function NM({label:e,text:t,characterCountTemplates:n,isUser:r,isInProgress:i}){let{isOpen:a,onSummaryClick:o}=CM({isInProgress:i}),s=(0,V.useRef)(null),c=MM(e,t,i?n?.inProgress:n?.completed),{onScroll:l}=TM({scrollRef:s,resetKey:`reasoning`,isLoading:!1,hasContent:t.length>0,contentVersion:t,stickyThresholdPx:20});return(0,H.jsxs)(`div`,{className:`group/reasoning`,children:[(0,H.jsx)(jM,{openGroup:`reasoning`,open:a,icon:ea,leadingIconClassName:r?`bg-primary`:`bg-card`,label:c,labelClassName:r?`text-primary-100`:void 0,onClick:o}),a?(0,H.jsx)(`div`,{ref:s,onScroll:l,"data-reasoning-scroll":`true`,className:U(`mt-1 w-fit max-w-[500px] max-h-56 overflow-y-auto rounded-lg custom-scrollbar`,r?`bg-primary/70`:`bg-muted`),children:(0,H.jsx)(`pre`,{className:`min-w-0 whitespace-pre-wrap break-all p-2 text-[11px]`,children:t})}):null]})}function PM({children:e,className:t}){return(0,H.jsx)(`div`,{className:U(`relative my-0 flex w-full min-w-0 max-w-full flex-col text-[0.925rem] leading-[1.72] text-muted-foreground`,t),children:e})}function FM({children:e,className:t}){return(0,H.jsx)(`div`,{className:U(`mt-0.5 w-full max-w-full min-w-0 overflow-hidden pl-[calc(1.15em+0.375rem)] text-[0.925rem] leading-[1.72] text-muted-foreground`,t),children:e})}function IM({label:e,tone:t,children:n}){let r={input:{dot:`bg-muted-foreground/60`,body:`text-foreground`},output:{dot:`bg-primary/70`,body:`text-foreground`},error:{dot:`bg-rose-500/80`,body:`text-rose-950/85`}}[t];return(0,H.jsxs)(`section`,{className:`overflow-hidden rounded-md border border-border/70 bg-muted/20`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 px-2.5 py-1.5 text-[10px] font-medium tracking-wide text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:U(`h-1.5 w-1.5 rounded-full`,r.dot)}),(0,H.jsx)(`span`,{className:`normal-case tracking-normal`,children:e})]}),(0,H.jsx)(`div`,{className:`w-full overflow-hidden`,children:(0,H.jsx)(`pre`,{className:U(`w-full max-w-full min-w-0 max-h-64 overflow-x-auto overflow-y-auto px-2.5 py-2 font-mono text-[12px] leading-relaxed whitespace-pre custom-scrollbar`,r.body),children:n})})]})}var LM={running:{text:`text-muted-foreground`,icon:fi,spin:!0},success:{text:`text-muted-foreground/75`,icon:wr,spin:!1},error:{text:`text-destructive`,icon:Ho,spin:!1},cancelled:{text:`text-muted-foreground/70`,icon:io,spin:!1}};function RM({card:e,iconOnly:t=!1}){let n=LM[e.statusTone]||LM.cancelled,r=n.icon,i=!t&&(e.statusTone===`running`||e.statusTone===`error`);return(0,H.jsxs)(`span`,{className:U(`inline-flex shrink-0 items-center gap-1 text-[0.925rem] font-normal leading-[1.72]`,n.text),"aria-label":t?e.statusLabel:void 0,children:[(0,H.jsx)(r,{"aria-hidden":`true`,className:U(`h-[1.05em] w-[1.05em]`,n.spin&&`animate-spin`),strokeWidth:2.25}),i?e.statusLabel:null]})}function zM(e){return e.kind===`show-content`?{icon:Oa,label:e.label,toneClassName:`border-border/70 bg-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:ring-primary/35`}:{icon:Ki,label:e.label??(e.sessionKind===`child`?`Open child session`:`Open session`),toneClassName:`border-border/70 bg-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground focus-visible:ring-primary/35`}}function BM({action:e,onAction:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=fl,o=zM(e),s=o.icon;return(0,H.jsx)(i,{delayDuration:250,children:(0,H.jsxs)(n,{children:[(0,H.jsx)(a,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(e)},className:U(`inline-flex h-6 w-6 items-center justify-center rounded-md border transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1`,o.toneClassName),"aria-label":o.label,title:o.label,children:(0,H.jsx)(s,{className:`h-3.5 w-3.5`,strokeWidth:2.25})})}),(0,H.jsx)(r,{side:`top`,className:`text-xs`,children:o.label})]})})}function VM(e){return e.replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim()}function HM(e,t){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),t())}function UM({label:e,summary:t}){return(0,H.jsxs)(`span`,{className:`min-w-0 shrink truncate`,children:[e,t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`mx-1.5 select-none text-muted-foreground/45`,children:`·`}),(0,H.jsx)(`span`,{title:t,children:t})]}):null]})}function WM({expanded:e}){return(0,H.jsx)(`span`,{className:U(`inline-flex h-[1.15em] w-[1.15em] shrink-0 items-center justify-center text-muted-foreground/80 transition-opacity`,e?`opacity-100`:`opacity-0 group-hover/process-row:opacity-100 group-focus-within/process-row:opacity-100`),children:(0,H.jsx)(sa,{className:U(`h-[1.05em] w-[1.05em] transition-transform`,e&&`rotate-90`),strokeWidth:2.25})})}function GM({additions:e,deletions:t}){if(e===0&&t===0)return null;let n=[e>0?`+${e}`:null,t>0?`-${t}`:null].filter(Boolean).join(` `);return(0,H.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 tabular-nums text-muted-foreground/75`,"aria-label":n,children:[e>0?(0,H.jsxs)(`span`,{className:`transition-colors group-hover/process-row:text-emerald-600`,children:[`+`,e]}):null,t>0?(0,H.jsxs)(`span`,{className:`transition-colors group-hover/process-row:text-rose-600`,children:[`-`,t]}):null]})}function KM({card:e,toolLabel:t,changeSummary:n,icon:r,expanded:i,canExpand:a,hideSummary:o=!1,trailingMeta:s,actionSlot:c,onToggle:l}){let u=o?``:e.summary?.replace(/^(command|path|args|query|input):\s*/i,``)??``,d=t??VM(e.toolName);return(0,H.jsxs)(AM,{interactive:a,onClick:a?()=>l():void 0,role:a?`button`:void 0,tabIndex:a?0:void 0,onKeyDown:a?e=>HM(e,l):void 0,children:[(0,H.jsx)(OM,{className:`relative z-[1] rounded-sm bg-card`,children:(0,H.jsx)(r,{className:`h-[1.05em] w-[1.05em]`,strokeWidth:2.25})}),(0,H.jsx)(UM,{label:d,summary:u}),n?(0,H.jsx)(GM,{...n}):null,(0,H.jsx)(RM,{card:e,iconOnly:!!t}),s,a?(0,H.jsx)(WM,{expanded:i}):null,c?(0,H.jsx)(`span`,{className:`inline-flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover/process-row:opacity-100 group-focus-within/process-row:opacity-100`,children:c}):null]})}function qM({action:e,onAction:t}){return(0,H.jsx)(BM,{action:e,onAction:t})}var JM=`font-mono text-[11px] leading-5`,YM=`flex h-5 w-full ${JM}`,XM=`flex h-5 items-center justify-center px-2.5 tabular-nums select-none`;function ZM(e){return String(e.newLineNumber??e.oldLineNumber??``)}function QM(e,t){return typeof t==`number`&&(e.newLineNumber??e.oldLineNumber)===t}function $M(e,t,n){return`${e}-${n}-${t.oldLineNumber??`x`}-${t.newLineNumber??`x`}`}function eN(e){return typeof e.newLineNumber==`number`||typeof e.oldLineNumber==`number`}function tN(e){return e.lines.some(eN)}function nN(e){let t=e.lines.reduce((e,t)=>eN(t)?Math.max(e,ZM(t).length):e,0);return`${Math.max(6,Math.min(7.5,t+3))}ch`}function rN(e){return`calc(${e.lines.reduce((e,t)=>Math.max(e,Math.max(1,t.text.length)),1)}ch + 1.25rem)`}function iN(e){let t=e.split(/[\\/]/).filter(Boolean).pop()??e,n=t.split(/[?#]/)[0]??t,r=n.lastIndexOf(`.`);return r<=0||r===n.length-1?null:n.slice(r+1).toLowerCase()}function aN(e){return e.languageHint?.trim()||iN(e.path)||`text`}function oN(e){let t=e.toLowerCase().replace(/[^a-z0-9-]/g,`-`);return t?`language-${t}`:`language-text`}function sN(e){return e.kind===`remove`?`border-r border-rose-200 bg-rose-50 text-rose-700`:e.kind===`add`?`border-r border-emerald-200 bg-emerald-50 text-emerald-700`:`border-r border-border bg-muted text-muted-foreground`}function cN(e){return e.kind===`remove`?`bg-rose-50 text-rose-950`:e.kind===`add`?`bg-emerald-50 text-emerald-950`:`bg-card text-foreground`}function lN({layout:e,line:t,lineNumberColumnWidth:n,target:r,targetRef:i}){return(0,H.jsx)(`span`,{ref:i,"data-file-line-number-cell":`true`,style:e===`compact`?{width:n,minWidth:n}:void 0,className:U(XM,e===`compact`?`sticky left-0 z-[1]`:`w-full shrink-0`,sN(t),r?`bg-gray-200 font-medium text-gray-950`:null),children:ZM(t)})}function uN({language:e,line:t,target:n,targetColumn:r,targetRef:i}){let a=(0,V.useMemo)(()=>pA.highlight(t.text||` `,e),[e,t.text]),o=typeof r==`number`&&Number.isSafeInteger(r)&&r>0?Math.min(r,t.text.length+1):null;return(0,H.jsxs)(`span`,{ref:o?void 0:i,"data-file-code-row":`true`,"data-file-code-language":a.language,"data-highlighted":a.highlighted?`true`:`false`,"data-file-target-column":o??void 0,className:U(`chat-file-code-syntax hljs relative block min-w-0 flex-1 whitespace-pre px-2.5`,oN(a.language),cN(t),n?`bg-gray-100/90`:null),children:[(0,H.jsx)(`span`,{dangerouslySetInnerHTML:{__html:a.html}}),o?(0,H.jsx)(`span`,{ref:i,"aria-hidden":`true`,"data-file-target-caret":`true`,className:`pointer-events-none absolute inset-y-0 w-px bg-primary`,style:{left:`calc(0.625rem + ${o-1}ch)`}}):null]})}function dN({language:e,line:t,showLineNumbers:n,lineNumberColumnWidth:r}){return(0,H.jsxs)(`div`,{"data-file-line-row":`true`,className:YM,children:[n?(0,H.jsx)(lN,{layout:`compact`,line:t,lineNumberColumnWidth:r}):null,(0,H.jsx)(uN,{language:e,line:t})]})}function fN({block:e,targetColumn:t,targetLine:n}){let r=tN(e),i=nN(e),a=rN(e),o=aN(e),s=(0,V.useRef)(null);return(0,V.useLayoutEffect)(()=>{s.current?.scrollIntoView({block:`center`,inline:t?`center`:`nearest`})},[e,t,n]),(0,H.jsxs)(`div`,{"data-file-code-surface":`true`,"data-file-code-surface-layout":`workspace`,className:`flex h-full min-h-full min-w-full bg-card`,children:[r?(0,H.jsxs)(`div`,{"data-file-code-gutter":`true`,style:{width:i,minWidth:i},className:U(`flex h-full min-h-full shrink-0 flex-col`,JM),children:[e.lines.map((e,r)=>(0,H.jsx)(lN,{layout:`workspace`,line:e,lineNumberColumnWidth:i,target:QM(e,n),targetRef:!t&&QM(e,n)?s:void 0},$M(`gutter`,e,r))),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 border-r border-border bg-muted`})]}):null,(0,H.jsxs)(`div`,{"data-file-code-canvas":`true`,className:`flex h-full min-h-full min-w-0 flex-1 flex-col bg-card`,children:[(0,H.jsx)(`div`,{"data-file-code-stack":`true`,className:`min-w-full`,style:{minWidth:a},children:e.lines.map((e,i)=>{let a=QM(e,n);return(0,H.jsx)(`div`,{"data-file-code-canvas-row":`true`,"data-file-target-line":a?`true`:void 0,"aria-current":a?`location`:void 0,className:YM,children:(0,H.jsx)(uN,{language:o,line:e,target:a,targetColumn:a?t:null,targetRef:a&&(t||!r)?s:void 0})},$M(`code`,e,i))})}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 bg-card`})]})]})}function pN({block:e,layout:t=`compact`,targetColumn:n,targetLine:r}){if(t===`workspace`)return(0,H.jsx)(fN,{block:e,targetColumn:n,targetLine:r});let i=tN(e),a=nN(e),o=rN(e),s=i?`calc(${a} + ${o})`:o,c=aN(e);return(0,H.jsx)(`div`,{"data-file-code-surface":`true`,"data-file-code-surface-layout":`compact`,className:`overflow-x-auto custom-scrollbar bg-card`,children:(0,H.jsx)(`div`,{"data-file-code-stack":`true`,className:`min-w-full`,style:{minWidth:s},children:e.lines.map((e,t)=>(0,H.jsx)(dN,{language:c,line:e,showLineNumbers:i,lineNumberColumnWidth:a},$M(`row`,e,t)))})})}function mN({block:e}){return(0,H.jsx)(pN,{block:e,layout:`compact`})}function hN(e){return e.display===`preview`}function gN(e){return e.rawText?e.rawText:e.lines.map(e=>[e.kind,e.oldLineNumber??``,e.newLineNumber??``,e.text].join(`:`)).join(`
52
+ `)}function _N(e){return/^\+\d+$/.test(e)?`text-emerald-700`:/^-\d+$/.test(e)?`text-rose-700`:`text-muted-foreground`}function vN(e){let t=e.split(`·`).map(e=>e.trim()).filter(e=>/^\+\d+$/.test(e)||/^-\d+$/.test(e));return t.length===0?null:(0,H.jsx)(`div`,{className:`flex shrink-0 items-center gap-x-1 whitespace-nowrap text-[10px] font-medium uppercase tracking-[0.08em]`,children:t.map((e,t)=>(0,H.jsxs)(V.Fragment,{children:[t>0?(0,H.jsx)(`span`,{className:`text-muted-foreground/45`,children:`·`}):null,(0,H.jsx)(`span`,{className:U(_N(e)),children:e})]},`${e}-${t}`))})}function yN(e){return{path:e.path,label:e.path.split(`/`).filter(Boolean).pop()??e.path,viewMode:e.display===`diff`?`diff`:`preview`,...e.rawText?{rawText:e.rawText}:{},...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...e.patchText?{patchText:e.patchText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{},fullLines:e.fullLines??e.lines}}function bN({children:e,contentVersion:t,resetKey:n,className:r,scrollKind:i}){let a=(0,V.useRef)(null),{onScroll:o}=TM({scrollRef:a,resetKey:n,isLoading:!1,hasContent:!0,contentVersion:t,stickyThresholdPx:20});return(0,H.jsx)(`div`,{ref:a,onScroll:o,"data-file-scroll-kind":i,className:U(`overflow-y-auto bg-card custom-scrollbar`,r),children:e})}function xN({block:e,showPathRow:t,isFirst:n,onFileOpen:r}){let{Tooltip:i,TooltipContent:a,TooltipProvider:o,TooltipTrigger:s}=fl,c=hN(e),l=t||!!e.caption;return(0,H.jsxs)(`section`,{className:U(`overflow-hidden bg-card`,!n&&`border-t border-border`),children:[l?(0,H.jsxs)(`div`,{className:U(`flex min-h-9 items-center justify-between gap-4 border-b border-border px-3 text-muted-foreground`,t?`py-2`:`py-1.5`),children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:t?(0,H.jsx)(o,{delayDuration:250,children:(0,H.jsxs)(i,{children:[(0,H.jsx)(s,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,onClick:()=>{r&&r(yN(e))},className:U(`w-full truncate whitespace-nowrap text-left font-mono text-[12px] font-medium leading-5 text-foreground`,r&&`transition-colors hover:text-primary hover:underline`),title:e.path,children:e.path})}),(0,H.jsx)(a,{side:`top`,className:`max-w-[420px] text-xs font-mono break-all`,children:e.path})]})}):null}),e.caption?vN(e.caption):null]}):null,e.lines.length>0?(0,H.jsx)(bN,{resetKey:`block:${e.key}`,contentVersion:gN(e),className:`max-h-72`,scrollKind:`block`,children:(0,H.jsx)(mN,{block:e})}):e.rawText?(0,H.jsx)(bN,{resetKey:`raw:${e.key}`,contentVersion:e.rawText,className:`max-h-72`,scrollKind:`raw`,children:(0,H.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,H.jsx)(`pre`,{className:`min-w-max whitespace-pre bg-card px-3 py-2 font-mono text-[11px] leading-5 text-foreground`,children:e.rawText})})}):null,e.truncated&&!c?(0,H.jsx)(`div`,{className:`border-t border-border bg-muted px-3 py-2 text-[10px] text-muted-foreground`,children:`Showing a shortened diff preview.`}):null]})}function SN({card:e,className:t,onFileOpen:n,showPathRow:r=!0}){let i=e.fileOperation?.blocks??[],a=e.output?.trim()??``;return i.length===0&&!a?null:(0,H.jsxs)(`div`,{className:U(`overflow-hidden rounded-md border border-border/70 bg-card`,t),children:[i.map((e,t)=>(0,H.jsx)(xN,{block:e,showPathRow:r,isFirst:t===0,onFileOpen:n},e.key)),a?(0,H.jsx)(bN,{resetKey:`output:${e.toolName}:${e.summary??`none`}`,contentVersion:a,className:U(`max-h-56`,i.length>0&&`border-t border-border`),scrollKind:`output`,children:(0,H.jsx)(`div`,{className:`overflow-x-auto custom-scrollbar`,children:(0,H.jsx)(`pre`,{className:`min-w-max whitespace-pre bg-card px-3 py-2 font-mono text-[11px] leading-5 text-foreground`,children:a})})}):null]})}function CN(e){if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function wN(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:null}function TN(e){let t=wN(e?.durationMs);if(t!=null)return t;let n=CN(e?.startedAt),r=CN(e?.endedAt);return n!=null&&r!=null&&r>=n?r-n:null}function EN(e){let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${String(r).padStart(2,`0`)}m ${String(i).padStart(2,`0`)}s`:r>0?`${r}m ${String(i).padStart(2,`0`)}s`:`${i}s`}function DN(e){return!Number.isFinite(e)||e<0?null:EN(e)}function ON(e){return!Number.isFinite(e)||e<0?null:e<1e3?`${Math.round(e)}ms`:e<6e4?`${Number((e/1e3).toFixed(2))}s`:EN(e)}function kN(){return globalThis.performance?.now()??Date.now()}function AN(e){return Math.max(0,e.baselineMs+kN()-e.monotonicStartedAt)}function jN(e,t){let n=CN(e?.startedAt),r=wN(e?.durationMs)!=null||e?.endedAt!=null,i=t&&n!=null&&!r,[a,o]=(0,V.useState)(null);return(0,V.useEffect)(()=>{if(!i||n==null||!e?.startedAt){o(null);return}let t={key:e.startedAt,baselineMs:Math.max(0,Date.now()-n),monotonicStartedAt:kN()};o({key:t.key,elapsedMs:AN(t)});let r,a=()=>{if(document.visibilityState===`hidden`)return;let e=AN(t),n=Math.max(50,1e3-e%1e3);r=setTimeout(()=>{o({key:t.key,elapsedMs:AN(t)}),a()},n)},s=()=>{r&&clearTimeout(r),r=void 0,document.visibilityState!==`hidden`&&(o({key:t.key,elapsedMs:AN(t)}),a())};return document.addEventListener(`visibilitychange`,s),a(),()=>{r&&clearTimeout(r),document.removeEventListener(`visibilitychange`,s)}},[i,e?.startedAt,n]),!i||!e?.startedAt?null:a?.key===e.startedAt?a.elapsedMs:null}function MN({execution:e,statusTone:t}){let n=TN(e),r=jN(e,t===`running`&&n==null),i=n==null?r==null?null:DN(r):ON(n);return i?(0,H.jsx)(`span`,{className:`inline-flex shrink-0 tabular-nums text-muted-foreground/75`,children:i}):null}var NN=`\x1B`,PN=RegExp(`${NN}\\[(.*?)([ -/]*[@-~])`,`g`);function FN(e){return e.includes(`${NN}[`)}function IN(e){return e.replace(RegExp(`${NN}\\[[0-?]*[ -/]*[@-~]`,`g`),``)}function LN(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var RN={bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1},zN={1:{bold:!0},2:{dim:!0},3:{italic:!0},4:{underline:!0},7:{inverse:!0},22:{bold:!1,dim:!1},23:{italic:!1},24:{underline:!1},27:{inverse:!1},39:{fg:void 0},49:{bg:void 0}},BN={30:`black`,31:`red`,32:`green`,33:`yellow`,34:`blue`,35:`magenta`,36:`cyan`,37:`white`,90:`bright-black`,91:`bright-red`,92:`bright-green`,93:`bright-yellow`,94:`bright-blue`,95:`bright-magenta`,96:`bright-cyan`,97:`bright-white`},VN={40:`black`,41:`red`,42:`green`,43:`yellow`,44:`blue`,45:`magenta`,46:`cyan`,47:`white`,100:`bright-black`,101:`bright-red`,102:`bright-green`,103:`bright-yellow`,104:`bright-blue`,105:`bright-magenta`,106:`bright-cyan`,107:`bright-white`};function HN(e,t){let n=e[t+1];return n===5&&typeof e[t+2]==`number`?{color:`ansi-256-${e[t+2]}`,consumed:2}:n===2&&typeof e[t+2]==`number`&&typeof e[t+3]==`number`&&typeof e[t+4]==`number`?{color:`rgb(${e[t+2]},${e[t+3]},${e[t+4]})`,consumed:4}:null}function UN(e,t){let n={...e};for(let e=0;e<t.length;e+=1){let r=t[e];if(r===0)return{...RN};let i=zN[r];if(i){n={...n,...i};continue}if(r===38||r===48){let i=HN(t,e);i&&(n=r===38?{...n,fg:i.color}:{...n,bg:i.color},e+=i.consumed);continue}if(BN[r]){n={...n,fg:BN[r]};continue}VN[r]&&(n={...n,bg:VN[r]})}return n}function WN(e){let t=[`ansi`];return e.bold&&t.push(`ansi-bold`),e.dim&&t.push(`ansi-dim`),e.italic&&t.push(`ansi-italic`),e.underline&&t.push(`ansi-underline`),e.inverse&&t.push(`ansi-inverse`),e.fg&&(e.fg.startsWith(`rgb(`)?t.push(`ansi-fg-custom`):e.fg.startsWith(`ansi-256-`)?(t.push(`ansi-fg-256`),t.push(e.fg)):t.push(`ansi-fg-${e.fg}`)),e.bg&&(e.bg.startsWith(`rgb(`)?t.push(`ansi-bg-custom`):e.bg.startsWith(`ansi-256-`)?(t.push(`ansi-bg-256`),t.push(e.bg)):t.push(`ansi-bg-${e.bg}`)),t.join(` `)}function GN(e){let t=[];return e.fg?.startsWith(`rgb(`)&&t.push(`color:${e.fg}`),e.bg?.startsWith(`rgb(`)&&t.push(`background-color:${e.bg}`),t.length>0?t.join(`;`):void 0}function KN(e){let t=WN(e),n=GN(e);return n?`<span class="${t}" style="${n}">`:`<span class="${t}">`}function qN(e){if(!e)return``;if(!FN(e))return LN(e);let t=``,n=0,r={...RN},i=!1,a=e=>{e&&(i||=(t+=KN(r),!0),t+=LN(e))},o=()=>{i&&=(t+=`</span>`,!1)};return e.replace(PN,(t,i,s,c)=>{if(a(e.slice(n,c)),n=c+t.length,s!==`m`)return t;let l=i.trim().length===0?[0]:i.split(`;`).map(e=>Number.parseInt(e,10)).filter(e=>Number.isFinite(e));return o(),r=UN(r,l.length>0?l:[0]),t}),a(e.slice(n)),o(),t}var JN=12e4;function YN(e){return e.length<=JN?e:`${e.slice(0,JN)}\n…`}function XN({code:e,language:t,preferAnsi:n=!1,className:r}){let i=YN(e),a=(0,V.useMemo)(()=>{if(n&&FN(i))return{html:qN(i),language:`ansi`,highlighted:!0};let e=IN(i);return pA.highlight(e,t)},[t,n,i]);return(0,H.jsx)(`code`,{className:U(`hljs chat-terminal-code`,`language-${a.language}`,r),"data-highlighted":a.highlighted?`true`:`false`,dangerouslySetInnerHTML:{__html:a.html}})}function ZN({command:e,output:t,emptyLabel:n,isRunning:r,hasOutput:i,isError:a=!1}){return(0,H.jsx)(`div`,{className:U(`chat-terminal-surface`,a?`chat-terminal-surface-error`:void 0),"data-testid":`chat-terminal-surface`,children:(0,H.jsxs)(`div`,{className:`chat-terminal-body custom-scrollbar`,children:[(0,H.jsxs)(`div`,{className:`chat-terminal-line chat-terminal-line-command`,children:[(0,H.jsx)(`span`,{className:`chat-terminal-gutter`,"aria-hidden":`true`,children:`$`}),(0,H.jsx)(`div`,{className:`chat-terminal-line-content`,children:e?(0,H.jsxs)(`pre`,{className:`chat-terminal-pre`,children:[(0,H.jsx)(XN,{code:e,language:`bash`}),r&&!i?(0,H.jsx)(`span`,{className:`chat-terminal-caret`,"aria-hidden":`true`}):null]}):(0,H.jsx)(`div`,{className:`chat-terminal-skeleton`})})]}),(i||!r)&&(0,H.jsx)(`div`,{className:`chat-terminal-output-block`,children:i?(0,H.jsxs)(`pre`,{className:U(`chat-terminal-pre chat-terminal-output`,a?`chat-terminal-pre-error`:void 0),children:[(0,H.jsx)(XN,{code:t,language:a?`text`:`shell`,preferAnsi:!0,className:a?`chat-terminal-code-error`:void 0}),r?(0,H.jsx)(`span`,{className:`chat-terminal-caret`,"aria-hidden":`true`}):null]}):(0,H.jsx)(`div`,{className:`chat-terminal-empty`,children:n})})]})})}var QN=200;function $N(e){return typeof e==`string`&&e.length>0?e:null}function eP(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function tP(e,t){if(e?.trim())return e.trim();if(t==null)return``;if(typeof t==`string`)return t.trim();if(typeof t==`number`||typeof t==`boolean`)return String(t);try{return JSON.stringify(t,null,2)}catch{return String(t)}}function nP(e){return`command`in e||`workingDir`in e||`exitCode`in e||`durationMs`in e||`stdout`in e||`stderr`in e||`aggregated_output`in e||`combinedOutput`in e}function rP(e){let t=$N(e.aggregated_output)??$N(e.combinedOutput)??$N(e.output);if(t)return t;let n=$N(e.stdout),r=$N(e.stderr);return!n&&!r?null:[n,r].filter(e=>!!e).join(`
53
+ `)}function iP(e,t){if(eP(t)){let e=rP(t);if(e)return e;if(nP(t))return``}if(!e)return``;let n=e.trim();if(!n.startsWith(`{`))return e;try{let t=JSON.parse(n);return eP(t)?rP(t)||(nP(t)?``:e):e}catch{return e}}function aP(e){return e===`write_file`||e===`edit_file`}function oP(e){return e.reduce((e,t)=>({additions:e.additions+t.lines.filter(e=>e.kind===`add`).length,deletions:e.deletions+t.lines.filter(e=>e.kind===`remove`).length}),{additions:0,deletions:0})}function sP({canExpand:e,isRunning:t,autoExpandWhileRunning:n=!0,expandOnError:r=!1,statusTone:i}){let[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1),l=(0,V.useRef)(null),u=(0,V.useRef)(t),d=(0,V.useRef)(!0);return(0,V.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]),(0,V.useEffect)(()=>{if(r&&i===`error`&&e&&!s){l.current!==null&&(window.clearTimeout(l.current),l.current=null),o(!0),u.current=t,d.current=!1;return}n&&t&&e&&!s&&!a&&(d.current||!u.current)&&(l.current=window.setTimeout(()=>{o(!0),l.current=null},QN)),t||(l.current!==null&&(window.clearTimeout(l.current),l.current=null),u.current&&!s&&o(!1)),u.current=t,d.current=!1},[n,e,r,a,s,t,i]),{expanded:a,onToggle:()=>{e&&(l.current!==null&&(window.clearTimeout(l.current),l.current=null),o(e=>!e),c(!0))}}}function cP(e){return eP(e)?{exitCode:typeof e.exitCode==`number`?e.exitCode:typeof e.exit_code==`number`?e.exit_code:null,workingDir:$N(e.workingDir)??$N(e.cwd)??$N(e.working_directory)}:{}}function lP({card:e,toolLabel:t}){let n=e.statusTone===`running`,r=e.summary?.replace(/^(command|path|args|query|input):\s*/i,``),i=!!e.output?.trim()||e.outputData!==null&&e.outputData!==void 0,a=n||i||!!r?.trim(),o=cP(e.outputData),{expanded:s,onToggle:c}=sP({canExpand:a,isRunning:n,autoExpandWhileRunning:!1,expandOnError:a,statusTone:e.statusTone}),l=s?iP(e.output,e.outputData)||tP(void 0,e.outputData):``;return(0,H.jsxs)(PM,{children:[(0,H.jsx)(KM,{card:e,toolLabel:t,icon:zo,expanded:s,canExpand:a,trailingMeta:(0,H.jsx)(MN,{execution:e.execution,statusTone:e.statusTone}),onToggle:c}),s&&(0,H.jsx)(FM,{className:`bg-transparent py-0`,children:(0,H.jsx)(ZN,{command:r,output:l,emptyLabel:e.emptyLabel,isRunning:n,hasOutput:i,isError:e.statusTone===`error`,exitCode:o.exitCode,workingDir:o.workingDir})})]})}function uP(e,t){return!!e?.trim()||t!=null}function dP(e){return{previewLineCount:e.reduce((e,t)=>e+t.lines.length,0),previewCharCount:e.reduce((e,t)=>e+(t.rawText?.length??t.lines.reduce((e,t)=>e+t.text.length+1,0)),0)}}function fP(e){return[`edit_file`,`write_file`,`apply_patch`,`file_change`].includes(e)}function pP(e){let{card:t,previewCharCount:n,previewLineCount:r}=e;return aP(t.toolName)?!(t.statusTone===`running`&&t.toolName===`write_file`&&(r>24||n>1200)):!1}function mP({card:e,toolLabel:t,onFileOpen:n}){let r=e.statusTone===`running`,i=!!e.fileOperation?.blocks.length,a=uP(e.input,e.inputData),o=uP(e.output,e.outputData),s=a&&!i,c=i||a||o,l=e.fileOperation?.blocks??[],{previewCharCount:u,previewLineCount:d}=dP(l),f=pP({card:e,previewCharCount:u,previewLineCount:d}),{expanded:p,onToggle:m}=sP({canExpand:c||r,isRunning:r,autoExpandWhileRunning:f,expandOnError:c,statusTone:e.statusTone}),h=p?tP(e.input,e.inputData):``,g=p?tP(e.output,e.outputData):``,_=fP(e.toolName);return(0,H.jsxs)(PM,{children:[(0,H.jsx)(KM,{card:e,toolLabel:t,changeSummary:_?oP(l):void 0,icon:_?va:Cn,expanded:p,canExpand:c||r,hideSummary:!1,onToggle:m}),p&&c?(0,H.jsxs)(FM,{className:`bg-transparent py-0`,children:[s?(0,H.jsx)(IM,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:h}):null,s&&g?(0,H.jsx)(`div`,{className:`h-2`}):null,i||g?(0,H.jsx)(SN,{card:g&&!e.output?{...e,output:g}:e,onFileOpen:n,showPathRow:!0}):null]}):null]})}function hP({card:e,toolLabel:t,icon:n=ui}){let r=e.statusTone===`running`,i=!!e.output?.trim()||e.outputData!==null&&e.outputData!==void 0,{expanded:a,onToggle:o}=sP({canExpand:i||r,isRunning:r,autoExpandWhileRunning:!1,statusTone:e.statusTone}),s=a?tP(e.output,e.outputData):``;return(0,H.jsxs)(PM,{children:[(0,H.jsx)(KM,{card:e,toolLabel:t,icon:n,expanded:a,canExpand:i||r,onToggle:o}),a&&s&&(0,H.jsx)(FM,{className:`py-0`,children:(0,H.jsx)(`pre`,{className:`font-mono text-[12px] text-muted-foreground whitespace-pre-wrap break-all w-full max-w-full max-h-64 overflow-y-auto overflow-x-hidden min-w-0 custom-scrollbar leading-relaxed`,children:s})})]})}function gP(e,t,n){let r=e.agentId&&n?n(e.agentId):null,i=e.action&&t?(0,H.jsx)(qM,{action:e.action,onAction:t}):null;return r||i?(0,H.jsxs)(H.Fragment,{children:[r,i]}):void 0}function _P({card:e,toolLabel:t,icon:n=Ko,onToolAction:r,renderToolAgent:i}){let a=e.statusTone===`running`,o=!!e.input?.trim()||e.inputData!==null&&e.inputData!==void 0,s=!!e.output?.trim()||e.outputData!==null&&e.outputData!==void 0,c=o||s,l=gP(e,r,i),{expanded:u,onToggle:d}=sP({canExpand:c||a,isRunning:a,autoExpandWhileRunning:!1,statusTone:e.statusTone}),f=u?tP(e.input,e.inputData):``,p=u?tP(e.output,e.outputData):``;return(0,H.jsxs)(PM,{children:[(0,H.jsx)(KM,{card:e,toolLabel:t,icon:n,expanded:u,canExpand:c||a,actionSlot:l,onToggle:d}),u&&c?(0,H.jsxs)(FM,{className:`bg-transparent py-0`,children:[o?(0,H.jsx)(IM,{label:e.inputLabel?.trim()||`Input`,tone:`input`,children:f}):null,o&&s?(0,H.jsx)(`div`,{className:`h-2`}):null,s?(0,H.jsx)(IM,{label:e.outputLabel?.trim()||`Output`,tone:e.statusTone===`error`?`error`:`output`,children:p}):null]}):null]})}function vP({card:e,onToolAction:t,renderPanelAppCard:n}){let{panelApp:r}=e;return r&&n?n(r):(0,H.jsx)(_P,{card:e,onToolAction:t})}function yP(e){let t=e.toLowerCase();return t===`exec`||t===`exec_command`||t===`execute_command`||t===`command_execution`||t===`bash`||t===`shell`||t.includes(`run_`)}function bP(e){let t=e.toLowerCase();return t===`read_file`||t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function xP(e){let t=e.toLowerCase();return t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`}function SP(e){let t=e.toLowerCase();return t===`grep_search`||t===`find_files`||t.includes(`search`)}var CP={list_dir:{statusKind:`directory`,icon:Ha},web_fetch:{statusKind:`web`,icon:Ta},message:{statusKind:`message`,icon:wo},sessions_list:{statusKind:`session`,icon:ro},sessions_history:{statusKind:`session`,icon:ro},sessions_request:{statusKind:`session`,icon:ro},spawn:{statusKind:`agent`,icon:Zi},sessions_spawn:{statusKind:`agent`,icon:Zi},subagents:{statusKind:`agent`,icon:Zi},memory_search:{statusKind:`memory`,icon:ea},memory_get:{statusKind:`memory`,icon:ea},cron:{statusKind:`schedule`,icon:na},gateway:{statusKind:`system`,icon:Do},view_image:{statusKind:`image`,icon:pee},show_file:{statusKind:`display`,icon:Oa},show_url:{statusKind:`display`,icon:Oa},show_panel_app:{statusKind:`display`,icon:Oa},show_content:{statusKind:`display`,icon:Oa}};function wP(e){return CP[e.toLowerCase()]??null}function TP({card:e,toolStatusLabels:t,onToolAction:n,onFileOpen:r,renderToolAgent:i,renderPanelAppCard:a}){if(e.panelApp)return(0,H.jsx)(vP,{card:e,onToolAction:n,renderPanelAppCard:a});let o=wP(e.toolName),s=o?t?.builtIn?.[o.statusKind]?.[e.statusTone]:void 0;return yP(e.toolName)?(0,H.jsx)(lP,{card:e,toolLabel:t?.terminal[e.statusTone]}):bP(e.toolName)?(0,H.jsx)(mP,{card:e,toolLabel:xP(e.toolName)?t?.fileEdit[e.statusTone]:t?.fileRead[e.statusTone],onFileOpen:r}):SP(e.toolName)?(0,H.jsx)(hP,{card:e,toolLabel:s??t?.search[e.statusTone],icon:o?.icon}):(0,H.jsx)(_P,{card:e,toolLabel:s,icon:o?.icon,onToolAction:n,renderToolAgent:i})}var EP=40;function DP({group:e,open:t,isUser:n,reasoningCharacterCountTemplates:r,toolStatusLabels:i,showMoreTemplate:a,onToolAction:o,onFileOpen:s,renderToolAgent:c,renderPanelAppCard:l,onOpenChange:u}){let[d,f]=(0,V.useState)(EP);(0,V.useEffect)(()=>{f(EP)},[e.key]);let p=e.parts.filter(e=>e.type===`tool-card`).length,m=t&&p>1,h=e.parts.slice(0,d),g=Math.max(0,e.parts.length-h.length),_=Math.min(EP,g),v=(a??`Show next {count} ({remaining} remaining)`).replace(`{count}`,String(_)).replace(`{remaining}`,String(g));return(0,H.jsxs)(`div`,{className:`group/tool-activity`,children:[(0,H.jsx)(jM,{openGroup:`tool-activity`,open:t,icon:Go,leadingIconClassName:`bg-card`,label:e.label,onClick:()=>u(!t)}),t?(0,H.jsxs)(`div`,{className:`text-[0.925rem] leading-[1.72]`,children:[h.map((t,a)=>{let u=a===h.length-1;return(0,H.jsxs)(`div`,{className:`relative min-w-0`,children:[m?(0,H.jsx)(kM,{position:a===0?`first`:u?`last`:`middle`}):null,t.type===`tool-card`?(0,H.jsx)(TP,{card:t.card,toolStatusLabels:i,onToolAction:o,onFileOpen:s,renderToolAgent:c,renderPanelAppCard:l}):(0,H.jsx)(NM,{label:t.label,text:t.text,characterCountTemplates:r,isUser:n,isInProgress:!1})]},t.type===`tool-card`&&t.card.toolCallId?`tool-group-call-${t.card.toolCallId}`:`tool-group-item-${e.startIndex+a}`)}),g>0?(0,H.jsx)(`button`,{type:`button`,className:`ml-6 mt-1 rounded-md px-2 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>f(e=>e+EP),children:v}):null]}):null]})}var OP=3;function kP(e){return e.type===`tool-card`}function AP(e){return e?.type===`reasoning`||e?.type===`tool-card`&&!e.card.panelApp}function jP(e){let t=e.toLowerCase();return t===`list_dir`?`directory`:t.includes(`show_content`)||t.includes(`panel_app`)||t.includes(`panel`)?`panel`:t===`spawn`||t.includes(`subagent`)||t.includes(`session_request`)||t.includes(`agent`)&&!t.includes(`read`)?`agent`:t.includes(`web_`)||t.includes(`_web`)||t.includes(`url`)||t.includes(`fetch`)||t.includes(`http`)?`web`:t===`grep_search`||t===`find_files`||t===`search_files`||t.includes(`search`)||t.includes(`grep`)?`search`:t===`exec`||t===`exec_command`||t===`execute_command`||t===`command_execution`||t===`bash`||t===`shell`||t===`terminal`||t.includes(`run_`)?`bash`:t===`write_file`||t===`edit_file`||t===`apply_patch`||t===`file_change`||t===`multi_replace`||t.includes(`write_file`)||t.includes(`edit_file`)||t.includes(`apply_patch`)?`edit`:t===`read_file`||t===`read`||t===`view_file`||t.includes(`read_file`)||t.startsWith(`read_`)?`read`:`other`}function MP(e){return e===`error`?0:e===`cancelled`?1:e===`running`?2:3}function NP(e,t,n){if(t!==`read`&&t!==`edit`&&t!==`directory`)return[`call:${n}`];let r=e.fileOperation?.blocks.map(({path:e})=>e.trim()).filter(Boolean),i=e.summary?.replace(/^(path|file):\s*/i,``).trim();return r?.length?r:[i||`call:${n}`]}function PP(e,t){let n=t.segmentTemplates[e.family],r=e.count===1?n.one:n.other.split(`{count}`).join(String(e.count)),i=e.exceptionCounts?.error??(e.tone===`error`?e.count:0),a=e.exceptionCounts?.cancelled??(e.tone===`cancelled`?e.count:0);return i===e.count?`${r} ${t.failedLabel}`:a===e.count?`${r} ${t.cancelledLabel}`:[r,i>0?`${i}/${e.count} ${t.failedLabel}`:null,a>0?`${a}/${e.count} ${t.cancelledLabel}`:null].filter(Boolean).join(` · `)}function FP(e){let t=[],n=new Map;for(let[r,i]of e.entries()){let e=jP(i.toolName),a=NP(i,e,r),o=n.get(e);if(!o){t.push(e),n.set(e,{unitTones:new Map(a.map(e=>[e,i.statusTone]))});continue}a.forEach(e=>o.unitTones.set(e,i.statusTone))}let r=t.map(e=>{let t=n.get(e),r=[...t.unitTones.values()],i=r.reduce((e,t)=>MP(t)<MP(e)?t:e,`success`);return{family:e,count:t.unitTones.size,tone:i,exceptionCounts:{error:r.filter(e=>e===`error`).length,cancelled:r.filter(e=>e===`cancelled`).length}}});return r.sort((e,n)=>{let r=MP(e.tone)-MP(n.tone);return r===0?t.indexOf(e.family)-t.indexOf(n.family):r}),r}function IP(e){let{labels:t,segments:n}=e;if(n.length===0)return``;let r=n.slice(0,OP),i=n.length-r.length,a=r.map(e=>PP(e,t));return i>0&&a.push(`+${i}`),a.join(` · `)}function LP(e,t){let n=[],r=t,i=-1;for(;;){let t=e[r];if(!AP(t))break;n.push(t),t.type===`tool-card`&&(i=n.length-1),r+=1}return{candidateParts:n,lastToolOffset:i}}function RP(e,t){let n=[],r=0;for(;r<e.length;){let i=e[r];if(i.type!==`tool-card`||i.card.panelApp){n.push({kind:`part`,key:`part-${r}`,index:r,part:i}),r+=1;continue}let a=r,{candidateParts:o,lastToolOffset:s}=LP(e,a),c=o.filter(kP);if(c.length===1){n.push({kind:`part`,key:`part-${a}`,index:a,part:i}),r=a+1;continue}let l=o.slice(0,s+1);r=a+l.length;let u=FP(c.map(e=>e.card)),d=IP({segments:u,labels:t});n.push({kind:`tool-group`,key:`tool-group-${a}`,group:{key:`tool-group-${a}`,startIndex:a,endIndex:r-1,parts:l,segments:u,label:d}})}return n}function zP(e){let{messageId:t,onRequest:n,state:r}=e,[i,a]=(0,V.useState)(!1),[o,s]=(0,V.useState)(()=>new Set),[c,l]=(0,V.useState)(!1),[u,d]=(0,V.useState)(null),f=r===void 0||r===`ready`;(0,V.useEffect)(()=>{f&&(c&&(a(!0),l(!1)),u&&(s(e=>new Set(e).add(u)),a(!0),d(null)))},[f,c,u]);let p=()=>{(r===`summary`||r===`error`)&&n?.(t)};return{handleProcessToggle:()=>{if(i)return a(!1);if(f)return a(!0);l(!0),p()},handleToolActivityOpenChange:(e,t)=>{if(t&&!f){d(e),p();return}s(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r}),t&&a(!0)},openToolGroupKeys:o,processOpen:i}}var BP={segmentTemplates:{read:{one:`Read 1 file`,other:`Read {count} files`},edit:{one:`Edit 1 file`,other:`Edit {count} files`},directory:{one:`View 1 directory`,other:`View {count} directories`},search:{one:`Search 1 time`,other:`Search {count} times`},bash:{one:`Run 1 command`,other:`Run {count} commands`},web:{one:`Open 1 page`,other:`Open {count} pages`},agent:{one:`Start 1 subtask`,other:`Start {count} subtasks`},panel:{one:`Show 1 result`,other:`Show {count} results`},other:{one:`Use 1 tool`,other:`Use {count} tools`}},failedLabel:`failed`,cancelledLabel:`cancelled`};function VP(e){return{segmentTemplates:{...BP.segmentTemplates,...e.toolActivitySegmentTemplates??{}},failedLabel:e.toolActivityFailedLabel??BP.failedLabel,cancelledLabel:e.toolActivityCancelledLabel??BP.cancelledLabel}}function HP(e){return e===`pending`||e===`streaming`}function UP(e){return e.type===`reasoning`||e.type===`tool-card`||e.type===`custom`&&e.process===!0}function WP(e){if(e.role!==`assistant`||!e.processSummary||HP(e.status))return null;let t=-1;for(let n=e.parts.length-1;n>=0;--n)if(UP(e.parts[n])){t=n;break}return t<0||t>=e.parts.length-1?null:{processParts:e.parts.slice(0,t+1),finalParts:e.parts.slice(t+1)}}function GP({index:e,isInProgress:t,isLastPart:n,isUser:r,onAttachmentOpen:i,onFileOpen:a,onInlineTokenClick:o,onToolAction:s,part:c,renderCustomPart:l,renderInlineDisplay:u,renderPanelAppCard:d,renderToolAgent:f,resolveFileContentUrl:p,role:m,texts:h}){let{type:g}=c;if(g===`custom`){let e=l?.(c);return e===void 0?null:(0,H.jsx)(`div`,{className:`min-w-0`,children:e},`custom-${c.customType}-${c.id}`)}if(g===`markdown`){let{inlineTokens:r,text:i}=c;return(0,H.jsx)(Wj,{text:i,role:m,texts:h,isStreaming:t&&n,inlineTokens:r,onFileOpen:a,onInlineTokenClick:o,resolveFileContentUrl:p,renderInlineDisplay:u},`markdown-${e}`)}if(g===`reasoning`){let{label:i,text:a}=c;return(0,H.jsx)(NM,{label:i,text:a,characterCountTemplates:h.reasoningCharacterCountTemplates,isUser:r,isInProgress:t&&n},`reasoning-${e}`)}if(g===`tool-card`){let{card:t}=c;return(0,H.jsxs)(`div`,{className:`relative min-w-0`,children:[(0,H.jsx)(kM,{position:`single`}),(0,H.jsx)(TP,{card:t,toolStatusLabels:h.toolStatusLabels,onToolAction:s,onFileOpen:a,renderToolAgent:f,renderPanelAppCard:d})]},`tool-${e}`)}if(g===`file`){let{file:t}=c;return(0,H.jsx)(yM,{file:t,isUser:r,texts:h,onOpen:i},`file-${e}`)}if(g===`unknown`){let{label:t,rawType:n,text:r}=c;return(0,H.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/60 px-2.5 py-2 text-xs text-muted-foreground`,children:[(0,H.jsxs)(`div`,{className:`font-semibold text-foreground`,children:[t,`: `,n]}),r?(0,H.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words text-[11px] text-muted-foreground`,children:r}):null]},`unknown-${e}`)}return null}function KP(e){let{isInProgress:t,isUser:n,onAttachmentOpen:r,onFileOpen:i,onInlineTokenClick:a,onToolActivityOpenChange:o,onToolAction:s,openToolGroupKeys:c,parts:l,renderCustomPart:u,renderInlineDisplay:d,renderPanelAppCard:f,renderToolAgent:p,resolveFileContentUrl:m,role:h,texts:g,indexOffset:_=0}=e;return SM(RP(l,VP(g))).map(e=>e.kind===`image-group`?(0,H.jsx)(bM,{group:e,indexOffset:_,isUser:n,texts:g,onOpen:r},`${e.key}-${_}`):e.kind===`tool-group`?(0,H.jsx)(DP,{group:e.group,open:c.has(e.group.key),isUser:n,reasoningCharacterCountTemplates:g.reasoningCharacterCountTemplates,toolStatusLabels:g.toolStatusLabels,showMoreTemplate:g.toolActivityShowMoreTemplate,onToolAction:s,onFileOpen:i,renderToolAgent:p,renderPanelAppCard:f,onOpenChange:t=>o(e.group.key,t)},e.key):GP({part:e.part,index:_+e.index,role:h,isUser:n,isInProgress:t,isLastPart:_+e.index===_+l.length-1,texts:g,onToolAction:s,onFileOpen:i,onAttachmentOpen:r,onInlineTokenClick:a,resolveFileContentUrl:m,renderCustomPart:u,renderInlineDisplay:d,renderToolAgent:p,renderPanelAppCard:f}))}var qP=(0,V.memo)(function({layout:e,message:t,texts:n,onToolAction:r,toolPayloadState:i,onToolPayloadRequest:a,onFileOpen:o,onAttachmentOpen:s,onInlineTokenClick:c,renderInlineDisplay:l,renderCustomPart:u,renderToolAgent:d,renderPanelAppCard:f,resolveFileContentUrl:p}){let{role:m}=t,h=m===`user`,g=e===`flat`&&!h,_=HP(t.status),v=WP(t),{handleProcessToggle:y,handleToolActivityOpenChange:b,openToolGroupKeys:x,processOpen:S}=zP({messageId:t.id,state:i,onRequest:a}),C=i===`loading`?`${t.processSummary?.label??``} · ${n.toolPayloadLoadingLabel??`Loading details`}`:i===`error`?`${t.processSummary?.label??``} · ${n.toolPayloadLoadFailedLabel??`Couldn’t load details. Try again`}`:t.processSummary?.label;return(0,H.jsx)(`div`,{"data-chat-message-surface":g?`flat`:`card`,className:U(`max-w-full has-[[data-chat-message-wide-content=true]]:w-full`,g?`block w-full text-foreground`:`inline-block w-fit rounded-2xl border px-4 shadow-sm`,!g&&(h?`nextclaw-chat-message-user rounded-[1.45rem] border-primary bg-primary py-2.5 text-primary-foreground shadow-none`:m===`assistant`?`border-border bg-card pb-3 pt-4 text-card-foreground`:`border-border bg-muted/45 py-3 text-foreground`)),children:(0,H.jsx)(`div`,{className:`space-y-0`,children:v?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`group/process`,children:[(0,H.jsx)(`div`,{className:`mb-2 border-b border-border/60 pb-2`,children:(0,H.jsx)(jM,{openGroup:`process`,open:S,label:C,onClick:y})}),S?(0,H.jsx)(`div`,{className:`space-y-0`,children:KP({parts:v.processParts,role:m,isUser:h,isInProgress:_,texts:n,onToolAction:r,onFileOpen:o,onAttachmentOpen:s,onInlineTokenClick:c,resolveFileContentUrl:p,openToolGroupKeys:x,onToolActivityOpenChange:b,renderCustomPart:u,renderInlineDisplay:l,renderToolAgent:d,renderPanelAppCard:f})}):null]}),KP({parts:v.finalParts,role:m,isUser:h,isInProgress:_,texts:n,onToolAction:r,onFileOpen:o,onAttachmentOpen:s,onInlineTokenClick:c,resolveFileContentUrl:p,openToolGroupKeys:x,onToolActivityOpenChange:b,renderCustomPart:u,renderInlineDisplay:l,renderToolAgent:d,renderPanelAppCard:f,indexOffset:v.processParts.length})]}):KP({parts:t.parts,role:m,isUser:h,isInProgress:_,texts:n,onToolAction:r,onFileOpen:o,onAttachmentOpen:s,onInlineTokenClick:c,resolveFileContentUrl:p,openToolGroupKeys:x,onToolActivityOpenChange:b,renderCustomPart:u,renderInlineDisplay:l,renderToolAgent:d,renderPanelAppCard:f})})})});function JP({messageText:e,texts:t}){let{copied:n,copy:r}=Sk({text:e}),i=n?t.copiedMessageLabel:t.copyMessageLabel,{Tooltip:a,TooltipContent:o,TooltipProvider:s,TooltipTrigger:c}=fl;return e?(0,H.jsx)(s,{delayDuration:250,children:(0,H.jsxs)(a,{children:[(0,H.jsx)(c,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,onClick:()=>void r(),className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,"aria-label":i,children:n?(0,H.jsx)(wr,{className:`h-3.5 w-3.5`}):(0,H.jsx)(xa,{className:`h-3.5 w-3.5`})})}),(0,H.jsx)(o,{side:`top`,className:`text-xs`,children:i})]})}):null}function YP({action:e,onAction:t}){let{Tooltip:n,TooltipContent:r,TooltipProvider:i,TooltipTrigger:a}=fl;return(0,H.jsx)(i,{delayDuration:250,children:(0,H.jsxs)(n,{children:[(0,H.jsx)(a,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":e.label,className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground`,disabled:e.disabled,onClick:()=>t(e),children:e.icon===`edit`?(0,H.jsx)(yo,{className:`h-3.5 w-3.5`}):(0,H.jsx)(ma,{"data-testid":`chat-continue-message-icon`,className:`h-3.5 w-3.5`})})}),(0,H.jsx)(r,{side:`top`,className:`text-xs`,children:e.label})]})})}function XP({action:e,open:t,onOpenChange:n,restoreFocusRef:r}){let{Dialog:i,DialogContent:a,DialogDescription:o,DialogHeader:s,DialogTitle:c}=fl;return(0,H.jsx)(i,{open:t,onOpenChange:n,children:(0,H.jsxs)(a,{className:`sm:max-w-xl`,closeLabel:e.dialog.closeLabel,onCloseAutoFocus:e=>{e.preventDefault(),r.current?.focus()},children:[(0,H.jsxs)(s,{className:`space-y-1 pr-8 text-left`,children:[(0,H.jsx)(c,{className:`text-lg font-semibold leading-tight text-foreground`,children:e.dialog.title}),e.dialog.description?(0,H.jsx)(o,{className:`text-sm leading-relaxed text-muted-foreground`,children:e.dialog.description}):null]}),(0,H.jsx)(`dl`,{className:`divide-y divide-border/70 rounded-xl border border-border/80 bg-muted/20 px-4`,children:e.dialog.rows.map(e=>(0,H.jsxs)(`div`,{className:`grid gap-1 py-3 sm:grid-cols-[11rem_minmax(0,1fr)] sm:gap-4`,children:[(0,H.jsx)(`dt`,{className:`text-xs font-medium text-muted-foreground`,children:e.label}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-xs leading-5 text-foreground`,children:e.value})]},e.label))})]})})}function ZP({message:e}){let[t,n]=(0,V.useState)(!1),[r,i]=(0,V.useState)(!1),[a,o]=(0,V.useState)(null),s=(0,V.useRef)(null),{moreActions:c}=e,{Popover:l,PopoverContent:u,PopoverTrigger:d,Tooltip:f,TooltipContent:p,TooltipProvider:m,TooltipTrigger:h}=fl;return c?.items.length?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(l,{open:t,onOpenChange:n,children:[(0,H.jsx)(m,{delayDuration:250,children:(0,H.jsxs)(f,{children:[(0,H.jsx)(h,{asChild:!0,children:(0,H.jsx)(d,{asChild:!0,children:(0,H.jsx)(`button`,{ref:s,type:`button`,"aria-label":c.triggerLabel,className:`flex items-center justify-center rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/35`,children:(0,H.jsx)(Ea,{className:`h-3.5 w-3.5`})})})}),(0,H.jsx)(p,{side:`top`,className:`text-xs`,children:c.triggerLabel})]})}),(0,H.jsx)(u,{align:`end`,className:`w-52 p-1`,role:`menu`,children:c.items.map(e=>(0,H.jsx)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center rounded-lg px-3 py-2 text-left text-sm text-foreground transition-colors hover:bg-[var(--interaction-hover)] focus-visible:bg-accent focus-visible:outline-none`,onClick:()=>{n(!1),o(e),i(!0)},children:e.label},e.key))})]}),a?(0,H.jsx)(XP,{action:a,open:r,onOpenChange:i,restoreFocusRef:s}):null]}):null}function QP({message:e,onAction:t,texts:n}){let r=(0,V.useMemo)(()=>e.parts.map(e=>e.type===`markdown`||e.type===`unknown`?e.text:``).filter(e=>!!e?.trim()).join(`
54
+
55
+ `),[e.parts]);return(0,H.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[t?e.actions?.map(e=>(0,H.jsx)(YP,{action:e,onAction:t},e.key)):null,(0,H.jsx)(JP,{messageText:r,texts:n}),(0,H.jsx)(ZP,{message:e})]})}var $P=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g,eF=`
56
+ @keyframes nextclaw-chat-typing-text-sheen {
57
+ 0% {
58
+ background-position: 160% 0;
59
+ }
60
+ 100% {
61
+ background-position: -60% 0;
62
+ }
63
+ }
64
+ .nextclaw-chat-typing-indicator__text {
65
+ background-image: linear-gradient(
66
+ 100deg,
67
+ hsl(var(--muted-foreground)) 0%,
68
+ hsl(var(--muted-foreground)) 34%,
69
+ hsl(var(--foreground-tertiary)) 43%,
70
+ hsl(var(--foreground-muted)) 50%,
71
+ hsl(var(--foreground-tertiary)) 57%,
72
+ hsl(var(--muted-foreground)) 66%,
73
+ hsl(var(--muted-foreground)) 100%
74
+ );
75
+ background-size: 240% 100%;
76
+ background-position: 160% 0;
77
+ -webkit-background-clip: text;
78
+ background-clip: text;
79
+ color: transparent;
80
+ -webkit-text-fill-color: transparent;
81
+ animation: nextclaw-chat-typing-text-sheen 2.5s linear infinite;
82
+ }
83
+
84
+ @media (prefers-reduced-motion: reduce) {
85
+ .nextclaw-chat-typing-indicator__text {
86
+ animation: none;
87
+ background-image: none;
88
+ color: hsl(var(--muted-foreground));
89
+ -webkit-text-fill-color: currentColor;
90
+ }
91
+ }
92
+ `;function tF(e){let t=e.trim();return t?t.replace($P,``).trim().length>0:!1}function nF(e){return(e.role===`assistant`||e.role===`user`)&&e.status!==`streaming`&&e.status!==`pending`}function rF(e){return e.role!==`user`&&(e.status===`streaming`||e.status===`pending`)}function iF(e,t){return e.role===`user`&&e.status===`pending`?{label:t.pendingInputLabel??`Waiting for the next step`,role:`status`}:{label:`${e.roleLabel} · ${e.timestampLabel}`}}function aF(e){return e.some(e=>e.role===`assistant`&&(e.status===`streaming`||e.status===`pending`))}function oF(e){return e.parts.some(e=>e.type===`markdown`||e.type===`reasoning`?tF(e.text):!0)}function sF(e,t){return e===`flat`&&!t}function cF(){return(0,H.jsx)(`div`,{className:`flex items-center gap-2 px-1 py-0.5 text-[11px] text-muted-foreground`,children:(0,H.jsxs)(`div`,{className:`flex space-x-1 items-center h-full`,children:[(0,H.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse`}),(0,H.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse [animation-delay:200ms]`}),(0,H.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground animate-pulse [animation-delay:400ms]`})]})})}function lF({label:e,layout:t}){return(0,H.jsxs)(`div`,{"data-chat-message-surface":t===`flat`?`flat`:`card`,className:U(`text-sm text-muted-foreground`,t===`flat`?`py-1`:`rounded-2xl border border-border bg-card px-4 py-3 shadow-sm`),children:[(0,H.jsx)(`style`,{children:eF}),(0,H.jsx)(`span`,{className:`nextclaw-chat-typing-indicator__text`,children:e})]})}function uF({assistantAvatarIcon:e,showAssistantHeader:t=!0,className:n,isSending:r,layout:i=`card`,messages:a,onAttachmentOpen:o,onFileOpen:s,onInlineTokenClick:c,onMessageAction:l,onToolAction:u,resolveMessageToolPayloadState:d,onMessageToolPayloadRequest:f,renderCustomPart:p,renderInlineDisplay:m,renderMessageContent:h,renderPanelAppCard:g,renderToolAgent:_,resolveFileContentUrl:v,texts:y}){let b=sF(i,t),x=a.filter(oF),S=aF(x);return(0,H.jsxs)(`div`,{className:U(`space-y-5`,n),children:[x.map(t=>{let n=t.role===`user`,r=rF(t),a=iF(t,y),x=nF(t),S=(0,H.jsx)(qP,{layout:i,message:t,texts:y,onToolAction:u,toolPayloadState:d?.(t.id),onToolPayloadRequest:f,onFileOpen:s,onAttachmentOpen:o,onInlineTokenClick:c,resolveFileContentUrl:v,renderCustomPart:p,renderInlineDisplay:m,renderToolAgent:_,renderPanelAppCard:g}),C=h?.(t)??S;return i===`flat`&&!n?(0,H.jsxs)(`article`,{"data-chat-message-id":t.id,"data-chat-message-layout":`flat`,"data-chat-message-role":t.role,"data-chat-message-role-label":t.roleLabel,"data-chat-message-selectable":String(x),className:`w-full min-w-0 space-y-2`,children:[(0,H.jsxs)(`div`,{"data-chat-message-header":`flat`,hidden:b,className:U(`flex min-w-0 items-center gap-2.5`,{hidden:b}),children:[(0,H.jsx)(Hb,{assistantIcon:e,role:t.role,size:`compact`}),(0,H.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:t.roleLabel})]}),(0,H.jsx)(`div`,{"data-chat-message-body":`flat`,className:`min-w-0 w-full`,children:C}),r?(0,H.jsx)(`div`,{className:`w-full`,children:(0,H.jsx)(cF,{})}):(0,H.jsxs)(`div`,{"data-chat-message-footer":`flat`,className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsxs)(`span`,{className:`px-1 text-[11px] leading-4 text-muted-foreground`,children:[t.timestampLabel,t.executionSummaryLabel?` · ${t.executionSummaryLabel}`:null]}),(0,H.jsx)(QP,{message:t,onAction:e=>l?.(t,e),texts:y})]})]},t.id):(0,H.jsxs)(`div`,{"data-chat-message-id":t.id,"data-chat-message-layout":`card`,"data-chat-message-role":t.role,"data-chat-message-role-label":t.roleLabel,"data-chat-message-selectable":String(x),className:U(`flex gap-3`,n?`justify-end`:`justify-start`),children:[n?null:(0,H.jsx)(Hb,{assistantIcon:e,role:t.role}),(0,H.jsxs)(`div`,{className:U(`w-fit max-w-[92%] space-y-2 has-[[data-chat-message-wide-content=true]]:w-full`,n&&`flex flex-col items-end`),children:[C,(0,H.jsx)(`div`,{className:U(`flex flex-wrap items-center gap-2`,n&&`justify-end`),children:r?(0,H.jsx)(cF,{}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{role:a.role,className:U(`px-1 text-[11px] leading-4 text-muted-foreground`,n?`text-right`:`text-left`),children:[a.label,t.executionSummaryLabel?` · ${t.executionSummaryLabel}`:null]}),(0,H.jsx)(QP,{message:t,onAction:e=>l?.(t,e),texts:y})]})})]}),n?(0,H.jsx)(Hb,{role:t.role}):null]},t.id)}),r&&!S?(0,H.jsxs)(`div`,{"data-chat-message-layout":i,className:`flex justify-start gap-3`,children:[(0,H.jsx)(`div`,{hidden:b,className:U({hidden:b}),children:(0,H.jsx)(Hb,{assistantIcon:e,role:`assistant`,size:i===`flat`?`compact`:`default`})}),(0,H.jsx)(lF,{label:y.typingLabel,layout:i})]}):null]})}var dF=12,fF=10;function pF(e,t){return t.rangeCount>0&&!t.isCollapsed&&e.contains(t.getRangeAt(0).commonAncestorContainer)}function mF(e){return typeof e.getClientRects==`function`?Array.from(e.getClientRects()).filter(e=>e.width>0||e.height>0):[]}function hF(e){if(e.commonAncestorContainer.nodeType===Node.TEXT_NODE)return mF(e);let t=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_TEXT),n=[];for(let r=t.nextNode();r;r=t.nextNode()){if(!(r instanceof Text)||!r.data||!e.intersectsNode(r))continue;let t=document.createRange();t.selectNodeContents(r),r===e.startContainer&&t.setStart(r,e.startOffset),r===e.endContainer&&t.setEnd(r,e.endOffset),n.push(...mF(t))}return n}function gF(e){let t=hF(e),n=t.length>0?t:mF(e),r=n.length>0?n:[e.getBoundingClientRect()],i=r.map(e=>({bottom:Math.min(e.bottom,window.innerHeight),left:Math.max(e.left,0),right:Math.min(e.right,window.innerWidth),top:Math.max(e.top,0)})).filter(e=>e.right>e.left&&e.bottom>e.top),a=i.length>0?i:r,o=Math.min(...a.map(e=>e.left)),s=Math.max(...a.map(e=>e.right));return{bottom:Math.max(...a.map(e=>e.bottom)),center:o+(s-o)/2,top:Math.min(...a.map(e=>e.top))}}function _F(e,t,n){return Math.min(Math.max(e,t),Math.max(t,n))}function vF({actionLabel:e,children:t,className:n=`contents`,isSelectionAllowed:r,maxCharacters:i,onAddToChat:a,selectionTooLongLabel:o}){let s=(0,V.useRef)(null),c=(0,V.useRef)(null),l=(0,V.useRef)(!1),u=(0,V.useRef)(null),[d,f]=(0,V.useState)(null),[p,m]=(0,V.useState)(null),h=(0,V.useCallback)(()=>{let e=s.current,t=window.getSelection();if(!e||!t||!pF(e,t)){f(null);return}let n=t.toString().trim();if(!n){f(null);return}let a=t.getRangeAt(0),o=gF(a),c={range:a.cloneRange(),text:n};if(r&&!r(c)){f(null);return}m(null),f({anchorBottom:o.bottom,anchorCenter:o.center,anchorTop:o.top,selection:c,tooLong:n.length>i})},[r,i]),g=(0,V.useCallback)(()=>{u.current!==null&&window.cancelAnimationFrame(u.current),u.current=window.requestAnimationFrame(()=>{u.current=null,h()})},[h]),_=(0,V.useCallback)(e=>{if(c.current=e,!d||!e)return;let t=e.getBoundingClientRect(),n=_F(d.anchorCenter-t.width/2,dF,window.innerWidth-dF-t.width),r=d.anchorBottom+fF,i=d.anchorTop-fF-t.height;m({left:n,top:_F(i>=dF?i:r,dF,window.innerHeight-dF-t.height)})},[d]);return(0,V.useEffect)(()=>{let e=()=>{let e=window.getSelection();if(!e||e.isCollapsed){f(null);return}l.current||g()},t=e=>{let t=s.current;l.current=!!(t&&e.target instanceof Node&&t.contains(e.target)),l.current&&f(null)},n=e=>{if(c.current?.contains(e.target))return;let t=l.current;l.current=!1,t&&g()},r=e=>{e.key===`Escape`&&f(null)},i=()=>f(null);return document.addEventListener(`selectionchange`,e),document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`pointerup`,n,!0),document.addEventListener(`keydown`,r),document.addEventListener(`scroll`,i,!0),window.addEventListener(`resize`,i),()=>{document.removeEventListener(`selectionchange`,e),document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`pointerup`,n,!0),document.removeEventListener(`keydown`,r),document.removeEventListener(`scroll`,i,!0),window.removeEventListener(`resize`,i),u.current!==null&&window.cancelAnimationFrame(u.current)}},[g]),(0,H.jsxs)(`div`,{ref:s,className:n,children:[t,d&&a?(0,uy.createPortal)((0,H.jsxs)(`button`,{ref:_,type:`button`,className:`fixed z-[var(--z-popover,10100)] inline-flex max-w-[calc(100vw-24px)] items-center gap-1.5 overflow-hidden whitespace-nowrap rounded-xl border border-border bg-popover px-3 py-2 text-xs font-medium text-popover-foreground shadow-lg transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 disabled:cursor-not-allowed disabled:text-muted-foreground`,style:{left:p?.left??0,top:p?.top??0,visibility:p?`visible`:`hidden`},disabled:d.tooLong,onMouseDown:e=>e.preventDefault(),onClick:()=>{d.tooLong||(a(d.selection),window.getSelection()?.removeAllRanges(),f(null))},children:[(0,H.jsx)(to,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:d.tooLong?o:e})]}),document.body):null]})}function yF(e){return{key:e.key,triggerSpecs:[e.trigger],resolvePanel:t=>t.trigger.key===e.trigger.key?e.resolvePanel(t):null}}function bF(e){let{data:t,plugins:n,trigger:r}=e,i=n.flatMap(e=>[...e.triggerSpecs]);if(!r)return{triggerSpecs:i,panel:null};for(let e of n){let n=e.resolvePanel({data:t,trigger:r});if(n)return{triggerSpecs:i,panel:n}}return{triggerSpecs:i,panel:null}}var xF=`2rem`;function SF(e){return`min(${e}, max(0px, calc(var(--radix-popover-content-available-height, 100vh) - ${xF})))`}var CF=SF(`24rem`),wF=Rc,TF=Bc,EF=zc,DF=V.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,collisionPadding:r=12,style:i,...a},o)=>(0,H.jsx)(Vc,{children:(0,H.jsx)(Hc,{ref:o,sideOffset:t,align:n,collisionPadding:r,className:u(`z-[var(--z-popover,10100)] w-72 overflow-x-hidden overflow-y-auto rounded-2xl border border-border bg-popover p-4 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),style:{maxHeight:CF,...i},...a})}));DF.displayName=Hc.displayName;async function OF(e){let t=await bk(e);R[t?`success`:`error`](b(t?`chatSessionCopyIdSuccess`:`chatSessionCopyIdFailed`))}function kF({sessionKey:e,children:t,disabled:n=!1,triggerSize:r=`md`,triggerTone:i=`default`,className:a}){let[o,s]=(0,V.useState)(!1);return(0,H.jsxs)(wF,{open:o,onOpenChange:s,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(B,{icon:(0,H.jsx)(ci,{className:`h-4 w-4`}),label:b(`chatSessionMoreActions`),tooltip:!1,size:r,tone:i,className:a,disabled:n,onClick:e=>e.stopPropagation()})}),(0,H.jsx)(DF,{align:`end`,className:`w-56 p-2`,children:(0,H.jsxs)(`div`,{className:`space-y-1`,onClick:()=>s(!1),children:[(0,H.jsx)(Fs,{icon:xa,label:b(`chatSessionCopyId`),onClick:()=>{s(!1),OF(e)},disabled:n}),t]})})]})}function AF(e){try{return JSON.stringify(e??{},null,2)}catch{return`{}`}}function jF({open:e,metadata:t,onOpenChange:n}){return(0,H.jsx)(Ir,{open:e,onOpenChange:n,children:(0,H.jsxs)(zr,{className:`max-w-2xl gap-0 overflow-hidden p-0`,children:[(0,H.jsxs)(Lr,{className:`border-b border-border px-5 py-4 pr-12`,children:[(0,H.jsx)(Br,{className:`text-base`,children:b(`chatSessionMetadataDialogTitle`)}),(0,H.jsx)(Nr,{className:`sr-only`,children:b(`chatSessionMetadataDialogDescription`)})]}),(0,H.jsx)(`div`,{className:`px-5 pb-5 pt-4`,children:(0,H.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto rounded-lg border border-border bg-muted/60 p-4 font-mono text-xs leading-6 text-foreground shadow-inner custom-scrollbar`,children:AF(t)})})]})})}function MF(e){return[`server-path-browse`,e.path?.trim()??``,e.basePath?.trim()??``,e.includeFiles??!1]}function NF(e){let{basePath:t,enabled:n,includeFiles:r,path:i}=e,a=i?.trim()??``,o=t?.trim()??``;return Ot({queryKey:MF({path:a,basePath:o,includeFiles:r}),queryFn:()=>dt({path:a,basePath:o,includeFiles:r}),enabled:n??!0,staleTime:0})}function PF(){return jt({mutationFn:Wt})}var FF=`[mask-image:linear-gradient(to_bottom,black_calc(100%_-_28px),transparent)] [-webkit-mask-image:linear-gradient(to_bottom,black_calc(100%_-_28px),transparent)]`,IF=V.forwardRef(({className:e,children:t,...n},r)=>(0,H.jsx)(`div`,{ref:r,className:u(`overflow-auto`,e),...n,children:t}));IF.displayName=`ScrollArea`;function LF({entries:e,emptyMessage:t,disabled:n,onOpen:r,onSelect:i,selectedPath:a}){let o=(e,t)=>{e.preventDefault();let n=Array.from(e.currentTarget.parentElement?.querySelectorAll(`[data-server-path-row]`)??[]),r=n[n.indexOf(e.currentTarget)+t];r&&(r.focus(),r.click())};return(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-background`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_8rem] border-b border-border bg-muted/20 px-3 py-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{children:b(`pathPickerNameColumn`)}),(0,H.jsx)(`span`,{children:b(`pathPickerTypeColumn`)})]}),(0,H.jsx)(IF,{className:`min-h-0 flex-1`,children:e.length>0?(0,H.jsx)(`div`,{role:`listbox`,"aria-label":b(`pathPickerDirectoryList`),className:`p-1.5`,children:e.map(e=>{let t=a===e.path;return(0,H.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,"data-server-path-row":!0,className:u(`grid w-full grid-cols-[minmax(0,1fr)_8rem] items-center rounded-sm border border-transparent px-2 py-1.5 text-left text-sm text-foreground outline-none transition-colors`,t?`border-primary/25 bg-primary/15`:`hover:bg-[var(--interaction-hover)] focus-visible:border-primary/35 focus-visible:bg-accent/70`),onClick:()=>i(e.path),onDoubleClick:()=>r(e.path),onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),r(e.path)),t.key===`ArrowDown`&&o(t,1),t.key===`ArrowUp`&&o(t,-1)},disabled:n,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(Ga,{className:`h-4 w-4 shrink-0 fill-amber-300 text-amber-500`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]}),(0,H.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:b(`pathPickerDirectoryType`)})]},e.path)})}):(0,H.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center px-6 text-center text-sm text-muted-foreground`,children:t})})]})}function RF({confirmLabel:e,disabled:t,hint:n,isSaving:r,onCancel:i,onSelectedPathChange:a,pathLabel:o,pathPlaceholder:s,selectedPath:c}){return(0,H.jsxs)(`div`,{className:`min-w-0 border-t border-border bg-muted/20 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(rn,{htmlFor:`server-path-picker-selection`,className:`shrink-0 text-sm`,children:o}),(0,H.jsx)(vt,{id:`server-path-picker-selection`,value:c,onChange:e=>a(e.target.value),placeholder:s,disabled:r,className:`h-9 min-w-0 flex-1 bg-background`}),(0,H.jsxs)(Dr,{className:`shrink-0 flex-row gap-2`,children:[(0,H.jsx)(L,{type:`button`,variant:`outline`,onClick:i,disabled:r,children:b(`cancel`)}),(0,H.jsx)(L,{type:`submit`,disabled:t,children:r?b(`saving`):e})]})]}),n?(0,H.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:n}):null]})}var zF={applications:Ur,desktop:ao,documents:Cn,downloads:wa,home:Ya,"icloud-drive":_a,workspace:za,root:Ja,volumes:Ja},BF={applications:`pathPickerApplications`,desktop:`pathPickerDesktop`,documents:`pathPickerDocuments`,downloads:`pathPickerDownloads`,"icloud-drive":`pathPickerICloudDrive`,volumes:`pathPickerVolumes`};function VF({currentPath:e,defaultWorkspacePath:t,disabled:n,homePath:r,locations:i,rootPath:a,onNavigate:o}){let s=[],c=[],l=new Set,d=(e,t)=>{let n=t.path.trim();!n||l.has(n)||(l.add(n),e.push({...t,path:n}))};t&&d(s,{icon:`workspace`,label:b(`pathPickerDefaultWorkspace`),path:t}),r&&d(s,{icon:`home`,label:b(`homeDirectory`),path:r});for(let e of i)d(e.kind===`volumes`?c:s,{icon:e.kind,label:b(BF[e.kind]),path:e.path});a&&d(c,{icon:`root`,label:b(`pathPickerFileSystem`),path:a});let f=t=>t.map(t=>{let r=zF[t.icon],i=e===t.path;return(0,H.jsxs)(`button`,{type:`button`,className:u(`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,i?`bg-primary/12 text-primary`:`text-foreground hover:bg-[var(--interaction-hover)]`),"aria-current":i?`location`:void 0,onClick:()=>o(t.path),disabled:n,children:[(0,H.jsx)(r,{className:u(`h-4 w-4 shrink-0`,i?`text-primary`:`text-amber-500`)}),(0,H.jsx)(`span`,{className:`truncate`,children:t.label})]},t.path)});return(0,H.jsxs)(`aside`,{className:`hidden min-h-0 w-48 shrink-0 overflow-y-auto border-r border-border bg-muted/20 p-2 sm:block`,children:[(0,H.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 px-2 py-1.5 text-xs font-medium text-muted-foreground`,children:[(0,H.jsx)(Lo,{className:`h-3.5 w-3.5`}),b(`pathPickerQuickAccess`)]}),(0,H.jsx)(`nav`,{"aria-label":b(`pathPickerQuickAccess`),className:`space-y-0.5`,children:f(s)}),c.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`mb-1 mt-3 px-2 py-1.5 text-xs font-medium text-muted-foreground`,children:b(`pathPickerLocations`)}),(0,H.jsx)(`nav`,{"aria-label":b(`pathPickerLocations`),className:`space-y-0.5`,children:f(c)})]}):null]})}function HF({addressPath:e,breadcrumbs:t,canGoBack:n,canGoForward:r,canGoUp:i,disabled:a,onBack:o,onForward:s,onNavigate:c,onRefresh:l,onSearchChange:u,onUp:d,searchText:f}){let[p,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(``),_=t.length>5?[t[0],...t.slice(-4)]:t,v=_.length<t.length,y=()=>{a||(g(e),m(!0))},x=()=>{g(``),m(!1)},S=()=>{let e=h.trim();e&&(m(!1),c(e))};return(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden border-b border-border bg-muted/25 px-3 py-2`,children:[(0,H.jsx)(B,{icon:(0,H.jsx)(li,{className:`h-4 w-4`}),label:b(`pathPickerBack`),size:`lg`,onClick:o,disabled:!n||a}),(0,H.jsx)(B,{icon:(0,H.jsx)(si,{className:`h-4 w-4`}),label:b(`pathPickerForward`),size:`lg`,onClick:s,disabled:!r||a}),(0,H.jsx)(B,{icon:(0,H.jsx)(Ua,{className:`h-4 w-4`}),label:b(`parentDirectory`),size:`lg`,onClick:d,disabled:!i||a}),(0,H.jsx)(`div`,{className:`ml-1 flex h-9 min-w-0 flex-1 items-center overflow-hidden rounded-md border border-border bg-background shadow-sm`,children:p?(0,H.jsx)(vt,{value:h,onChange:e=>g(e.target.value),onBlur:x,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S()),e.key===`Escape`&&(e.preventDefault(),x())},"aria-label":b(`pathPickerAddressLabel`),className:`h-full rounded-none border-0 bg-transparent px-3 shadow-none focus-visible:ring-0`,autoFocus:!0}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Ga,{className:`ml-3 h-4 w-4 shrink-0 text-amber-500`}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center overflow-hidden pl-2`,onDoubleClick:y,children:[_.length>0?_.map((e,t)=>(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center`,children:[t>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(sa,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),v&&t===1?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,className:`rounded px-1.5 py-1 text-sm text-muted-foreground hover:bg-[var(--interaction-hover)]`,"aria-label":b(`pathPickerShowFullAddress`),onClick:y,children:`…`}),(0,H.jsx)(sa,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}):null]}):null,(0,H.jsx)(`button`,{type:`button`,className:`max-w-40 truncate rounded px-1.5 py-1 text-sm text-foreground hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>c(e.path),disabled:a,children:e.label})]},e.path)):(0,H.jsx)(`span`,{className:`truncate text-sm text-foreground`,children:e}),(0,H.jsx)(`span`,{className:`h-full min-w-2 flex-1 cursor-text`,"aria-hidden":`true`}),(0,H.jsx)(B,{icon:(0,H.jsx)(yo,{className:`h-3.5 w-3.5`}),label:b(`pathPickerEditAddress`),size:`md`,tooltipSide:`bottom`,onClick:y,disabled:a,className:`mr-1`})]})]})}),(0,H.jsx)(B,{icon:(0,H.jsx)(So,{className:`h-4 w-4`}),label:b(`chatRefresh`),size:`lg`,onClick:l,disabled:a}),(0,H.jsxs)(`div`,{className:`relative hidden w-56 shrink-0 sm:block`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(vt,{value:f,onChange:e=>u(e.target.value),placeholder:b(`pathPickerSearchPlaceholder`),disabled:a,className:`h-9 rounded-md bg-background pl-9`})]})]})}function UF({errorMessage:e,isCreating:t,name:n,onCancel:r,onCreate:i,onNameChange:a}){return(0,H.jsxs)(`div`,{className:`border-b border-gray-200 bg-white px-3 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(vt,{value:n,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i()),e.key===`Escape`&&r()},placeholder:b(`pathPickerNewFolderPlaceholder`),"aria-label":b(`pathPickerNewFolderName`),autoFocus:!0,disabled:t}),(0,H.jsx)(L,{type:`button`,onClick:i,disabled:!n.trim()||t,children:b(t?`saving`:`pathPickerCreateFolder`)}),(0,H.jsx)(L,{type:`button`,variant:`outline`,onClick:r,disabled:t,children:b(`cancel`)})]}),e?(0,H.jsxs)(`p`,{role:`alert`,className:`mt-2 text-sm text-destructive`,children:[b(`pathPickerCreateFolderFailed`),`: `,e]}):null]})}function WF({allowCreateDirectory:e,disabled:t,onNewFolder:n}){return(0,H.jsxs)(`div`,{className:`flex items-center border-b border-border bg-background px-3 py-1.5`,children:[e?(0,H.jsxs)(L,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,disabled:t,children:[(0,H.jsx)(Va,{className:`mr-1 h-4 w-4`}),b(`pathPickerNewFolder`)]}):null,(0,H.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:b(`pathPickerDoubleClickHint`)})]})}function GF(e,t){if(!t)return e;if(e===`~`)return t;let n=t.includes(`\\`);if(e.startsWith(`~/`)||n&&e.startsWith(`~\\`)){let r=n?`\\`:`/`,i=e.slice(2).replaceAll(r===`\\`?`/`:`\\`,r);return`${t.replace(/[\\/]+$/,``)}${r}${i}`}return e}function KF({open:e,allowCreateDirectory:t=!0,currentPath:n,defaultWorkspacePath:r,isSaving:i,onOpenChange:a,onConfirm:o,title:s,description:c,pathLabel:l,pathPlaceholder:u,confirmLabel:d,hint:f}){let p=n?.trim()??``,m=r?.trim()??``,h=`${p}\u0000${m}`;return(0,H.jsx)(Ir,{open:e,onOpenChange:e=>{i||a(e)},children:(0,H.jsxs)(zr,{className:`max-h-[92vh] overflow-hidden p-0 sm:h-[44rem] sm:max-w-5xl sm:grid-rows-[auto_minmax(0,1fr)]`,children:[(0,H.jsxs)(Lr,{className:`border-b border-border px-5 py-4 pr-12`,children:[(0,H.jsx)(Br,{children:s}),(0,H.jsx)(Nr,{className:c?void 0:`sr-only`,children:c??s})]}),e?(0,H.jsx)(qF,{allowCreateDirectory:t,currentPath:p,defaultWorkspacePath:m,isSaving:i,onCancel:()=>a(!1),onConfirm:o,pathLabel:l,pathPlaceholder:u,confirmLabel:d,hint:f},h):null]})})}function qF({allowCreateDirectory:e,currentPath:t,defaultWorkspacePath:n,isSaving:r,onCancel:i,onConfirm:a,pathLabel:o,pathPlaceholder:s,confirmLabel:c,hint:l}){let u=t||n,[d,f]=(0,V.useState)(u||null),[p,m]=(0,V.useState)(u||null),[h,g]=(0,V.useState)([]),[_,v]=(0,V.useState)([]),[y,x]=(0,V.useState)(``),[S,C]=(0,V.useState)(!1),[w,T]=(0,V.useState)(``),E=NF({path:p,enabled:!0}),D=PF(),O=GF(p?.trim()??``,E.data?.homePath),k=d===null?E.data?.currentPath??``:d===p&&E.data?.currentPath===O?E.data.currentPath:d,A=k.trim(),ee=A.length===0||r,j=O||E.data?.currentPath||``,M=!p||E.data?.currentPath===j?E.data?.breadcrumbs??[]:[],N=(0,V.useMemo)(()=>E.error?E.error instanceof Error?E.error.message:String(E.error):null,[E.error]),te=(0,V.useMemo)(()=>D.error?D.error instanceof Error?D.error.message:String(D.error):null,[D.error]),P=w.trim().toLowerCase(),ne=(0,V.useMemo)(()=>(E.data?.entries??[]).filter(e=>e.kind===`directory`),[E.data?.entries]),re=(0,V.useMemo)(()=>P.length===0?ne:ne.filter(e=>{let t=e.name.toLowerCase(),n=e.path.toLowerCase();return t.includes(P)||n.includes(P)}),[ne,P]),ie=e=>{m(e),f(e),T(``),C(!1),x(``),D.reset()},ae=e=>{let t=e.trim();if(!t)return;let n=j;n&&n!==t&&g(e=>[...e,n].slice(-50)),v([]),ie(t)},oe=()=>{let e=h.at(-1);if(!e)return;let t=j;g(e=>e.slice(0,-1)),t&&v(e=>[t,...e].slice(0,50)),ie(e)},se=()=>{let e=_[0];if(!e)return;let t=j;v(e=>e.slice(1)),t&&g(e=>[...e,t].slice(-50)),ie(e)},ce=async()=>{let t=E.data?.currentPath,n=y.trim();if(!(!e||!t||!n||D.isPending))try{let e=await D.mutateAsync({parentPath:t,name:n});await E.refetch(),f(e.path),x(``),C(!1)}catch{}},le=E.isLoading?b(`loading`):N?`${b(`pathBrowseFailed`)}: ${N}`:ne.length>0?b(`pathPickerSearchEmpty`):b(`emptyDirectory`),ue=r||E.isLoading;return(0,H.jsxs)(`form`,{className:`flex min-h-0 min-w-0 flex-col overflow-hidden`,onSubmit:e=>{e.preventDefault(),!ee&&a(A)},children:[(0,H.jsx)(HF,{addressPath:j,breadcrumbs:M,canGoBack:h.length>0,canGoForward:_.length>0,canGoUp:!!E.data?.parentPath,disabled:ue,onBack:oe,onForward:se,onNavigate:ae,onRefresh:()=>void E.refetch(),onSearchChange:T,onUp:()=>{let e=E.data?.parentPath;e&&ae(e)},searchText:w}),(0,H.jsx)(WF,{allowCreateDirectory:e,disabled:ue||!E.data?.currentPath,onNewFolder:()=>{C(!0),x(``),D.reset()}}),(0,H.jsxs)(`div`,{className:`relative border-b border-border p-2 sm:hidden`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(vt,{value:w,onChange:e=>T(e.target.value),placeholder:b(`pathPickerSearchPlaceholder`),disabled:ue,className:`h-9 pl-9`})]}),e&&S?(0,H.jsx)(UF,{errorMessage:te,isCreating:D.isPending,name:y,onCancel:()=>C(!1),onCreate:()=>void ce(),onNameChange:e=>{x(e),D.reset()}}):null,(0,H.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(0,H.jsx)(VF,{currentPath:j,defaultWorkspacePath:GF(n,E.data?.homePath)||null,disabled:ue,homePath:E.data?.homePath,locations:E.data?.locations??[],rootPath:E.data?.breadcrumbs[0]?.path,onNavigate:ae}),(0,H.jsx)(LF,{entries:re,emptyMessage:le,disabled:r,onOpen:ae,onSelect:f,selectedPath:A})]}),(0,H.jsx)(RF,{confirmLabel:c,disabled:ee,hint:l,isSaving:r,onCancel:i,onSelectedPathChange:f,pathLabel:o,pathPlaceholder:s,selectedPath:k})]})}function JF({open:e,currentProjectRoot:t,defaultWorkspacePath:n,isSaving:r,onOpenChange:i,onSave:a}){return(0,H.jsx)(KF,{open:e,currentPath:t,defaultWorkspacePath:n,isSaving:r,onOpenChange:i,onConfirm:a,title:b(`chatSessionProjectDialogTitle`),description:b(`chatSessionProjectDialogDescription`),pathLabel:b(`chatSessionProjectPathLabel`),pathPlaceholder:b(`chatSessionProjectPathPlaceholder`),confirmLabel:b(`chatSessionSetProject`),hint:b(`chatSessionProjectUpdateHint`)})}var YF=`flex shrink-0 items-center gap-1.5`;function XF({sessionKey:e,canDeleteSession:t,isDeletePending:n,currentPath:r,defaultWorkspacePath:i,metadata:a,isWorkspaceOpen:o,onToggleWorkspace:s,onDeleteSession:c}){let l=Ps(),[u,d]=(0,V.useState)(!1),[f,p]=(0,V.useState)(!1),[m,h]=(0,V.useState)(!1),g=n||m,_=async n=>{if(!e)return;let r=t;h(!0);try{await l({sessionKey:e,projectRoot:n,persistToServer:r}),d(!1)}finally{h(!1)}};return(0,H.jsxs)(`div`,{className:YF,children:[e?(0,H.jsxs)(kF,{sessionKey:e,disabled:g,children:[(0,H.jsx)(Fs,{icon:Ba,label:b(`chatSessionSetProject`),onClick:()=>d(!0),disabled:g}),(0,H.jsx)(Fs,{icon:Qi,label:b(`chatSessionViewMetadata`),onClick:()=>p(!0),disabled:g}),(0,H.jsx)(Fs,{icon:Vo,label:b(`chatDeleteSession`),onClick:c,disabled:!t||g,destructive:!0})]}):null,(0,H.jsx)(B,{icon:o?(0,H.jsx)(ho,{className:`h-4 w-4`}):(0,H.jsx)(Wr,{className:`h-4 w-4`}),label:b(o?`chatSessionCloseWorkspace`:`chatSessionOpenWorkspace`),"aria-pressed":o,onClick:s,disabled:g}),e?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(JF,{open:u,currentProjectRoot:r,defaultWorkspacePath:i,isSaving:m,onOpenChange:d,onSave:_}),(0,H.jsx)(jF,{open:f,metadata:a,onOpenChange:p})]}):null]})}var ZF={maxHeight:SF(`18rem`)};function QF({sessionKey:e,projectName:t,projectRoot:n,defaultWorkspacePath:r,persistToServer:i}){let a=Ps(),[o,s]=(0,V.useState)(!1),[c,l]=(0,V.useState)(!1),[u,d]=(0,V.useState)(!1),f=async t=>{d(!0);try{await a({sessionKey:e,projectRoot:t,persistToServer:i}),l(!1),s(!1)}finally{d(!1)}};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(wF,{open:o,onOpenChange:s,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,title:n??void 0,className:`min-w-0 max-w-[320px] shrink rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:border-primary/35 hover:bg-[var(--interaction-hover)] hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":b(`chatSessionSetProject`),disabled:u,children:(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(Ba,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:t}),(0,H.jsx)($n,{className:`h-3 w-3 shrink-0 opacity-70`})]})})}),(0,H.jsxs)(DF,{align:`start`,className:`w-72 p-2`,style:ZF,children:[(0,H.jsxs)(`div`,{className:`px-3 pb-2 pt-1`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:t}),n?(0,H.jsx)(`div`,{className:`mt-1 break-all text-xs text-muted-foreground`,children:n}):null]}),(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(Fs,{icon:yo,label:b(`chatSessionSetProject`),onClick:()=>{s(!1),l(!0)},disabled:u}),(0,H.jsx)(Fs,{icon:Wa,label:b(`chatSessionClearProject`),onClick:()=>{f(null)},disabled:u})]})]})]}),(0,H.jsx)(JF,{open:c,currentProjectRoot:n,defaultWorkspacePath:r,isSaving:u,onOpenChange:l,onSave:f})]})}var $F=(0,V.createContext)(null);function eI({presenter:e,children:t}){return(0,H.jsx)($F.Provider,{value:e,children:t})}function tI(){let e=(0,V.useContext)($F);if(!e)throw Error(`usePresenter must be used inside ChatPresenterProvider`);return e}var nI=[[`Thinking`,`thinking`],[`Calling tool`,`tool-running`],[`Tool call completed`,`tool-completed`],[`Run failed`,`run-failed`],[`Run interrupted`,`run-interrupted`]];function rI(e){let t=e.label?.trim();if(t)return t;let n=e.key.split(`:`);return n[n.length-1]||e.key}function iI(e,t){let n=e.statusText?.trim(),r=e.statusKind||!n?void 0:nI.find(([e])=>n===e||n.startsWith(`${e}: `)),i=e.statusKind??r?.[1],a=r?n?.slice(r[0].length).replace(/^:\s*/,``)||void 0:n;switch(i){case`thinking`:return b(`chatTyping`,t);case`tool-running`:return[b(`chatToolCall`,t),b(`chatToolStatusRunning`,t),a].filter(Boolean).join(` · `);case`tool-completed`:return[b(`chatToolCall`,t),b(`chatToolStatusCompleted`,t),a].filter(Boolean).join(` · `);case`run-failed`:return[b(`chatToolStatusFailed`,t),a].filter(Boolean).join(` · `);case`run-interrupted`:return b(`chatSessionActivityInterrupted`,t);default:return a??null}}function aI(e,t=M()){let n=e.activityPreview;return!n||n.state===`cancelled`?null:n.state===`completed`&&n.replyText?n.replyText:iI(n,t)??n.replyText??null}function oI(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function sI(e,t){return e.getFullYear()===t.getFullYear()}function cI(e,t){let n=`${e.getMonth()+1}月${e.getDate()}日`;return sI(e,t)?n:`${e.getFullYear()}年${n}`}function lI(e,t=M(),n=new Date){if(!e)return`-`;let r=e instanceof Date?e:new Date(e);if(Number.isNaN(r.getTime()))return typeof e==`string`?e:`-`;let i=S(t),a=oI(r),o=oI(n),s=Math.floor((o-a)/864e5);if(s===0)return new Intl.DateTimeFormat(i,{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(r);if(s===1)return b(`chatSidebarYesterday`,t);if(s>1&&s<7)return new Intl.DateTimeFormat(i,{weekday:`long`}).format(r);if(t===`zh`)return cI(r,n);let c=sI(r,n)?{month:`numeric`,day:`numeric`}:{year:`numeric`,month:`numeric`,day:`numeric`};return new Intl.DateTimeFormat(i,c).format(r)}function uI(e){return e.trim().toLowerCase()}function dI(e,t){let n=uI(t);return n?[e.key,rI(e),e.projectRoot??``,e.projectName??``].map(uI).some(e=>e.includes(n)):!0}var fI=function(e){return e.CALL=`call`,e.RESULT=`result`,e.PARTIAL_CALL=`partial-call`,e.ERROR=`error`,e.CANCELLED=`cancelled`,e}({});function pI(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function mI(e){return pI(e)}function hI(e){let t=pI(e);if(!t)return null;let n=t.replace(/[\\/]+$/,``);if(!n)return t;let r=n.split(/[\\/]/).filter(Boolean);return r[r.length-1]??n}function gI(e){return/^[A-Za-z]:[\\/]?$/.test(e)||e===`/`?e:e.replace(/[\\/]+$/,``)}function _I(e){let t=gI(e.trim().replace(/\\/g,`/`));return/^[A-Za-z]:/.test(t)?`${t.slice(0,1).toLowerCase()}${t.slice(1)}`:t}function vI(e,t){if(!e)return t.join(`/`);let n=gI(e.trim().replace(/\\/g,`/`));return t.length===0?n:n===`/`?`/${t.join(`/`)}`:`${n}/${t.join(`/`)}`}function yI(e){let t=gI(e.trim().replace(/\\/g,`/`));if(!t||t===`/`||/^[A-Za-z]:[\\/]?$/.test(t))return null;let n=t.lastIndexOf(`/`);if(n<0)return null;if(n===0)return`/`;let r=t.slice(0,n);return/^[A-Za-z]:$/.test(r)?`${r}/`:r}function bI(e){let t=e.trim().replace(/\\/g,`/`);return t?/^[A-Za-z]:\//.test(t)?{prefix:t.slice(0,2),segments:t.slice(3).split(`/`).filter(Boolean)}:t.startsWith(`/`)?{prefix:`/`,segments:t.slice(1).split(`/`).filter(Boolean)}:{prefix:null,segments:t.split(`/`).filter(Boolean)}:{prefix:null,segments:[]}}function xI(e){let t=_I(e.path),n=_I(e.sessionProjectRoot);if(!t||!n)return null;if(!t.startsWith(`/`)&&!/^[A-Za-z]:\//.test(t))return t.split(`/`).filter(Boolean);if(t===n)return[];let r=n.endsWith(`/`)?n:`${n}/`;return t.startsWith(r)?t.slice(r.length).split(`/`).filter(Boolean):null}function SI(e){let t=e.sessionProjectRoot?.trim();if(!t)return null;let n=xI({path:e.path,sessionProjectRoot:t});return!n?.length||n.some(e=>e===`.`||e===`..`)?null:n.join(`/`)}function CI(e){let{basePath:t=null,currentKind:n=`file`,labels:r,leading:i=null}=e,a=r.map((e,i)=>{let a=i===r.length-1?n:`directory`,o=vI(t,r.slice(0,i+1));return{key:`${i}:${e}`,label:e,kind:a,path:o,browsePath:a===`file`?yI(o):o,isCurrent:i===r.length-1}});return i?[i,...a]:a}function wI(e){let{kind:t=`file`,path:n,sessionProjectRoot:r,truncated:i}=e,a=n.trim(),o=r?.trim()&&a?xI({path:a,sessionProjectRoot:r}):null,s;if(r?.trim()&&o){let e=r.trim(),n=hI(e)??e;s=CI({labels:o,basePath:e,currentKind:t,leading:{key:`workspace:${n}`,label:n,kind:`workspace`,path:e,browsePath:e,isCurrent:o.length===0}})}else{let{prefix:e,segments:n}=bI(a),r=e===`/`?`/`:e?`${e}/`:null;s=CI({labels:n,basePath:r,currentKind:t,leading:e?{key:`root:${e}`,label:e,kind:`root`,path:r??e,browsePath:r??e,isCurrent:n.length===0}:null})}return s.length===0&&(s=[{key:`file:unknown`,label:a||`file`,kind:t,path:a,browsePath:t===`directory`?a:yI(a),isCurrent:!0}]),{fullPath:a,truncated:i,segments:s}}var TI=new Set([`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`]),EI=new Set([`running`,`completed`,`failed`,`cancelled`,`idle`]),DI=new Set([`thinking`,`tool-running`,`tool-completed`,`run-failed`,`run-interrupted`]);function OI(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function kI(e){let{metadata:t}=e;return!t||typeof t!=`object`||Array.isArray(t)?null:t}function AI(e){let t=kI(e)?.last_activity_preview;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,{state:r}=n,i=OI(n.timestamp);if(!EI.has(r)||!i)return null;let a=OI(n.statusKind);return{state:r,timestamp:i,statusKind:DI.has(a)?a:void 0,statusText:OI(n.statusText)??void 0,replyText:OI(n.replyText)??void 0}}function jI(e){let t=kI(e);return t?OI(t.preferred_model)??OI(t.preferredModel)??OI(t.model):null}function MI(e){let t=kI(e);if(!t)return null;let n=OI(t.preferred_thinking)??OI(t.thinking)??OI(t.thinking_level)??OI(t.thinkingLevel);if(!n)return null;let r=n.toLowerCase();return TI.has(r)?r:null}function NI(e){let t=kI(e);return t?OI(t.label):null}function PI(e){let t=kI(e);return t?mI(t.project_root??t.projectRoot):null}function FI(e){return OI(e.workingDir)}function II(e){let t=kI(e);return t?OI(t.ui_last_read_at):null}function LI(e){let t=kI(e);return t?OI(t.runtime)??OI(t.session_type)??OI(t.sessionType)??`native`:`native`}function RI(e){let t=kI(e);return t?OI(t.parent_session_id)??OI(t.parentSessionId):null}function zI(e){let t=kI(e);return t?OI(t.spawned_by_request_id)??OI(t.spawnedByRequestId):null}function BI(e){let t=kI(e);return t?t.child_session_promoted===!0:!1}function VI(e){if(e.startsWith(`cron:`))return{type:`cron`};if(e.startsWith(`agent:`)){let t=e.split(`:`);if(t.length>=3){let e=t[2];if(e&&e!==`main`&&e!==`direct`)return{channel:e}}}return{}}function HI(e){return e.state===`cancelled`?fI.CANCELLED:e.state===`result`?fI.RESULT:e.state===`partial-call`?fI.PARTIAL_CALL:fI.CALL}function UI(e){let t=[];for(let n of e.filter(e=>e.type!==`tool-invocation`||!e.payloadDeferred)){if(n.type===`text`){t.push({type:`text`,text:n.text});continue}if(n.type===`rich-text`){t.push({type:`text`,text:n.text});continue}if(n.type===`reasoning`){t.push({type:`reasoning`,reasoning:n.text,details:[]});continue}if(n.type===`source`){t.push({type:`source`,source:{sourceType:`url`,id:n.url??n.title??Math.random().toString(36).slice(2,8),url:n.url??``,...n.title?{title:n.title}:{}}});continue}if(n.type===`file`&&n.contentBase64){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:n.contentBase64,...n.url?{url:n.url}:{},...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`file`&&n.url){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:``,url:n.url,...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`file`&&n.assetUri){t.push({type:`file`,...n.name?{name:n.name}:{},mimeType:n.mimeType??`application/octet-stream`,data:``,url:Se(n.assetUri),...typeof n.sizeBytes==`number`?{sizeBytes:n.sizeBytes}:{}});continue}if(n.type===`step-start`){t.push({type:`step-start`});continue}n.type===`tool-invocation`&&t.push({type:`tool-invocation`,toolInvocation:{status:HI(n),toolCallId:n.toolCallId??`${n.toolName}-${Math.random().toString(36).slice(2,8)}`,toolName:n.toolName,args:typeof n.args==`string`?n.args:``,parsedArgs:n.args,result:n.result,...n.execution?{execution:{...n.execution}}:{}}})}return t}function WI(e){return e.flatMap(e=>e.type===`extension`?[e]:UI([e]))}function GI(e){return e===`service`?`system`:e===`tool`?`assistant`:e}function KI(e){return{id:e.id,role:GI(e.role),parts:UI(e.parts),meta:{source:`stream`,status:e.status,sessionKey:e.sessionId,timestamp:e.timestamp}}}function qI(e){let t=kI(e),n=NI(e),r=jI(e),i=MI(e),a=PI(e),o=FI(e)??a,s=II(e),c=OI(e.lastMessageAt),l=hI(a),u=VI(e.sessionId),d=RI(e),f=zI(e),p=BI(e),m=AI(e);return{key:e.sessionId,createdAt:e.createdAt??e.updatedAt,updatedAt:e.updatedAt,...c?{lastMessageAt:c}:{},...s?{readAt:s}:{},...typeof e.agentId==`string`&&e.agentId.trim().length>0?{agentId:e.agentId.trim()}:{},...n?{label:n}:{},...u,...r?{preferredModel:r}:{},...i?{preferredThinking:i}:{},...a?{projectRoot:a}:{},...o?{workingDir:o}:{},...l?{projectName:l}:{},...t?{metadata:t}:{},sessionType:LI(e),sessionTypeMutable:!1,status:e.status??`idle`,isChildSession:!!d,...p?{isPromotedChildSession:p}:{},...d?{parentSessionId:d}:{},...f?{spawnedByRequestId:f}:{},...m?{activityPreview:m}:{},messageCount:e.messageCount}}function JI(e){return e.map(qI)}function YI(){return`ncp-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}var XI=`nextclaw.chat.session-list.mode`,ZI=`time-first`;function QI(e){return e===`time-first`||e===`project-first`}function $I(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean))]:[]}function eL(e){if(!e||typeof e!=`object`)return null;let{snapshot:t}=e;return!t||typeof t!=`object`?null:QI(t.listMode)?t.listMode:null}function tL(e,t){let n=e?.trim();if(!n)return!1;let r=t?.trim();return r?n.localeCompare(r)>0:!1}function nL(e){let{active:t,readAt:n,runStatus:r,lastMessageAt:i}=e;return t||r===`running`?!1:tL(i,n)}var rL={selectedSessionKey:null,selectedAgentId:`main`,query:``,listMode:ZI,pinnedSessionKeys:[],pinnedProjectRoots:[],collapsedProjectRoots:[]};function iL(e){return t=>e(e=>({snapshot:{...e.snapshot,...t}}))}function aL(e){return(t,n)=>e(e=>{let r=t.trim(),i=n?.trim();if(!r||!i)return e;let a=e.optimisticReadAtBySessionKey[r];return a&&a.localeCompare(i)>=0?e:{...e,optimisticReadAtBySessionKey:{...e.optimisticReadAtBySessionKey,[r]:i}}})}var oL=N()(_i(e=>({snapshot:rL,optimisticReadAtBySessionKey:{},setSnapshot:iL(e),markSessionRead:aL(e)}),{name:XI,storage:vi(()=>window.localStorage),partialize:e=>({snapshot:{listMode:e.snapshot.listMode,pinnedSessionKeys:e.snapshot.pinnedSessionKeys,pinnedProjectRoots:e.snapshot.pinnedProjectRoots,collapsedProjectRoots:e.snapshot.collapsedProjectRoots}}),merge:(e,t)=>{if(!e||typeof e!=`object`)return t;let{snapshot:n}=e,r=eL(e);return{...t,snapshot:{...t.snapshot,...r?{listMode:r}:{},pinnedSessionKeys:$I(n?.pinnedSessionKeys),pinnedProjectRoots:$I(n?.pinnedProjectRoots),collapsedProjectRoots:$I(n?.collapsedProjectRoots)}}}})),sL={staleTime:5e3,retry:!1};function cL(e){return Ot({queryKey:[`ncp-sessions`,e?.limit??null,e?.peerId?.trim()||null],queryFn:()=>Be(e),...sL})}function lL(e){return Ot({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>je(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,...sL})}function uL(e){return Ot({queryKey:[`ncp-session-token-usage`,e],queryFn:()=>Pe(e),enabled:!!e,...sL})}var dL=e=>[`ncp-session-observations`,e];function fL(e){return Ot({queryKey:dL(e),queryFn:()=>Je(e),enabled:!!e,...sL})}function pL(e){let t=F();return jt({mutationFn:t=>oee(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:dL(e)})}})}function mL(e,t){return e.filter(e=>dI(e,t))}function hL(e){return e.isChildSession?e.isPromotedChildSession===!0:!0}function gL(e={}){let t=oL(e=>e.snapshot.query),n=e.query??t,r=cL({limit:e.limit??200}),i=(0,V.useMemo)(()=>mL(JI(r.data?.sessions??[]).filter(hL),n).map(e=>({session:e,runStatus:e.status===`running`?`running`:void 0})),[n,r.data?.sessions]);return{isLoading:r.isLoading,items:i}}function _L(e){return new Date(e.session.lastMessageAt??e.session.createdAt).getTime()}function vL(e){return[...e].sort((e,t)=>_L(t)-_L(e))}function yL(e,t){return[...e].sort((e,n)=>Number(t.has(n.session.key))-Number(t.has(e.session.key))||_L(n)-_L(e))}function bL(e,t=new Set){let n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),i=r-864e5,a=r-7*864e5,o=[],s=[],c=[],l=[],u=e.filter(e=>!t.has(e.session.key)),d=yL(e.filter(e=>t.has(e.session.key)),t);for(let e of u){let t=_L(e);t>=r?o.push(e):t>=i?s.push(e):t>=a?c.push(e):l.push(e)}let f=[];return d.length>0&&f.push({label:b(`chatSidebarPinned`),items:d}),o.length>0&&f.push({label:b(`chatSidebarToday`),items:o}),s.length>0&&f.push({label:b(`chatSidebarYesterday`),items:s}),c.length>0&&f.push({label:b(`chatSidebarPrevious7Days`),items:c}),l.length>0&&f.push({label:b(`chatSidebarOlder`),items:l}),f}function xL(e,t=new Set,n=new Set,r=[]){let i=new Map;for(let e of r)i.set(e.rootPath,{projectRoot:e.rootPath,projectName:e.name,items:[],latestUpdatedAt:new Date(e.updatedAt).getTime(),isPinned:n.has(e.rootPath)});for(let t of e){let e=t.session.projectRoot?.trim();if(!e)continue;let r=i.get(e),a=_L(t);if(r){r.items.push(t),r.latestUpdatedAt=Math.max(r.latestUpdatedAt,a);continue}i.set(e,{projectRoot:e,projectName:t.session.projectName?.trim()||hI(e)||e,items:[t],latestUpdatedAt:a,isPinned:n.has(e)})}return[...i.values()].map(e=>({...e,items:yL(e.items,t)})).sort((e,t)=>Number(t.isPinned)-Number(e.isPinned)||t.latestUpdatedAt-e.latestUpdatedAt)}function SL(e){let t=new Map;for(let n of e){let e=n.session.parentSessionId?.trim();if(!e)continue;let r=t.get(e)??[];r.push(n),t.set(e,r)}for(let e of t.values())e.sort((e,t)=>_L(t)-_L(e));return t}function CL(e){if(e.label&&e.label.trim())return e.label.trim();let t=e.key.split(`:`);return t[t.length-1]||e.key}function wL({isProjectFirstView:e,onSelectMode:t}){return(0,H.jsxs)(`div`,{role:`group`,"aria-label":b(`chatSidebarViewMode`),className:`relative grid h-7 grid-cols-2 rounded-full bg-foreground/[0.04] p-0.5 text-[11px]`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:u(`pointer-events-none absolute bottom-0.5 left-0.5 top-0.5 w-[calc(50%-2px)] rounded-full bg-gray-200/70 transition-transform duration-200 ease-out motion-reduce:transition-none`,e&&`translate-x-full`)}),(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":!e,onClick:()=>t(`time-first`),className:u(`relative z-10 inline-flex h-6 items-center justify-center gap-1 rounded-full px-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1`,e?`text-muted-foreground hover:text-foreground`:`font-medium text-foreground`),children:[(0,H.jsx)(ha,{"aria-hidden":`true`,className:`h-3.5 w-3.5`}),b(`chatSidebarViewTime`)]}),(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":e,onClick:()=>t(`project-first`),className:u(`relative z-10 inline-flex h-6 items-center justify-center gap-1 rounded-full px-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1`,e?`font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,H.jsx)(Ga,{"aria-hidden":`true`,className:`h-3.5 w-3.5`}),b(`chatSidebarViewProject`)]})]})}var TL=`native`;function EL(e){return typeof e==`string`?e.trim().toLowerCase()||`native`:TL}function DL(e,t=TL){return EL(e?.runtime?.trim()||e?.engine?.trim()||t)}function OL(e,t){return e===`native`?b(`chatSessionTypeNative`):t?.trim()||e.trim().split(/[-_]+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)||e}function kL(e){let t=new Map;for(let n of e){let e=EL(n.value);t.set(e,{value:e,label:n.label?.trim()||OL(e),icon:n.icon??null,ready:n.ready??!0,reason:n.reason??null,reasonMessage:n.reasonMessage??null,supportedModels:n.supportedModels,recommendedModel:n.recommendedModel??null,modelSelectionMode:n.modelSelectionMode??`nextclaw`,runtimeDefaultThinking:n.runtimeDefaultThinking??null,cta:n.cta??null})}return t.has(`native`)||t.set(TL,{value:TL,label:OL(TL),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}),Array.from(t.values()).sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}var AL={telegram:`telegram.svg`,slack:`slack.svg`,discord:`discord.svg`,whatsapp:`whatsapp.svg`,qq:`qq.svg`,feishu:`feishu.svg`,dingtalk:`dingtalk.svg`,wecom:`wecom.svg`,weixin:`weixin.svg`,email:`email.svg`};function jL(e,t){let n=e[t.toLowerCase()];return n?`/logos/${n}`:null}function ML(e){return jL(AL,e)}var NL={wx:`weixin`,lark:`feishu`},PL={cron:{icon:`cron`}},FL={codex:`chatSessionTypeCodex`,claude:`chatSessionTypeClaude`};function IL(e){return e?.trim().toLowerCase()??``}function LL(e){return e.split(/[-_]+/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function RL(e,t){let n=IL(e);if(!n||n===`native`)return null;let r=t.find(e=>IL(e.value)===n);return r?.label.trim()?r.label.trim():LL(n)}function zL(e,t){let n=IL(e);return!n||n===`native`?null:t.find(e=>IL(e.value)===n)??null}function BL(e){let t=IL(e);if(!t)return null;let n=NL[t]??t;return ML(n)?n:null}function VL(e,t){let n=BL(e.channel??``);if(n)return{icon:{kind:`channel-logo`,channel:n},label:null};let r=PL[IL(e.type)];if(r)return{icon:{kind:`symbol`,icon:r.icon},label:null};let i=IL(e.sessionType),a=zL(i,t);if(a?.icon?.src?.trim())return{icon:{kind:`runtime-image`,src:a.icon.src,alt:a.icon.alt??null,name:a.label},label:null};let o=FL[i];return o?{icon:null,label:b(o)}:{icon:null,label:a?.label?.trim()||RL(e.sessionType,t)}}var HL=`app://`;function UL(e){let t=e.trim().replace(/^\/+/,``);if(!t)return null;let n=t.split(`/`);return n.some(e=>e.trim().length===0||e===`.`||e===`..`)?null:n.join(`/`)}function WL(e){let t=e.trim();if(!t)return null;if(!t.startsWith(HL))return t;let n=UL(t.slice(6));return n?`/${n}`:null}function GL({name:e,src:t,className:n,imgClassName:r,fallback:i}){let[a,o]=(0,V.useState)(!1),s=!!t&&!a;return(0,H.jsx)(`div`,{className:u(`inline-flex shrink-0 items-center justify-center overflow-hidden`,n),children:s?(0,H.jsx)(`img`,{src:t,alt:`${e} logo`,className:u(`block h-6 w-6 object-contain`,r),onError:()=>o(!0),draggable:!1}):i??(0,H.jsx)(`span`,{className:`text-lg font-bold uppercase`,children:e.slice(0,1)})})}function KL({icon:e,className:t}){if(e.kind===`channel-logo`)return(0,H.jsx)(qL,{channel:e.channel,className:t});if(e.kind===`runtime-image`){let n=WL(e.src);return(0,H.jsx)(GL,{name:e.name?.trim()||e.alt?.trim()||`runtime`,src:n??void 0,className:u(`h-[1.125rem] w-[1.125rem]`,t),imgClassName:`h-full w-full object-contain`,fallback:(0,H.jsx)(Zi,{className:u(`h-3 w-3 text-current`,t),strokeWidth:2.4})})}return(0,H.jsx)(Ui,{className:u(`h-3.5 w-3.5`,t)})}function qL({channel:e,className:t}){return(0,H.jsx)(GL,{name:e,src:ML(e),className:u(`h-[1.125rem] w-[1.125rem]`,t),imgClassName:`h-full w-full object-contain`,fallback:(0,H.jsx)(Zi,{className:`h-3 w-3 text-muted-foreground`})})}function JL({status:e,className:t}){let n=b(e===`running`?`sessionsRunStatusRunning`:`sessionsRunStatusQueued`);return(0,H.jsxs)(`span`,{className:u(`inline-flex h-3.5 w-3.5 items-center justify-center text-muted-foreground/70`,t),title:n,"aria-label":n,children:[(0,H.jsx)(fi,{className:`h-3 w-3 animate-spin`}),(0,H.jsx)(`span`,{className:`sr-only`,children:n})]})}function YL({item:e,selectedSessionKey:t,optimisticReadAtBySessionKey:n,sessionTypeOptions:r,onSelect:i}){let{session:a,runStatus:o}=e,s=t===a.key,c=n[a.key],l=c&&a.readAt?c.localeCompare(a.readAt)>0?c:a.readAt:c??a.readAt,d=nL({active:s,lastMessageAt:a.lastMessageAt,readAt:l,runStatus:o}),f=aI(a)??a.projectName??a.projectRoot??`${a.messageCount}`,p=lI(a.lastMessageAt??a.createdAt),m=VL(a,r);return(0,H.jsxs)(`button`,{type:`button`,"aria-current":s?`page`:void 0,className:u(`flex w-full min-w-0 items-start gap-2 rounded-lg px-2.5 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,s?`bg-accent text-accent-foreground`:`text-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`),onClick:()=>i(a.key),children:[(0,H.jsx)(`span`,{className:`relative mt-1 flex h-2.5 w-2.5 shrink-0 items-center justify-center`,children:d?(0,H.jsx)(`span`,{"aria-label":b(`chatSidebarUnread`),className:`h-1.5 w-1.5 rounded-full bg-primary`}):s?(0,H.jsx)(wr,{className:`h-3 w-3 text-primary`}):(0,H.jsx)(`span`,{className:`h-1 w-1 rounded-full bg-muted-foreground/45`})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:rI(a)}),m.label?(0,H.jsx)(`span`,{className:`shrink-0 rounded-full border border-border/70 px-1.5 py-0.5 text-[10px] font-semibold leading-none text-muted-foreground`,children:m.label}):null,m.icon?(0,H.jsx)(`span`,{className:`inline-flex h-[1.125rem] w-[1.125rem] shrink-0 items-center justify-center text-muted-foreground`,children:(0,H.jsx)(KL,{icon:m.icon})}):null]}),(0,H.jsxs)(`span`,{className:`mt-0.5 flex min-w-0 items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:f}),(0,H.jsx)(`span`,{className:`shrink-0`,children:p})]})]}),o?(0,H.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:(0,H.jsx)(JL,{status:o})}):null]})}function XL({items:e,selectedSessionKey:t,optimisticReadAtBySessionKey:n,sessionTypeOptions:r,onSelect:i,className:a}){return(0,H.jsx)(`div`,{className:u(`space-y-1`,a),children:e.map(e=>(0,H.jsx)(YL,{item:e,selectedSessionKey:t,optimisticReadAtBySessionKey:n,sessionTypeOptions:r,onSelect:i},e.session.key))})}function ZL({group:e,...t}){return(0,H.jsxs)(`section`,{"aria-label":e.label,children:[(0,H.jsx)(`div`,{className:`px-2 py-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/70`,children:e.label}),(0,H.jsx)(XL,{items:e.items,...t})]})}function QL({group:e,isCollapsed:t,onToggleCollapsed:n,...r}){let i=(0,V.useId)(),a=`${b(t?`chatSidebarExpandProject`:`chatSidebarCollapseProject`)} · ${e.projectName}`;return(0,H.jsxs)(`section`,{"aria-label":e.projectName,children:[(0,H.jsxs)(`button`,{type:`button`,"aria-controls":i,"aria-expanded":!t,"aria-label":a,className:`group flex h-10 w-full min-w-0 items-center gap-1.5 rounded-lg px-2 text-left text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>n(e.projectRoot),children:[(0,H.jsx)(Ga,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-medium uppercase tracking-wider`,title:e.projectRoot,children:e.projectName}),(0,H.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/70`,children:e.items.length}),t?(0,H.jsx)(sa,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):(0,H.jsx)($n,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`})]}),t?null:(0,H.jsx)(XL,{items:e.items,className:`mt-0.5`,...r})]})}function $L({collapsedProjectRoots:e,dateGroups:t,isProjectFirstView:n,onToggleProjectCollapsed:r,projectGroups:i,...a}){return(0,H.jsx)(`div`,{className:`space-y-3`,children:n?i.map(t=>(0,H.jsx)(QL,{group:t,isCollapsed:e.includes(t.projectRoot),onToggleCollapsed:r,...a},t.projectRoot)):t.map(e=>(0,H.jsx)(ZL,{group:e,...a},e.label))})}var eR=N(e=>({snapshot:{},setSnapshot:t=>e(({snapshot:e})=>({snapshot:{...e,...t}}))})),tR=[`projects`];function nR(e={}){return Ot({queryKey:tR,queryFn:zt,enabled:e.enabled??!0,staleTime:3e4})}function rR(){let e=F();return jt({mutationFn:qe,onSuccess:async()=>{await e.invalidateQueries({queryKey:tR}),R.success(b(`chatProjectCreated`))},onError:e=>{R.error(`${b(`chatProjectCreateFailed`)}: ${e.message}`)}})}function iR(){let e=F();return jt({mutationFn:De,onSuccess:async()=>{await e.invalidateQueries({queryKey:tR}),R.success(b(`chatProjectExistingAdded`))},onError:e=>{R.error(`${b(`chatProjectExistingFailed`)}: ${e.message}`)}})}var aR=`group inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-md px-1.5 py-1 text-sm font-medium text-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`;function oR({title:e}){return(0,H.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:e})}function sR({label:e}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-xs text-muted-foreground`,children:[(0,H.jsx)(no,{className:`h-4 w-4 shrink-0 text-muted-foreground/55`}),(0,H.jsx)(`span`,{children:e})]})}function cR(){return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-xs text-muted-foreground`,children:[(0,H.jsx)(fi,{className:`h-4 w-4 shrink-0 animate-spin`}),(0,H.jsx)(`span`,{children:b(`sessionsLoading`)})]})}function lR({selectedSessionKey:e,title:t}){let n=tI(),[r,i]=(0,V.useState)(!1),[a,o]=(0,V.useState)(``),s=oL(e=>e.optimisticReadAtBySessionKey),c=oL(e=>e.snapshot.pinnedSessionKeys),l=oL(e=>e.snapshot.pinnedProjectRoots),d=oL(e=>e.snapshot.collapsedProjectRoots),f=oL(e=>e.snapshot.listMode),p=eR(e=>e.snapshot.sessionTypesQuery?.data??null),{isLoading:m,items:h}=gL({query:a}),g=nR(),_=(0,V.useMemo)(()=>{let e=a.trim().toLowerCase(),t=g.data?.projects??[];return e?t.filter(t=>t.name.toLowerCase().includes(e)||t.rootPath.toLowerCase().includes(e)):t},[g.data?.projects,a]),v=(0,V.useMemo)(()=>vL(h),[h]),y=(0,V.useMemo)(()=>bL(v,new Set(c)),[c,v]),x=(0,V.useMemo)(()=>xL(v,new Set(c),new Set(l),_),[l,c,v,_]),S=(0,V.useMemo)(()=>kL(p?.options??[]),[p?.options]),C=t=>{i(!1),o(``),t!==e&&n.chatSessionListManager.selectSession(t)},w=e=>{i(e),e||o(``)},T={selectedSessionKey:e,optimisticReadAtBySessionKey:s,sessionTypeOptions:S,onSelect:C},E=f===`project-first`,D=E?x.length>0:y.length>0;return(0,H.jsxs)(wF,{open:r,onOpenChange:w,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,"aria-label":`${b(`chatSessionSwitch`)}: ${t}`,"aria-expanded":r,className:aR,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,H.jsx)($n,{className:u(`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-hover:text-accent-foreground`,r?`rotate-180`:null)})]})}),(0,H.jsxs)(DF,{align:`start`,className:`w-[22rem] max-w-[calc(100vw-2rem)] p-0`,children:[(0,H.jsxs)(`div`,{className:`space-y-2 border-b border-border px-3 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/75`,children:b(`chatSessionSwitcherTitle`)}),(0,H.jsx)(wL,{isProjectFirstView:E,onSelectMode:n.chatSessionListManager.setListMode})]}),(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/65`}),(0,H.jsx)(vt,{value:a,onChange:e=>o(e.target.value),placeholder:b(`chatSearchSessionPlaceholder`),"aria-label":b(`chatSearchSessionPlaceholder`),className:`h-8 rounded-lg bg-background pl-8 pr-2 text-xs`,autoFocus:!0})]})]}),(0,H.jsx)(`div`,{className:`max-h-80 overflow-y-auto p-1.5`,children:m?(0,H.jsx)(cR,{}):D?(0,H.jsx)($L,{collapsedProjectRoots:d,dateGroups:y,isProjectFirstView:E,onToggleProjectCollapsed:n.chatSessionListManager.toggleProjectCollapsed,projectGroups:x,...T}):(0,H.jsx)(sR,{label:a.trim()?b(`chatSessionSwitcherNoResults`):b(E?`chatSidebarProjectViewEmpty`:`sessionsEmpty`)})})]})]})}function uR({layoutMode:e,selectedSessionKey:t,title:n}){let r=Os(e=>e.isSidebarCollapsed);return e===`desktop`&&!r?(0,H.jsx)(oR,{title:n}):(0,H.jsx)(lR,{selectedSessionKey:t,title:n})}var dR=mn.chat.newSessionType,fR=[`preference`,dR];function pR(e,t){let n=EL(e);return t.find(e=>e.value===n&&e.ready!==!1)??null}function mR(e){let{defaultSessionType:t,preferredSessionType:n,sessionTypeOptions:r}=e,i=n?pR(n,r):null,a=pR(t,r);return i??a??r.find(e=>e.ready!==!1)??r[0]??{value:EL(t),label:EL(t),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}}function hR(e){return typeof e?.value==`string`?EL(e.value):null}function gR({defaultSessionType:e,sessionTypeOptions:t}){let n=F(),r=Ot({queryKey:fR,queryFn:()=>nt(dR),staleTime:3e4,retry:!1}),i=(0,V.useMemo)(()=>hR(r.data),[r.data]),a=(0,V.useMemo)(()=>mR({preferredSessionType:i,defaultSessionType:e,sessionTypeOptions:t}),[e,i,t]),o=jt({mutationFn:async e=>await Oe(dR,EL(e)),onMutate:async e=>{let t=EL(e);await n.cancelQueries({queryKey:fR});let r=n.getQueryData(fR);return n.setQueryData(fR,{key:dR,value:t,updatedAt:new Date().toISOString()}),{previous:r}},onError:(e,t,r)=>{r?.previous&&n.setQueryData(fR,r.previous)},onSuccess:e=>{n.setQueryData(fR,e)}}),s=(0,V.useCallback)(e=>{let n=pR(e,t);n&&o.mutate(n.value)},[t,o]);return{selectedSessionType:a.value,selectedSessionTypeOption:a,isLoading:r.isLoading,setSelectedSessionType:s}}var _R=[];function vR(){let e=eR(e=>!!(e.snapshot.configQuery?.isFetched||e.snapshot.configQuery?.isSuccess)),t=eR(e=>!!(e.snapshot.providersQuery?.isFetched||e.snapshot.providersQuery?.isSuccess)),n=eR(e=>!!(e.snapshot.providerTemplatesQuery?.isFetched||e.snapshot.providerTemplatesQuery?.isSuccess));return e&&t&&n}function yR(e){let t=eR(e=>e.snapshot.sessionsQuery?.data?.sessions??_R),n=(0,V.useMemo)(()=>JI(t),[t]);return(0,V.useMemo)(()=>n.find(t=>t.key===e)??null,[n,e])}function bR(e){return!!e&&typeof e==`object`}function xR(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function SR(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function CR(e){return typeof e==`string`?e:null}function wR(e){return e===`auto`||e===`source`||e===`rendered`?e:null}function TR(e){try{return a(e)??null}catch{return null}}function ER(e){if(!bR(e)||typeof e.key!=`string`||typeof e.path!=`string`||e.viewMode!==`preview`&&e.viewMode!==`diff`)return null;let t=e.key.trim(),n=e.path.trim();return!t||!n?null:{key:t,parentSessionKey:xR(e.parentSessionKey),path:n,label:xR(e.label),viewMode:e.viewMode,previewViewer:wR(e.previewViewer),line:SR(e.line),column:SR(e.column),params:TR(e.params),rawText:CR(e.rawText),contentUrl:xR(e.contentUrl),mimeType:xR(e.mimeType),beforeText:CR(e.beforeText),afterText:CR(e.afterText),patchText:CR(e.patchText),oldStartLine:SR(e.oldStartLine),newStartLine:SR(e.newStartLine)}}function DR(e){return{key:e.key,parentSessionKey:e.parentSessionKey,path:e.path,label:e.label,viewMode:e.viewMode,previewViewer:e.previewViewer,line:e.line,column:e.column,params:e.params,rawText:e.rawText,contentUrl:e.contentUrl,mimeType:e.mimeType,beforeText:e.beforeText,afterText:e.afterText,patchText:e.patchText,oldStartLine:e.oldStartLine,newStartLine:e.newStartLine}}function OR(e,t,n){let r=e.slice(0,n),i=t?e.find(e=>e.key===t):null;return!i||r.some(e=>e.key===i.key)?r:r.length<n?[...r,i]:[...r.slice(0,-1),i]}function kR(e){return typeof e!=`number`||!Number.isFinite(e)?480:Math.max(360,Math.min(860,e))}function AR(e){return typeof e!=`number`||!Number.isFinite(e)?224:Math.max(192,Math.min(400,e))}function jR(e){return e.index>0&&e.entries.length>0}function MR(e){return e.index>=0&&e.index<e.entries.length-1}function NR(e,t,n=Object.is){let r=IR(e),i=e.entries[r];if(i&&n(i,t))return{entries:e.entries,index:r};let a=[...e.entries.slice(0,r+1),t];return{entries:a,index:a.length-1}}function PR(e,t){let n=IR(e),r=t===`back`?n-1:n+1,i=e.entries[r];return i?{history:{entries:e.entries,index:r},entry:i}:null}function FR(e,t,n){let r=IR(e),i=e.entries.filter(t);if(i.length===0)return n===void 0?{entries:[],index:0}:{entries:[n],index:0};let a=e.entries.slice(0,r+1).filter(t);return{entries:i,index:Math.min(Math.max(0,a.length-1),i.length-1)}}function IR(e){return e.entries.length===0?0:Number.isInteger(e.index)?Math.min(Math.max(0,e.index),e.entries.length-1):e.entries.length-1}function LR(e){return/\.html?$/i.test(e)?`html`:/\.mdx?$/i.test(e)?`markdown`:null}function RR(e,t){let n=LR(e);return n===`html`?t===`rendered`?`rendered`:`source`:n===`markdown`?t===`source`?`source`:`rendered`:t===`source`||t===`rendered`?t:null}function zR(e,t){return RR(e,t)??t??null}function BR(e,t){return LR(e)?RR(e,t)===`source`?`rendered`:`source`:null}function VR(e,t){let n=e.path.trim();if(!n)return null;let r=t?.trim()||null,i=e.viewMode===`preview`?zR(n,e.previewViewer??(e.line?`source`:void 0)):e.previewViewer??null,a=e.viewMode===`preview`&&i===`rendered`?`preview:rendered`:e.viewMode;return{key:`${r??`draft`}::${a}::${n}`,parentSessionKey:r,path:n,label:e.label?.trim()||null,viewMode:e.viewMode,previewViewer:i,line:e.line??null,column:e.column??null,params:e.params??null,rawText:e.rawText??null,contentUrl:e.contentUrl?.trim()||null,mimeType:e.mimeType?.trim()||null,beforeText:e.beforeText??null,afterText:e.afterText??null,patchText:e.patchText??null,oldStartLine:e.oldStartLine??null,newStartLine:e.newStartLine??null,fullLines:e.fullLines}}function HR(e,t,n){let r=e.findIndex(e=>e.key===t.key);if(r!==-1){let n=[...e];return n[r]={...e[r],...t},n}let i=n?e.findIndex(e=>e.key===n):-1;return i===-1?[t,...e]:[...e.slice(0,i+1),t,...e.slice(i+1)]}function UR(e,t,n){let r=e.viewMode===`preview`&&e.previewViewer===`rendered`?`preview:rendered`:e.viewMode;return{...e,key:`${e.parentSessionKey??`draft`}::${r}::${t}`,path:t,label:n?.trim()||e.label}}function WR(e,t){let n=t.trim(),r=e.key.indexOf(`::`),i=r>=0?e.key.slice(r):`::${e.key}`;return{...e,key:`${n}${i}`,parentSessionKey:n}}function GR(e,t){return e.kind===t.kind?e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`||e.kind===`cron`||e.kind===`continuous-attention`?!0:t.kind!==`overview`&&t.kind!==`child-sessions`&&t.kind!==`project-files`&&t.kind!==`cron`&&t.kind!==`continuous-attention`&&e.key===t.key:!1}function KR(e){let{activeChildSessionKey:t,activeSideChatDraft:n,activeWorkspaceFileKey:r,activeWorkspacePanelKind:i}=e;return i===`overview`||i===`child-sessions`||i===`project-files`||i===`cron`||i===`continuous-attention`?{kind:i}:i===`child-session`&&t?{kind:`child-session`,key:t}:i===`side-chat-draft`&&n?{kind:`side-chat-draft`,key:n.draftKey}:i===`file`&&r?{kind:`file`,key:r}:null}function qR(e,t){if(e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`||e.kind===`continuous-attention`)return{activeWorkspacePanelKind:e.kind,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null};if(e.kind===`cron`)return{activeWorkspacePanelKind:`cron`,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null};if(e.kind===`file`)return t.workspaceFileTabs.some(t=>t.key===e.key)?{activeWorkspacePanelKind:`file`,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:e.key}:null;if(e.kind===`side-chat-draft`){let{activeSideChatDraft:n}=t;return n?.draftKey===e.key?{activeWorkspacePanelKind:`side-chat-draft`,activeChildSessionKey:null,activeSideChatDraft:n,activeWorkspaceFileKey:null}:null}return{activeWorkspacePanelKind:`child-session`,activeChildSessionKey:e.key,activeSideChatDraft:null,activeWorkspaceFileKey:null}}function JR(e,t){if(t.kind===`overview`||t.kind===`child-sessions`||t.kind===`cron`||t.kind===`project-files`||t.kind===`continuous-attention`)return null;let n=FR({entries:e.workspaceNavigationHistory,index:e.workspaceNavigationHistoryIndex},e=>!GR(e,t),{kind:`overview`}),r={closedWorkspaceTabEntries:t.kind!==`file`&&t.kind!==`side-chat-draft`?[...e.closedWorkspaceTabEntries.filter(e=>!GR(e,t)),t]:e.closedWorkspaceTabEntries,childSessionTabs:t.kind===`child-session`?e.childSessionTabs.filter(e=>e.sessionKey!==t.key):e.childSessionTabs,activeSideChatDraft:t.kind===`side-chat-draft`?null:e.activeSideChatDraft,workspaceFileTabs:t.kind===`file`?e.workspaceFileTabs.filter(e=>e.key!==t.key):e.workspaceFileTabs,workspaceNavigationHistory:[...n.entries],workspaceNavigationHistoryIndex:n.index},i=KR(e);if(!i||!GR(i,t))return r;let a=qR(n.entries[n.index]??{kind:`overview`},{...e,...r});return{...r,...a??qR({kind:`overview`},e)}}function YR(e){return{draftKey:`side-chat-draft:${e}:${typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`,parentSessionKey:e}}function XR(e,t){let n=e.findIndex(e=>e.sessionKey===t.sessionKey);if(n===-1)return[t,...e];let r=e[n],i=[...e];return i[n]={...r,parentSessionKey:r.parentSessionKey??t.parentSessionKey,label:r.label?.trim()?r.label:t.label,agentId:r.agentId?.trim()?r.agentId:t.agentId},i}function ZR(e,t){let n=t.trim();if(!n)return null;let r=new Map,i=e.workspaceFileTabs.map(e=>{if(e.parentSessionKey!==null)return e;let t=WR(e,n);return r.set(e.key,t.key),t}),a=e=>{if(e.kind!==`file`)return e;let t=r.get(e.key);return t?{...e,key:t}:e};return{draftProjectRoot:null,workspaceFileTabs:i,activeWorkspaceFileKey:e.activeWorkspaceFileKey?r.get(e.activeWorkspaceFileKey)??e.activeWorkspaceFileKey:null,closedWorkspaceTabEntries:e.closedWorkspaceTabEntries.map(a),workspaceNavigationHistory:e.workspaceNavigationHistory.map(a),workspacePanelParentKey:e.workspacePanelParentKey===null&&e.activeWorkspacePanelKind?n:e.workspacePanelParentKey}}function QR(e){let{agentId:t,draftKey:n,label:r,sessionKey:i,snapshot:a}=e,o=i.trim(),s=n.trim(),{activeSideChatDraft:c}=a;if(!o||!s||c?.draftKey!==s)return null;let{parentSessionKey:l}=c,u=NR(FR({entries:a.workspaceNavigationHistory,index:a.workspaceNavigationHistoryIndex},e=>e.kind!==`side-chat-draft`||e.key!==s),{kind:`child-session`,key:o},GR);return{parentSessionKey:l,patch:{workspacePanelParentKey:l,activeWorkspacePanelKind:`child-session`,activeChildSessionKey:o,activeSideChatDraft:null,activeWorkspaceFileKey:null,childSessionTabs:XR(a.childSessionTabs,{sessionKey:o,parentSessionKey:l,label:r?.trim()||null,agentId:t?.trim()||null}),workspaceNavigationHistory:[...u.entries],workspaceNavigationHistoryIndex:u.index}}}var $R=`nextclaw.chat.workspace-panel.state`,ez=3,tz=8,nz={sessionTypeLabel:null,sessionTypeIcon:null,sessionKey:null,agentId:null,sessionDisplayName:void 0,draftProjectRoot:null,sessionProjectName:null,canDeleteSession:!1,isDeletePending:!1,isHistoryLoading:!1,messages:[],isSending:!1,isAwaitingAssistantOutput:!1,hasSubmittedDraftMessage:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,workspaceFileTabs:[],activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0,workspaceExplorerOpen:!1,workspaceExplorerWidth:224,workspacePanelWidth:480,contextWindow:null};function rz(e){return!!e&&typeof e==`object`}function iz(e){return typeof e==`string`&&e.trim().length>0?e.trim():null}function az(e,t){return typeof e==`number`&&Number.isInteger(e)?Math.min(Math.max(0,e),t):t}function oz(e){return e===`overview`||e===`child-sessions`||e===`child-session`||e===`project-files`||e===`file`||e===`cron`}function sz(e){if(!rz(e))return null;if(e.kind===`overview`||e.kind===`child-sessions`||e.kind===`project-files`||e.kind===`cron`||e.kind===`continuous-attention`)return{kind:e.kind};let t=iz(e.key);return!t||e.kind!==`child-session`&&e.kind!==`file`?null:{kind:e.kind,key:t}}function cz(e){if(!rz(e))return null;let t=iz(e.workspacePanelParentKey),n=iz(e.activeWorkspaceFileKey),r=OR(Array.isArray(e.workspaceFileTabs)?e.workspaceFileTabs.map(ER).filter(e=>e!==null):[],n,tz),i=r.filter(e=>e.parentSessionKey===t),a=n&&i.some(e=>e.key===n)?n:i[0]?.key??null,o=oz(e.activeWorkspacePanelKind)?e.activeWorkspacePanelKind:null,s=o===`file`&&!a?null:o,c=iz(e.activeChildSessionKey),l=Array.isArray(e.closedWorkspaceTabEntries)?e.closedWorkspaceTabEntries.map(sz).filter(e=>e!==null&&e.kind!==`overview`):[],u=KR({activeWorkspacePanelKind:s,activeChildSessionKey:c,activeSideChatDraft:null,activeWorkspaceFileKey:a}),d=Array.isArray(e.workspaceNavigationHistory)?e.workspaceNavigationHistory.map(sz).filter(e=>e!==null).filter(e=>e.kind!==`file`||r.some(t=>t.key===e.key)):[],f=d.length>0?d:u?[u]:[];return{workspacePanelParentKey:t,activeWorkspacePanelKind:s,activeChildSessionKey:c,workspaceFileTabs:r,activeWorkspaceFileKey:a,closedWorkspaceTabEntries:l,workspaceNavigationHistory:f,workspaceNavigationHistoryIndex:f.length>0?az(e.workspaceNavigationHistoryIndex,f.length-1):0,workspaceExplorerOpen:e.workspaceExplorerOpen===!0,workspaceExplorerWidth:AR(e.workspaceExplorerWidth),workspacePanelWidth:kR(e.workspacePanelWidth)}}var $=N()(_i(e=>({snapshot:nz,setSnapshot:t=>e(e=>({snapshot:{...e.snapshot,...t}}))}),{name:$R,version:ez,storage:vi(()=>window.localStorage),partialize:e=>{let t=e.snapshot.workspaceNavigationHistory.filter(e=>e.kind!==`side-chat-draft`),n=t.length>0?Math.min(e.snapshot.workspaceNavigationHistoryIndex,t.length-1):0;return{snapshot:{workspacePanelParentKey:e.snapshot.workspacePanelParentKey,activeWorkspacePanelKind:e.snapshot.activeWorkspacePanelKind===`side-chat-draft`?null:e.snapshot.activeWorkspacePanelKind,activeChildSessionKey:e.snapshot.activeChildSessionKey,workspaceFileTabs:OR(e.snapshot.workspaceFileTabs,e.snapshot.activeWorkspaceFileKey,tz).map(DR),activeWorkspaceFileKey:e.snapshot.activeWorkspaceFileKey,closedWorkspaceTabEntries:e.snapshot.closedWorkspaceTabEntries.filter(e=>e.kind!==`overview`&&e.kind!==`side-chat-draft`),workspaceNavigationHistory:t,workspaceNavigationHistoryIndex:n,workspaceExplorerOpen:e.snapshot.workspaceExplorerOpen,workspaceExplorerWidth:e.snapshot.workspaceExplorerWidth,workspacePanelWidth:e.snapshot.workspacePanelWidth}}},merge:(e,t)=>{let n=cz(rz(e)?e.snapshot:null);return n?{...t,snapshot:{...t.snapshot,...n}}:t}})),lz=[[`bg-amber-100`,`text-amber-700`],[`bg-emerald-100`,`text-emerald-700`],[`bg-blue-100`,`text-blue-700`],[`bg-rose-100`,`text-rose-700`],[`bg-cyan-100`,`text-cyan-700`],[`bg-violet-100`,`text-violet-700`]];function uz(e){let t=0;for(let n=0;n<e.length;n+=1)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function dz({agentId:e,displayName:t,avatarUrl:n,className:r}){let i=t?.trim()||e,a=e.trim().toLowerCase()===`main`,[o,s]=a?[`bg-[#ede7dc] [html[data-theme-appearance=dark]_&]:bg-[#373229]`,`text-[#57534e] [html[data-theme-appearance=dark]_&]:text-[#e2ded7]`]:lz[uz(e)%lz.length]??lz[0];return n?.trim()?(0,H.jsx)(`img`,{src:n,alt:t?.trim()||e,className:u(`rounded-full object-cover`,r)}):(0,H.jsx)(`div`,{className:u(`rounded-full flex items-center justify-center font-semibold`,o,s,r),"aria-label":t?.trim()||e,children:a?(0,H.jsx)(Zi,{className:`h-[55%] w-[55%]`,strokeWidth:2.4}):(i.trim()||`A`).slice(0,1).toUpperCase()})}function fz(){return Ot({queryKey:[`agents`],queryFn:Rt,staleTime:3e4})}function pz(){let e=F();return jt({mutationFn:({agentId:e,data:t})=>We(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`agents`]}),e.invalidateQueries({queryKey:[`config`]}),R.success(b(`configSavedApplied`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function mz(){let e=F();return jt({mutationFn:({agentId:e})=>xe(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`agents`]}),e.invalidateQueries({queryKey:[`config`]}),R.success(b(`configSavedApplied`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function hz(e){return new Map(e.filter(e=>typeof e.id==`string`&&e.id.trim().length>0).map(e=>[e.id,e]))}function gz(e){let t=e?.trim()??``,n=fz(),r=(0,V.useMemo)(()=>hz(n.data?.agents??[]),[n.data?.agents]);return(0,V.useMemo)(()=>{if(!t)return null;let e=r.get(t)??null;return{agentId:t,profile:e,displayName:e?.displayName?.trim()||t,avatarUrl:e?.avatarUrl?.trim()||null}},[r,t])}function _z({agentId:e,className:t}){let n=gz(e);return n?(0,H.jsx)(dz,{agentId:n.agentId,displayName:n.displayName,avatarUrl:n.avatarUrl,className:t}):null}function vz({layoutMode:e,onBackToList:t}){let n=tI(),r=$(e=>e.snapshot),i=oL(e=>e.snapshot.selectedSessionKey),a=oL(e=>e.snapshot.selectedAgentId),o=eR(e=>e.snapshot.sessionTypesQuery?.data??null),s=eR(e=>e.snapshot.configQuery?.data??null),c=yR(i),l=(0,V.useMemo)(()=>kL(o?.options??[]),[o?.options]),u=EL(o?.defaultType??`native`),d=gR({defaultSessionType:u,sessionTypeOptions:l}),f=EL(c?.sessionType??u),p=l.find(e=>e.value===f)??null,m=p?.label??OL(f),h=f!==`native`&&!!m,g=c?.projectRoot??null,_=mI(s?.agents.defaults.workspace),v=c?.projectName??hI(g),y=!!c,x=!!(i||m),S=(c?rI(c):void 0)||(y&&i?i:null)||b(`chatSidebarNewTask`),C=c?.agentId?.trim()??a?.trim()??``,w=C.length>0&&C.toLowerCase()!==`main`,T=!!(r.workspacePanelParentKey===i&&r.activeWorkspacePanelKind);return(0,H.jsx)(js,{layoutMode:e,title:S,titleContent:(0,H.jsx)(uR,{layoutMode:e,selectedSessionKey:i,title:S}),shouldShow:x,onBackToList:t,leading:w?(0,H.jsx)(`div`,{className:`inline-flex shrink-0 items-center`,children:(0,H.jsx)(_z,{agentId:C,className:`h-5 w-5`})}):null,sessionTypeBadge:h?(0,H.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1.5 rounded-full border border-border bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground`,children:[p?.icon?.src?(0,H.jsx)(`span`,{className:`inline-flex h-[1.125rem] w-[1.125rem] items-center justify-center`,children:(0,H.jsx)(KL,{icon:{kind:`runtime-image`,src:p.icon.src,alt:p.icon.alt??null,name:m}})}):null,m]}):null,projectBadge:v?(0,H.jsx)(QF,{sessionKey:i??`draft`,projectName:v,projectRoot:g,defaultWorkspacePath:_,persistToServer:y}):null,actions:(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[e===`mobile`&&i?(0,H.jsx)(B,{icon:(0,H.jsx)(Po,{className:`h-4 w-4`}),label:b(`chatSidebarNewTask`),tooltip:!1,onClick:()=>n.chatSessionListManager.createSession({sessionType:d.selectedSessionType})}):null,(0,H.jsx)(XF,{sessionKey:i,canDeleteSession:y,isDeletePending:r.isDeletePending,currentPath:g??c?.workingDir??r.draftProjectRoot??_,defaultWorkspacePath:_,metadata:c?.metadata??null,isWorkspaceOpen:T,onToggleWorkspace:()=>{n.chatThreadManager.toggleWorkspacePanel(i)},onDeleteSession:n.chatThreadManager.deleteSession})]})})}function yz(){let e=tI(),t=$(e=>e.snapshot);return(0,H.jsx)(As,{parentSessionLabel:t.parentSessionKey?t.parentSessionLabel??null:null,onGoToParentSession:e.chatThreadManager.goToParentSession})}function bz(e,t){return e.label?.trim()?e.label.trim():t?rI(t):e.sessionKey}function xz(e){let t=cL({limit:200}),n=(0,V.useMemo)(()=>t.data?.sessions??[],[t.data?.sessions]),r=(0,V.useMemo)(()=>{let e=JI(n);return new Map(e.map(e=>[e.key,e]))},[n]);return(0,V.useMemo)(()=>e.map(e=>{let t=r.get(e.sessionKey)??null,n=e.agentId?.trim()||t?.agentId||null;return{sessionKey:e.sessionKey,parentSessionKey:e.parentSessionKey,title:bz(e,t),agentId:n,updatedAt:t?.updatedAt??null,lastMessageAt:t?.lastMessageAt??null,readAt:t?.readAt??null,runStatus:t?.status===`running`?`running`:void 0,sessionTypeLabel:t?.sessionType?OL(t.sessionType):null,preferredModel:t?.preferredModel?.trim()||null,projectName:t?.projectName?.trim()||null,projectRoot:t?.projectRoot?.trim()||null}}),[r,e])}function Sz(e){let t=e.path.split(`/`).filter(Boolean).pop();return e.label?.trim()||t||e.path}function Cz(e){let{activePanelKind:t,activeChildSessionKey:n,activeSideChatDraft:r,activeWorkspaceFileKey:i,childSessionTabs:a,workspaceFileTabs:o}=e;if(t===`overview`)return{kind:`overview`};if(t===`child-sessions`)return{kind:`child-sessions`};if(t===`project-files`)return{kind:`project-files`};if(t===`cron`)return{kind:`cron`};if(t===`continuous-attention`)return{kind:`continuous-attention`};if(t===`side-chat-draft`&&r)return{kind:`side-chat-draft`,draft:r};if(t!==`child-session`&&i){let e=o.find(e=>e.key===i);if(e)return{kind:`file`,file:e}}if(t!==`file`&&n){let e=a.find(e=>e.sessionKey===n);if(e)return{kind:`child-session`,tab:e}}return a[0]?{kind:`child-session`,tab:a[0]}:r?{kind:`side-chat-draft`,draft:r}:o[0]?{kind:`file`,file:o[0]}:null}function wz({activeSelection:e,hasSession:t,onSelectChildSessions:n,onSelectCronJobs:r,onSelectOverview:i,onSelectProjectFiles:a,onSelectContinuousAttention:o}){let s=[{key:`overview`,kind:`overview`,title:b(`chatWorkspaceOverview`),tooltip:b(`chatWorkspaceOverview`),active:e?.kind===`overview`,onSelect:i},{key:`child-sessions`,kind:`child-sessions`,title:b(`chatWorkspaceChildSessions`),tooltip:b(`chatWorkspaceChildSessions`),active:e?.kind===`child-sessions`,onSelect:n},{key:`cron:session`,kind:`cron`,title:b(`chatWorkspaceSessionCronJobs`),tooltip:b(`chatWorkspaceSessionCronJobs`),active:e?.kind===`cron`,onSelect:r},{key:`continuous-attention`,kind:`continuous-attention`,title:b(`chatWorkspaceContinuousAttention`),tooltip:b(`chatWorkspaceContinuousAttention`),active:e?.kind===`continuous-attention`,onSelect:o??(()=>void 0)},{key:`project-files`,kind:`project-files`,title:b(`chatWorkspaceProjectFiles`),tooltip:b(`chatWorkspaceProjectFiles`),active:e?.kind===`project-files`,onSelect:a}];return t?s:s.filter(e=>e.kind===`project-files`)}function Tz(e){let{hasSession:t,activeSideChatDraft:n,closedWorkspaceTabEntries:r,resolvedChildTabs:i,workspaceFileTabs:a,activeSelection:o,optimisticReadAtBySessionKey:s,sessionProjectRoot:c,onAddFileToChat:l,onSelectSession:u,onSelectFile:d,onOpenFileViewer:f,onCloseTab:p,onSelectOverview:m,onSelectChildSessions:h,onSelectProjectFiles:g,onSelectCronJobs:_,onSelectContinuousAttention:v=()=>void 0}=e,y=wz({activeSelection:o,hasSession:t,onSelectChildSessions:h,onSelectCronJobs:_,onSelectOverview:m,onSelectProjectFiles:g,onSelectContinuousAttention:v}),x=n?[{key:`side-chat-draft:${n.draftKey}`,kind:`side-chat-draft`,title:b(`chatWorkspaceSideChatDraftTitle`),tooltip:b(`chatWorkspaceSideChatDraftSubtitle`),active:o?.kind===`side-chat-draft`&&o.draft.draftKey===n.draftKey,onSelect:()=>void 0,onClose:()=>p({kind:`side-chat-draft`,key:n.draftKey})}]:[],S=i.filter(e=>!r.some(t=>GR(t,{kind:`child-session`,key:e.sessionKey}))).map(e=>{let t=s[e.sessionKey],n=t&&e.readAt?t.localeCompare(e.readAt)>0?t:e.readAt:t??e.readAt;return{key:`child:${e.sessionKey}`,kind:`child-session`,title:e.title,tooltip:e.title,agentId:e.agentId,sessionKey:e.sessionKey,active:o?.kind===`child-session`&&o.tab.sessionKey===e.sessionKey,showUnreadDot:nL({active:o?.kind===`child-session`&&o.tab.sessionKey===e.sessionKey,lastMessageAt:e.lastMessageAt,readAt:n,runStatus:e.runStatus}),onSelect:()=>u(e.sessionKey),onClose:()=>p({kind:`child-session`,key:e.sessionKey})}}),C=a.map(e=>{let t=e.viewMode===`preview`?RR(e.path,e.previewViewer):null,n=e.viewMode===`preview`?BR(e.path,e.previewViewer):null,r=Sz(e),i=SI({path:e.path,sessionProjectRoot:c??null});return{key:`file:${e.key}`,kind:`file`,title:t===`rendered`?`${b(`chatWorkspacePreview`)}: ${r}`:r,tooltip:e.path,fileName:e.path,viewMode:e.viewMode,isRenderedPreview:t===`rendered`,alternateViewerAction:n?{label:b(n===`rendered`?`chatWorkspaceOpenPreview`:`chatWorkspaceOpenSource`),viewer:n,onSelect:()=>f(e.key,n)}:null,onAddToChat:i&&l?()=>l({label:r,tokenKey:i}):void 0,active:o?.kind===`file`&&o.file.key===e.key,onSelect:()=>d(e.key),onClose:()=>p({kind:`file`,key:e.key})}});return[...y,...x,...S,...C]}function Ez(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var Dz=Object.freeze({left:0,top:0,width:16,height:16}),Oz=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),kz=Object.freeze({...Dz,...Oz}),Az=Object.freeze({...kz,body:``,hidden:!1});function jz(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Mz(e,t){let n=jz(e,t);for(let r in Az)r in Oz?r in e&&!(r in n)&&(n[r]=Oz[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Nz(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=Mz(r[e]||i[e],a)}return o(t),n.forEach(o),Mz(e,a)}function Pz(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=Ez(e);for(let i in r){let a=r[i];a&&(t(i,Nz(e,i,a)),n.push(i))}return n}var Fz={provider:``,aliases:{},not_found:{},...Dz};function Iz(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Lz(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!Iz(e,Fz))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!Iz(t,Az))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!Iz(t,Az))return null}return t}var Rz=Object.create(null);function zz(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Bz(e,t){let n=Rz[e]||(Rz[e]=Object.create(null));return n[t]||(n[t]=zz(e,t))}function Vz(e,t){return Lz(t)?Pz(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function Hz(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var Uz=/^[a-z0-9]+(-[a-z0-9]+)*$/,Wz=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!Gz(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!Gz(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!Gz(e,n)?null:e}return null},Gz=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,Kz=!1;function qz(e){return typeof e==`boolean`&&(Kz=e),Kz}function Jz(e){let t=typeof e==`string`?Wz(e,!0,Kz):e;if(t){let e=Bz(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function Yz(e,t){let n=Wz(e,!0,Kz);if(!n)return!1;let r=Bz(n.provider,n.prefix);return t?Hz(r,n.name,t):(r.missing.add(n.name),!0)}function Xz(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),Kz&&!t&&!e.prefix){let t=!1;return Lz(e)&&(e.prefix=``,Pz(e,(e,n)=>{Yz(e,n)&&(t=!0)})),t}let n=e.prefix;return Gz({prefix:n,name:`a`})?!!Vz(Bz(t,n),e):!1}var Zz=Object.freeze({width:null,height:null}),Qz=Object.freeze({...Zz,...Oz}),$z=/(-?[0-9.]*[0-9]+[0-9.]*)/g,eB=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function tB(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split($z);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=eB.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function nB(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function rB(e,t){return e?`<defs>`+e+`</defs>`+t:t}function iB(e,t,n){let r=nB(e);return rB(r.defs,t+r.content+n)}var aB=e=>e===`unset`||e===`undefined`||e===`none`;function oB(e,t){let n={...kz,...e},r={...Qz,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=iB(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=tB(d,c/l)):(u=o===`auto`?c:o,d=s===null?tB(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{aB(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var sB=/\sid="(\S+)"/g,cB=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),lB=0;function uB(e,t=cB){let n=[],r;for(;r=sB.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(lB++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var dB=Object.create(null);function fB(e,t){dB[e]=t}function pB(e){return dB[e]||dB[``]}function mB(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var hB=Object.create(null),gB=[`https://api.simplesvg.com`,`https://api.unisvg.com`],_B=[];gB.length>0;)gB.length===1||Math.random()>.5?_B.push(gB.shift()):_B.push(gB.pop());hB[``]=mB({resources:[`https://api.iconify.design`].concat(_B)});function vB(e,t){let n=mB(t);return n===null?!1:(hB[e]=n,!0)}function yB(e){return hB[e]}var bB=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function xB(e,t){let n=yB(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function SB(e){return e===404}var CB=(e,t,n)=>{let r=[],i=xB(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function wB(e){if(typeof e==`string`){let t=yB(e);if(t)return t.path}return`/`}var TB={prepare:CB,send:(e,t,n)=>{if(!bB){n(`abort`,424);return}let r=wB(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;bB(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(SB(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function EB(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function DB(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||EB([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var OB=0;function kB(e,t,n){let r=OB++,i=EB.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function AB(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=Bz(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function jB(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?Wz(e,t,n):e;i&&r.push(i)}),r}var MB={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function NB(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function PB(e){let t={...MB,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=NB(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function FB(){}var IB=Object.create(null);function LB(e){if(!IB[e]){let t=yB(e);if(!t)return;IB[e]={config:t,redundancy:PB(t)}}return IB[e]}function RB(e,t,n){let r,i;if(typeof e==`string`){let t=pB(e);if(!t)return n(void 0,424),FB;i=t.send;let a=LB(e);a&&(r=a.redundancy)}else{let t=mB(e);if(t){r=PB(t);let n=pB(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),FB):r.query(t,i,n)().abort}function zB(){}function BB(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,DB(e)}))}function VB(e){let t=[],n=[];return e.forEach(e=>{(e.match(Uz)?t:n).push(e)}),{valid:t,invalid:n}}function HB(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!Vz(e,n).length){r();return}}catch(e){console.error(e)}r(),BB(e)}function UB(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function WB(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){UB(e.loadIcons(r,n,t),t=>{HB(e,r,t)});return}if(i){r.forEach(r=>{UB(i(r,n,t),t=>{HB(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=VB(r);if(o.length&&HB(e,o,null),!a.length)return;let s=n.match(Uz)?pB(t):null;if(!s){HB(e,a,null);return}s.prepare(t,n,a).forEach(n=>{RB(t,n,t=>{HB(e,n.icons,t)})})}))}var GB=(e,t)=>{let n=AB(jB(e,!0,qz()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,zB)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(Bz(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=Bz(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&WB(e,t)}),t?kB(t,n,i):zB};function KB(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in Zz?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var qB=/[\s,]+/;function JB(e,t){t.split(qB).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function YB(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function XB(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function ZB(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function QB(e){return`data:image/svg+xml,`+ZB(e)}function $B(e){return`url("`+QB(e)+`")`}var eV;function tV(){try{eV=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{eV=null}}function nV(e){return eV===void 0&&tV(),eV?eV.createHTML(e):e}var rV={...Qz,inline:!1},iV={xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},aV={display:`inline-block`},oV={backgroundColor:`currentColor`},sV={backgroundColor:`transparent`},cV={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},lV={WebkitMask:oV,mask:oV,background:sV};for(let e in lV){let t=lV[e];for(let n in cV)t[e+n]=cV[n]}var uV={...rV,inline:!0};function dV(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var fV=(e,t,n)=>{let r=t.inline?uV:rV,i=KB(r,t),a=t.mode||`svg`,o={},s=t.style||{},c={...a===`svg`?iV:{}};if(n){let e=Wz(n,!1,!0);if(e){let t=[`iconify`];for(let n of[`provider`,`prefix`])e[n]&&t.push(`iconify--`+e[n]);c.className=t.join(` `)}}for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`children`:case`onLoad`:case`mode`:case`ssr`:case`fallback`:break;case`_ref`:c.ref=n;break;case`className`:c[e]=(c[e]?c[e]+` `:``)+n;break;case`inline`:case`hFlip`:case`vFlip`:i[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&JB(i,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?i[e]=YB(n):typeof n==`number`&&(i[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete c[`aria-hidden`];break;default:r[e]===void 0&&(c[e]=n)}}let l=oB(e,i),u=l.attributes;if(i.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){c.style={...o,...s},Object.assign(c,u);let e=0,n=t.id;return typeof n==`string`&&(n=n.replace(/-/g,`_`)),c.dangerouslySetInnerHTML={__html:nV(uB(l.body,n?()=>n+`ID`+ e++:`iconifyReact`))},(0,V.createElement)(`svg`,c)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=XB(d,{...u,width:f+``,height:p+``});return c.style={...o,"--svg":$B(h),width:dV(u.width),height:dV(u.height),...aV,...m?oV:sV,...s},(0,V.createElement)(`span`,c)};if(qz(!0),fB(``,TB),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!Xz(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;vB(e,r)||console.error(n)}catch{console.error(n)}}}}function pV(e){let[t,n]=(0,V.useState)(!!e.ssr),[r,i]=(0,V.useState)({});function a(t){if(t){let t=e.icon;if(typeof t==`object`)return{name:``,data:t};let n=Jz(t);if(n)return{name:t,data:n}}return{name:``}}let[o,s]=(0,V.useState)(a(!!e.ssr));function c(){let e=r.callback;e&&(e(),i({}))}function l(e){if(JSON.stringify(o)!==JSON.stringify(e))return c(),s(e),!0}function u(){var t;let n=e.icon;if(typeof n==`object`){l({name:``,data:n});return}let r=Jz(n);l({name:n,data:r})&&(r===void 0?i({callback:GB([n],u)}):r&&((t=e.onLoad)==null||t.call(e,n)))}(0,V.useEffect)(()=>(n(!0),c),[]),(0,V.useEffect)(()=>{t&&u()},[e.icon,t]);let{name:d,data:f}=o;return f?fV({...kz,...f},e,d):e.children?e.children:e.fallback?e.fallback:(0,V.createElement)(`span`,{})}var mV=(0,V.forwardRef)((e,t)=>pV({...e,_ref:t}));(0,V.forwardRef)((e,t)=>pV({inline:!0,...e,_ref:t}));var hV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#c5c5c5" d="M20.414 2H5v28h22V8.586ZM7 28V4h12v6h6v18Z"/>`}})),gV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#00007f" d="M17.229 4a.9.9 0 0 0-.569.232l-7.6 6.32a1.158 1.158 0 0 1-.955.328H3.208A1.2 1.2 0 0 0 2 12.088v7.826a1.2 1.2 0 0 0 1.208 1.206H8.1a1.158 1.158 0 0 1 .955.328l7.6 6.32c.521.433 1.081.224 1.081-.289V4.522A.494.494 0 0 0 17.229 4ZM27 6.3l-1.791 1.793a14.708 14.708 0 0 1 0 15.844l1.785 1.776A17.19 17.19 0 0 0 27 6.3Zm-4.333 4.323L20.905 12.4a6.035 6.035 0 0 1 0 7.237l1.756 1.756a8.554 8.554 0 0 0 .01-10.769Z"/>`}})),_V=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fbf0df" d="M29 17c0 5.65-5.82 10.23-13 10.23S3 22.61 3 17c0-3.5 2.24-6.6 5.66-8.44S14.21 4.81 16 4.81s3.32 1.54 7.34 3.71C26.76 10.36 29 13.46 29 17Z"/><path fill="none" stroke="#000" d="M16 27.65c7.32 0 13.46-4.65 13.46-10.65c0-3.72-2.37-7-5.89-8.85c-1.39-.75-2.46-1.41-3.37-2l-1.13-.69A6.14 6.14 0 0 0 16 4.35a6.88 6.88 0 0 0-3.3 1.23c-.42.24-.86.51-1.32.8c-.87.54-1.83 1.13-3 1.73C4.91 10 2.54 13.24 2.54 17c0 6 6.14 10.65 13.46 10.65Z"/><ellipse cx="21.65" cy="18.62" fill="#febbd0" rx="2.17" ry="1.28"/><ellipse cx="10.41" cy="18.62" fill="#febbd0" rx="2.17" ry="1.28"/><path fill-rule="evenodd" d="M11.43 18.11a2 2 0 1 0-2-2.05a2.05 2.05 0 0 0 2 2.05Zm9.2 0a2 2 0 1 0-2-2.05a2 2 0 0 0 2 2.05Z"/><path fill="#fff" fill-rule="evenodd" d="M10.79 16.19a.77.77 0 1 0-.76-.77a.76.76 0 0 0 .76.77Zm9.2 0a.77.77 0 1 0 0-1.53a.77.77 0 0 0 0 1.53Z"/><path fill="#b71422" stroke="#000" stroke-width=".75" d="M18.62 19.67a3.3 3.3 0 0 1-1.09 1.75a2.48 2.48 0 0 1-1.5.69a2.53 2.53 0 0 1-1.5-.69a3.28 3.28 0 0 1-1.08-1.75a.26.26 0 0 1 .29-.3h4.58a.27.27 0 0 1 .3.3Z"/><path fill="#ccbea7" fill-rule="evenodd" d="M14.93 5.75a6.09 6.09 0 0 1-2.09 4.62c-.1.09 0 .27.11.22c1.25-.49 2.94-1.94 2.23-4.88c-.03-.15-.25-.11-.25.04Zm.85 0a6 6 0 0 1 .57 5c0 .13.12.24.21.13c.83-1 1.54-3.11-.59-5.31c-.1-.11-.27.04-.19.17Zm1-.06a6.09 6.09 0 0 1 2.53 4.38c0 .14.21.17.24 0c.34-1.3.15-3.51-2.66-4.66c-.12-.02-.21.18-.09.27ZM9.94 9.55a6.27 6.27 0 0 0 3.89-3.33c.07-.13.28-.08.25.07c-.64 3-2.79 3.59-4.13 3.51c-.14-.01-.14-.21-.01-.25Z"/>`}})),vV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#99b8c4" d="m23.265 24.381l.9-.894c4.164.136 4.228-.01 4.411-.438l1.144-2.785l.085-.264l-.093-.231c-.049-.122-.2-.486-2.8-2.965V15.5c3-2.89 2.936-3.038 2.765-3.461l-1.139-2.814c-.171-.422-.236-.587-4.37-.474l-.9-.93a20.166 20.166 0 0 0-.141-4.106l-.116-.263l-2.974-1.3c-.438-.2-.592-.272-3.4 2.786l-1.262-.019c-2.891-3.086-3.028-3.03-3.461-2.855L9.149 3.182c-.433.175-.586.237-.418 4.437l-.893.89c-4.162-.136-4.226.012-4.407.438l-1.146 2.786l-.09.267l.094.232c.049.12.194.48 2.8 2.962v1.3c-3 2.89-2.935 3.038-2.763 3.462l1.138 2.817c.174.431.236.584 4.369.476l.9.935a20.243 20.243 0 0 0 .137 4.1l.116.265l2.993 1.308c.435.182.586.247 3.386-2.8l1.262.016c2.895 3.09 3.043 3.03 3.466 2.859l2.759-1.115c.436-.173.588-.234.413-4.436Zm-11.858-6.524a4.957 4.957 0 1 1 6.488 2.824a5.014 5.014 0 0 1-6.488-2.824Z"/>`}})),yV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#984c93" d="M14.742 24.047a10.242 10.242 0 0 1-4.673.919a7.628 7.628 0 0 1-5.914-2.346A8.876 8.876 0 0 1 2 16.369a9.476 9.476 0 0 1 2.422-6.748a8.216 8.216 0 0 1 6.285-2.588a11.151 11.151 0 0 1 4.035.641v3.761A6.839 6.839 0 0 0 11 10.395a4.813 4.813 0 0 0-3.712 1.535a5.9 5.9 0 0 0-1.413 4.159A5.8 5.8 0 0 0 7.209 20.1a4.57 4.57 0 0 0 3.59 1.493a7.319 7.319 0 0 0 3.943-1.113Zm2.37-9.218v-2.344h2.344v2.344H21.8v2.343h-2.344v2.343h-2.344v-2.343H14.77v-2.344l2.342.001zm8.201 0v-2.344h2.344v2.344H30v2.343h-2.343v2.343h-2.344v-2.343h-2.342v-2.344l2.342.001z"/>`}})),bV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#368832" d="M19.792 7.071h2.553v2.553H24.9V7.071h2.552v2.553H30v2.552h-2.55v2.551H30v2.553h-2.551v2.552H24.9v-2.55h-2.55v2.552h-2.557v-2.55H17.24v-2.559h2.553v-2.546H17.24V9.622h2.554Zm2.553 7.658H24.9v-2.553h-2.555Zm-7.656 9.284a10.2 10.2 0 0 1-4.653.915a7.6 7.6 0 0 1-5.89-2.336A8.839 8.839 0 0 1 2 16.367a9.436 9.436 0 0 1 2.412-6.719a8.181 8.181 0 0 1 6.259-2.577a11.1 11.1 0 0 1 4.018.638v3.745a6.81 6.81 0 0 0-3.723-1.036a4.793 4.793 0 0 0-3.7 1.529a5.879 5.879 0 0 0-1.407 4.142a5.774 5.774 0 0 0 1.328 3.992a4.551 4.551 0 0 0 3.575 1.487a7.288 7.288 0 0 0 3.927-1.108Z"/>`}})),xV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#1572b6" d="M5.902 27.201L3.656 2h24.688l-2.249 25.197L15.985 30L5.902 27.201z"/><path fill="#33a9dc" d="m16 27.858l8.17-2.265l1.922-21.532H16v23.797z"/><path fill="#fff" d="M16 13.191h4.09l.282-3.165H16V6.935h7.75l-.074.829l-.759 8.518H16v-3.091z"/><path fill="#ebebeb" d="m16.019 21.218l-.014.004l-3.442-.93l-.22-2.465H9.24l.433 4.853l6.331 1.758l.015-.004v-3.216z"/><path fill="#fff" d="m19.827 16.151l-.372 4.139l-3.447.93v3.216l6.336-1.756l.047-.522l.537-6.007h-3.101z"/><path fill="#ebebeb" d="M16.011 6.935v3.091H8.545l-.062-.695l-.141-1.567l-.074-.829h7.743zM16 13.191v3.091h-3.399l-.062-.695l-.14-1.567l-.074-.829H16z"/>`}})),SV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#3a4e55" d="M18.191 13.071H20.7v2.566h1.27a5.5 5.5 0 0 0 1.744-.292a4.462 4.462 0 0 0 .848-.383a3.149 3.149 0 0 1-.589-1.623a3.427 3.427 0 0 1 .616-2.416l.264-.305l.314.253a4 4 0 0 1 1.575 2.538a3.837 3.837 0 0 1 2.913.271l.345.2l-.181.354a3.629 3.629 0 0 1-3.648 1.74c-2.173 5.413-6.9 7.976-12.642 7.976A7.958 7.958 0 0 1 6.3 20.211l-.025-.043l-.226-.459a7.28 7.28 0 0 1-.579-3.693l.035-.38h2.143v-2.565h2.51v-2.51h5.02v-2.51h3.012v5.02Z"/><path fill="#00aada" d="M26.324 14.021a3.311 3.311 0 0 0-1.418-2.821a3.072 3.072 0 0 0 .289 3.821a5.279 5.279 0 0 1-3.225 1.037H5.883a6.779 6.779 0 0 0 .667 3.737l.183.335a6.2 6.2 0 0 0 .379.569q.992.064 1.829.045a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.4 8.4 0 0 1-1.845.3c.044 0-.046.007-.046.007l-.082.007a21.455 21.455 0 0 1-2.008-.006l-.01.007a7.882 7.882 0 0 0 6.063 2.41c5.56 0 10.276-2.465 12.365-8c1.482.152 2.906-.226 3.553-1.49a3.5 3.5 0 0 0-3.122-.022"/><path fill="#27b9ec" d="M26.324 14.021a3.311 3.311 0 0 0-1.418-2.821a3.072 3.072 0 0 0 .289 3.821a5.279 5.279 0 0 1-3.225 1.037H6.836a5.223 5.223 0 0 0 2.106 4.686a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.83 8.83 0 0 1-1.894.314l-.019-.022c1.892.971 4.636.967 7.782-.241a21.868 21.868 0 0 0 9.1-6.889l-.1.048"/><path fill="#088cb9" d="M5.913 17.732a6.431 6.431 0 0 0 .637 2.061l.183.335a6.2 6.2 0 0 0 .379.569q.992.064 1.829.045a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.826 8.826 0 0 1-1.891.307h-.1c-.291.016-.6.026-.922.026c-.351 0-.709-.007-1.1-.026a7.913 7.913 0 0 0 6.076 2.413c4.76 0 8.9-1.807 11.3-5.8Z"/><path fill="#039cc7" d="M6.98 17.732a4.832 4.832 0 0 0 1.961 3.01a8.972 8.972 0 0 0 2.669-.389a.193.193 0 1 1 .126.365c-.09.031-.184.061-.281.088a8.959 8.959 0 0 1-1.9.307c1.892.971 4.628.957 7.773-.252a20.545 20.545 0 0 0 5.377-3.13Z"/><path fill="#00acd3" d="M9.889 13.671h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H9.23v-1.813Zm-.33 0h.179v1.813H8.9v-1.813Zm-.33 0h.179v1.813H8.57v-1.813Zm-.323 0h.172v1.813h-.17v-1.813Zm-.181-.181h2.175v2.176H8.066V13.49Zm4.335-2.329h.172v1.813H12.4v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.178v1.813h-.178v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175v-2.177Z"/><path fill="#26c2ee" d="M12.4 13.671h.172v1.813H12.4v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.178v1.813h-.178v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175V13.49Z"/><path fill="#00acd3" d="M14.909 13.671h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.181v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.174V13.49Z"/><path fill="#26c2ee" d="M14.909 11.161h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.179v1.813h-.178v-1.813Zm-.33 0h.181v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.174v-2.177Zm4.335 2.691h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H16.1v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.177-.181h2.176v2.176H15.6V13.49Z"/><path fill="#00acd3" d="M17.42 11.161h.172v1.813h-.172v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813H16.1v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176H15.6v-2.177Z"/><path fill="#26c2ee" d="M17.42 8.65h.172v1.813h-.172V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813h-.179V8.65Zm-.33 0h.179v1.813H16.1V8.65Zm-.323 0h.172v1.813h-.172V8.65Zm-.177-.181h2.176v2.176H15.6V8.469Z"/><path fill="#00acd3" d="M19.93 13.671h.17v1.813h-.17v-1.813Zm-.33 0h.178v1.813H19.6v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.33 0h.179v1.813h-.179v-1.813Zm-.323 0h.172v1.813h-.172v-1.813Zm-.181-.181h2.176v2.176h-2.175V13.49Z"/><path fill="#d5eef2" d="M12.616 19.193a.6.6 0 1 1-.6.6a.6.6 0 0 1 .6-.6"/><path fill="#3a4e55" d="M12.616 19.363a.431.431 0 0 1 .156.029a.175.175 0 1 0 .241.236a.43.43 0 1 1-.4-.265M2 17.949h27.92c-.608-.154-1.923-.362-1.707-1.159c-1.105 1.279-3.771.9-4.444.267c-.749 1.087-5.111.674-5.415-.173c-.939 1.1-3.85 1.1-4.789 0c-.3.847-4.666 1.26-5.415.173c-.673.631-3.338 1.012-4.444-.267c.217.8-1.1 1.005-1.707 1.159"/><path fill="#c0dbe1" d="M14.211 23.518a5.287 5.287 0 0 1-2.756-2.711a9.2 9.2 0 0 1-1.987.3q-.436.024-.917.025q-.554 0-1.168-.033a7.942 7.942 0 0 0 6.145 2.43q.344 0 .683-.013"/><path fill="#d5eef2" d="M12.007 21.773a5.206 5.206 0 0 1-.552-.966a9.2 9.2 0 0 1-1.987.3a6.325 6.325 0 0 0 2.539.664"/>`}})),CV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<g fill-rule="evenodd"><path d="M3.167 3.167h25.667v25.667H3.167z"/><path fill="#ecd53f" fill-rule="nonzero" d="M30 2v28H2V2zM14.757 20.539H9.98v6.44h4.898v-1.085h-3.597V24.14h3.232v-1.085H11.28v-1.428h3.475v-1.09zm2.503 0h-1.264v6.44h1.207v-4.2l2.597 4.2h1.305v-6.44h-1.21v4.3l-2.635-4.301zm5.97 0h-1.41l2.303 6.44h1.388l2.306-6.44h-1.38l-1.577 4.766l-1.63-4.767zM8.3 24.96H6.34v1.96H8.3z"/></g>`}})),wV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#4b32c3" d="m29.832 16.7l-6.354 10.717A1.256 1.256 0 0 1 22.36 28H9.647a1.262 1.262 0 0 1-1.118-.59l-6.356-10.7a1.256 1.256 0 0 1 0-1.272L8.527 4.676A1.344 1.344 0 0 1 9.647 4h12.709a1.344 1.344 0 0 1 1.118.678l6.354 10.786a1.2 1.2 0 0 1 0 1.238Zm-5.262 4.2v-9.614L16 6.466l-8.56 4.82V20.9L16 25.719Z"/><path fill="#8080f2" d="m21.802 19.188l-5.747 3.235l-5.742-3.235v-6.47l5.742-3.236l5.747 3.236v6.47z"/>`}})),TV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeExcel0" x1="4.494" x2="13.832" y1="-2092.086" y2="-2075.914" gradientTransform="translate(0 2100)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#18884f"/><stop offset=".5" stop-color="#117e43"/><stop offset="1" stop-color="#0b6631"/></linearGradient></defs><path fill="#185c37" d="M19.581 15.35L8.512 13.4v14.409A1.192 1.192 0 0 0 9.705 29h19.1A1.192 1.192 0 0 0 30 27.809V22.5Z"/><path fill="#21a366" d="M19.581 3H9.705a1.192 1.192 0 0 0-1.193 1.191V9.5L19.581 16l5.861 1.95L30 16V9.5Z"/><path fill="#107c41" d="M8.512 9.5h11.069V16H8.512Z"/><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2Z" opacity=".1"/><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypeExcel0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="m5.7 19.873l2.511-3.884l-2.3-3.862h1.847L9.013 14.6c.116.234.2.408.238.524h.017c.082-.188.169-.369.26-.546l1.342-2.447h1.7l-2.359 3.84l2.419 3.905h-1.809l-1.45-2.711A2.355 2.355 0 0 1 9.2 16.8h-.024a1.688 1.688 0 0 1-.168.351l-1.493 2.722Z"/><path fill="#33c481" d="M28.806 3h-9.225v6.5H30V4.191A1.192 1.192 0 0 0 28.806 3Z"/><path fill="#107c41" d="M19.581 16H30v6.5H19.581Z"/>`}})),EV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cfcfcf" d="m12.677 17.781l-2.626-6.256l-2.694 6.256Zm6.723 6.511h-7.069v-1.365l.458-.023a1.847 1.847 0 0 0 .972-.2a.313.313 0 0 0 .145-.263a4.158 4.158 0 0 0-.419-1.4l-.812-1.931H7.322L6.4 21.259a3.319 3.319 0 0 0-.349 1.157c0 .036 0 .119.154.241a2.481 2.481 0 0 0 1.191.247l.448.033v1.354H2v-1.31l.4-.07a2.188 2.188 0 0 0 1-.318a6.318 6.318 0 0 0 1.18-2.066l5.575-13.036H11.2l5.512 13.174a5.255 5.255 0 0 0 1.049 1.835a1.959 1.959 0 0 0 1.19.4l.454.027Zm6.441-2.732v-3.985a22.542 22.542 0 0 0-2.226.97a3.845 3.845 0 0 0-1.29 1.05a2.03 2.03 0 0 0-.388 1.2a1.951 1.951 0 0 0 .491 1.362a1.49 1.49 0 0 0 1.13.544a4.142 4.142 0 0 0 2.283-1.141Zm-3.333 2.949a2.833 2.833 0 0 1-2.139-.893a3.206 3.206 0 0 1-.833-2.285a2.959 2.959 0 0 1 .415-1.577a5 5 0 0 1 1.791-1.625a23.876 23.876 0 0 1 3.617-1.588v-.074a2.905 2.905 0 0 0-.383-1.833a1.325 1.325 0 0 0-1.075-.412a1.155 1.155 0 0 0-.816.26a.687.687 0 0 0-.277.536l.023.646a1.62 1.62 0 0 1-.4 1.158a1.481 1.481 0 0 1-2.1-.019a1.634 1.634 0 0 1-.391-1.134a2.8 2.8 0 0 1 1.182-2.177a4.813 4.813 0 0 1 3.125-.932a5.381 5.381 0 0 1 2.508.524a2.628 2.628 0 0 1 1.213 1.346a6.391 6.391 0 0 1 .244 2.2v3.55a14.665 14.665 0 0 0 .051 1.749a.661.661 0 0 0 .054.2c.085-.078.284-.225.864-.806l.819-.828v1.967l-.1.128c-.958 1.283-1.883 1.907-2.83 1.907a1.6 1.6 0 0 1-1.257-.557a1.788 1.788 0 0 1-.358-.74a9.688 9.688 0 0 1-1.433.977a3.579 3.579 0 0 1-1.514.332Z"/>`}})),DV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#dd4c35" d="M29.472 14.753L17.247 2.528a1.8 1.8 0 0 0-2.55 0l-2.539 2.539l3.22 3.22a2.141 2.141 0 0 1 2.712 2.73l3.1 3.1a2.143 2.143 0 1 1-1.285 1.21l-2.895-2.895v7.617a2.141 2.141 0 1 1-1.764-.062V12.3a2.146 2.146 0 0 1-1.165-2.814l-3.17-3.172L2.528 14.7a1.8 1.8 0 0 0 0 2.551l12.225 12.221a1.8 1.8 0 0 0 2.55 0L29.472 17.3a1.8 1.8 0 0 0 0-2.551"/><path fill="#fff" d="m12.158 5.067l3.22 3.22a2.141 2.141 0 0 1 2.712 2.73l3.1 3.1a2.143 2.143 0 1 1-1.285 1.21l-2.895-2.895v7.617a2.141 2.141 0 1 1-1.764-.062V12.3a2.146 2.146 0 0 1-1.165-2.814l-3.17-3.172"/>`}})),OV=n((e=>{e.__esModule=!0,e.default={width:254.5,height:225,body:`<path fill="#00acd7" d="M-46.926 89c-.621 0-.777-.311-.466-.777l3.262-4.194a2.225 2.225 0 0 1 1.708-.777h55.448c.621 0 .777.466.466.932l-2.64 4.038a2.367 2.367 0 0 1-1.553.932Zm-23.453 14.285c-.621 0-.777-.311-.466-.777l3.262-4.194a2.225 2.225 0 0 1 1.708-.777H4.95a.714.714 0 0 1 .777.932L4.484 102.2a1.358 1.358 0 0 1-1.4.932Zm37.587 14.289c-.621 0-.777-.466-.466-.932l2.174-3.883a2.06 2.06 0 0 1 1.553-.932H1.533c.621 0 .932.466.932 1.087l-.311 3.728a1.167 1.167 0 0 1-1.087 1.087ZM128.426 86.2c-9.785 2.485-16.464 4.349-26.093 6.834c-2.33.621-2.485.777-4.5-1.553c-2.33-2.64-4.038-4.349-7.3-5.9c-9.785-4.815-19.259-3.417-28.112 2.33c-10.561 6.834-16 16.929-15.842 29.51c.155 12.425 8.7 22.676 20.968 24.385c10.561 1.4 19.414-2.33 26.4-10.251c1.4-1.708 2.64-3.572 4.194-5.747H68.163c-3.262 0-4.038-2.019-2.951-4.659c2.019-4.815 5.747-12.891 7.921-16.929a4.194 4.194 0 0 1 3.883-2.485h56.535c-.311 4.194-.311 8.387-.932 12.581a66.239 66.239 0 0 1-12.736 30.442c-11.183 14.752-25.783 23.915-44.265 26.4c-15.221 2.019-29.355-.932-41.78-10.251a48.785 48.785 0 0 1-19.725-34.48c-2.019-16.929 2.951-32.15 13.2-45.508C38.342 66.475 52.942 57.312 70.8 54.05c14.6-2.64 28.578-.932 41.159 7.61a48.686 48.686 0 0 1 18.017 21.9c.935 1.398.313 2.175-1.55 2.64Z"/><path fill="#00acd7" d="M179.835 172.09c-14.134-.311-27.025-4.349-37.9-13.668a48.711 48.711 0 0 1-16.774-29.976c-2.8-17.551 2.019-33.082 12.581-46.905c11.338-14.91 25.006-22.676 43.488-25.938c15.842-2.8 30.753-1.243 44.265 7.921c12.27 8.387 19.88 19.725 21.9 34.635c2.64 20.968-3.417 38.052-17.861 52.652a71.17 71.17 0 0 1-37.276 19.88c-4.191.778-8.384.933-12.423 1.399Zm36.965-62.747a44.7 44.7 0 0 0-.466-5.125c-2.8-15.376-16.929-24.074-31.684-20.657c-14.444 3.262-23.763 12.425-27.18 27.025a25.579 25.579 0 0 0 14.289 29.355c8.542 3.728 17.085 3.262 25.317-.932c12.269-6.369 18.948-16.309 19.724-29.666Z"/>`}})),kV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e10098" d="M4.781 22.746L16.232 2.914l1.028.593L5.81 23.34z"/><path fill="#e10098" d="M4.545 21.162h22.902v1.187H4.545z"/><path fill="#e10098" d="m4.999 21.828l.593-1.028l11.455 6.614l-.594 1.028zM14.95 4.59l.594-1.027l11.455 6.614l-.594 1.028z"/><path fill="#e10098" d="M5.002 10.174L16.456 3.56l.594 1.028l-11.455 6.614z"/><path fill="#e10098" d="m14.743 3.508l1.028-.594l11.45 19.833l-1.027.593zM5.454 9.386h1.187v13.228H5.454z"/><path fill="#e10098" d="M25.36 9.386h1.187v13.228H25.36z"/><path fill="#e10098" d="m15.734 27.042l9.962-5.752l.519.898l-9.963 5.752z"/><path fill="#e10098" d="M28.12 23a2.5 2.5 0 1 1-.915-3.411A2.5 2.5 0 0 1 28.12 23M8.2 11.5a2.5 2.5 0 1 1-.915-3.411A2.5 2.5 0 0 1 8.2 11.5M3.88 23a2.5 2.5 0 1 1 3.411.915A2.5 2.5 0 0 1 3.88 23M23.8 11.5a2.5 2.5 0 1 1 3.411.915A2.5 2.5 0 0 1 23.8 11.5M16 30a2.5 2.5 0 1 1 2.5-2.5A2.493 2.493 0 0 1 16 30m0-23.009a2.5 2.5 0 1 1 2.5-2.5a2.493 2.493 0 0 1-2.5 2.5"/>`}})),AV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e44f26" d="M5.902 27.201L3.655 2h24.69l-2.25 25.197L15.985 30L5.902 27.201z"/><path fill="#f1662a" d="m16 27.858l8.17-2.265l1.922-21.532H16v23.797z"/><path fill="#ebebeb" d="M16 13.407h-4.09l-.282-3.165H16V7.151H8.25l.074.83l.759 8.517H16v-3.091zm0 8.027l-.014.004l-3.442-.929l-.22-2.465H9.221l.433 4.852l6.332 1.758l.014-.004v-3.216z"/><path fill="#fff" d="M15.989 13.407v3.091h3.806l-.358 4.009l-3.448.93v3.216l6.337-1.757l.046-.522l.726-8.137l.076-.83h-7.185zm0-6.256v3.091h7.466l.062-.694l.141-1.567l.074-.83h-7.743z"/>`}})),jV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#2dcc9f" d="M30 5.851v20.298H2V5.851h28"/><path fill="#fff" d="M24.232 8.541a2.2 2.2 0 1 0 1.127.623a2.212 2.212 0 0 0-1.127-.623M18.111 20.1q-2.724-3.788-5.45-7.575L4.579 23.766h10.9q1.316-1.832 2.634-3.663M22.057 16q-2.793 3.882-5.584 7.765h11.169Q24.851 19.882 22.057 16Z"/>`}})),MV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#5382a1" d="M12.325 23.654s-1.07.622.761.833a16.023 16.023 0 0 0 5.8-.246a10.088 10.088 0 0 0 1.541.752c-5.481 2.349-12.405-.136-8.1-1.339m-.671-3.066s-1.2.888.633 1.078a22.618 22.618 0 0 0 7.481-.359a3.32 3.32 0 0 0 1.152.7c-6.627 1.938-14.009.153-9.266-1.421m5.644-5.198a2.051 2.051 0 0 1-.355 2.954s3.429-1.77 1.854-3.987c-1.471-2.067-2.6-3.095 3.508-6.636c0 0-9.586 2.394-5.007 7.669"/><path fill="#5382a1" d="M24.552 25.921s.792.652-.872 1.157c-3.164.958-13.168 1.248-15.948.038c-1-.435.874-1.038 1.464-1.164a3.8 3.8 0 0 1 .966-.108c-1.111-.783-7.181 1.537-3.083 2.2c11.176 1.812 20.372-.816 17.473-2.124M12.84 17.412s-5.089 1.209-1.8 1.648a38.225 38.225 0 0 0 6.731-.072a53.11 53.11 0 0 0 4.221-.555a8.934 8.934 0 0 0-1.28.685c-5.168 1.359-15.151.727-12.277-.663a9.629 9.629 0 0 1 4.407-1.042m9.127 5.102c5.253-2.73 2.824-5.353 1.129-5a3.932 3.932 0 0 0-.6.161a.957.957 0 0 1 .449-.346c3.354-1.179 5.933 3.478-1.083 5.322a.458.458 0 0 0 .106-.138M18.8 2s2.909 2.91-2.759 7.386c-4.546 3.59-1.037 5.637 0 7.975c-2.653-2.394-4.6-4.5-3.294-6.463C14.664 8.019 19.976 6.623 18.8 2"/><path fill="#5382a1" d="M13.356 29.912c5.042.323 12.786-.179 12.969-2.565c0 0-.353.9-4.167 1.623a41.458 41.458 0 0 1-12.76.2s.645.533 3.959.746"/>`}})),NV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f5de19" d="M18.774 19.7a3.727 3.727 0 0 0 3.376 2.078c1.418 0 2.324-.709 2.324-1.688c0-1.173-.931-1.589-2.491-2.272l-.856-.367c-2.469-1.052-4.11-2.37-4.11-5.156c0-2.567 1.956-4.52 5.012-4.52A5.058 5.058 0 0 1 26.9 10.52l-2.665 1.711a2.327 2.327 0 0 0-2.2-1.467a1.489 1.489 0 0 0-1.638 1.467c0 1.027.636 1.442 2.1 2.078l.856.366c2.908 1.247 4.549 2.518 4.549 5.376c0 3.081-2.42 4.769-5.671 4.769a6.575 6.575 0 0 1-6.236-3.5ZM6.686 20c.538.954 1.027 1.76 2.2 1.76c1.124 0 1.834-.44 1.834-2.15V7.975h3.422v11.683c0 3.543-2.078 5.156-5.11 5.156A5.312 5.312 0 0 1 3.9 21.688Z"/>`}})),PV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f5de19" d="M4.014 14.976a2.51 2.51 0 0 0 1.567-.518a2.377 2.377 0 0 0 .805-1.358a15.261 15.261 0 0 0 .214-2.944q.012-2.085.075-2.747a5.236 5.236 0 0 1 .418-1.686a3.025 3.025 0 0 1 .755-1.018A3.046 3.046 0 0 1 9 4.125A6.762 6.762 0 0 1 10.544 4h.7v1.96h-.387a2.338 2.338 0 0 0-1.723.468a3.4 3.4 0 0 0-.425 2.092a36.054 36.054 0 0 1-.137 4.133a4.734 4.734 0 0 1-.768 2.06A4.567 4.567 0 0 1 6.1 16a3.809 3.809 0 0 1 1.992 1.754a8.861 8.861 0 0 1 .618 3.865q0 2.435.05 2.9a1.755 1.755 0 0 0 .504 1.181a2.639 2.639 0 0 0 1.592.337h.387V28h-.7a5.655 5.655 0 0 1-1.773-.2a2.97 2.97 0 0 1-1.324-.93a3.353 3.353 0 0 1-.681-1.63a24.175 24.175 0 0 1-.165-3.234a16.469 16.469 0 0 0-.214-3.106a2.408 2.408 0 0 0-.805-1.361a2.489 2.489 0 0 0-1.567-.524Zm23.972 2.035a2.489 2.489 0 0 0-1.567.524a2.408 2.408 0 0 0-.805 1.361a16.469 16.469 0 0 0-.212 3.109a24.175 24.175 0 0 1-.169 3.234a3.353 3.353 0 0 1-.681 1.63a2.97 2.97 0 0 1-1.324.93a5.655 5.655 0 0 1-1.773.2h-.7V26.04h.387a2.639 2.639 0 0 0 1.592-.337a1.755 1.755 0 0 0 .506-1.186q.05-.462.05-2.9a8.861 8.861 0 0 1 .618-3.865A3.809 3.809 0 0 1 25.9 16a4.567 4.567 0 0 1-1.7-1.286a4.734 4.734 0 0 1-.768-2.06a36.054 36.054 0 0 1-.137-4.133a3.4 3.4 0 0 0-.425-2.092a2.338 2.338 0 0 0-1.723-.468h-.387V4h.7a6.762 6.762 0 0 1 1.54.125a3.046 3.046 0 0 1 1.149.581a3.025 3.025 0 0 1 .755 1.018a5.236 5.236 0 0 1 .418 1.686q.062.662.075 2.747a15.261 15.261 0 0 0 .212 2.947a2.377 2.377 0 0 0 .805 1.355a2.51 2.51 0 0 0 1.567.518Z"/>`}})),FV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeKotlin0" x1="311.336" x2="283.342" y1="1452.064" y2="1480.058" gradientTransform="translate(-281.4 -1450)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#e44857"/><stop offset=".47" stop-color="#9d4b9d"/><stop offset="1" stop-color="#6d5faa"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypeKotlin0)" d="M30 30H2V2h28L16 16Z"/>`}})),IV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeLicense0" x1="-264.845" x2="-255.586" y1="181.772" y2="182.061" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#bd6316"/><stop offset="1" stop-color="#4e1500"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense1" x1="-263.276" x2="-256.603" y1="170.205" y2="171.772" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense2" x1="-265.068" x2="-256.777" y1="175.732" y2="178.801" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense3" x1="-655.014" x2="-655.555" y1="147.549" y2="146.948" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffd436"/><stop offset="1" stop-color="#8b3f02"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense4" x1="-258.899" x2="-253.843" y1="170.981" y2="171.325" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff8b7"/><stop offset="1" stop-color="#fcbf0e"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense5" x1="-258.884" x2="-253.896" y1="170.975" y2="171.314" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense6" x1="-257.805" x2="-257.726" y1="172.266" y2="168.648" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense7" x1="-258.935" x2="-256.173" y1="181.92" y2="182.108" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense8" x1="-274.156" x2="-274.512" y1="170.544" y2="173.778" gradientTransform="matrix(-1 0 0 1 -257.657 -155.509)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense9" x1="-645.79" x2="-645.121" y1="-337.938" y2="-334.17" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffef94"/><stop offset="1" stop-color="#ffd200"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicensea" x1="-276.128" x2="-274.754" y1="178.682" y2="178.682" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseb" x1="-274.314" x2="-271.841" y1="178.887" y2="178.987" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensec" x1="-273.817" x2="-274.213" y1="189.281" y2="174.569" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#d89530"/><stop offset="1" stop-color="#772d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicensed" x1="-274.075" x2="-273.917" y1="174.09" y2="181.459" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensee" x1="-272.919" x2="-273.315" y1="189.281" y2="174.57" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensef" x1="-273.177" x2="-273.019" y1="174.071" y2="181.44" gradientTransform="scale(-1 1) rotate(26.18 189.155 648.159)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseg" x1="-652.29" x2="-651.867" y1="-335.227" y2="-332.867" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffdb57"/><stop offset="1" stop-color="#b55c13"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicenseh" x1="-665.076" x2="-659.751" y1="157.413" y2="150.922" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensei" x1="-665.161" x2="-664.822" y1="156.114" y2="155.701" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensej" x1="-665.308" x2="-665.836" y1="156.436" y2="155.32" gradientTransform="scale(-1 1) rotate(-18.83 -723.282 -1847.955)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensek" x1="-655.442" x2="-654.817" y1="147.568" y2="146.776" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensel" x1="-253.999" x2="-254.134" y1="175.1" y2="173.736" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensem" x1="-252.571" x2="-252.785" y1="173.138" y2="170.963" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensen" x1="-257.206" x2="-259.174" y1="169.107" y2="169.787" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicenseo" x1="-260.717" x2="-260.77" y1="170.284" y2="171.228" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicensep" x1="-257.835" x2="-257.782" y1="174.993" y2="171.93" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenseq" x1="-263.928" x2="-255.721" y1="171.018" y2="171.018" gradientTransform="scale(-1 1) rotate(26.18 205.537 615.155)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicenser" x1="-514.299" x2="-505.041" y1="-57.926" y2="-57.638" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenses" x1="-512.744" x2="-505.964" y1="-69.496" y2="-67.904" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenset" x1="-514.521" x2="-506.23" y1="-63.966" y2="-60.897" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicenseu" x1="-662.221" x2="-662.762" y1="-197.167" y2="-197.768" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensev" x1="-508.354" x2="-503.297" y1="-68.717" y2="-68.373" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicensew" x1="-508.338" x2="-503.351" y1="-68.723" y2="-68.384" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicensex" x1="-507.26" x2="-507.18" y1="-67.432" y2="-71.05" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicensey" x1="-508.389" x2="-505.627" y1="-57.779" y2="-57.591" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicensez" x1="-523.609" x2="-523.966" y1="-69.153" y2="-65.918" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense10" x1="-645.333" x2="-642.973" y1="-334.169" y2="-332.091" href="#vscodeIconsFileTypeLicense9"/><linearGradient id="vscodeIconsFileTypeLicense11" x1="-525.581" x2="-524.207" y1="-61.015" y2="-61.015" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense12" x1="-523.768" x2="-521.294" y1="-60.81" y2="-60.71" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense13" x1="-523.27" x2="-523.666" y1="-50.416" y2="-65.127" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense14" x1="-523.528" x2="-523.37" y1="-65.606" y2="-58.238" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense15" x1="-522.372" x2="-522.768" y1="-50.416" y2="-65.127" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense16" x1="-522.631" x2="-522.472" y1="-65.626" y2="-58.257" gradientTransform="matrix(-.947 -.323 -.148 .966 -492.49 -86.99)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense17" x1="-649.116" x2="-646.827" y1="-328.591" y2="-326.795" href="#vscodeIconsFileTypeLicense9"/><linearGradient id="vscodeIconsFileTypeLicense18" x1="-672.284" x2="-666.958" y1="-187.303" y2="-193.795" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense19" x1="-672.369" x2="-672.03" y1="-188.603" y2="-189.016" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1a" x1="-672.516" x2="-673.044" y1="-188.281" y2="-189.397" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1b" x1="-662.648" x2="-662.023" y1="-197.148" y2="-197.94" gradientTransform="matrix(-.564 -.911 -.774 .455 -516.113 -497.612)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1c" x1="-503.367" x2="-503.501" y1="-64.607" y2="-65.971" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1d" x1="-502.006" x2="-502.232" y1="-66.361" y2="-68.654" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1e" x1="-506.661" x2="-508.629" y1="-70.591" y2="-69.911" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1f" x1="-510.172" x2="-510.224" y1="-69.414" y2="-68.47" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicensec"/><linearGradient id="vscodeIconsFileTypeLicense1g" x1="-507.289" x2="-507.236" y1="-64.705" y2="-67.768" gradientTransform="matrix(-.947 -.323 -.148 .966 -476.554 -85.464)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1h" x1="-642.337" x2="-640.048" y1="-337.231" y2="-335.435" gradientTransform="scale(-1 1) rotate(-52.06 29.075 -802.903)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffdb57"/><stop offset="1" stop-color="#b66512"/></linearGradient><linearGradient id="vscodeIconsFileTypeLicense1i" x1="-628.479" x2="-627.663" y1="-215.005" y2="-209.203" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense0"/><linearGradient id="vscodeIconsFileTypeLicense1j" x1="-633.006" x2="-622.552" y1="-211.18" y2="-211.18" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense1k" x1="-627.491" x2="-627.755" y1="-215.556" y2="-211.648" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1l" x1="-627.796" x2="-627.057" y1="-210.705" y2="-205.186" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/><linearGradient id="vscodeIconsFileTypeLicense1m" x1="245.815" x2="245.923" y1="139.434" y2="136.367" gradientTransform="rotate(7.312 1187.515 -1764.249)" href="#vscodeIconsFileTypeLicense4"/><linearGradient id="vscodeIconsFileTypeLicense1n" x1="-626.269" x2="-627.643" y1="-215.112" y2="-213.078" gradientTransform="scale(-1 1) rotate(-37.85 -2.119 -997.83)" href="#vscodeIconsFileTypeLicense3"/></defs><path fill="url(#vscodeIconsFileTypeLicense0)" d="m13.372 16.416l5.013-2.464l.93 1.893l-.054.238l-2.048 1.007l5.706 11.611l-.221.359l-1.543.758l-.82-.45l-5.459-11.109l-.482.237l-1.022-2.08z"/><path fill="url(#vscodeIconsFileTypeLicense1)" d="m9.24 13.619l1.2 2.44c.072.146.416.252.617.292l2.634.683l4.609-2.268l.867-2.342a.679.679 0 0 0 .036-.674l-1.2-2.44a.546.546 0 0 0-.452-.3l-4.44.136a1.278 1.278 0 0 0-1.018.541l-2.72 3.162a.916.916 0 0 0-.133.77Zm1.932.033a.356.356 0 0 1 .011-.334l1.84-2.215a.829.829 0 0 1 .66-.351l2.877-.088a.355.355 0 0 1 .293.2l.356.725a.242.242 0 0 1-.139.339L11.833 14.5a.224.224 0 0 1-.3-.121Z"/><path fill="url(#vscodeIconsFileTypeLicense2)" d="m9.426 13.209l1.2 2.44c.072.146.416.252.617.292l2.7.547l.782 1.591l.375-.179l5.459 11.109l.82.451l1.541-.76l-.017-.683l.868-1.458l-.241-.49l-.54.1l-.31-.63l.41-.366l-.59-1.199l-.593-.006l-.277-.564l.357-.473l-.3-.607l-.568.043l-.432-.879l.382-.423l-.161-.327a.871.871 0 0 1-.659-1.342l-.345-.7a1.347 1.347 0 0 1-.962-1.956l-.29-.591l.631-.31l-.773-1.546l.843-2.277a.68.68 0 0 0 .035-.674l-1.2-2.44a.546.546 0 0 0-.453-.3l-4.435.131a1.278 1.278 0 0 0-1.018.541l-2.84 3.419a.548.548 0 0 0-.016.516Zm1.932.033a.356.356 0 0 1 .011-.334l1.84-2.215a.828.828 0 0 1 .66-.351l2.877-.088a.354.354 0 0 1 .293.2l.356.725a.242.242 0 0 1-.139.339l-5.238 2.574a.224.224 0 0 1-.3-.121Z"/><path fill="url(#vscodeIconsFileTypeLicense3)" d="m14.47 18.381l.276-.318l.335-.164l-.139.245l-.472.237z"/><path fill="url(#vscodeIconsFileTypeLicense4)" d="m11.259 15.828l2.776.6l4.38-2.152l.865-2.339a.576.576 0 0 0 .024-.567L18.1 8.917a.441.441 0 0 0-.367-.246l-4.438.13a1.169 1.169 0 0 0-.938.5L9.52 12.725a.447.447 0 0 0-.011.414l1.206 2.453a1 1 0 0 0 .544.236Zm.354-1.836l-.358-.729a.463.463 0 0 1 .013-.434v-.008l1.853-2.221a.922.922 0 0 1 .739-.389l2.881-.084a.468.468 0 0 1 .392.257l.358.729c.005.009.19.3-.187.481l-5.244 2.577c-.272.129-.44-.164-.447-.179Z"/><path fill="url(#vscodeIconsFileTypeLicense5)" d="M11.246 15.738c.006 0 2.438.51 2.751.591l4.354-2.139l.878-2.336a.472.472 0 0 0 .015-.458l-1.208-2.458a.337.337 0 0 0-.282-.187l-4.454.141a1.083 1.083 0 0 0-.864.46l-2.863 3.436a.341.341 0 0 0-.008.313l1.206 2.454a1.118 1.118 0 0 0 .475.183Zm.245-1.7l-.355-.723a.568.568 0 0 1 .018-.535v-.008l.01-.015l1.865-2.241a1.033 1.033 0 0 1 .824-.43l2.9-.091a.575.575 0 0 1 .492.316l.359.73a.456.456 0 0 1 .027.338a.484.484 0 0 1-.265.286l-5.287 2.6a.415.415 0 0 1-.331.025a.486.486 0 0 1-.258-.248Z"/><path fill="url(#vscodeIconsFileTypeLicense6)" d="M11.268 15.663c.009 0 2.53.528 2.722.577l4.3-2.113l.878-2.314a.419.419 0 0 0 .01-.4l-1.2-2.436a.282.282 0 0 0-.237-.156l-4.433.149a1.033 1.033 0 0 0-.82.437l-2.353 2.823l-.5.595a.285.285 0 0 0 0 .254l1.193 2.421a1.181 1.181 0 0 0 .44.163Zm.14-1.529l-.351-.715a.575.575 0 0 1-.011-.56l1.959-2.36a1.082 1.082 0 0 1 .86-.447l2.887-.1a.628.628 0 0 1 .538.341l.356.724a.539.539 0 0 1-.309.773l-5.267 2.588a.482.482 0 0 1-.662-.243Z"/><path fill="url(#vscodeIconsFileTypeLicense7)" d="m18.463 14.345l.7 1.433l-.653.321l.319.649a1.428 1.428 0 0 0 1 2.043l.3.619a.958.958 0 0 0 .706 1.436l.107.218l-.39.428l.5 1.011l.577-.047l.239.485l-.366.478l.336.683h.6l.523 1.065l-.419.371l.382.777l.549-.1l.181.368A96.344 96.344 0 0 1 22.8 28v.638l-1.342.659l-.729-.414l-5.488-11.176l-.467.23l-.7-1.433Z"/><path fill="url(#vscodeIconsFileTypeLicense8)" d="M14.289 15.413h4.622v1.4h-4.622z" transform="rotate(-26.171 16.6 16.113)"/><path fill="url(#vscodeIconsFileTypeLicense9)" d="m18.128 14.582l-.8.392l.617 1.256l.8-.392Zm-1.319.648l.617 1.256l.308-.152l-.617-1.256Z"/><path fill="url(#vscodeIconsFileTypeLicensea)" d="m18.4 16.123l.308.628a1.523 1.523 0 0 0 1.037 2.11l.263.535a1.052 1.052 0 0 0 .744 1.513l.054.111l-.381.423l.557 1.134l.567-.043l.177.36l-.357.472l.392.8l.591.006l.456.929l-.409.366l.45.917l.539-.1l.12.243L22.634 28l-1.027.5l-5.525-11.235Z"/><path fill="url(#vscodeIconsFileTypeLicenseb)" d="m17.141 16.745l5.528 11.248l.046.511l-1.247.613l-.613-.349l-5.483-11.154Z"/><path fill="url(#vscodeIconsFileTypeLicensec)" d="m22.287 28.694l.427-.21l-4.794-9.754l-1.028-1.554l.602 1.764l4.793 9.754z"/><path fill="url(#vscodeIconsFileTypeLicensed)" d="M16.892 17.176L22.5 28.589l-.213.105l-4.793-9.754l-.602-1.764z"/><path fill="url(#vscodeIconsFileTypeLicensee)" d="m21.481 29.09l.427-.209l-4.794-9.755l-1.028-1.554l.602 1.764l4.793 9.754z"/><path fill="url(#vscodeIconsFileTypeLicensef)" d="m16.086 17.572l5.608 11.413l-.213.105l-4.793-9.754l-.602-1.764z"/><path fill="url(#vscodeIconsFileTypeLicenseg)" d="m18.27 16.189l-.411.2l5.285 10.755l.279-.47l-.181-.369l-.386.072l-.45-.917l.294-.26l-.508-1.034h-.424l-.392-.8l.256-.338l-.237-.482l-.407.031l-.557-1.134l.273-.3l-.143-.291a1.038 1.038 0 0 1-.619-1.259l-.391-.8a1.505 1.505 0 0 1-.906-1.844Zm-.68.334l5.371 10.929l.108-.182l-5.319-10.825Z"/><path fill="url(#vscodeIconsFileTypeLicenseh)" d="m15.018 18.247l5.356 10.997l.196-.273l-5.391-11.032l-.161.308z"/><path fill="url(#vscodeIconsFileTypeLicensei)" d="m20.436 29.315l.211-.291l.705.361l-.203.294l-.713-.364z"/><path fill="url(#vscodeIconsFileTypeLicensej)" d="m21.446 29.41l-.179.26l1.382-.659l.131-.241l-1.334.64z"/><path fill="url(#vscodeIconsFileTypeLicensek)" d="m14.029 16.673l-.225.388l.601 1.293l.297-.354l-.673-1.327z"/><path fill="url(#vscodeIconsFileTypeLicensel)" d="m13.946 16.506l-.239.432l-2.944-.761l.124-.345l3.059.674z"/><path fill="url(#vscodeIconsFileTypeLicensem)" d="M9.359 13s-.145.444-.087.563l1.212 2.465l.2-.384Z"/><path fill="url(#vscodeIconsFileTypeLicensen)" d="m16.683 10.624l.1-.327l-2.963.095a.914.914 0 0 0-.51.251l-.007.165a1.871 1.871 0 0 1 .394-.1Z"/><path fill="url(#vscodeIconsFileTypeLicenseo)" d="M16.83 10.309a.329.329 0 0 1 .17.137l.382.762l-.164.279l-.341-.693c-.023-.047-.108-.145-.147-.149Z"/><path fill="url(#vscodeIconsFileTypeLicensep)" d="m11.237 13.786l.171.348a.482.482 0 0 0 .661.248l5.267-2.588a.539.539 0 0 0 .309-.773l-.153-.31l1.08-.531l.606 1.232a.419.419 0 0 1-.01.4l-.878 2.314l-4.3 2.113c-.191-.049-2.713-.575-2.722-.577a1.181 1.181 0 0 1-.439-.16l-.6-1.222Z"/><path fill="url(#vscodeIconsFileTypeLicenseq)" d="m13.377 8.968l.532 1.084l.539-.018l-.532-1.084Zm2.306-.077l-1.395.047l.533 1.084l1.4-.046Zm1.471 2.994l-1.142.561l1.106 2.25l1.142-.561Zm-1.447.711l-.441.217l1.106 2.251l.441-.217Z"/><path fill="url(#vscodeIconsFileTypeLicenser)" d="m10.65 14.159l5.287 1.803L15.623 18l-.173.134l-2.16-.737l-1.921 12.501l-.371.102l-1.627-.555l-.395-.913l1.838-11.961l-.508-.173l.344-2.239z"/><path fill="url(#vscodeIconsFileTypeLicenses)" d="m8.951 9.175l-.542 2.747a.567.567 0 0 0 .175.452l1.976 2.461l4.866 1.659l1.969-1.077a.535.535 0 0 0 .4-.463l.4-2.627a.659.659 0 0 0-.188-.544L14.453 8.7a1.313 1.313 0 0 0-1.1-.337l-3.874.345a.707.707 0 0 0-.528.467Zm1.5 1.407a.281.281 0 0 1 .192-.234l2.633-.256a.928.928 0 0 1 .724.315l2.3 2a.426.426 0 0 1 .121.352l-.1.651s-.027.237-.3.146L10.5 11.667a.269.269 0 0 1-.172-.305Z"/><path fill="url(#vscodeIconsFileTypeLicenset)" d="m9.322 9.01l-.4 2.627c-.024.157.188.481.324.653l1.817 2.33l-.263 1.714l.392.134l-1.843 11.959l.395.914l1.627.555l.363-.507l1.483-.436l.081-.528l-.479-.314l.1-.678l.523.028l.2-1.283l-.461-.428l.093-.608l.54-.087l.1-.653l-.469-.375l.145-.946l.532-.034l.054-.352a1.047 1.047 0 0 1-.29-.859a.688.688 0 0 1 .512-.585l.116-.756a1.6 1.6 0 0 1-.364-1.232a1.07 1.07 0 0 1 .688-.874l.1-.636l.666.227l.246-1.674l1.915-1.047a.535.535 0 0 0 .4-.463l.4-2.627a.657.657 0 0 0-.188-.544l-3.556-3.08a1.313 1.313 0 0 0-1.1-.336l-4.109.445a.434.434 0 0 0-.29.356Zm1.5 1.407a.281.281 0 0 1 .192-.234l2.663-.289a.852.852 0 0 1 .711.218l2.3 2a.427.427 0 0 1 .122.352l-.12.781s-.027.237-.3.146L10.871 11.5a.269.269 0 0 1-.171-.3Z"/><path fill="url(#vscodeIconsFileTypeLicenseu)" d="m10.428 16.37l.392-.033l.353.12l-.244.078l-.501-.165z"/><path fill="url(#vscodeIconsFileTypeLicensev)" d="m9.317 12.221l1.846 2.421l4.619 1.575l1.967-1.076a.454.454 0 0 0 .331-.393l.406-2.641a.53.53 0 0 0-.152-.441l-3.552-3.083a1.207 1.207 0 0 0-1.011-.31l-4.109.453a.354.354 0 0 0-.237.292l-.405 2.641a1.261 1.261 0 0 0 .297.562Zm1.289-1.077l.121-.785a.367.367 0 0 1 .25-.305h.008l2.675-.295a.953.953 0 0 1 .794.247l2.3 2a.563.563 0 0 1 .166.467l-.121.785c0 .01-.014.35-.411.215l-5.53-1.886a.423.423 0 0 1-.252-.443Z"/><path fill="url(#vscodeIconsFileTypeLicensew)" d="M9.356 12.146c0 .005 1.63 2.115 1.831 2.4l4.591 1.566l1.974-1.065a.372.372 0 0 0 .264-.321l.406-2.646a.405.405 0 0 0-.118-.338l-3.571-3.091a1.117 1.117 0 0 0-.931-.285l-4.133.444a.271.271 0 0 0-.179.221l-.406 2.642a1.421 1.421 0 0 0 .272.473Zm1.126-1.054l.12-.778a.451.451 0 0 1 .309-.375h.024l2.7-.29a1.07 1.07 0 0 1 .883.278l2.324 2.01a.694.694 0 0 1 .212.581l-.121.786a.38.38 0 0 1-.165.265a.417.417 0 0 1-.365.018l-5.576-1.9a.5.5 0 0 1-.273-.219a.55.55 0 0 1-.072-.377Z"/><path fill="url(#vscodeIconsFileTypeLicensex)" d="M9.415 12.108c.006.008 1.693 2.194 1.816 2.366l4.535 1.546l1.963-1.048a.33.33 0 0 0 .228-.282l.4-2.623a.339.339 0 0 0-.1-.283L14.7 8.719a1.066 1.066 0 0 0-.884-.271l-3.4.359l-.716.076a.226.226 0 0 0-.142.183s-.4 2.594-.4 2.611a1.506 1.506 0 0 0 .257.431Zm.952-1.007l.118-.77a.463.463 0 0 1 .3-.414l2.836-.308a1.12 1.12 0 0 1 .921.292l2.316 2a.758.758 0 0 1 .234.632s-.1.633-.12.779c-.034.219-.191.5-.668.339l-5.555-1.894a.584.584 0 0 1-.383-.657Z"/><path fill="url(#vscodeIconsFileTypeLicensey)" d="m15.781 16.3l-.237 1.543l-.689-.235l-.107.7a1.158 1.158 0 0 0-.7.917a1.723 1.723 0 0 0 .367 1.283l-.1.666a.765.765 0 0 0-.527.634a1.154 1.154 0 0 0 .29.912l-.036.235l-.542.031l-.167 1.088l.479.379l-.08.522l-.55.084l-.113.736l.471.432l-.176 1.146l-.532-.031l-.128.837l.488.317l-.061.4c-.09.027-1.455.411-1.455.411l-.352.462l-1.424-.483l-.343-.822l1.843-12.03l-.493-.168l.237-1.543Z"/><path fill="url(#vscodeIconsFileTypeLicensez)" d="m11.056 16.181l4.374 1.491l.208-1.352l-4.374-1.492l-.208 1.353z"/><path fill="url(#vscodeIconsFileTypeLicense10)" d="m15.388 16.234l-.842-.287l-.207 1.353l.841.287ZM14 15.76l-.208 1.353l.325.111l.208-1.353Z"/><path fill="url(#vscodeIconsFileTypeLicense11)" d="m14.756 17.55l-.1.676a1.251 1.251 0 0 0-.7.957A1.845 1.845 0 0 0 14.3 20.5l-.089.576a.844.844 0 0 0-.525.678a1.256 1.256 0 0 0 .275.95l-.018.119l-.531.034l-.188 1.221l.469.375l-.06.388l-.539.087l-.132.858l.46.427l-.154 1l-.522-.028l-.152.987l.478.314l-.04.262l-1.506.443l-1.083-.369l1.86-12.1Z"/><path fill="url(#vscodeIconsFileTypeLicense12)" d="m13.423 17.1l-1.86 12.1l-.246.4L10 29.16l-.289-.692l1.845-12.009Z"/><path fill="url(#vscodeIconsFileTypeLicense13)" d="m10.877 29.44l.45.154l1.614-10.501l.049-1.863l-.499 1.709l-1.614 10.501z"/><path fill="url(#vscodeIconsFileTypeLicense14)" d="m12.99 17.23l-1.888 12.287l-.225-.077l1.614-10.501l.499-1.709z"/><path fill="url(#vscodeIconsFileTypeLicense15)" d="m10.028 29.151l.449.153l1.614-10.501l.049-1.863l-.499 1.71l-1.613 10.501z"/><path fill="url(#vscodeIconsFileTypeLicense16)" d="m12.14 16.94l-1.887 12.287l-.225-.076l1.613-10.501l.499-1.71z"/><path fill="url(#vscodeIconsFileTypeLicense17)" d="m14.615 17.5l-.433-.148l-1.782 11.58l.478-.14l.061-.4l-.339-.222l.152-.987l.374.02l.171-1.113l-.33-.306l.132-.858l.387-.062l.08-.519l-.336-.268l.188-1.221l.381-.024l.048-.314a1.2 1.2 0 0 1-.154-.766a.85.85 0 0 1 .363-.59l.132-.856a1.79 1.79 0 0 1-.231-1.123a1.261 1.261 0 0 1 .536-.861Zm-.717-.244L12.09 29.024l.185-.054l1.791-11.655Z"/><path fill="url(#vscodeIconsFileTypeLicense18)" d="M10.932 16.665L9.075 28.47l.303-.058l1.85-11.855l-.296.108z"/><path fill="url(#vscodeIconsFileTypeLicense19)" d="m9.085 28.566l.325-.06l.354.766l-.321.068l-.358-.774z"/><path fill="url(#vscodeIconsFileTypeLicense1a)" d="m9.823 29.357l-.283.06l1.447.513l.235-.081l-1.399-.492z"/><path fill="url(#vscodeIconsFileTypeLicense1b)" d="m11.024 14.816l-.391.12l-.241 1.367l.429-.043l.203-1.444z"/><path fill="url(#vscodeIconsFileTypeLicense1c)" d="m11.05 14.636l-.425.141l-2.084-2.606l.483-.214l2.026 2.679z"/><path fill="url(#vscodeIconsFileTypeLicense1d)" d="M9.384 8.813s-.358.218-.378.346l-.546 2.773l.51-.253Z"/><path fill="url(#vscodeIconsFileTypeLicense1e)" d="m16.435 12.332l.256-.168l-2.375-2.052a.962.962 0 0 0-.538-.183l-.1.115a2.143 2.143 0 0 1 .362.211Z"/><path fill="url(#vscodeIconsFileTypeLicense1f)" d="M16.724 12.208a.393.393 0 0 1 .058.221c-.016.1-.112.774-.12.825l-.283.085l.115-.747a.4.4 0 0 0-.033-.213Z"/><path fill="url(#vscodeIconsFileTypeLicense1g)" d="m10.424 10.725l-.058.375a.584.584 0 0 0 .381.653l5.553 1.894c.478.163.634-.12.668-.339l.051-.334l1.139.388l-.2 1.327a.33.33 0 0 1-.228.282l-1.963 1.048l-4.535-1.546a358.09 358.09 0 0 0-1.816-2.366a1.506 1.506 0 0 1-.257-.43l.2-1.315Z"/><path fill="url(#vscodeIconsFileTypeLicense1h)" d="m14.756 8.764l-.179 1.166l.432.373l.179-1.167Zm1.851 1.595l-1.119-.965l-.179 1.167l1.119.965Zm-.5 3.223l-1.2-.411l-.372 2.423l1.2.411Zm-1.526-.52l-.461-.162l-.372 2.423l.465.159Z"/><path fill="url(#vscodeIconsFileTypeLicense1i)" d="M9.936 2.733c2.042-1.441 5.206-.715 7.065 1.8A6.169 6.169 0 0 1 18.27 9.1c-.219-.73-1.023-.427-1.664-.441a4.11 4.11 0 0 0-.763-3.207C14.6 3.778 12.41 3.1 11.07 4.094s-1.382 3.253-.143 4.929a3.68 3.68 0 0 0 3.69 1.742c.521.444 1 .871 1.507 1.329c-1.84 1.134-4.8.334-6.51-1.982c-1.86-2.512-1.93-5.789.322-7.379Z"/><path fill="url(#vscodeIconsFileTypeLicense1j)" d="M9.956 2.841c1.939-1.405 5.111-.606 6.892 1.8a6.587 6.587 0 0 1 1.38 4.159c-.293-.387-1.035-.264-1.466-.211a4.6 4.6 0 0 0-.823-3.272c-1.317-1.78-3.546-2.373-4.97-1.32s-1.442 3.27-.125 5.051a4.034 4.034 0 0 0 3.842 1.905c.4.35.79.715 1.185 1.073c-1.982 1.012-4.528.084-6.123-2.073c-1.782-2.408-1.897-5.587.208-7.112Z"/><path fill="url(#vscodeIconsFileTypeLicense1k)" d="M10.1 2.918c1.855-1.345 4.971-.5 6.675 1.8a6.635 6.635 0 0 1 1.361 3.89a1.872 1.872 0 0 0-1.148-.126a4.555 4.555 0 0 0-.946-3.23c-1.394-1.885-3.6-2.472-5.1-1.357s-1.511 3.279-.171 5.2a4.075 4.075 0 0 0 3.976 1.973c.323.285.639.58.957.871c-1.939.959-4.394-.1-5.893-2.131C8.1 7.511 8.1 4.363 10.1 2.918Z"/><path fill="url(#vscodeIconsFileTypeLicense1l)" d="M9.684 3.412C8.6 4.969 8.825 7.5 10.3 9.494c1.413 1.911 3.466 2.885 5.249 2.443c-1.694.674-4.074-.233-5.554-2.235c-1.54-2.081-1.66-4.783-.311-6.29Z"/><path fill="url(#vscodeIconsFileTypeLicense1m)" d="M9.9 3.511c-.171.291.366.627.547.144a4.29 4.29 0 0 1 2.442-1.222A3.558 3.558 0 0 0 9.9 3.511Zm.077.506a.244.244 0 1 0 .211.273a.243.243 0 0 0-.213-.273Z"/><path fill="url(#vscodeIconsFileTypeLicense1n)" d="M11.035 3.763c1.4-1.181 3.664-.647 5.163 1.132a4.723 4.723 0 0 1 1.2 3.542c-.136.014-.273.03-.411.048a4.555 4.555 0 0 0-.946-3.23c-1.394-1.885-3.6-2.472-5.1-1.357c-.071.053-.136.11-.2.167a2.672 2.672 0 0 1 .294-.302Z"/>`}})),LV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="gray" d="m16.5 30l-.011-.321c.4-.014.8-.045 1.19-.094l.039.319c-.406.048-.818.08-1.218.096Zm-1.222-.011c-.4-.021-.814-.061-1.216-.118l.045-.318c.393.055.793.094 1.188.115Zm3.642-.289l-.067-.314c.387-.083.776-.184 1.155-.3l.094.307c-.388.118-.786.222-1.182.307Zm-6.063-.053c-.4-.091-.791-.2-1.177-.326l.1-.306c.377.122.764.23 1.15.319Zm8.4-.665l-.121-.3c.364-.148.728-.314 1.08-.493h.006l.145.286c-.367.186-.741.356-1.114.507Zm-10.718-.088a13.693 13.693 0 0 1-1.1-.524l.15-.284c.35.186.713.358 1.078.512Zm12.893-1.021l-.17-.273c.337-.21.668-.437.984-.675l.193.257c-.328.243-.667.476-1.011.691Zm-15.053-.122c-.341-.22-.676-.459-1-.708l.2-.253c.312.243.64.476.972.691Zm17-1.346l-.215-.239c.294-.265.58-.546.851-.836l.235.219c-.278.297-.571.585-.872.851Zm-18.925-.153c-.3-.276-.585-.569-.856-.87l.239-.215c.265.294.547.58.836.85Zm20.587-1.632l-.253-.2c.244-.312.476-.639.692-.972l.27.175c-.221.343-.46.677-.709.997ZM4.82 24.439a14.237 14.237 0 0 1-.692-1.007l.272-.17c.21.337.438.668.676.984Zm23.547-1.867l-.284-.151c.186-.35.358-.713.513-1.078l.3.125a14.91 14.91 0 0 1-.528 1.104Zm-24.841-.2l-.006-.012a13.075 13.075 0 0 1-.5-1.1l.3-.121c.147.362.312.724.491 1.074l.006.012Zm25.794-2.047l-.306-.1c.122-.377.23-.764.319-1.15l.313.072c-.091.396-.2.792-.326 1.178Zm-26.712-.218c-.12-.388-.223-.786-.308-1.182l.314-.067c.083.387.184.776.3 1.155Zm27.262-2.161l-.318-.045c.056-.393.094-.793.115-1.188l.321.017a13.78 13.78 0 0 1-.118 1.216ZM2.1 17.72c-.05-.4-.082-.812-.1-1.218l.321-.011c.014.4.046.8.094 1.19Zm27.582-2.2c-.014-.4-.045-.8-.093-1.19l.319-.039c.049.4.082.813.1 1.218ZM2.331 15.3l-.321-.02c.021-.405.061-.814.117-1.216l.318.045c-.055.391-.093.791-.114 1.191Zm27.057-2.144a13.987 13.987 0 0 0-.3-1.155l.312-.101c.119.388.223.786.307 1.183Zm-26.725-.222l-.313-.072c.091-.4.2-.791.326-1.177l.306.1c-.123.376-.23.763-.319 1.149Zm26.026-2.062a12.639 12.639 0 0 0-.5-1.086l.286-.146c.185.363.355.736.507 1.111ZM3.4 10.665l-.3-.125c.158-.374.334-.745.524-1.1l.284.15c-.184.347-.356.71-.508 1.075Zm1.113-2.108l-.27-.174c.22-.341.458-.676.707-1l.254.2c-.243.317-.476.641-.691.974Zm1.464-1.881l-.235-.219c.276-.3.569-.585.87-.857l.215.239c-.294.261-.58.547-.85.837Zm1.77-1.6l-.193-.257c.323-.244.662-.477 1.007-.692l.17.272c-.337.215-.668.442-.984.68Zm15.705-.558l-.018-.012l.175-.27l.018.011Zm-1.047-.616a13.44 13.44 0 0 0-1.078-.512l.125-.3c.374.158.745.334 1.1.524ZM9.769 3.815l-.146-.286l.018-.009c.356-.181.724-.349 1.093-.5l.121.3c-.361.147-.72.311-1.068.488Zm10.44-.838a13.414 13.414 0 0 0-1.151-.317l.072-.313c.4.091.792.2 1.178.325Zm-8.229-.06l-.094-.307a14.25 14.25 0 0 1 1.182-.308l.067.314a13.89 13.89 0 0 0-1.155.301Zm5.9-.473a13.953 13.953 0 0 0-1.188-.113l.016-.321c.405.021.814.059 1.216.115Zm-3.572-.026l-.04-.319c.4-.05.812-.083 1.218-.1l.012.321c-.392.017-.793.049-1.186.098Z"/><circle cx="16" cy="15.998" r="10.708" fill="navy"/><circle cx="20.435" cy="11.562" r="3.136" fill="#fff"/><circle cx="26.708" cy="5.29" r="3.137" fill="navy"/><path fill="#fff" d="M13.1 21.352v-.79H9.629v-6.236h-.9v7.026H13.1m4.816 0V16.3h-.8v2.785c0 1.031-.54 1.706-1.378 1.706A.95.95 0 0 1 14.7 19.8v-3.5h-.8v3.817c0 .838.626 1.378 1.609 1.378a1.863 1.863 0 0 0 1.687-.925v.781h.723m5.872-.018v-.607a.664.664 0 0 1-.173.019c-.279 0-.434-.145-.434-.4v-2.809c0-.9-.655-1.378-1.9-1.378c-1.224 0-1.976.472-2.024 1.638h.81c.067-.617.434-.9 1.185-.9c.723 0 1.128.27 1.128.752v.212c0 .337-.2.482-.838.559a5.763 5.763 0 0 0-1.619.308a1.327 1.327 0 0 0-.887 1.311c0 .916.636 1.455 1.658 1.455a2.363 2.363 0 0 0 1.715-.742a.855.855 0 0 0 .829.665a1.967 1.967 0 0 0 .549-.087m-1.407-1.725a1.366 1.366 0 0 1-1.513 1.185c-.626 0-.993-.222-.993-.771c0-.53.357-.761 1.214-.887a4 4 0 0 0 1.291-.279v.752"/>`}})),RV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fff" d="M7.313 18.654a.548.548 0 0 1-.6.233a.917.917 0 0 0-.869.08c-.306.218-.637.053-.579-.345a1.229 1.229 0 0 1 .583-.971c.833-.479.254-.812.711-1.293s.357-.629.341-1.283a4.648 4.648 0 0 1-3.4-1.9a6.012 6.012 0 0 1-1.46-3.764a6.365 6.365 0 0 1 .649-3.8a5.315 5.315 0 0 1 2.565-2.522a7.022 7.022 0 0 1 3.489-.77a4.96 4.96 0 0 1 2.443.452a5.148 5.148 0 0 0 1.546.8a1.217 1.217 0 0 0 .782-.226c.047 1.189-1.023 1.292-1.98 1.317s-1.546-.371-2.427-.224a4.193 4.193 0 0 0-3.03 1.774A3.783 3.783 0 0 0 5.408 8.9a1.952 1.952 0 0 0 1.441 1.8c.5.008.61-.136 1.047-.421s2.665-3.043 3.426-3.663a3.522 3.522 0 0 1 2.322-.821a3.24 3.24 0 0 1 1.671.286A12.275 12.275 0 0 1 16.9 7.139a8.833 8.833 0 0 0 .684-.576a2.865 2.865 0 0 1 2.393-.718a3.644 3.644 0 0 1 1.819.8a14.312 14.312 0 0 1 2.013 2.425a3.59 3.59 0 0 0 1.621 1.489c.771.237 1.352-.762 1.437-1.316a5.814 5.814 0 0 0 .112-.935a4.413 4.413 0 0 0-.135-1.125a4 4 0 0 0-.455-1.016a3.606 3.606 0 0 0-1.3-1.25A4.129 4.129 0 0 0 23.7 4.5a13.676 13.676 0 0 0-1.4.2c-.584.04-1.628.171-2.086-.28a1.18 1.18 0 0 1-.378-.853a.892.892 0 0 0 .469.19c.366.031.708-.268 1-.441a7.34 7.34 0 0 1 .908-.526a5.856 5.856 0 0 1 2.7-.232a6.308 6.308 0 0 1 2.2.725a6 6 0 0 1 1.634 1.48A4.983 4.983 0 0 1 29.781 6.9a8.981 8.981 0 0 1 .017 3.847a7.577 7.577 0 0 1-1.714 2.819a4.388 4.388 0 0 1-2.317 1.112a4.911 4.911 0 0 0 .086.488c.064.206.188.436.441.363a.236.236 0 0 1 .289.063c.133.116.064.567-.311.769a1.449 1.449 0 0 1-.695.131a6.612 6.612 0 0 1-1.11-.051c-.33-.058-.528-.32-.894-.361a3.572 3.572 0 0 1-1.452-.764a3.048 3.048 0 0 0-.362-.185c.059.18.138.368.177.541s.023.334.043.472s.059.247.082.359c.09.081.119.2.272.243a1.706 1.706 0 0 0 .546-.043c.156-.021.26-.106.383-.083a.85.85 0 0 1 .34.193c.1.082.191.094.274.3a3.333 3.333 0 0 1 .171.9a1.93 1.93 0 0 1-.1.755a1.261 1.261 0 0 1-.381.541a5.937 5.937 0 0 1-.956.769a1.652 1.652 0 0 0 .2.3c.1.109.324.229.421.344a.473.473 0 0 1 .148.324a.686.686 0 0 1-.109.433a1.9 1.9 0 0 1-.937.573a2.477 2.477 0 0 1 .023 1.06c-.037.159-.119.519-.315.612a3.823 3.823 0 0 1-.814.086c-.239.038-.373.074-.56.111a3.3 3.3 0 0 0-.34.492a.4.4 0 0 0 .008.35c.049.15.214.368.261.544a1.091 1.091 0 0 1 .012.541a.943.943 0 0 1-.269.46c-.15.157-.446.28-.593.406s-.294.142-.254.352a1.551 1.551 0 0 0 .781.867a.925.925 0 0 0 .65-.048c-.015.246-.228.412-.367.576a2.2 2.2 0 0 0 1-.588a2.488 2.488 0 0 1-.752.955a2.872 2.872 0 0 1-.6.4a2.652 2.652 0 0 0 .99 0a1.97 1.97 0 0 1-.748.242a2.2 2.2 0 0 1-.85-.064a5.7 5.7 0 0 1-.951-.541a.78.78 0 0 0 .217.442a2.859 2.859 0 0 0 .639.334a9.407 9.407 0 0 1-.963-.116a2.233 2.233 0 0 1-.555-.189a3.647 3.647 0 0 1-.449-.309a1.291 1.291 0 0 0 .215.411a1.963 1.963 0 0 0 .48.232a2.1 2.1 0 0 1-.5-.011a1.408 1.408 0 0 1-.517-.245a3.7 3.7 0 0 1-.52-.463a2.155 2.155 0 0 1-.4-.538c-.058-.154.035-.262.052-.393a1.233 1.233 0 0 0-.318.21a.4.4 0 0 0-.118.37a2.46 2.46 0 0 0 .315.589c-.344-.281-.536-.389-.618-.729a1.143 1.143 0 0 1 .272-.846c.075-.119.187-.23.257-.345a4.668 4.668 0 0 1-.466-.456c-.133-.173-.189-.408-.325-.573a3.412 3.412 0 0 0-.478-.407a6.246 6.246 0 0 1 .42.9a.6.6 0 0 1-.139.5c-.083.126-.216.154-.343.231s-.323.017-.4.131a.392.392 0 0 0-.023.4l.3.466a1.421 1.421 0 0 1-.381-.328c-.084-.114-.214-.218-.232-.371a.541.541 0 0 1 .073-.422c.1-.137.371-.182.493-.287s.19-.173.183-.309s-.14-.232-.253-.318a8.278 8.278 0 0 1-1.088-.815a1.08 1.08 0 0 1-.28-.443a.459.459 0 0 1 .085-.368c.083-.151.367-.352.4-.515s-.109-.2-.238-.256s-.376.029-.5-.071s.035-.311-.1-.427s-.445-.051-.6-.176a.837.837 0 0 1-.281-.459a.974.974 0 0 1-.024-.509c.038-.131.15-.154.217-.222s.127-.124.036-.225s-.385.006-.555-.124s-.066-.44-.186-.572s-.336-.079-.449-.121s-.159.106-.228-.128s-.072-.93-.166-1.189s-.278-.018-.363-.276a7.085 7.085 0 0 1-.043-1.06l-.175-1.061c-.609.409-2.53.935-2.7 1.233"/><path fill="#030303" d="M16.623 8.258a3.733 3.733 0 0 0 .077.942a.909.909 0 0 0 .382.66c.462.343.758.286 1.114.485a1.017 1.017 0 0 1 .446.421a.363.363 0 0 1-.17.422a.361.361 0 0 0 .371-.48c-.052-.128-.3-.185-.373-.314a.488.488 0 0 1-.04-.393c.064-.236.531-.451.7-.637a.772.772 0 0 0 .208-.9a2.831 2.831 0 0 0-1.45-1.141a3.209 3.209 0 0 0-.5-.15a1.65 1.65 0 0 1 .875.807c.144.374.019.515.024.84c0 .151.2.226.289.322s.07.145.009.259a.3.3 0 0 0-.13-.236c-.13-.093-.271-.073-.341-.263c-.106-.289.1-.563-.132-.888a1.029 1.029 0 0 0-.727-.522a1.267 1.267 0 0 0-.423.066l-.219-.258a4.594 4.594 0 0 0-1.34-.995a3.033 3.033 0 0 0-1.607-.3a3.068 3.068 0 0 0-2.2.771c-.808.7-2.892 3.367-3.4 3.7a1.7 1.7 0 0 1-1.248.453a2.124 2.124 0 0 1-1.657-2.002a4.041 4.041 0 0 1 .722-2.857a4.173 4.173 0 0 1 3.224-1.9a12.022 12.022 0 0 1 2.441.23c.771 0 1.534-.132 1.759-.745a1.044 1.044 0 0 1-.672.118A6.739 6.739 0 0 1 11 2.952a5.237 5.237 0 0 0-2.29-.377a6.319 6.319 0 0 0-3.215.669a5.769 5.769 0 0 0-2.582 2.475a5.866 5.866 0 0 0-.654 3.649a6.068 6.068 0 0 0 1.423 3.613a4.457 4.457 0 0 0 3.295 1.785l.329-1.45l-.587.842l.015-.937l-.531.659l-.233-.894l-.43.716l-.214-1l-.623.5l.2-.823l-.825.092l.379-.572l-.752.009l.438-.764l-.667-.106L4 10.35l-.817-.242l.676-.648l-.659-.544l.522-.406l-.492-.65l.521-.607l-.194-.8L4 6.067l.132-.916l.5-.249l.427-.715l.785-.087l.39-.643l.793.04l.749-.407l.778.181l.883-.266l.654.153l.853.125l.824.659L10.5 3.5l-.636.305l-.526-.321l-.362.246l-.64.064l-.574-.037l-.419.511l-.843.013l-.3.688l-.759.266l-.071.791l-.544.426L5 7.2l-.47.773l.361.676l-.355.619l.472.308l-.107.995l.656.166l.148.738l.715-.075l.444.506l.549-.536a6.151 6.151 0 0 0 2.193-1.625a10.282 10.282 0 0 1 2.58-2.506a3.451 3.451 0 0 1 2.493-.477c.895.154 1.194.691 1.853 1.257a.626.626 0 0 1 .2-.253a4.416 4.416 0 0 0-.108.492Zm4.665 5.934a.71.71 0 0 1-.2.143a2.376 2.376 0 0 1-.344.083c.173.27.355.543.521.826s.31.594.469.892a4.909 4.909 0 0 0-.022-.511a5.014 5.014 0 0 0-.168-.537c-.071-.239-.159-.564-.26-.9Zm-.06-1.551a.508.508 0 0 1 .168.092a.646.646 0 0 1 .255.269a1.025 1.025 0 0 1 .048.466c-.056-.016-.132-.005-.191-.055s-.092-.162-.167-.21a.439.439 0 0 0-.219-.048a.694.694 0 0 1 .043.35a.431.431 0 0 1-.409.387a1.336 1.336 0 0 1-.342-.036c.04.089.108.167.147.256a1.842 1.842 0 0 0 .439-.073a3.264 3.264 0 0 1 .345-.2a2.175 2.175 0 0 1 .395-.067c-.113.1-.188.2-.3.295l.25.728c.177.111.344.169.566.306a7.337 7.337 0 0 0 .781.515a2.887 2.887 0 0 0 .767.263c.3.057.545.3.844.343a6.43 6.43 0 0 0 1.087.025c.261-.025.6-.16.631-.447a.6.6 0 0 1-.723-.407c-.075-.183-.038-.52-.153-.737s-.274-.286-.466-.552a8.352 8.352 0 0 1-.679-1.045c-.175-.357-.217-.762-.365-1.082a5.285 5.285 0 0 0-.546-.826a2.918 2.918 0 0 0-1.308-1.18a6.4 6.4 0 0 0-.963-.249c-.131.059-.31.124-.342.276a.622.622 0 0 0 .14.493a2.1 2.1 0 0 1 .568.7a2.753 2.753 0 0 1 .03 1.029a1.146 1.146 0 0 1-.328.42Zm-1.451.173a2.483 2.483 0 0 1 .854-.242c.126-.008.321.012.448.017a1.7 1.7 0 0 0 .3-.466a2.519 2.519 0 0 0-.043-.826c-.172-.423-.34-.441-.577-.683a1.347 1.347 0 0 1-.231-.743c-.019-.11-.073-.249-.1-.363a4.64 4.64 0 0 0-1-.052a1.088 1.088 0 0 0 .39-.567a1.116 1.116 0 0 0-.132-.78a3.032 3.032 0 0 0-.576-.6c-.208-.182-.506-.332-.7-.482a5.781 5.781 0 0 1 .768-.275a2.5 2.5 0 0 1 1.842.448a4.6 4.6 0 0 1 1.053.833c.384.4.859 1.137 1.23 1.574a7.877 7.877 0 0 0 .997 1.043a4.973 4.973 0 0 0 .925.5l.481.51l.389-.481l.625.071l.129-.7l.574-.157l-.093-.947l.413-.293l-.31-.589l.315-.644l-.411-.736l.159-.708l-.476-.405l-.062-.753l-.664-.253l-.266-.655l-.75-.01l-.366-.486l-.5.035l-.56-.061l-.316-.234l-.46.3l-.557-.29l-1.106.42l.721-.627l.747-.119l.569-.138l.773.254l.68-.172l.656.388l.694-.038l.341.612l.691.079l.374.68l.435.237l.115.871l.387.367l-.17.762l.456.577l-.428.619l.457.387l-.585.518l.592.616l-.715.23l.466.661l-.584.1l.383.727l-.658-.009l.331.545l-.722-.087l.173.783l-.546-.48l-.187.949l-.377-.682l-.2.85l-.465-.627l.012.891l-.514-.8a3.638 3.638 0 0 0 .385 1.382a3.518 3.518 0 0 0 2.24-1.041a7.168 7.168 0 0 0 1.627-2.739a9.306 9.306 0 0 0 .011-3.618a5.45 5.45 0 0 0-1.045-2.109A7.963 7.963 0 0 0 26.9 3.405a6.2 6.2 0 0 0-3.2-.694a3.79 3.79 0 0 0-1.338.25c-.617.224-1.11.714-1.737.955a.6.6 0 0 1-.53 0a.989.989 0 0 0 .723.572a5.464 5.464 0 0 0 1.431-.013a9.013 9.013 0 0 1 1.451-.19a3.1 3.1 0 0 1 1.484.428a3.658 3.658 0 0 1 1.4 1.318a4 4 0 0 1 .448 1.079a5.063 5.063 0 0 1 .151 1.174a3.6 3.6 0 0 1-.112 1.035c-.212.781-.68 1.576-1.641 1.454c-.588-.075-1.475-1.18-1.772-1.585a15.7 15.7 0 0 0-1.969-2.4a3.034 3.034 0 0 0-1.705-.757a2.579 2.579 0 0 0-2.384.829a4.609 4.609 0 0 1 .532.17a3.981 3.981 0 0 1 1.094.718a1.19 1.19 0 0 1 .5.968c.008.3-.239.541-.465.758c-.139.133-.322.254-.434.357c-.149.137-.333.286-.147.5a1.883 1.883 0 0 0 .3.22c.163.121.089.572-.127.691a.712.712 0 0 1-.832-.069c.287-.043.469-.081.461-.315c0-.136-.177-.249-.347-.326a4.931 4.931 0 0 1-1.125-.452c-.411-.3-.42-.458-.531-.922a2.623 2.623 0 0 0-.646.113c-.265.087-.558.3-.8.348a1.718 1.718 0 0 1-1.058.006a4.244 4.244 0 0 0-2.1.349a5.917 5.917 0 0 0-.975.121a6.413 6.413 0 0 0-1.7.995a9.083 9.083 0 0 0-1.98 4.059c-.051.57.112.955-.248 1.233s-.349.992-.471 1.193s-.263.111-.525.392s-.4.234-.389.766a1.839 1.839 0 0 1 .845-.332c.256-.009.259.328.916-.322c.352-.348 1.027-.358 1.5-.512A4.732 4.732 0 0 0 11 16.152a5.613 5.613 0 0 0 1.415-3.381a3.984 3.984 0 0 1-.038 1.247a3.473 3.473 0 0 0 .151 2.442l.309.59a5.184 5.184 0 0 1-.652-.953l-.25-.674a5.057 5.057 0 0 1-1.463 1.662a2.916 2.916 0 0 0 .089 1.169c.128.373-.076.8.021 1.049s.321.106.394.355s-.038.741.075.983s.392.1.527.174a.774.774 0 0 1 .251.289c.073.1-.028.346.119.425s.376.012.529.088a.357.357 0 0 1 .139.422c-.036.163-.2.238-.272.4a.427.427 0 0 0 .023.434a.891.891 0 0 0 .466.314c.19.077.457.034.653.14a1.537 1.537 0 0 1 .476.473a.636.636 0 0 1 .127.425a1.19 1.19 0 0 1-.157.505c-.087.157-.278.347.021.647s.287.17.458.364c-.019-.336-.157-.609-.056-.862s.406-.3.566-.411a2.625 2.625 0 0 0 .379-.4a4.487 4.487 0 0 1 0 .491c-.041.266-.119.5.277.544a1.293 1.293 0 0 0 .535-.166c-.1.176-.269.318-.3.528a.918.918 0 0 0 .151.651a2.127 2.127 0 0 0 .582.487a2.227 2.227 0 0 0 .425.2c.007.207-.034.427-.01.621a1.134 1.134 0 0 0 .2.529a1.73 1.73 0 0 0 .465.373c-.094-.218-.283-.424-.281-.653a.734.734 0 0 1 .294-.594c.223-.2.746-.38.992-.577a1.214 1.214 0 0 0 .414-.51a2.23 2.23 0 0 0 .08-.673a2.032 2.032 0 0 1 .119.569a2.006 2.006 0 0 1-.221.794a1.217 1.217 0 0 0 .6-.612c.065.039.032.145.056.349c.109-.108.232-.191.341-.293a.949.949 0 0 0 .284-.334a.765.765 0 0 0-.008-.459a3.091 3.091 0 0 0-.324-.538c-.1-.181.017-.358.01-.576a1.727 1.727 0 0 0-.6-.1c-.229.033-.491.29-.725.293s-.365-.216-.557-.277a3.409 3.409 0 0 0-.579-.08a5.348 5.348 0 0 1 1.84-.451a11.629 11.629 0 0 1 1.715-.155a4.393 4.393 0 0 0 .769.03c.179-.051.141-.174.194-.307a1.73 1.73 0 0 0-.006-1.079A8.378 8.378 0 0 0 20.46 22c-.511.039-1.117.282-1.644.3a3.165 3.165 0 0 1-1.53-.328a3.63 3.63 0 0 1-.986-1.125c-.215-.329-.486-.975-.651-1.27a1.614 1.614 0 0 0-.339-.5a1.512 1.512 0 0 0-.488-.2c.188.019.392-.04.563.058c.256.147.543.756.7 1.021c.169-.566.129-.788.618-1.107a2.153 2.153 0 0 0-.5 1.295c.327.537.782 1.393 1.378 1.63a3.907 3.907 0 0 0 .817.168a5.91 5.91 0 0 0 2.132-.315a5.587 5.587 0 0 1 1.678-.04c.215.012.72-.117.825-.333a.382.382 0 0 0-.033-.386c-.081-.126-.3-.186-.414-.3a2.667 2.667 0 0 1-.274-.368a7.515 7.515 0 0 1-1.238.138c.257-.106.5-.167.771-.271a4.6 4.6 0 0 0 .787-.419a2.522 2.522 0 0 0 .51-.391a3.13 3.13 0 0 0 .471-.539a1.406 1.406 0 0 0 .139-.681a2.03 2.03 0 0 0-.1-.805a.634.634 0 0 0-.433-.311c-.15-.048-.252.073-.408.09s-.3.115-.527.008a1.967 1.967 0 0 1-.72-.642c-.228-.32-.39-.844-.623-1.247a21.2 21.2 0 0 0-1.376-1.986a4.043 4.043 0 0 1-.118-.593a2.861 2.861 0 0 1 .076-1.13a.987.987 0 0 1 .512-.69a.563.563 0 0 1 .371-.026a.25.25 0 0 1 .167.294c-.045.15-.15.155-.221.231a.808.808 0 0 0-.213.384a1.825 1.825 0 0 1 .412.016a.481.481 0 0 1 .339.326a.611.611 0 0 0-.456-.22a2.057 2.057 0 0 0-.316.048a2.271 2.271 0 0 1-.118.383c-.056.1-.163.075-.2.191a1.12 1.12 0 0 0-.022.455Zm.546.2c-.208.013-.258-.014-.424.1l.271.422a.65.65 0 0 1 .153-.525Zm-7.072-1.86a.812.812 0 0 1 .036-.194c-.3-.081-.423.115-.6.479c-.066.136 0 .217-.072.306s-.185.077-.3.163s-.23.251-.338.34a3.758 3.758 0 0 1-.777.418a2.536 2.536 0 0 0 .625-.513c.058-.1.05-.287.14-.377s.123-.152.24-.174s.07-.159.108-.266a1.151 1.151 0 0 1 .193-.293a.848.848 0 0 1 .339-.329c.158-.059.405 0 .525-.029s.051-.121.138-.173s.257-.029.373-.085a1.139 1.139 0 0 0 .429-.442A2.256 2.256 0 0 1 14.187 11a1.478 1.478 0 0 1-.749.89a2.38 2.38 0 0 1-.426.16c.073-.1.177-.143.219-.3a3.762 3.762 0 0 0 .02-.6Zm1.931 1.493c.157-.014.351.028.5.02a2.652 2.652 0 0 0 .377-.07c-.023-.221 0-.627-.205-.774a1.783 1.783 0 0 0-.817.008a7.63 7.63 0 0 0-1.017.385a3.168 3.168 0 0 1 .923-.514a2.428 2.428 0 0 1 .948-.09c.1.028.123.07.185.156a1.811 1.811 0 0 1 .268.9a2.524 2.524 0 0 1 .157.229a1.1 1.1 0 0 1 .081.338c-.056-.081-.022-.183-.177-.243a1.507 1.507 0 0 0-.6.018a.508.508 0 0 1-.231.934a.541.541 0 0 1-.641-.333a.988.988 0 0 1-.021-.4a.794.794 0 0 0-.688.259a1.3 1.3 0 0 0 .523.508a1.681 1.681 0 0 0 .5.186a2.516 2.516 0 0 0 .676.032a.734.734 0 0 0 .444-.216a1.04 1.04 0 0 0 .212-.47a1.369 1.369 0 0 1-.083.431a.786.786 0 0 1-.778.412a2.853 2.853 0 0 1-1.019-.2a1.542 1.542 0 0 1-.73-.624a1.8 1.8 0 0 1-.02-.557c.332-.22.413-.166.806-.231c.164-.027.277-.088.433-.1Zm.9-2.187a1.48 1.48 0 0 0 .524.212c.147 0 .185-.1.272-.154a6.578 6.578 0 0 0 .523 1.333c.1.169.159.09.232.26s.107.514.176.73a5.907 5.907 0 0 0 .242.564a7.727 7.727 0 0 1-.583-.9c-.114-.241-.041-.262-.133-.492s-.279-.588-.418-.882a.829.829 0 0 1-.3.008c-.076-.023-.061-.1-.129-.156s-.184-.032-.28-.115a.592.592 0 0 1-.127-.405Zm-1.964 7.762c.138-.112.511-.023.789 0l-.6.154c-.019.068-.01.147-.056.2s-.132.079-.2.119c.007-.179-.072-.363.066-.475Zm2.574-3.737a2.621 2.621 0 0 0 .205-.6c-.027.252.024.529-.1.712s-.339.151-.518.2c.139-.106.3-.153.411-.312Zm-.252 2.8a1 1 0 0 1 .5-.9a2.14 2.14 0 0 1 .706-.253a2.751 2.751 0 0 1 1.186.155a7.055 7.055 0 0 1 .7.459c.239.141.409.236.637.395c.35.243.554.512.8.673a1.763 1.763 0 0 0 .435.113a.73.73 0 0 1-.407.033a1.823 1.823 0 0 1-.513-.306a3.515 3.515 0 0 0-.579-.42c-.145-.084-.383-.183-.542-.287s-.435-.331-.587-.407a1.892 1.892 0 0 0-.759-.146a1.606 1.606 0 0 0-.959.267a.645.645 0 0 0-.264.66a2.992 2.992 0 0 1 .23-.3a.721.721 0 0 1 .607-.131a.531.531 0 0 1 .459.415a1.1 1.1 0 0 0-.238-.159a.573.573 0 0 0-.51.05c-.21.112-.153.278-.183.463a1.765 1.765 0 0 1-.069.231a.453.453 0 0 1-.211-.113a1.493 1.493 0 0 0 .008.259a3.194 3.194 0 0 0 .1.319a1.872 1.872 0 0 1-.39-.47a1.237 1.237 0 0 1-.148-.6Zm1.889.318a.98.98 0 0 1 .439.114a1.712 1.712 0 0 1 .314.223a1.858 1.858 0 0 1 .5.877a5.274 5.274 0 0 1 .077.745a4.767 4.767 0 0 0-.225-.687a1.682 1.682 0 0 0-.783-.8a.42.42 0 0 0-.252-.032c.028.047.075.086.077.155a.27.27 0 0 1-.13.259a.493.493 0 0 1-.541-.1a.48.48 0 0 1-.12-.535c.091-.224.439-.224.644-.216Zm-10.406.644a.726.726 0 0 0-.6.4a.548.548 0 0 1-.6.233a.917.917 0 0 0-.869.08c-.306.218-.637.053-.579-.344a1.226 1.226 0 0 1 .583-.971c.832-.479.254-.812.71-1.293s.356-.629.342-1.283a4.65 4.65 0 0 1-3.4-1.9A6.013 6.013 0 0 1 2.036 9.4a6.362 6.362 0 0 1 .649-3.8a5.314 5.314 0 0 1 2.569-2.522a7.026 7.026 0 0 1 3.489-.769a4.958 4.958 0 0 1 2.443.452a5.153 5.153 0 0 0 1.545.8a1.218 1.218 0 0 0 .782-.226c.047 1.189-1.023 1.292-1.981 1.317s-1.546-.371-2.427-.223A4.192 4.192 0 0 0 6.078 6.2a3.78 3.78 0 0 0-.669 2.683a1.951 1.951 0 0 0 1.44 1.8c.5.008.61-.136 1.047-.421s2.665-3.041 3.426-3.662a3.518 3.518 0 0 1 2.321-.821a3.236 3.236 0 0 1 1.671.285A12.282 12.282 0 0 1 16.9 7.128a8.515 8.515 0 0 0 .684-.576a2.865 2.865 0 0 1 2.393-.718a3.644 3.644 0 0 1 1.819.8a14.284 14.284 0 0 1 2.014 2.425a3.594 3.594 0 0 0 1.621 1.489c.771.237 1.351-.762 1.437-1.316a5.786 5.786 0 0 0 .112-.932a4.39 4.39 0 0 0-.134-1.125a4.012 4.012 0 0 0-.455-1.016a3.6 3.6 0 0 0-1.3-1.25a4.131 4.131 0 0 0-1.391-.424a13.632 13.632 0 0 0-1.4.2c-.584.04-1.627.171-2.085-.28a1.18 1.18 0 0 1-.378-.854a.891.891 0 0 0 .469.189c.366.031.708-.268 1-.441a7.2 7.2 0 0 1 .907-.526a5.861 5.861 0 0 1 2.7-.233a6.315 6.315 0 0 1 2.2.725a6.005 6.005 0 0 1 1.634 1.48a4.992 4.992 0 0 1 1.037 2.15a8.988 8.988 0 0 1 .017 3.847a7.581 7.581 0 0 1-1.713 2.819a4.391 4.391 0 0 1-2.317 1.112c.034.177.04.342.085.487c.065.206.188.436.442.364a.236.236 0 0 1 .289.062c.133.117.063.567-.312.769a1.444 1.444 0 0 1-.695.131a6.517 6.517 0 0 1-1.11-.051c-.33-.058-.528-.319-.894-.361a3.576 3.576 0 0 1-1.452-.764a3.069 3.069 0 0 0-.362-.185c.059.18.137.368.177.541s.022.334.043.473s.059.246.081.359c.091.081.12.2.272.243a1.688 1.688 0 0 0 .546-.043c.156-.021.261-.105.383-.083a.853.853 0 0 1 .341.193c.1.082.19.094.274.3a3.364 3.364 0 0 1 .17.9a1.922 1.922 0 0 1-.1.755a1.254 1.254 0 0 1-.381.541a5.924 5.924 0 0 1-.957.769a1.691 1.691 0 0 0 .2.3c.1.108.324.229.421.343a.474.474 0 0 1 .148.324a.689.689 0 0 1-.109.434a1.9 1.9 0 0 1-.937.573a2.484 2.484 0 0 1 .023 1.06c-.037.159-.119.519-.315.612a3.808 3.808 0 0 1-.814.086c-.239.038-.373.074-.56.111a3.312 3.312 0 0 0-.34.491a.4.4 0 0 0 .008.35c.049.15.215.369.261.544a1.091 1.091 0 0 1 .012.541a.952.952 0 0 1-.269.461c-.15.157-.446.279-.593.406s-.294.142-.254.352a1.548 1.548 0 0 0 .781.867a.93.93 0 0 0 .65-.047c-.015.246-.228.412-.367.575a2.2 2.2 0 0 0 1-.587a2.486 2.486 0 0 1-.752.954a2.86 2.86 0 0 1-.6.4a2.634 2.634 0 0 0 .991 0a1.964 1.964 0 0 1-.748.242a2.189 2.189 0 0 1-.85-.063a5.72 5.72 0 0 1-.951-.541a.782.782 0 0 0 .216.442a2.849 2.849 0 0 0 .639.334a9.6 9.6 0 0 1-.963-.116a2.274 2.274 0 0 1-.555-.189a3.8 3.8 0 0 1-.449-.309a1.3 1.3 0 0 0 .215.411a1.95 1.95 0 0 0 .481.233a2.1 2.1 0 0 1-.5-.011a1.409 1.409 0 0 1-.517-.245a3.708 3.708 0 0 1-.521-.464a2.146 2.146 0 0 1-.4-.538c-.058-.154.035-.262.052-.393a1.218 1.218 0 0 0-.319.209a.4.4 0 0 0-.118.371a2.45 2.45 0 0 0 .315.589c-.344-.281-.536-.39-.618-.729a1.142 1.142 0 0 1 .272-.846c.075-.119.187-.23.256-.345a4.636 4.636 0 0 1-.466-.456c-.133-.174-.189-.408-.325-.574a3.436 3.436 0 0 0-.478-.406a6.173 6.173 0 0 1 .42.9a.6.6 0 0 1-.139.5c-.083.126-.216.154-.342.231s-.324.016-.4.131a.393.393 0 0 0-.023.4l.3.466a1.418 1.418 0 0 1-.381-.328c-.085-.113-.214-.218-.232-.371a.541.541 0 0 1 .073-.423c.1-.136.371-.182.493-.287s.19-.173.183-.309s-.139-.233-.253-.318a8.319 8.319 0 0 1-1.088-.815a1.091 1.091 0 0 1-.28-.443a.461.461 0 0 1 .085-.368c.083-.151.367-.352.4-.515s-.109-.2-.238-.257s-.375.029-.5-.071s.035-.311-.1-.427s-.445-.051-.6-.176a.84.84 0 0 1-.281-.46a.968.968 0 0 1-.024-.509c.037-.131.149-.153.217-.221s.127-.124.036-.226s-.386.006-.556-.124s-.066-.44-.186-.571s-.336-.08-.449-.122s-.158.106-.228-.127s-.072-.929-.165-1.189s-.278-.017-.364-.276a7.171 7.171 0 0 1-.043-1.061l-.175-1.061a3.741 3.741 0 0 1-1.666.654a10.832 10.832 0 0 0 .338 4.321c.543 1.777 1.643 2.824 3.128 4.328a9.109 9.109 0 0 1-3.478-4.188a9.791 9.791 0 0 1-.414-4.277"/>`}})),zV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="none" stroke="#755838" d="M2.5 7.955h27v16.091h-27z"/><path fill="#755838" d="M5.909 20.636v-9.272h2.727l2.728 3.409l2.727-3.409h2.727v9.272h-2.727v-5.318l-2.727 3.409l-2.728-3.409v5.318H5.909zm17.046 0l-4.091-4.5h2.727v-4.772h2.727v4.772h2.727l-4.09 4.5z"/>`}})),BV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cb3837" d="M2 10.555h28v9.335H16v1.556H9.778v-1.557H2Zm1.556 7.779h3.111v-4.668h1.555v4.667h1.556v-6.222H3.556Zm7.778-6.223v7.779h3.111v-1.556h3.111v-6.223Zm3.111 1.556H16v3.112h-1.556Zm4.667-1.556v6.223h3.111v-4.668h1.556v4.667h1.556v-4.667h1.556v4.667h1.556v-6.222Z"/>`}})),VV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#909090" d="m24.1 2.072l5.564 5.8v22.056H8.879V30h20.856V7.945L24.1 2.072"/><path fill="#f4f4f4" d="M24.031 2H8.808v27.928h20.856V7.873L24.03 2"/><path fill="#7a7b7c" d="M8.655 3.5h-6.39v6.827h20.1V3.5H8.655"/><path fill="#dd2025" d="M22.472 10.211H2.395V3.379h20.077v6.832"/><path fill="#464648" d="M9.052 4.534H7.745v4.8h1.028V7.715L9 7.728a2.042 2.042 0 0 0 .647-.117a1.427 1.427 0 0 0 .493-.291a1.224 1.224 0 0 0 .335-.454a2.13 2.13 0 0 0 .105-.908a2.237 2.237 0 0 0-.114-.644a1.173 1.173 0 0 0-.687-.65a2.149 2.149 0 0 0-.409-.104a2.232 2.232 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.193a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.942.942 0 0 1-.524.114m3.671-2.306c-.111 0-.219.008-.295.011L12 4.538h-.78v4.8h.918a2.677 2.677 0 0 0 1.028-.175a1.71 1.71 0 0 0 .68-.491a1.939 1.939 0 0 0 .373-.749a3.728 3.728 0 0 0 .114-.949a4.416 4.416 0 0 0-.087-1.127a1.777 1.777 0 0 0-.4-.733a1.63 1.63 0 0 0-.535-.4a2.413 2.413 0 0 0-.549-.178a1.282 1.282 0 0 0-.228-.017m-.182 3.937h-.1V5.392h.013a1.062 1.062 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a2.926 2.926 0 0 1-.033.513a1.756 1.756 0 0 1-.169.5a1.13 1.13 0 0 1-.363.36a.673.673 0 0 1-.416.106m5.08-3.915H15v4.8h1.028V7.434h1.3v-.892h-1.3V5.43h1.4v-.892"/><path fill="#dd2025" d="M21.781 20.255s3.188-.578 3.188.511s-1.975.646-3.188-.511Zm-2.357.083a7.543 7.543 0 0 0-1.473.489l.4-.9c.4-.9.815-2.127.815-2.127a14.216 14.216 0 0 0 1.658 2.252a13.033 13.033 0 0 0-1.4.288Zm-1.262-6.5c0-.949.307-1.208.546-1.208s.508.115.517.939a10.787 10.787 0 0 1-.517 2.434a4.426 4.426 0 0 1-.547-2.162Zm-4.649 10.516c-.978-.585 2.051-2.386 2.6-2.444c-.003.001-1.576 3.056-2.6 2.444ZM25.9 20.895c-.01-.1-.1-1.207-2.07-1.16a14.228 14.228 0 0 0-2.453.173a12.542 12.542 0 0 1-2.012-2.655a11.76 11.76 0 0 0 .623-3.1c-.029-1.2-.316-1.888-1.236-1.878s-1.054.815-.933 2.013a9.309 9.309 0 0 0 .665 2.338s-.425 1.323-.987 2.639s-.946 2.006-.946 2.006a9.622 9.622 0 0 0-2.725 1.4c-.824.767-1.159 1.356-.725 1.945c.374.508 1.683.623 2.853-.91a22.549 22.549 0 0 0 1.7-2.492s1.784-.489 2.339-.623s1.226-.24 1.226-.24s1.629 1.639 3.2 1.581s1.495-.939 1.485-1.035"/><path fill="#909090" d="M23.954 2.077V7.95h5.633l-5.633-5.873Z"/><path fill="#f4f4f4" d="M24.031 2v5.873h5.633L24.031 2Z"/><path fill="#fff" d="M8.975 4.457H7.668v4.8H8.7V7.639l.228.013a2.042 2.042 0 0 0 .647-.117a1.428 1.428 0 0 0 .493-.291a1.224 1.224 0 0 0 .332-.454a2.13 2.13 0 0 0 .105-.908a2.237 2.237 0 0 0-.114-.644a1.173 1.173 0 0 0-.687-.65a2.149 2.149 0 0 0-.411-.105a2.232 2.232 0 0 0-.319-.026m-.189 2.294h-.089v-1.48h.194a.57.57 0 0 1 .459.181a.92.92 0 0 1 .183.558c0 .246 0 .469-.222.626a.942.942 0 0 1-.524.114m3.67-2.306c-.111 0-.219.008-.295.011l-.235.006h-.78v4.8h.918a2.677 2.677 0 0 0 1.028-.175a1.71 1.71 0 0 0 .68-.491a1.939 1.939 0 0 0 .373-.749a3.728 3.728 0 0 0 .114-.949a4.416 4.416 0 0 0-.087-1.127a1.777 1.777 0 0 0-.4-.733a1.63 1.63 0 0 0-.535-.4a2.413 2.413 0 0 0-.549-.178a1.282 1.282 0 0 0-.228-.017m-.182 3.937h-.1V5.315h.013a1.062 1.062 0 0 1 .6.107a1.2 1.2 0 0 1 .324.4a1.3 1.3 0 0 1 .142.526c.009.22 0 .4 0 .549a2.926 2.926 0 0 1-.033.513a1.756 1.756 0 0 1-.169.5a1.13 1.13 0 0 1-.363.36a.673.673 0 0 1-.416.106m5.077-3.915h-2.43v4.8h1.028V7.357h1.3v-.892h-1.3V5.353h1.4v-.892"/>`}})),HV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><radialGradient id="vscodeIconsFileTypePhp0" cx="-16.114" cy="20.532" r="18.384" gradientTransform="translate(26.52 -9.307)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".5" stop-color="#4c6b96"/><stop offset="1" stop-color="#231f20"/></radialGradient></defs><ellipse cx="16" cy="16" fill="url(#vscodeIconsFileTypePhp0)" rx="14" ry="7.365"/><ellipse cx="16" cy="16" fill="#6280b6" rx="13.453" ry="6.818"/><path fill="#fff" d="m18.725 18.2l.667-3.434a1.752 1.752 0 0 0-.372-1.719a2.929 2.929 0 0 0-2-.525h-1.153l.331-1.7a.219.219 0 0 0-.215-.26h-1.6a.219.219 0 0 0-.215.177l-.709 3.646a2.051 2.051 0 0 0-.477-1.054a2.783 2.783 0 0 0-2.2-.807H7.7a.219.219 0 0 0-.215.177l-1.434 7.38a.219.219 0 0 0 .215.26h1.603a.219.219 0 0 0 .215-.177l.347-1.785h1.2a5.167 5.167 0 0 0 1.568-.2a3.068 3.068 0 0 0 1.15-.689a3.538 3.538 0 0 0 .68-.844l-.287 1.475a.219.219 0 0 0 .215.26h1.6a.219.219 0 0 0 .215-.177l.787-4.051h1.094c.466 0 .6.093.64.133s.1.165.025.569l-.635 3.265a.219.219 0 0 0 .215.26h1.62a.219.219 0 0 0 .207-.18Zm-7.395-2.834a1.749 1.749 0 0 1-.561 1.092a2.171 2.171 0 0 1-1.315.321h-.712l.515-2.651h.921c.677 0 .949.145 1.059.266a1.181 1.181 0 0 1 .093.972Zm14.216-2.034a2.783 2.783 0 0 0-2.2-.807h-3.091a.219.219 0 0 0-.215.177l-1.434 7.38a.219.219 0 0 0 .215.26h1.608a.219.219 0 0 0 .215-.177l.347-1.785h1.2a5.167 5.167 0 0 0 1.568-.2a3.068 3.068 0 0 0 1.15-.689a3.425 3.425 0 0 0 1.076-1.927a2.512 2.512 0 0 0-.439-2.232Zm-1.667 2.034a1.749 1.749 0 0 1-.561 1.092a2.171 2.171 0 0 1-1.318.32h-.71l.515-2.651h.921c.677 0 .949.145 1.059.266a1.181 1.181 0 0 1 .094.973Z"/><path fill="#000004" d="M10.178 13.908a1.645 1.645 0 0 1 1.221.338a1.34 1.34 0 0 1 .145 1.161a1.945 1.945 0 0 1-.642 1.223a2.361 2.361 0 0 1-1.448.37h-.978l.6-3.089Zm-3.917 6.216h1.608l.381-1.962h1.377a4.931 4.931 0 0 0 1.5-.191a2.84 2.84 0 0 0 1.07-.642a3.207 3.207 0 0 0 1.01-1.808a2.3 2.3 0 0 0-.385-2.044a2.568 2.568 0 0 0-2.035-.732H7.7Zm8.126-9.342h1.6l-.387 1.962h1.421a2.767 2.767 0 0 1 1.85.468a1.548 1.548 0 0 1 .305 1.516l-.667 3.434H16.89l.635-3.265a.886.886 0 0 0-.08-.76a1.121 1.121 0 0 0-.8-.2H15.37l-.822 4.228h-1.6Zm8.34 3.126a1.645 1.645 0 0 1 1.221.338a1.34 1.34 0 0 1 .145 1.161a1.945 1.945 0 0 1-.642 1.223A2.361 2.361 0 0 1 22 17h-.978l.6-3.089Zm-3.917 6.216h1.608l.381-1.962h1.377a4.931 4.931 0 0 0 1.5-.191a2.84 2.84 0 0 0 1.07-.642a3.207 3.207 0 0 0 1.01-1.808a2.3 2.3 0 0 0-.385-2.044a2.568 2.568 0 0 0-2.035-.732h-3.092Z"/>`}})),UV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f9ad00" d="M30 10.75h-8.749V2H30Zm-9.626 0h-8.75V2h8.75Zm-9.625 0H2V2h8.749ZM30 20.375h-8.749v-8.75H30Z"/><path fill="#fff" d="M20.374 20.375h-8.75v-8.75h8.75Zm0 9.625h-8.75v-8.75h8.75ZM30 30h-8.749v-8.75H30Zm-19.251 0H2v-8.75h8.749Z"/>`}})),WV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypePowerpoint0" x1="4.494" x2="13.832" y1="-1748.086" y2="-1731.914" gradientTransform="translate(0 1756)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ca4c28"/><stop offset=".5" stop-color="#c5401e"/><stop offset="1" stop-color="#b62f14"/></linearGradient></defs><path fill="#ed6c47" d="M18.93 17.3L16.977 3h-.146A12.9 12.9 0 0 0 3.953 15.854V16Z"/><path fill="#ff8f6b" d="M17.123 3h-.146v13l6.511 2.6L30 16v-.146A12.9 12.9 0 0 0 17.123 3Z"/><path fill="#d35230" d="M30 16v.143A12.905 12.905 0 0 1 17.12 29h-.287a12.907 12.907 0 0 1-12.88-12.857V16Z"/><path d="M17.628 9.389V23.26a1.2 1.2 0 0 1-.742 1.1a1.16 1.16 0 0 1-.45.091H7.027a10.08 10.08 0 0 1-.521-.65a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85a8.82 8.82 0 0 1 .456-.65h9.93a1.2 1.2 0 0 1 1.192 1.189Z" opacity=".1"/><path d="M16.977 10.04v13.871a1.15 1.15 0 0 1-.091.448a1.2 1.2 0 0 1-1.1.741H7.62q-.309-.314-.593-.65a10.08 10.08 0 0 1-.521-.65a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.735a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path d="M16.977 10.04v12.571a1.2 1.2 0 0 1-1.192 1.189H6.506a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.735a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path d="M16.326 10.04v12.571a1.2 1.2 0 0 1-1.192 1.189H6.506a12.735 12.735 0 0 1-2.553-7.657v-.286A12.705 12.705 0 0 1 6.05 8.85h9.084a1.2 1.2 0 0 1 1.192 1.19Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypePowerpoint0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="M9.293 12.028a3.287 3.287 0 0 1 2.174.636a2.27 2.27 0 0 1 .756 1.841a2.555 2.555 0 0 1-.373 1.376a2.49 2.49 0 0 1-1.059.935a3.607 3.607 0 0 1-1.591.334H7.687v2.8H6.141v-7.922ZM7.686 15.94h1.331a1.735 1.735 0 0 0 1.177-.351a1.3 1.3 0 0 0 .4-1.025q0-1.309-1.525-1.31H7.686v2.686Z"/>`}})),GV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#56b3b4" d="M21.714 8.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M4.571 26.857h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#bf85bf" d="M18.286 17.714h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M11.429 17.714H16a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M4.571 17.714h4.572a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#bf85bf" d="M4.571 22.286h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 22.857a.571.571 0 0 1 .571-.571Zm0-9.143h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 13.714a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M10.286 6.286h11.428a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H10.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#ea5e5e" d="M4.571 6.286H8a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.572H4.571A.571.571 0 0 1 4 6.857a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M9.143 24.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M9.143 10.857h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571ZM4.571 24.571h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M4.571 10.857h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.572H4.571A.571.571 0 0 1 4 11.429a.571.571 0 0 1 .571-.572Z"/><path fill="#4d616e" d="M19.429 24.571h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-6.858 0h4.571a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Zm10.286 0h4.571a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-4.571a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z" opacity=".5"/><path fill="#56b3b4" d="M13.714 15.429h9.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-9.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#f7ba3e" d="M8 15.429h3.429A.571.571 0 0 1 12 16a.571.571 0 0 1-.571.571H8A.571.571 0 0 1 7.429 16A.571.571 0 0 1 8 15.429Z"/><path fill="#ea5e5e" d="M4.571 15.429h1.143a.571.571 0 0 1 .572.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 16a.571.571 0 0 1 .571-.571Z"/><path fill="#bf85bf" d="M14.857 8.571h4.571a.571.571 0 0 1 .572.572a.571.571 0 0 1-.571.571h-4.572a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Z"/><path fill="#56b3b4" d="M4.571 8.571h8a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-8A.571.571 0 0 1 4 9.143a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M8 20h10.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H8a.571.571 0 0 1-.571-.571A.571.571 0 0 1 8 20Z"/><path fill="#bf85bf" d="M4.571 20h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 20.571A.571.571 0 0 1 4.571 20Z"/><path fill="#ea5e5e" d="M18.286 10.857H24a.571.571 0 0 1 .571.571A.571.571 0 0 1 24 12h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Z"/><path fill="#f7ba3e" d="M18.286 13.143H24a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z"/><path fill="#56b3b4" d="M4.571 4h13.715a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H4.571A.571.571 0 0 1 4 4.571A.571.571 0 0 1 4.571 4Z"/><path fill="#4d616e" d="M20.571 4h6.857a.571.571 0 0 1 .572.571a.571.571 0 0 1-.571.571h-6.858A.571.571 0 0 1 20 4.571A.571.571 0 0 1 20.571 4Zm0 16h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm4.572 0h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571ZM24 17.714h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H24a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm0-11.428h3.429a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H24a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm1.143 9.143h2.286A.571.571 0 0 1 28 16a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.572-.571a.571.571 0 0 1 .572-.571Zm0-6.858h2.286a.571.571 0 0 1 .571.572a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Zm1.143 2.286h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm0 2.286h1.143a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-1.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-9.143 9.143h10.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571H17.143a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-4.572 0h2.286a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-2.286a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm9.143 4.571h5.714a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-5.714a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Zm-9.143 0h6.857a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-6.857a.571.571 0 0 1-.571-.57a.571.571 0 0 1 .571-.572Zm0-16H16a.571.571 0 0 1 .571.571A.571.571 0 0 1 16 12h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.572Zm0 2.286H16a.571.571 0 0 1 .571.571a.571.571 0 0 1-.571.571h-3.429a.571.571 0 0 1-.571-.571a.571.571 0 0 1 .571-.571Z" opacity=".5"/>`}})),KV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypePython0" x1="-133.268" x2="-133.198" y1="-202.91" y2="-202.84" gradientTransform="matrix(189.38 0 0 189.81 25243.061 38519.17)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#387eb8"/><stop offset="1" stop-color="#366994"/></linearGradient><linearGradient id="vscodeIconsFileTypePython1" x1="-133.575" x2="-133.495" y1="-203.203" y2="-203.133" gradientTransform="matrix(189.38 0 0 189.81 25309.061 38583.42)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#ffe052"/><stop offset="1" stop-color="#ffc331"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypePython0)" d="M15.885 2.1c-7.1 0-6.651 3.07-6.651 3.07v3.19h6.752v1H6.545S2 8.8 2 16.005s4.013 6.912 4.013 6.912H8.33v-3.361s-.13-4.013 3.9-4.013h6.762s3.772.06 3.772-3.652V5.8s.572-3.712-6.842-3.712Zm-3.732 2.137a1.214 1.214 0 1 1-1.183 1.244v-.02a1.214 1.214 0 0 1 1.214-1.214Z"/><path fill="url(#vscodeIconsFileTypePython1)" d="M16.085 29.91c7.1 0 6.651-3.08 6.651-3.08v-3.18h-6.751v-1h9.47S30 23.158 30 15.995s-4.013-6.912-4.013-6.912H23.64V12.4s.13 4.013-3.9 4.013h-6.765S9.2 16.356 9.2 20.068V26.2s-.572 3.712 6.842 3.712h.04Zm3.732-2.147A1.214 1.214 0 1 1 21 26.519v.03a1.214 1.214 0 0 1-1.214 1.214h.03Z"/>`}})),qV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<circle cx="16" cy="15.974" r="2.5" fill="#00d8ff"/><path fill="#00d8ff" d="M16 21.706a28.385 28.385 0 0 1-8.88-1.2a11.3 11.3 0 0 1-3.657-1.958A3.543 3.543 0 0 1 2 15.974c0-1.653 1.816-3.273 4.858-4.333A28.755 28.755 0 0 1 16 10.293a28.674 28.674 0 0 1 9.022 1.324a11.376 11.376 0 0 1 3.538 1.866A3.391 3.391 0 0 1 30 15.974c0 1.718-2.03 3.459-5.3 4.541a28.8 28.8 0 0 1-8.7 1.191Zm0-10.217a27.948 27.948 0 0 0-8.749 1.282c-2.8.977-4.055 2.313-4.055 3.2c0 .928 1.349 2.387 4.311 3.4A27.21 27.21 0 0 0 16 20.51a27.6 27.6 0 0 0 8.325-1.13C27.4 18.361 28.8 16.9 28.8 15.974a2.327 2.327 0 0 0-1.01-1.573a10.194 10.194 0 0 0-3.161-1.654A27.462 27.462 0 0 0 16 11.489Z"/><path fill="#00d8ff" d="M10.32 28.443a2.639 2.639 0 0 1-1.336-.328c-1.432-.826-1.928-3.208-1.327-6.373a28.755 28.755 0 0 1 3.4-8.593a28.676 28.676 0 0 1 5.653-7.154a11.376 11.376 0 0 1 3.384-2.133a3.391 3.391 0 0 1 2.878 0c1.489.858 1.982 3.486 1.287 6.859a28.806 28.806 0 0 1-3.316 8.133a28.385 28.385 0 0 1-5.476 7.093a11.3 11.3 0 0 1-3.523 2.189a4.926 4.926 0 0 1-1.624.307Zm1.773-14.7a27.948 27.948 0 0 0-3.26 8.219c-.553 2.915-.022 4.668.75 5.114c.8.463 2.742.024 5.1-2.036a27.209 27.209 0 0 0 5.227-6.79a27.6 27.6 0 0 0 3.181-7.776c.654-3.175.089-5.119-.713-5.581a2.327 2.327 0 0 0-1.868.089A10.194 10.194 0 0 0 17.5 6.9a27.464 27.464 0 0 0-5.4 6.849Z"/><path fill="#00d8ff" d="M21.677 28.456c-1.355 0-3.076-.82-4.868-2.361a28.756 28.756 0 0 1-5.747-7.237a28.676 28.676 0 0 1-3.374-8.471a11.376 11.376 0 0 1-.158-4A3.391 3.391 0 0 1 8.964 3.9c1.487-.861 4.01.024 6.585 2.31a28.8 28.8 0 0 1 5.39 6.934a28.384 28.384 0 0 1 3.41 8.287a11.3 11.3 0 0 1 .137 4.146a3.543 3.543 0 0 1-1.494 2.555a2.59 2.59 0 0 1-1.315.324Zm-9.58-10.2a27.949 27.949 0 0 0 5.492 6.929c2.249 1.935 4.033 2.351 4.8 1.9c.8-.465 1.39-2.363.782-5.434A27.212 27.212 0 0 0 19.9 13.74a27.6 27.6 0 0 0-5.145-6.64c-2.424-2.152-4.39-2.633-5.191-2.169a2.327 2.327 0 0 0-.855 1.662a10.194 10.194 0 0 0 .153 3.565a27.465 27.465 0 0 0 3.236 8.1Z"/>`}})),JV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<circle cx="16" cy="15.974" r="2.5" fill="#007acc"/><path fill="#007acc" d="M16 21.706a28.385 28.385 0 0 1-8.88-1.2a11.3 11.3 0 0 1-3.657-1.958A3.543 3.543 0 0 1 2 15.974c0-1.653 1.816-3.273 4.858-4.333A28.755 28.755 0 0 1 16 10.293a28.674 28.674 0 0 1 9.022 1.324a11.376 11.376 0 0 1 3.538 1.866A3.391 3.391 0 0 1 30 15.974c0 1.718-2.03 3.459-5.3 4.541a28.8 28.8 0 0 1-8.7 1.191Zm0-10.217a27.948 27.948 0 0 0-8.749 1.282c-2.8.977-4.055 2.313-4.055 3.2c0 .928 1.349 2.387 4.311 3.4A27.21 27.21 0 0 0 16 20.51a27.6 27.6 0 0 0 8.325-1.13C27.4 18.361 28.8 16.9 28.8 15.974a2.327 2.327 0 0 0-1.01-1.573a10.194 10.194 0 0 0-3.161-1.654A27.462 27.462 0 0 0 16 11.489Z"/><path fill="#007acc" d="M10.32 28.443a2.639 2.639 0 0 1-1.336-.328c-1.432-.826-1.928-3.208-1.327-6.373a28.755 28.755 0 0 1 3.4-8.593a28.676 28.676 0 0 1 5.653-7.154a11.376 11.376 0 0 1 3.384-2.133a3.391 3.391 0 0 1 2.878 0c1.489.858 1.982 3.486 1.287 6.859a28.806 28.806 0 0 1-3.316 8.133a28.385 28.385 0 0 1-5.476 7.093a11.3 11.3 0 0 1-3.523 2.189a4.926 4.926 0 0 1-1.624.307Zm1.773-14.7a27.948 27.948 0 0 0-3.26 8.219c-.553 2.915-.022 4.668.75 5.114c.8.463 2.742.024 5.1-2.036a27.209 27.209 0 0 0 5.227-6.79a27.6 27.6 0 0 0 3.181-7.776c.654-3.175.089-5.119-.713-5.581a2.327 2.327 0 0 0-1.868.089A10.194 10.194 0 0 0 17.5 6.9a27.464 27.464 0 0 0-5.4 6.849Z"/><path fill="#007acc" d="M21.677 28.456c-1.355 0-3.076-.82-4.868-2.361a28.756 28.756 0 0 1-5.747-7.237a28.676 28.676 0 0 1-3.374-8.471a11.376 11.376 0 0 1-.158-4A3.391 3.391 0 0 1 8.964 3.9c1.487-.861 4.01.024 6.585 2.31a28.8 28.8 0 0 1 5.39 6.934a28.384 28.384 0 0 1 3.41 8.287a11.3 11.3 0 0 1 .137 4.146a3.543 3.543 0 0 1-1.494 2.555a2.59 2.59 0 0 1-1.315.324Zm-9.58-10.2a27.949 27.949 0 0 0 5.492 6.929c2.249 1.935 4.033 2.351 4.8 1.9c.8-.465 1.39-2.363.782-5.434A27.212 27.212 0 0 0 19.9 13.74a27.6 27.6 0 0 0-5.145-6.64c-2.424-2.152-4.39-2.633-5.191-2.169a2.327 2.327 0 0 0-.855 1.662a10.194 10.194 0 0 0 .153 3.565a27.465 27.465 0 0 0 3.236 8.1Z"/>`}})),YV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeRuby0" x1="-235.957" x2="-235.986" y1="-308.579" y2="-308.527" gradientTransform="matrix(202.935 0 0 -202.78 47910.461 -62541.16)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fb7655"/><stop offset=".41" stop-color="#e42b1e"/><stop offset=".99" stop-color="#900"/><stop offset="1" stop-color="#900"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby1" x1="-235.571" x2="-235.697" y1="-309.087" y2="-309.041" gradientTransform="matrix(60.308 0 0 -111.778 14236.351 -34525.395)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#871101"/><stop offset=".99" stop-color="#911209"/><stop offset="1" stop-color="#911209"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby2" x1="-235.896" x2="-235.937" y1="-313.362" y2="-313.129" gradientTransform="matrix(188.32 0 0 -21.986 44447.302 -6856.882)" href="#vscodeIconsFileTypeRuby1"/><linearGradient id="vscodeIconsFileTypeRuby3" x1="-233.515" x2="-233.497" y1="-309.082" y2="-309.161" gradientTransform="matrix(65.222 0 0 -97.1 15237.802 -29991.814)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".23" stop-color="#e57252"/><stop offset=".46" stop-color="#de3b20"/><stop offset=".99" stop-color="#a60003"/><stop offset="1" stop-color="#a60003"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby4" x1="-235.314" x2="-235.31" y1="-309.534" y2="-309.607" gradientTransform="matrix(105.32 0 0 -106.825 24798.925 -33053.152)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".23" stop-color="#e4714e"/><stop offset=".56" stop-color="#be1a0d"/><stop offset=".99" stop-color="#a80d00"/><stop offset="1" stop-color="#a80d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby5" x1="-235.882" x2="-235.869" y1="-311.851" y2="-311.935" gradientTransform="matrix(94.321 0 0 -66.418 22271.499 -20707.004)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".18" stop-color="#e46342"/><stop offset=".4" stop-color="#c82410"/><stop offset=".99" stop-color="#a80d00"/><stop offset="1" stop-color="#a80d00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby6" x1="-235.412" x2="-235.333" y1="-321.074" y2="-320.958" gradientTransform="matrix(70.767 0 0 -24.301 16678.116 -7798.647)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".54" stop-color="#c81f11"/><stop offset=".99" stop-color="#bf0905"/><stop offset="1" stop-color="#bf0905"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby7" x1="-223.821" x2="-223.796" y1="-310.116" y2="-310.18" gradientTransform="matrix(18.177 0 0 -72.645 4071.017 -22510.233)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#fff"/><stop offset=".31" stop-color="#de4024"/><stop offset=".99" stop-color="#bf190b"/><stop offset="1" stop-color="#bf190b"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby8" x1="-235.561" x2="-235.424" y1="-309.258" y2="-309.116" gradientTransform="matrix(158.162 0 0 -157.937 37256.313 -48819.382)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#bd0012"/><stop offset=".07" stop-color="#fff"/><stop offset=".17" stop-color="#fff"/><stop offset=".27" stop-color="#c82f1c"/><stop offset=".33" stop-color="#820c01"/><stop offset=".46" stop-color="#a31601"/><stop offset=".72" stop-color="#b31301"/><stop offset=".99" stop-color="#e82609"/><stop offset="1" stop-color="#e82609"/></linearGradient><linearGradient id="vscodeIconsFileTypeRuby9" x1="-235.424" x2="-235.476" y1="-309.143" y2="-309.126" gradientTransform="matrix(127.074 0 0 -97.409 29932.229 -30086.947)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8c0c01"/><stop offset=".54" stop-color="#990c00"/><stop offset=".99" stop-color="#a80d0e"/><stop offset="1" stop-color="#a80d0e"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubya" x1="-235.839" x2="-235.901" y1="-309.604" y2="-309.555" gradientTransform="matrix(94.011 0 0 -105.603 22198.743 -32676.856)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7e110b"/><stop offset=".99" stop-color="#9e0c00"/><stop offset="1" stop-color="#9e0c00"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyb" x1="-235.854" x2="-235.891" y1="-311.24" y2="-311.202" gradientTransform="matrix(79.702 0 0 -81.791 18827.397 -25447.905)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#79130d"/><stop offset=".99" stop-color="#9e120b"/><stop offset="1" stop-color="#9e120b"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyc" x1="-231.241" x2="-231.299" y1="-309.435" y2="-309.337" gradientTransform="matrix(40.137 0 0 -81.143 9286.998 -25078.589)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#8b2114"/><stop offset=".43" stop-color="#9e100a"/><stop offset=".99" stop-color="#b3100c"/><stop offset="1" stop-color="#b3100c"/></linearGradient><linearGradient id="vscodeIconsFileTypeRubyd" x1="-235.898" x2="-235.831" y1="-317.466" y2="-317.537" gradientTransform="matrix(78.099 0 0 -32.624 18447.361 -10353.553)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#b31000"/><stop offset=".44" stop-color="#910f08"/><stop offset=".99" stop-color="#791c12"/><stop offset="1" stop-color="#791c12"/></linearGradient><radialGradient id="vscodeIconsFileTypeRubye" cx="-235.882" cy="-312.543" r=".076" gradientTransform="matrix(93.113 0 0 -48.655 21986.073 -15193.61)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a80d00"/><stop offset=".99" stop-color="#7e0e08"/><stop offset="1" stop-color="#7e0e08"/></radialGradient><radialGradient id="vscodeIconsFileTypeRubyf" cx="-235.282" cy="-309.704" r=".097" gradientTransform="matrix(97.434 0 0 -75.848 22937.057 -23467.84)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#a30c00"/><stop offset=".99" stop-color="#800e08"/><stop offset="1" stop-color="#800e08"/></radialGradient></defs><path fill="url(#vscodeIconsFileTypeRuby0)" d="M23.693 20.469L7.707 29.961l20.7-1.4L30 7.685Z"/><path fill="url(#vscodeIconsFileTypeRuby1)" d="m28.44 28.542l-1.779-12.279l-4.846 6.4Z"/><path fill="url(#vscodeIconsFileTypeRuby2)" d="M28.464 28.542L15.43 27.519l-7.654 2.415Z"/><path fill="url(#vscodeIconsFileTypeRuby3)" d="M7.794 29.937L11.05 19.27L3.885 20.8Z"/><path fill="url(#vscodeIconsFileTypeRuby4)" d="m21.813 22.7l-3-11.735L10.243 19Z"/><path fill="url(#vscodeIconsFileTypeRuby5)" d="m29.32 11.127l-8.1-6.619l-2.257 7.3Z"/><path fill="url(#vscodeIconsFileTypeRuby6)" d="m25.53 2.148l-4.767 2.634l-3.007-2.67Z"/><path fill="url(#vscodeIconsFileTypeRuby7)" d="m2 24.38l2-3.642L2.382 16.4Z"/><path fill="#fff" d="m2.274 16.263l1.626 4.61l7.062-1.584l8.062-7.489L21.3 4.569l-3.583-2.53l-6.091 2.28C9.706 6.1 5.982 9.635 5.848 9.7s-2.459 4.464-3.574 6.562Z"/><path fill="url(#vscodeIconsFileTypeRuby8)" d="M7.981 7.981C12.14 3.858 17.5 1.421 19.559 3.5s-.124 7.121-4.283 11.244s-9.455 6.69-11.511 4.614s.057-7.258 4.216-11.377Z"/><path fill="url(#vscodeIconsFileTypeRuby9)" d="m7.794 29.933l3.231-10.7l10.729 3.447c-3.879 3.638-8.194 6.713-13.96 7.254Z"/><path fill="url(#vscodeIconsFileTypeRubya)" d="m19.038 11.774l2.754 10.91c3.24-3.407 6.149-7.07 7.573-11.6l-10.328.691Z"/><path fill="url(#vscodeIconsFileTypeRubyb)" d="M29.337 11.139c1.1-3.327 1.357-8.1-3.841-8.985l-4.265 2.355l8.106 6.629Z"/><path fill="#9e1209" d="M2 24.332c.153 5.49 4.114 5.572 5.8 5.62l-3.9-9.1l-1.9 3.48Z"/><path fill="url(#vscodeIconsFileTypeRubye)" d="M19.053 11.791c2.49 1.531 7.509 4.6 7.61 4.661a17.552 17.552 0 0 0 2.619-5.343l-10.229.683Z"/><path fill="url(#vscodeIconsFileTypeRubyf)" d="m11.021 19.232l4.319 8.332a27.924 27.924 0 0 0 6.385-4.88l-10.7-3.452Z"/><path fill="url(#vscodeIconsFileTypeRubyc)" d="m3.887 20.861l-.612 7.287c1.155 1.577 2.743 1.714 4.409 1.591c-1.205-3-3.614-9-3.8-8.878Z"/><path fill="url(#vscodeIconsFileTypeRubyd)" d="m21.206 4.528l8.58 1.2c-.458-1.94-1.864-3.192-4.261-3.584l-4.319 2.38Z"/>`}})),XV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><radialGradient id="vscodeIconsFileTypeRust0" cx="-492.035" cy="-883.37" r="13.998" gradientTransform="matrix(.866 -.5 -.3 -.52 177.106 -689.033)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7d7d7d"/><stop offset=".267" stop-color="#7e7c7a"/><stop offset=".45" stop-color="#817871"/><stop offset=".608" stop-color="#867162"/><stop offset=".753" stop-color="#8d684c"/><stop offset=".886" stop-color="#965c30"/><stop offset="1" stop-color="#a04f12"/></radialGradient></defs><path fill="url(#vscodeIconsFileTypeRust0)" d="M15.124 5.3a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832M5.2 12.834a.832.832 0 1 1 .832.832a.832.832 0 0 1-.832-.832m19.856.039a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832m-17.451 1.14a.76.76 0 0 0 .386-1l-.369-.835h1.452v6.545h-2.93a10.247 10.247 0 0 1-.332-3.911Zm6.074.161v-1.929h3.458c.179 0 1.261.206 1.261 1.016c0 .672-.83.913-1.513.913ZM8.958 24.561a.832.832 0 1 1 .832.832a.831.831 0 0 1-.832-.832m12.331.039a.832.832 0 1 1 .832.832a.832.832 0 0 1-.832-.832m.257-1.887a.758.758 0 0 0-.9.584l-.418 1.949a10.249 10.249 0 0 1-8.545-.041l-.417-1.949a.759.759 0 0 0-.9-.583l-1.721.37a10.233 10.233 0 0 1-.89-1.049h8.374c.095 0 .158-.017.158-.1v-2.966c0-.086-.063-.1-.158-.1h-2.45v-1.881h2.649a1.665 1.665 0 0 1 1.629 1.412c.105.413.336 1.757.494 2.187c.157.483.8 1.447 1.482 1.447h4.323a10.243 10.243 0 0 1-.949 1.1Zm4.65-7.821a10.261 10.261 0 0 1 .022 1.779h-1.051c-.105 0-.148.069-.148.172v.483c0 1.136-.641 1.384-1.2 1.447c-.535.06-1.128-.224-1.2-.551a3.616 3.616 0 0 0-1.671-2.808c1.03-.654 2.1-1.619 2.1-2.911A3.292 3.292 0 0 0 21.44 9.8a4.559 4.559 0 0 0-2.2-.724H8.367A10.246 10.246 0 0 1 14.1 5.84l1.282 1.344a.758.758 0 0 0 1.072.026l1.434-1.372a10.248 10.248 0 0 1 7.015 5l-.982 2.217a.761.761 0 0 0 .386 1Zm2.448.036l-.033-.343l1.011-.943a.42.42 0 0 0-.013-.595a.428.428 0 0 0-.121-.081l-1.288-.483l-.1-.334l.806-1.12a.422.422 0 0 0-.13-.581a.43.43 0 0 0-.133-.055l-1.363-.222l-.164-.306l.573-1.257a.419.419 0 0 0-.236-.544a.426.426 0 0 0-.146-.029l-1.383.048l-.224-.264l.318-1.347a.421.421 0 0 0-.343-.487a.435.435 0 0 0-.144 0l-1.348.315l-.266-.219l.049-1.381a.421.421 0 0 0-.431-.411a.426.426 0 0 0-.141.028l-1.257.573l-.306-.164l-.222-1.363a.421.421 0 0 0-.5-.318a.43.43 0 0 0-.133.055l-1.121.806l-.333-.1l-.483-1.293a.421.421 0 0 0-.555-.215a.442.442 0 0 0-.12.08l-.946 1.012l-.343-.033l-.728-1.177a.421.421 0 0 0-.688 0l-.728 1.177l-.343.033l-.943-1.012a.421.421 0 0 0-.595.015a.442.442 0 0 0-.08.12L12.483 3.8l-.333.1l-1.12-.8a.422.422 0 0 0-.581.13a.43.43 0 0 0-.055.133l-.222 1.363l-.306.164l-1.258-.573a.421.421 0 0 0-.544.239a.444.444 0 0 0-.028.144l.048 1.383l-.266.217l-1.347-.316a.421.421 0 0 0-.487.343a.435.435 0 0 0 0 .144L6.3 7.819l-.218.265L4.7 8.036a.422.422 0 0 0-.383.573l.573 1.257l-.164.306l-1.363.222a.42.42 0 0 0-.318.5a.43.43 0 0 0 .055.133l.806 1.12l-.1.334l-1.293.483a.421.421 0 0 0-.215.555a.414.414 0 0 0 .081.121l1.011.943l-.033.343l-1.177.728a.421.421 0 0 0 0 .688l1.177.728l.033.343l-1.011.943a.421.421 0 0 0 .015.595a.436.436 0 0 0 .119.08l1.293.483l.1.334l-.806 1.124a.421.421 0 0 0 .131.581a.43.43 0 0 0 .133.055l1.363.222l.164.307l-.573 1.257a.422.422 0 0 0 .24.545a.438.438 0 0 0 .143.028l1.383-.048l.219.266l-.317 1.348a.42.42 0 0 0 .341.486a.4.4 0 0 0 .146 0l1.345-.319l.266.218l-.049 1.382a.419.419 0 0 0 .429.41a.413.413 0 0 0 .143-.028l1.257-.573l.306.164l.222 1.362a.421.421 0 0 0 .5.319a.407.407 0 0 0 .133-.055l1.12-.807l.334.1l.483 1.292a.422.422 0 0 0 .556.214a.436.436 0 0 0 .119-.08l.943-1.011l.343.034l.728 1.177a.422.422 0 0 0 .588.1a.413.413 0 0 0 .1-.1l.728-1.177l.343-.034l.943 1.011a.421.421 0 0 0 .595-.015a.436.436 0 0 0 .08-.119l.483-1.292l.334-.1l1.12.807a.421.421 0 0 0 .581-.131a.43.43 0 0 0 .055-.133l.222-1.362l.306-.164l1.257.573a.421.421 0 0 0 .544-.239a.438.438 0 0 0 .028-.143l-.048-1.384l.265-.218l1.347.317a.421.421 0 0 0 .487-.34a.447.447 0 0 0 0-.146l-.309-1.346l.218-.266l1.383.048a.421.421 0 0 0 .41-.431a.4.4 0 0 0-.028-.142l-.573-1.257l.164-.307l1.363-.222a.421.421 0 0 0 .319-.5a.434.434 0 0 0-.056-.135l-.806-1.12l.1-.334l1.293-.483a.42.42 0 0 0 .215-.554a.414.414 0 0 0-.081-.121l-1.011-.943l.033-.343l1.177-.728a.421.421 0 0 0 0-.688Z"/>`}})),ZV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#cd6799" d="M26.11 17.572a5.8 5.8 0 0 0-2.537.588a5.345 5.345 0 0 1-.568-1.314a3.53 3.53 0 0 1-.051-1.1a9.811 9.811 0 0 1 .332-1.192c-.005-.051-.061-.292-.624-.3s-1.048.107-1.1.256a6.171 6.171 0 0 0-.235.834a19.686 19.686 0 0 1-1.713 3.294a3.186 3.186 0 0 1-.44-2.066a9.811 9.811 0 0 1 .332-1.192c-.005-.051-.061-.292-.624-.3s-1.048.107-1.1.256s-.118.5-.235.834s-1.483 3.386-1.841 4.173c-.184.4-.343.726-.455.946a.233.233 0 0 1-.02.041l-.153.292v.005c-.077.138-.159.266-.2.266a1.711 1.711 0 0 1 .01-.869c.2-1.059.69-2.705.685-2.762c0-.031.092-.317-.317-.465a.508.508 0 0 0-.578.1c-.036 0-.061.087-.061.087s.445-1.851-.849-1.851a3.855 3.855 0 0 0-2.475 1.683c-.348.189-1.089.593-1.882 1.028c-.3.169-.614.338-.905.5c-.02-.02-.041-.046-.061-.066C6.87 17.6 3.975 16.416 4.1 14.171c.046-.818.327-2.966 5.559-5.575c4.306-2.122 7.733-1.534 8.326-.23c.849 1.862-1.836 5.319-6.285 5.82a3.351 3.351 0 0 1-2.813-.711c-.235-.256-.271-.271-.358-.22c-.143.077-.051.307 0 .44a2.626 2.626 0 0 0 1.606 1.263a8.55 8.55 0 0 0 5.217-.517c2.7-1.043 4.8-3.943 4.184-6.372c-.619-2.465-4.71-3.278-8.582-1.9a19.5 19.5 0 0 0-6.595 3.783c-2.133 1.995-2.47 3.728-2.332 4.455c.5 2.578 4.051 4.255 5.472 5.5a8.554 8.554 0 0 1-.194.107c-.711.353-3.421 1.77-4.1 3.268c-.767 1.7.123 2.915.711 3.079a4.374 4.374 0 0 0 4.71-1.908a4.725 4.725 0 0 0 .423-4.353a.107.107 0 0 0-.02-.031l.557-.327a27.2 27.2 0 0 1 1.028-.578a6.74 6.74 0 0 0-.363 1.862a3.886 3.886 0 0 0 .834 2.7a.921.921 0 0 0 .675.22c.6 0 .875-.5 1.176-1.094c.368-.726.7-1.57.7-1.57s-.414 2.281.711 2.281c.409 0 .823-.532 1.008-.8v.005l.031-.051l.066-.107v-.01c.164-.286.532-.936 1.079-2.015c.706-1.391 1.386-3.13 1.386-3.13a8.888 8.888 0 0 0 .271 1.13a10.643 10.643 0 0 0 .583 1.309c-.164.23-.266.358-.266.358l.005.005c-.133.174-.276.363-.435.547a16.3 16.3 0 0 0-1.314 1.647a.447.447 0 0 0 .123.6a1.116 1.116 0 0 0 .685.113a3.147 3.147 0 0 0 1.028-.235a3.45 3.45 0 0 0 .885-.465a1.98 1.98 0 0 0 .849-1.744a3.521 3.521 0 0 0-.322-1.233c.051-.072.1-.143.148-.215a23.428 23.428 0 0 0 1.534-2.649a8.888 8.888 0 0 0 .271 1.13a7.57 7.57 0 0 0 .5 1.125a4.861 4.861 0 0 0-1.497 1.922c-.322.931-.072 1.35.4 1.447a1.425 1.425 0 0 0 .747-.153a3.4 3.4 0 0 0 .946-.486a2.126 2.126 0 0 0 1.043-1.729a3.268 3.268 0 0 0-.235-1.023a5.356 5.356 0 0 1 2.716-.312c2.434.286 2.915 1.805 2.823 2.445a1.618 1.618 0 0 1-.772 1.094c-.169.107-.225.143-.21.22c.02.113.1.107.245.087A1.9 1.9 0 0 0 30 20.7c.077-1.5-1.355-3.145-3.887-3.13ZM7.33 23.9c-.808.88-1.933 1.212-2.419.931c-.522-.3-.317-1.6.675-2.532a12.884 12.884 0 0 1 1.9-1.417c.118-.072.292-.174.5-.3l.056-.031l.123-.077A3.493 3.493 0 0 1 7.33 23.9Zm5.881-4c-.281.685-.869 2.44-1.227 2.342c-.307-.082-.5-1.412-.061-2.726a6.193 6.193 0 0 1 .956-1.754c.44-.491.926-.655 1.043-.455a9.062 9.062 0 0 1-.711 2.593Zm4.853 2.322c-.118.061-.23.1-.281.072c-.036-.02.051-.1.051-.1s.609-.655.849-.951c.138-.174.3-.378.476-.609v.066c0 .782-.757 1.309-1.094 1.524Zm3.744-.854c-.087-.061-.072-.266.22-.905a3.408 3.408 0 0 1 .834-1.074a1.448 1.448 0 0 1 .082.471a1.547 1.547 0 0 1-1.135 1.509Z"/>`}})),QV=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#d9b400" d="M29.4 27.6H2.5V4.5h26.9Zm-25.9-1h24.9V5.5H3.5Z"/><path fill="#d9b400" d="m6.077 19.316l-.555-.832l4.844-3.229l-4.887-4.071l.641-.768l5.915 4.928l-5.958 3.972zM12.7 18.2h7.8v1h-7.8zM2.5 5.5h26.9v1.9H2.5z"/>`}})),$V=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffda44" d="M8.562 15.256A21.159 21.159 0 0 0 16 16.449a21.159 21.159 0 0 0 7.438-1.194c1.864-.727 2.525-1.535 2.525-2V9.7a10.357 10.357 0 0 1-2.084 1.076A22.293 22.293 0 0 1 16 12.078a22.36 22.36 0 0 1-7.879-1.3A10.28 10.28 0 0 1 6.037 9.7v3.55c0 .474.663 1.278 2.525 2.006Zm0 6.705a15.611 15.611 0 0 0 2.6.741a24.9 24.9 0 0 0 4.838.453a24.9 24.9 0 0 0 4.838-.452a15.614 15.614 0 0 0 2.6-.741c1.864-.727 2.525-1.535 2.525-2v-3.39a10.706 10.706 0 0 1-1.692.825A23.49 23.49 0 0 1 16 18.74a23.49 23.49 0 0 1-8.271-1.348a10.829 10.829 0 0 1-1.692-.825v3.393c0 .466.663 1.271 2.525 2.001ZM16 30c5.5 0 9.963-1.744 9.963-3.894v-2.837a10.5 10.5 0 0 1-1.535.762l-.157.063A23.487 23.487 0 0 1 16 25.445a23.422 23.422 0 0 1-8.271-1.351c-.054-.02-.106-.043-.157-.063a10.5 10.5 0 0 1-1.535-.762v2.837C6.037 28.256 10.5 30 16 30Z"/><ellipse cx="16" cy="5.894" fill="#ffda44" rx="9.963" ry="3.894"/>`}})),eH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ff3e00" d="M26.47 5.7a8.973 8.973 0 0 0-11.793-2.454L7.96 7.4a7.461 7.461 0 0 0-3.481 5.009a7.686 7.686 0 0 0 .8 5.058a7.358 7.358 0 0 0-1.151 2.8a7.789 7.789 0 0 0 1.4 6.028a8.977 8.977 0 0 0 11.794 2.458L24.04 24.6a7.468 7.468 0 0 0 3.481-5.009a7.673 7.673 0 0 0-.8-5.062a7.348 7.348 0 0 0 1.152-2.8A7.785 7.785 0 0 0 26.47 5.7"/><path fill="#fff" d="M14.022 26.64A5.413 5.413 0 0 1 8.3 24.581a4.678 4.678 0 0 1-.848-3.625a4.307 4.307 0 0 1 .159-.61l.127-.375l.344.238a8.76 8.76 0 0 0 2.628 1.274l.245.073l-.025.237a1.441 1.441 0 0 0 .271.968a1.63 1.63 0 0 0 1.743.636a1.512 1.512 0 0 0 .411-.175l6.7-4.154a1.366 1.366 0 0 0 .633-.909a1.407 1.407 0 0 0-.244-1.091a1.634 1.634 0 0 0-1.726-.622a1.509 1.509 0 0 0-.413.176l-2.572 1.584a4.934 4.934 0 0 1-1.364.582a5.415 5.415 0 0 1-5.727-2.06a4.678 4.678 0 0 1-.831-3.628A4.507 4.507 0 0 1 9.9 10.09l6.708-4.154a4.932 4.932 0 0 1 1.364-.581A5.413 5.413 0 0 1 23.7 7.414a4.679 4.679 0 0 1 .848 3.625a4.272 4.272 0 0 1-.159.61l-.127.375l-.344-.237a8.713 8.713 0 0 0-2.628-1.274l-.245-.074l.025-.237a1.438 1.438 0 0 0-.272-.968a1.629 1.629 0 0 0-1.725-.622a1.484 1.484 0 0 0-.411.176l-6.722 4.14a1.353 1.353 0 0 0-.631.908a1.394 1.394 0 0 0 .244 1.092a1.634 1.634 0 0 0 1.726.621a1.538 1.538 0 0 0 .413-.175l2.562-1.585a4.9 4.9 0 0 1 1.364-.581a5.417 5.417 0 0 1 5.728 2.059a4.681 4.681 0 0 1 .843 3.625a4.5 4.5 0 0 1-2.089 3.013l-6.707 4.154a4.9 4.9 0 0 1-1.364.581"/>`}})),tH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M7.674 14.488a2.218 2.218 0 1 0 0 3.137h16.652a2.218 2.218 0 1 0 0-3.137Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M11.222 9.06A2.218 2.218 0 1 0 9 11.278l11.778 11.774A2.218 2.218 0 1 0 23 20.834Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M17.568 7.73a2.218 2.218 0 1 0-3.137 0v16.652a2.218 2.218 0 1 0 3.137 0Z"/><path fill="#ffb13b" stroke="#000" stroke-width="3.73" d="M23 11.278a2.218 2.218 0 1 0-2.222-2.218L9 20.834a2.218 2.218 0 1 0 2.218 2.218Z"/><path fill="#ffb13b" d="M7.674 14.488a2.218 2.218 0 1 0 0 3.137h16.652a2.218 2.218 0 1 0 0-3.137Z"/><path fill="#ffb13b" d="M11.222 9.06A2.218 2.218 0 1 0 9 11.278l11.778 11.774A2.218 2.218 0 1 0 23 20.834Z"/><path fill="#ffb13b" d="M17.568 7.73a2.218 2.218 0 1 0-3.137 0v16.652a2.218 2.218 0 1 0 3.137 0Z"/><path fill="#ffb13b" d="M23 11.278a2.218 2.218 0 1 0-2.222-2.218L9 20.834a2.218 2.218 0 1 0 2.218 2.218Z"/><path d="M2 16.056h28v9.894a4.035 4.035 0 0 1-4.106 4.106H6.106A4.035 4.035 0 0 1 2 25.95Z"/><path fill="#fff" d="M6.2 23.045a3.628 3.628 0 1 1 6.2-2.565h-2.13a1.5 1.5 0 1 0-2.57 1.061a1.6 1.6 0 0 0 1.062.441a4.118 4.118 0 0 1 2.566 1.063a3.628 3.628 0 1 1-6.194 2.565h2.13a1.5 1.5 0 1 0 2.566-1.06a1.948 1.948 0 0 0-1.063-.44A4.465 4.465 0 0 1 6.2 23.045Zm13.451-6.193L17.085 29.24H14.96L12.4 16.852h2.12l1.5 7.255l1.5-7.255Zm3.629 5.131h3.628v3.628a3.628 3.628 0 1 1-7.257 0V20.48a3.628 3.628 0 0 1 7.257 0h-2.125a1.5 1.5 0 1 0-3.005 0v5.13a1.5 1.5 0 0 0 3.005 0v-1.5h-1.5v-2.127Z"/>`}})),nH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeSwift0" x1="-134.494" x2="-134.497" y1="-171.82" y2="-171.89" gradientTransform="matrix(240 0 0 -205.6 32295 -35312.585)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f88535"/><stop offset="1" stop-color="#fd2221"/></linearGradient></defs><path fill="url(#vscodeIconsFileTypeSwift0)" d="M19.422 4.007s6.217 3.554 7.844 9.2c1.466 5.1.292 7.534.292 7.534a8.915 8.915 0 0 1 1.742 2.8a4.825 4.825 0 0 1 .29 4.453s-.1-2.08-3.2-2.511c-2.841-.4-3.874 2.366-9.3 2.232A18.435 18.435 0 0 1 2 19.354C4.651 20.8 8.124 23.045 12.449 22.7s5.228-1.674 5.228-1.674A66.9 66.9 0 0 1 4.891 7.643c3.4 2.845 11.822 8.507 11.626 8.363A75.826 75.826 0 0 1 8.092 6.24s12.636 10.389 13.653 10.323c.418-.861 2.579-5.318-2.324-12.557Z"/>`}})),rH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#44a8b3" d="M9 13.7q1.4-5.6 7-5.6c5.6 0 6.3 4.2 9.1 4.9q2.8.7 4.9-2.1q-1.4 5.6-7 5.6c-5.6 0-6.3-4.2-9.1-4.9q-2.8-.7-4.9 2.1Zm-7 8.4q1.4-5.6 7-5.6c5.6 0 6.3 4.2 9.1 4.9q2.8.7 4.9-2.1q-1.4 5.6-7 5.6c-5.6 0-6.3-4.2-9.1-4.9q-2.8-.7-4.9 2.1Z"/>`}})),iH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#c2c2c2" d="M22.038 2H6.375a1.755 1.755 0 0 0-1.75 1.75v24.5A1.755 1.755 0 0 0 6.375 30h19.25a1.755 1.755 0 0 0 1.75-1.75V6.856Zm.525 2.844l1.663 1.531h-1.663ZM6.375 28.25V3.75h14.438v4.375h4.813V28.25Z"/><path fill="#829ec2" d="M8.125 15.097h13.076v1.75H8.125zm0 9.342h9.762v1.75H8.125zm0-4.676h15.75v1.75H8.125zm0-9.533h15.75v1.75H8.125z"/>`}})),aH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#7f7f7f" d="M22.76 6.83v3.25h-5v15.09h-3.5V10.08h-5V6.83Z"/><path fill="#bfbfbf" d="M2 2h6.2v3.09H5.34v21.8H8.2V30H2Zm28 28h-6.2v-3.09h2.86V5.11H23.8V2H30Z"/>`}})),oH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#007acc" d="M23.827 8.243a4.424 4.424 0 0 1 2.223 1.281a5.853 5.853 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.014 2.014 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.1 3.636 1.817 4.31 2.843a5.158 5.158 0 0 1 .416 4.333a4.764 4.764 0 0 1-3.932 2.815a10.9 10.9 0 0 1-2.708-.028a6.531 6.531 0 0 1-3.616-1.884a6.278 6.278 0 0 1-.926-1.371a2.655 2.655 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.771 4.771 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.4-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.687 4.687 0 0 1-.976-1.777a7.116 7.116 0 0 1-.062-2.268a4.332 4.332 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084Zm-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a13.986 13.986 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z"/><path fill="#99b8c4" d="m27.075 25.107l.363-.361c1.68.055 1.706 0 1.78-.177l.462-1.124l.034-.107l-.038-.093c-.02-.049-.081-.2-1.13-1.2v-.526c1.211-1.166 1.185-1.226 1.116-1.4l-.46-1.136c-.069-.17-.1-.237-1.763-.191l-.364-.367a8.138 8.138 0 0 0-.057-1.657l-.047-.106l-1.2-.525c-.177-.081-.239-.11-1.372 1.124l-.509-.008c-1.167-1.245-1.222-1.223-1.4-1.152l-1.115.452c-.175.071-.236.1-.169 1.79l-.36.359c-1.68-.055-1.7 0-1.778.177L18.606 20l-.036.108l.038.094c.02.048.078.194 1.13 1.2v.525c-1.211 1.166-1.184 1.226-1.115 1.4l.459 1.137c.07.174.1.236 1.763.192l.363.377a8.169 8.169 0 0 0 .055 1.654l.047.107l1.208.528c.176.073.236.1 1.366-1.13l.509.006c1.168 1.247 1.228 1.223 1.4 1.154l1.113-.45c.176-.075.237-.102.169-1.795Zm-4.788-2.632a2 2 0 1 1 2.618 1.14a2.023 2.023 0 0 1-2.618-1.14Z"/>`}})),sH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#007acc" d="M23.827 8.243a4.424 4.424 0 0 1 2.223 1.281a5.853 5.853 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.014 2.014 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.095 3.636 1.817 4.31 2.843a5.158 5.158 0 0 1 .416 4.333a4.764 4.764 0 0 1-3.932 2.815a10.9 10.9 0 0 1-2.708-.028a6.531 6.531 0 0 1-3.616-1.884a6.278 6.278 0 0 1-.926-1.371a2.655 2.655 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.771 4.771 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.395-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.687 4.687 0 0 1-.976-1.777a7.116 7.116 0 0 1-.062-2.268a4.332 4.332 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084Zm-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a13.986 13.986 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z"/>`}})),cH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#e75749" d="M4.5 2.375A2.562 2.562 0 0 1 5.861 2h20.366a2.545 2.545 0 0 1 2.423 1.951a3.37 3.37 0 0 1 .072.862v11.176h-1.573a1.814 1.814 0 0 0-.22.022a5.236 5.236 0 0 0-.581-.011c-.3.007-.61-.014-.914.014a2.275 2.275 0 0 0-.4-.02h-4.739c-.2 0-.392.008-.587-.01l.1-.065l-6.353-3.813v3.889c-2.213-.005-4.427 0-6.64 0a2.274 2.274 0 0 0-.251.021c-.212-.032-.427-.016-.642-.016c-.284.006-.57-.015-.853.015a2.052 2.052 0 0 0-.253-.022H3.275c.006-3.635 0-7.27 0-10.9a4.786 4.786 0 0 1 .071-1.131A2.541 2.541 0 0 1 4.5 2.375Zm.54 2.188a.639.639 0 0 0-.489.606v1.316a.639.639 0 0 0 .627.6h1.309a.638.638 0 0 0 .6-.608c.005-.426 0-.853 0-1.279a.644.644 0 0 0-.329-.575a.708.708 0 0 0-.358-.078H5.264a1.081 1.081 0 0 0-.224.018Zm20.341 0a.639.639 0 0 0-.474.607v1.306a.638.638 0 0 0 .6.608c.436.005.872 0 1.308 0a.639.639 0 0 0 .627-.606c.006-.438 0-.876 0-1.314a.638.638 0 0 0-.594-.621c-.348-.009-.7 0-1.045 0a1.98 1.98 0 0 0-.422.024ZM5.042 8.38a.637.637 0 0 0-.452.4a1.078 1.078 0 0 0-.041.386v1.135a.637.637 0 0 0 .6.6c.4.008.795 0 1.192 0a.826.826 0 0 0 .395-.065a.641.641 0 0 0 .36-.574V8.983a.638.638 0 0 0-.6-.624c-.338-.008-.677 0-1.016 0a2.385 2.385 0 0 0-.438.021Zm20.338 0a.637.637 0 0 0-.433.4a1.072 1.072 0 0 0-.041.387v1.131a.638.638 0 0 0 .608.607c.406.006.812 0 1.218 0a.739.739 0 0 0 .38-.078a.64.64 0 0 0 .335-.558V8.985a.637.637 0 0 0-.593-.622c-.349-.009-.7 0-1.047 0a1.928 1.928 0 0 0-.428.022ZM5.041 12.2a.639.639 0 0 0-.491.608c0 .438-.005.877 0 1.315a.638.638 0 0 0 .627.6h1.3a.638.638 0 0 0 .608-.607v-1.307a.638.638 0 0 0-.605-.626c-.348-.007-.7 0-1.045 0a2.12 2.12 0 0 0-.394.017Zm20.335.006a.635.635 0 0 0-.43.394a1.06 1.06 0 0 0-.041.386v1.131a.638.638 0 0 0 .607.608c.435.005.87 0 1.306 0a.639.639 0 0 0 .628-.605c.006-.438 0-.876 0-1.313a.637.637 0 0 0-.592-.622c-.349-.01-.7 0-1.046 0a1.908 1.908 0 0 0-.431.015Z"/><path fill="#fff" d="M13.458 12.1q3.176 1.908 6.353 3.813l-.1.065q-3.127 1.872-6.251 3.748V15.99c-.001-1.295-.004-2.59-.002-3.89Z"/><path fill="#c0392b" d="M3.275 15.988h1.541a2.052 2.052 0 0 1 .253.022a.645.645 0 0 0-.409.273a.883.883 0 0 0-.111.518v1.045a.686.686 0 0 0 .685.689h1.192a.68.68 0 0 0 .657-.569c.008-.447 0-.9 0-1.343a.632.632 0 0 0-.521-.613a2.274 2.274 0 0 1 .251-.021h6.64v3.736q3.127-1.871 6.251-3.748c.2.018.391.007.587.01h4.741a2.275 2.275 0 0 1 .4.02a.637.637 0 0 0-.475.385a.983.983 0 0 0-.045.407v1.014a.677.677 0 0 0 .691.719h1.16a.684.684 0 0 0 .686-.658v-.984a1.074 1.074 0 0 0-.1-.589a.642.642 0 0 0-.42-.292a1.814 1.814 0 0 1 .22-.022h1.573c.011 1.721 0 3.443 0 5.165v6.293a2.567 2.567 0 0 1-.612 1.651a2.539 2.539 0 0 1-1.563.868a7.534 7.534 0 0 1-.981.033H6.724a9.27 9.27 0 0 1-1.368-.048a2.557 2.557 0 0 1-2-1.846a2.825 2.825 0 0 1-.09-.746V16.891c.007-.3-.002-.602.009-.903Zm1.795 3.843a.613.613 0 0 0-.386.234a.761.761 0 0 0-.134.464v1.162a.685.685 0 0 0 .686.658h1.283a.687.687 0 0 0 .568-.716v-1.191a.617.617 0 0 0-.2-.458a.712.712 0 0 0-.487-.17H5.264a1.039 1.039 0 0 0-.194.017Zm20.366 0a.62.62 0 0 0-.522.58v1.222a.676.676 0 0 0 .69.718c.428 0 .857.005 1.285 0a.7.7 0 0 0 .562-.684v-1.013a.9.9 0 0 0-.123-.568a.661.661 0 0 0-.532-.267h-.954a2.246 2.246 0 0 0-.406.011ZM5.071 23.648a.609.609 0 0 0-.4.249a.766.766 0 0 0-.124.448v1.132a.7.7 0 0 0 .6.688h1.376a.687.687 0 0 0 .567-.717v-1.189a.617.617 0 0 0-.2-.459a.71.71 0 0 0-.484-.17H5.265a1.028 1.028 0 0 0-.194.018Zm20.362 0a.616.616 0 0 0-.492.427a.99.99 0 0 0-.029.33V25.6a.681.681 0 0 0 .656.567h1.193a.689.689 0 0 0 .686-.719v-1.164a.657.657 0 0 0-.286-.545a1.461 1.461 0 0 0-.787-.11c-.312.01-.629-.02-.94.018Z"/>`}})),lH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<g fill="none"><path fill="url(#vscodeIconsFileTypeVite0)" d="m29.884 6.146l-13.142 23.5a.714.714 0 0 1-1.244.005L2.096 6.148a.714.714 0 0 1 .746-1.057l13.156 2.352a.714.714 0 0 0 .253 0l12.881-2.348a.714.714 0 0 1 .752 1.05z"/><path fill="url(#vscodeIconsFileTypeVite1)" d="M22.264 2.007L12.54 3.912a.357.357 0 0 0-.288.33l-.598 10.104a.357.357 0 0 0 .437.369l2.707-.625a.357.357 0 0 1 .43.42l-.804 3.939a.357.357 0 0 0 .454.413l1.672-.508a.357.357 0 0 1 .454.414l-1.279 6.187c-.08.387.435.598.65.267l.143-.222l7.925-15.815a.357.357 0 0 0-.387-.51l-2.787.537a.357.357 0 0 1-.41-.45l1.818-6.306a.357.357 0 0 0-.412-.45z"/><defs><linearGradient id="vscodeIconsFileTypeVite0" x1="6" x2="235" y1="33" y2="344" gradientTransform="translate(1.34 1.894) scale(.07142)" gradientUnits="userSpaceOnUse"><stop stop-color="#41D1FF"/><stop offset="1" stop-color="#BD34FE"/></linearGradient><linearGradient id="vscodeIconsFileTypeVite1" x1="194.651" x2="236.076" y1="8.818" y2="292.989" gradientTransform="translate(1.34 1.894) scale(.07142)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFEA83"/><stop offset=".083" stop-color="#FFDD35"/><stop offset="1" stop-color="#FFA800"/></linearGradient></defs></g>`}})),uH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#fcc72b" d="m22.86 11.09l-6.55 9.46a.58.58 0 0 1-.28.21a.55.55 0 0 1-.36 0a.56.56 0 0 1-.29-.21a.59.59 0 0 1-.09-.35l.26-5.2l-4.23-.9a.55.55 0 0 1-.24-.12a.5.5 0 0 1-.16-.22a.5.5 0 0 1 0-.27a.46.46 0 0 1 .1-.25l6.54-9.46a.58.58 0 0 1 .29-.22a.53.53 0 0 1 .35 0a.58.58 0 0 1 .29.22a.52.52 0 0 1 .09.34l-.26 5.22l4.23.9a.58.58 0 0 1 .25.12a.69.69 0 0 1 .16.22a.62.62 0 0 1-.06.53Z"/><path fill="#729b1b" d="M16 28.49a1.44 1.44 0 0 1-.5-.1a1.3 1.3 0 0 1-.43-.29l-6.19-6.19A1.28 1.28 0 0 1 8.5 21a1.3 1.3 0 0 1 1.32-1.32a1.32 1.32 0 0 1 .94.38L16 25.29l11.43-11.43a1.32 1.32 0 0 1 .94-.38a1.31 1.31 0 0 1 .93.39a1.29 1.29 0 0 1 .39.93a1.34 1.34 0 0 1-.38.93L16.94 28.1a1.42 1.42 0 0 1-.43.29a1.45 1.45 0 0 1-.51.1Z"/><path fill="#729b1b" fill-opacity=".5" d="M16 28.49a1.44 1.44 0 0 0 .5-.1a1.3 1.3 0 0 0 .43-.29l6.19-6.19a1.28 1.28 0 0 0 .38-.91a1.3 1.3 0 0 0-1.32-1.32a1.32 1.32 0 0 0-.94.38L16 25.29L4.57 13.86a1.32 1.32 0 0 0-.94-.38a1.31 1.31 0 0 0-.93.39a1.29 1.29 0 0 0-.39.93a1.34 1.34 0 0 0 .38.93L15.06 28.1a1.42 1.42 0 0 0 .43.29a1.45 1.45 0 0 0 .51.1Z"/>`}})),dH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#41b883" d="M24.4 3.925H30l-14 24.15L2 3.925h10.71l3.29 5.6l3.22-5.6Z"/><path fill="#41b883" d="m2 3.925l14 24.15l14-24.15h-5.6L16 18.415L7.53 3.925Z"/><path fill="#35495e" d="M7.53 3.925L16 18.485l8.4-14.56h-5.18L16 9.525l-3.29-5.6Z"/>`}})),fH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeWord0" x1="4.494" x2="13.832" y1="-1712.086" y2="-1695.914" gradientTransform="translate(0 1720)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2368c4"/><stop offset=".5" stop-color="#1a5dbe"/><stop offset="1" stop-color="#1146ac"/></linearGradient></defs><path fill="#41a5ee" d="M28.806 3H9.705a1.192 1.192 0 0 0-1.193 1.191V9.5l11.069 3.25L30 9.5V4.191A1.192 1.192 0 0 0 28.806 3Z"/><path fill="#2b7cd3" d="M30 9.5H8.512V16l11.069 1.95L30 16Z"/><path fill="#185abd" d="M8.512 16v6.5l10.418 1.3L30 22.5V16Z"/><path fill="#103f91" d="M9.705 29h19.1A1.192 1.192 0 0 0 30 27.809V22.5H8.512v5.309A1.192 1.192 0 0 0 9.705 29Z"/><path d="M16.434 8.2H8.512v16.25h7.922a1.2 1.2 0 0 0 1.194-1.191V9.391A1.2 1.2 0 0 0 16.434 8.2Z" opacity=".1"/><path d="M15.783 8.85H8.512V25.1h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.783 8.85H8.512V23.8h7.271a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path d="M15.132 8.85h-6.62V23.8h6.62a1.2 1.2 0 0 0 1.194-1.191V10.041a1.2 1.2 0 0 0-1.194-1.191Z" opacity=".2"/><path fill="url(#vscodeIconsFileTypeWord0)" d="M3.194 8.85h11.938a1.193 1.193 0 0 1 1.194 1.191v11.918a1.193 1.193 0 0 1-1.194 1.191H3.194A1.192 1.192 0 0 1 2 21.959V10.041A1.192 1.192 0 0 1 3.194 8.85Z"/><path fill="#fff" d="M6.9 17.988c.023.184.039.344.046.481h.028c.01-.13.032-.287.065-.47s.062-.338.089-.465l1.255-5.407h1.624l1.3 5.326a7.761 7.761 0 0 1 .162 1h.022a7.6 7.6 0 0 1 .135-.975l1.039-5.358h1.477l-1.824 7.748h-1.727l-1.237-5.126q-.054-.222-.122-.578t-.084-.52h-.021q-.021.189-.084.561c-.042.249-.075.432-.1.552L7.78 19.871H6.024L4.19 12.127h1.5l1.131 5.418a4.469 4.469 0 0 1 .079.443Z"/>`}})),pH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#f1662a" d="m20.42 21.157l2.211 2.211L30 16l-7.369-7.369l-2.211 2.212L25.58 16Zm-8.84-10.314L9.369 8.631L2 16l7.369 7.369l2.211-2.211L6.42 16Zm5.831-3.166l1.6.437l-4.42 16.209l-1.6-.437l4.42-16.209Z"/>`}})),mH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#ffe885" d="M2 12.218c.755 0 1.51-.008 2.264 0l.053.038l2.761 2.758c.891-.906 1.8-1.794 2.7-2.7c.053-.052.11-.113.192-.1h1.823a1.4 1.4 0 0 1 .353.019c-.7.67-1.377 1.369-2.069 2.05L5.545 18.8c-.331.324-.648.663-.989.975c-.754.022-1.511.007-2.266.007c1.223-1.209 2.431-2.433 3.658-3.637c-1.321-1.304-2.63-2.62-3.948-3.927Zm10.7 0h1.839v7.566c-.611 0-1.222.012-1.832-.008v-4.994c-1.6 1.607-3.209 3.2-4.811 4.8c-.089.08-.166.217-.305.194c-.824-.006-1.649 0-2.474 0Q8.916 16 12.7 12.218Zm2.258.002c.47-.009.939 0 1.409 0c.836.853 1.69 1.689 2.536 2.532q1.268-1.267 2.539-2.532h1.4q-.008 3.784 0 7.567c-.471 0-.943.006-1.414 0q.008-2.387 0-4.773c-.844.843-1.676 1.7-2.526 2.536c-.856-.835-1.687-1.695-2.532-2.541c0 1.594-.006 3.188.006 4.781c-.472 0-.943.005-1.415 0q-.003-3.79-.003-7.57Zm8.301-.003c.472 0 .944-.007 1.416 0q-.007 3.083 0 6.166h3.782c.063.006.144-.012.191.045c.448.454.907.9 1.353 1.354q-3.371.007-6.741 0q.007-3.782-.001-7.565Z"/>`}})),hH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<path fill="#2188b6" d="M28.208 24.409a10.493 10.493 0 0 0-3.959 1.822a23.743 23.743 0 0 1-5.835 2.642a1.632 1.632 0 0 1-.983.55a62.228 62.228 0 0 1-6.447.577c-1.163.009-1.876-.3-2.074-.776a1.573 1.573 0 0 1 .866-2.074a3.759 3.759 0 0 1-.514-.379c-.171-.171-.352-.514-.406-.388c-.225.55-.343 1.894-.947 2.5c-.83.839-2.4.559-3.328.072c-1.019-.541.072-1.813.072-1.813a.73.73 0 0 1-.992-.343a4.847 4.847 0 0 1-.667-2.949a5.374 5.374 0 0 1 1.749-2.895a9.334 9.334 0 0 1 .658-4.4a10.445 10.445 0 0 1 3.165-3.661S6.628 10.747 7.35 8.817c.469-1.262.658-1.253.812-1.308a3.633 3.633 0 0 0 1.452-.857a5.265 5.265 0 0 1 4.41-1.7S15.2 1.4 16.277 2.09a18.349 18.349 0 0 1 1.533 2.886s1.281-.748 1.425-.469a11.334 11.334 0 0 1 .523 6.132a14.01 14.01 0 0 1-2.6 5.411c-.135.225 1.551.938 2.615 3.887c.983 2.7.108 4.96.262 5.212c.027.045.036.063.036.063s1.127.09 3.391-1.308a8.5 8.5 0 0 1 4.277-1.604a1.081 1.081 0 0 1 .469 2.11Z"/>`}})),gH=n((e=>{e.__esModule=!0,e.default={width:32,height:32,body:`<defs><linearGradient id="vscodeIconsFileTypeZip0" x1="17.65" x2="21.099" y1="26.056" y2="26.056" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#4d4d4d"/><stop offset=".5" stop-color="#fff"/><stop offset="1" stop-color="#4d4d4d"/></linearGradient><linearGradient id="vscodeIconsFileTypeZip1" x1="17.65" x2="21.099" y1="23.756" y2="23.756" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip2" x1="17.65" x2="21.099" y1="21.456" y2="21.456" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip3" x1="17.65" x2="21.099" y1="19.156" y2="19.156" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip4" x1="17.65" x2="21.099" y1="16.857" y2="16.857" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip5" x1="17.65" x2="21.099" y1="14.557" y2="14.557" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip6" x1="17.65" x2="21.099" y1="12.257" y2="12.257" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip7" x1="17.65" x2="21.099" y1="9.957" y2="9.957" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip8" x1="17.65" x2="21.099" y1="7.657" y2="7.657" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZip9" x1="16.237" x2="19.686" y1="27.217" y2="27.217" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipa" x1="16.237" x2="19.686" y1="24.918" y2="24.918" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipb" x1="16.237" x2="19.686" y1="22.618" y2="22.618" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipc" x1="16.237" x2="19.686" y1="20.318" y2="20.318" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipd" x1="16.237" x2="19.686" y1="18.018" y2="18.018" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipe" x1="17.65" x2="21.099" y1="28.356" y2="28.356" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipf" x1="16.237" x2="19.686" y1="15.718" y2="15.718" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipg" x1="16.237" x2="19.686" y1="13.419" y2="13.419" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZiph" x1="16.237" x2="19.686" y1="11.119" y2="11.119" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipi" x1="16.237" x2="19.686" y1="8.819" y2="8.819" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipj" x1="16.237" x2="19.686" y1="29.514" y2="29.514" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipk" x1="16.985" x2="20.446" y1="11.196" y2="11.196" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipl" x1="18.096" x2="19.336" y1="5.329" y2="5.329" href="#vscodeIconsFileTypeZip0"/><linearGradient id="vscodeIconsFileTypeZipm" x1="16.029" x2="21.403" y1="5.591" y2="5.591" href="#vscodeIconsFileTypeZip0"/></defs><path fill="#c09553" d="M27.667 27.667V17.333L23 15V2H4.333v28h23.334Zm-4.667 0v-9.111l2.333 1.222v7.889Z"/><path fill="url(#vscodeIconsFileTypeZip0)" d="M17.65 25.559h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip1)" d="M17.65 23.26h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip2)" d="M17.65 20.96h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip3)" d="M17.65 18.66h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip4)" d="M17.65 16.36h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip5)" d="M17.65 14.06h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip6)" d="M17.65 11.76h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip7)" d="M17.65 9.461h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip8)" d="M17.65 7.161h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZip9)" d="M16.237 26.721h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipa)" d="M16.237 24.421h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipb)" d="M16.237 22.121h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipc)" d="M16.237 19.821h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipd)" d="M16.237 17.522h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipe)" d="M17.65 27.859h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipf)" d="M16.237 15.222h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipg)" d="M16.237 12.922h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZiph)" d="M16.237 10.622h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipi)" d="M16.237 8.322h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipj)" d="M16.237 29.018h3.45v.993h-3.45z"/><path fill="url(#vscodeIconsFileTypeZipk)" d="M20.1 5.911a.554.554 0 0 0-.548-.53h-.009v.557h.092l.206 2.514h-2.252l.211-2.514h.094v-.557h-.044a.552.552 0 0 0-.547.53l-.314 10.569a.513.513 0 0 0 .515.531h2.432a.512.512 0 0 0 .513-.531Zm-1.384 10.5a1.171 1.171 0 1 1 1.171-1.171a1.171 1.171 0 0 1-1.171 1.168Z"/><path fill="url(#vscodeIconsFileTypeZipl)" d="M18.096 3.802h1.24v3.054h-1.24z"/><path fill="url(#vscodeIconsFileTypeZipm)" d="M21.4 4.56a2.549 2.549 0 0 0-2.549-2.549h-.276a2.55 2.55 0 0 0-2.436 3.3v.006a7.986 7.986 0 0 1 .261 2.561a1.811 1.811 0 0 0 .641 1.271l.109-3.441a.593.593 0 0 1 .6-.551h.135v-1.57h1.653v1.57h.1a.6.6 0 0 1 .605.551l.121 3.462a1.813 1.813 0 0 0 .666-1.292V7.72a7.693 7.693 0 0 1 .236-2.359a2.543 2.543 0 0 0 .134-.801Z"/>`}})),_H=e(hV(),1),vH=e(gV(),1),yH=e(_V(),1),bH=e(vV(),1),xH=e(yV(),1),SH=e(bV(),1),CH=e(xV(),1),wH=e(SV(),1),TH=e(CV(),1),EH=e(wV(),1),DH=e(TV(),1),OH=e(EV(),1),kH=e(DV(),1),AH=e(OV(),1),jH=e(kV(),1),MH=e(AV(),1),NH=e(jV(),1),PH=e(MV(),1),FH=e(NV(),1),IH=e(PV(),1),LH=e(FV(),1),RH=e(IV(),1),zH=e(LV(),1),BH=e(RV(),1),VH=e(zV(),1),HH=e(BV(),1),UH=e(VV(),1),WH=e(HV(),1),GH=e(UV(),1),KH=e(WV(),1),qH=e(GV(),1),JH=e(KV(),1),YH=e(qV(),1),XH=e(JV(),1),ZH=e(YV(),1),QH=e(XV(),1),$H=e(ZV(),1),eU=e(QV(),1),tU=e($V(),1),nU=e(eH(),1),rU=e(tH(),1),iU=e(nH(),1),aU=e(rH(),1),oU=e(iH(),1),sU=e(aH(),1),cU=e(oH(),1),lU=e(sH(),1),uU=e(cH(),1),dU=e(lH(),1),fU=e(uH(),1),pU=e(dH(),1),mU=e(fH(),1),hU=e(pH(),1),gU=e(mH(),1),_U=e(hH(),1),vU=e(gH(),1),yU=[{icon:wH.default,name:`docker`,pattern:/^(dockerfile|\.dockerignore)$/},{icon:TH.default,name:`dotenv`,pattern:/^\.env(?:\.|$)/},{icon:kH.default,name:`git`,pattern:/^\.git(?:attributes|ignore|modules)$/},{icon:BH.default,name:`makefile`,pattern:/^makefile$/},{icon:RH.default,name:`license`,pattern:/^licen[cs]e(?:\.|$)/},{icon:VH.default,name:`markdown`,pattern:/^readme(?:\.|$)/},{icon:HH.default,name:`npm`,pattern:/^package(?:-lock)?\.json$/},{icon:GH.default,name:`pnpm`,pattern:/^(pnpm-lock\.yaml|pnpm-workspace\.yaml)$/},{icon:_U.default,name:`yarn`,pattern:/^yarn\.lock$/},{icon:yH.default,name:`bun`,pattern:/^bun\.lockb?$/},{icon:cU.default,name:`tsconfig`,pattern:/^tsconfig(?:\..+)?\.json$/},{icon:dU.default,name:`vite`,pattern:/^vite\.config\./},{icon:fU.default,name:`vitest`,pattern:/^vitest(?:\..+)?\.config\./},{icon:aU.default,name:`tailwind`,pattern:/^tailwind\.config\./},{icon:EH.default,name:`eslint`,pattern:/^(eslint\.config\.|\.eslintrc)/},{icon:qH.default,name:`prettier`,pattern:/^(prettier\.config\.|\.prettierrc)/}],bU=[{icon:XH.default,name:`react-typescript`,extensions:[`tsx`]},{icon:YH.default,name:`react-javascript`,extensions:[`jsx`]},{icon:lU.default,name:`typescript`,extensions:[`ts`,`mts`,`cts`]},{icon:FH.default,name:`javascript`,extensions:[`js`,`mjs`,`cjs`]},{icon:IH.default,name:`json`,extensions:[`json`,`json5`,`jsonc`]},{icon:VH.default,name:`markdown`,extensions:[`md`,`mdx`]},{icon:MH.default,name:`html`,extensions:[`html`,`htm`]},{icon:CH.default,name:`css`,extensions:[`css`,`pcss`,`less`]},{icon:$H.default,name:`sass`,extensions:[`sass`,`scss`]},{icon:pU.default,name:`vue`,extensions:[`vue`]},{icon:nU.default,name:`svelte`,extensions:[`svelte`]},{icon:JH.default,name:`python`,extensions:[`py`,`pyw`]},{icon:AH.default,name:`go`,extensions:[`go`]},{icon:QH.default,name:`rust`,extensions:[`rs`]},{icon:PH.default,name:`java`,extensions:[`java`]},{icon:LH.default,name:`kotlin`,extensions:[`kt`,`kts`]},{icon:iU.default,name:`swift`,extensions:[`swift`]},{icon:xH.default,name:`cpp`,extensions:[`c`,`cc`,`cpp`,`h`,`hpp`]},{icon:SH.default,name:`csharp`,extensions:[`cs`]},{icon:WH.default,name:`php`,extensions:[`php`]},{icon:ZH.default,name:`ruby`,extensions:[`rb`]},{icon:zH.default,name:`lua`,extensions:[`lua`]},{icon:eU.default,name:`shell`,extensions:[`sh`,`bash`,`zsh`,`fish`,`ps1`]},{icon:jH.default,name:`graphql`,extensions:[`graphql`,`gql`]},{icon:gU.default,name:`yaml`,extensions:[`yaml`,`yml`]},{icon:sU.default,name:`toml`,extensions:[`toml`]},{icon:hU.default,name:`xml`,extensions:[`xml`]},{icon:tU.default,name:`sql`,extensions:[`sql`,`sqlite`,`db`]},{icon:rU.default,name:`svg`,extensions:[`svg`]},{icon:NH.default,name:`image`,extensions:[`avif`,`bmp`,`gif`,`heic`,`ico`,`jpeg`,`jpg`,`png`,`tif`,`tiff`,`webp`]},{icon:vH.default,name:`audio`,extensions:[`aac`,`flac`,`m4a`,`mp3`,`ogg`,`opus`,`wav`,`weba`]},{icon:uU.default,name:`video`,extensions:[`avi`,`m4v`,`mkv`,`mov`,`mp4`,`webm`,`wmv`]},{icon:UH.default,name:`pdf`,extensions:[`pdf`]},{icon:mU.default,name:`word`,extensions:[`doc`,`docx`,`odt`,`rtf`]},{icon:DH.default,name:`excel`,extensions:[`csv`,`numbers`,`ods`,`tsv`,`xls`,`xlsx`]},{icon:KH.default,name:`powerpoint`,extensions:[`odp`,`ppt`,`pptx`]},{icon:vU.default,name:`archive`,extensions:[`7z`,`bz2`,`gz`,`rar`,`tar`,`tgz`,`zip`]},{icon:OH.default,name:`font`,extensions:[`eot`,`otf`,`ttf`,`woff`,`woff2`]},{icon:bH.default,name:`config`,extensions:[`cfg`,`conf`,`ini`,`properties`]},{icon:oU.default,name:`text`,extensions:[`log`,`txt`]}],xU={icon:_H.default,name:`default`};function SU(e){return e.trim().split(/[\\/]/).filter(Boolean).pop()??e.trim()}function CU(e){return/\.([a-z0-9]{1,16})$/i.exec(e)?.[1]?.toLowerCase()??``}function wU(e){let t=SU(e).toLowerCase(),n=yU.find(({pattern:e})=>e.test(t));if(n)return n;let r=CU(t);return bU.find(({extensions:e})=>e.includes(r))??xU}function TU(e){let t=e;return`body`in t?t:t.default}function EU({className:e,fileName:t,size:n=`default`}){let r=wU(t);return(0,H.jsx)(mV,{"aria-hidden":`true`,"data-file-type-icon":r.name,icon:TU(r.icon),className:u(`shrink-0`,n===`compact`?`h-3.5 w-3.5`:`h-4 w-4`,e)})}function DU({agentId:e,fileName:t,kind:n}){return n===`overview`?(0,H.jsx)(gee,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`child-sessions`?(0,H.jsx)(Ka,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`project-files`?(0,H.jsx)(Ha,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`cron`?(0,H.jsx)(Ui,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`continuous-attention`?(0,H.jsx)(Oa,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`}):n===`file`?(0,H.jsx)(EU,{fileName:t??``,size:`compact`}):n===`side-chat-draft`?(0,H.jsx)(to,{className:`h-3.5 w-3.5 shrink-0 text-primary`}):e?(0,H.jsx)(_z,{agentId:e,className:`h-3.5 w-3.5 shrink-0`}):(0,H.jsx)(no,{className:`h-3.5 w-3.5 shrink-0 text-gray-400`})}function OU(e){if(e.kind!==`file`)return;let t=[...e.onAddToChat?[{key:`add-to-chat`,icon:(0,H.jsx)(to,{className:`h-4 w-4`}),label:b(`chatWorkspaceAddToChat`),restoreFocus:!1,onSelect:e.onAddToChat}]:[],...e.alternateViewerAction?[{key:`viewer:${e.alternateViewerAction.viewer}`,icon:e.alternateViewerAction.viewer===`rendered`?(0,H.jsx)(Oa,{className:`h-4 w-4`}):(0,H.jsx)(va,{className:`h-4 w-4`}),label:e.alternateViewerAction.label,onSelect:e.alternateViewerAction.onSelect}]:[]],n=e.onClose?[{key:`close`,icon:(0,H.jsx)(hi,{className:`h-4 w-4`}),label:b(`chatWorkspaceCloseFile`),onSelect:e.onClose}]:[];return[{key:`file`,items:t},{key:`tab`,items:n}]}function kU(e){if(!(e.kind!==`child-session`||!e.sessionKey))return[{key:`session`,items:[{key:`copy-session-id`,label:b(`chatSessionCopyId`),icon:(0,H.jsx)(xa,{className:`h-4 w-4`}),onSelect:()=>void OF(e.sessionKey)}]}]}function AU(e){return e.map(e=>({key:e.key,label:e.title,labelClassName:e.isRenderedPreview?`italic font-normal`:void 0,active:e.active,tooltip:e.tooltip,leadingIcon:(0,H.jsx)(DU,{kind:e.kind,agentId:e.agentId,fileName:e.fileName}),badge:e.kind===`file`&&e.viewMode===`diff`?(0,H.jsx)(`span`,{className:`shrink-0 rounded border border-amber-200 bg-amber-50 px-1 py-0 text-[9px] font-medium uppercase tracking-[0.08em] text-amber-700`,children:b(`chatWorkspaceDiff`)}):null,unreadIndicator:e.showUnreadDot?(0,H.jsx)(`span`,{"aria-label":b(`chatSessionUnread`),className:`h-2 w-2 shrink-0 rounded-full bg-primary`}):null,closeLabel:`${e.kind===`file`?b(`chatWorkspaceCloseFile`):b(`chatWorkspaceCloseTab`)}: ${e.title}`,closePlacement:`leading-hover`,onSelect:e.onSelect,onClose:e.onClose,menuLabel:e.kind===`child-session`?b(`chatSessionMoreActions`):b(`chatWorkspaceFileMoreActions`),menuGroups:e.menuGroups??kU(e)??OU(e)}))}function jU({canGoBack:e,canGoForward:t,isMaximized:n=!1,onClose:r,onGoBack:i,onGoForward:a,onRefreshFile:o,onToggleMaximize:s,tabs:c}){return(0,H.jsx)(ri,{testId:`workspace-tabs-bar`,scrollTestId:`workspace-tabs-scroll`,tabs:AU(c),actions:[{key:`back`,icon:(0,H.jsx)(li,{className:`h-4 w-4`}),label:b(`chatWorkspaceBack`),disabled:!e,onClick:i},{key:`forward`,icon:(0,H.jsx)(si,{className:`h-4 w-4`}),label:b(`chatWorkspaceForward`),disabled:!t,onClick:a},...o?[{key:`refresh-file`,icon:(0,H.jsx)(mi,{className:`h-4 w-4`}),label:b(`chatWorkspaceRefreshFile`),onClick:o}]:[],...s?[{key:`maximize`,icon:n?(0,H.jsx)(Tee,{className:`h-4 w-4`}):(0,H.jsx)($a,{className:`h-4 w-4`}),label:b(n?`chatWorkspaceRestorePanel`:`chatWorkspaceMaximizePanel`),onClick:s}]:[],{key:`close`,icon:(0,H.jsx)(hi,{className:`h-4 w-4`}),label:b(`chatWorkspaceClosePanel`),onClick:r}],scrollClassName:`workspace-horizontal-scrollbar`,actionsClassName:`ml-1 mr-1 self-stretch`})}var MU=[`cmd`,`command`,`query`,`q`,`path`,`url`,`to`,`channel`,`agentId`,`sessionKey`];function NU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function PU(e,t=2400){return e.length<=t?e:`${e.slice(0,t)}\n…`}function FU(e,t=120){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:t<=1?`…`:`${n.slice(0,t-1)}…`}function IU(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(e==null)return``;try{return PU(JSON.stringify(e,null,2))}catch{return String(e)}}function LU(e){if(NU(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return null;try{let e=JSON.parse(t);return NU(e)?e:null}catch{return null}}function RU(e){let t=LU(e);if(!t){let t=IU(e).trim();return t?FU(t,120):void 0}let n=[];for(let e of MU){let r=t[e];if(typeof r==`string`&&r.trim()?n.push(`${e}: ${r.trim()}`):(typeof r==`number`||typeof r==`boolean`)&&n.push(`${e}: ${String(r)}`),n.length>=2)break}if(n.length>0)return FU(n.join(` · `),120)}function zU(e){return typeof e==`string`&&e.trim()?e.trim():null}function BU(e){let t=zU(e.messageId),n=zU(e.excerpt),{role:r}=e;return t&&n&&(r===`assistant`||r===`user`)?{messageId:t,role:r,excerpt:n}:null}function VU(e,t){let n=BU(e.data??{});return n?{kind:P,key:e.tokenKey,label:e.label,rawText:t,...n}:null}function HU(e){let{entry:t,label:n,rawText:r}=e,i=zU(t.key),a=BU(t);return i&&a?{kind:P,key:i,label:n,rawText:r,...a}:null}function UU(e){return zs({tokenKind:o,tokenKey:e.uri,label:e.label,data:{reference:e}})}function WU(e,t){return e.some(e=>e.type===`token`&&e.tokenKind===`system_object`&&e.tokenKey===t.uri&&te(e.data?.reference)?.version===t.version)?Us([...e]):Us([...e,UU(t)])}var GU=`$`,KU=`@panel-app:`,qU=`@project:`,JU=`@file:`,YU=`@folder:`,XU=`@excerpt:`,ZU=`@message-excerpt:`,QU=`@object:`,$U=`@resource:`;function eW(e){let{label:t,tokenKey:n,tokenKind:r}=e;return r===`skill`?`${GU}${t?.trim()||n}`:r===`panel_app`?`${KU}${n}`:r===`project`?`${qU}${encodeURIComponent(n)}`:r===`workspace_file`?`${JU}${encodeURIComponent(n)}`:r===`workspace_directory`?`${YU}${encodeURIComponent(n)}`:r===`workspace_excerpt`?`${XU}${encodeURIComponent(n)}`:r===`conversation_excerpt`?`${ZU}${encodeURIComponent(n)}`:r===`system_object`?`${QU}${encodeURIComponent(n)}`:r===`ui_resource`?`${$U}${encodeURIComponent(n)}`:null}function tW(e){return typeof e==`string`&&e.trim()?e.trim():null}function nW(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:null}function rW(e){let t=new Set;return e.filter(e=>{let n=`ref`in e?e.ref:e.key,r=`${e.kind}:${n}:${e.rawText}`;return t.has(r)?!1:(t.add(r),!0)})}function iW(e,t){let n=tW(e.data?.path),r=tW(e.data?.excerpt);return!n||!r?null:{kind:O,key:e.tokenKey,path:n,label:e.label,excerpt:r,startLine:nW(e.data?.startLine),endLine:nW(e.data?.endLine),rawText:t}}function aW(e,t){if(e.tokenKind===`workspace_excerpt`)return iW(e,t);if(e.tokenKind===`conversation_excerpt`)return VU(e,t);if(e.tokenKind===`system_object`){let n=te(e.data?.reference);return n?.uri===e.tokenKey?{kind:o,key:e.tokenKey,label:e.label,rawText:t,reference:n}:null}if(e.tokenKind===`ui_resource`){let n=x(e.data?.reference);return n?.uri===e.tokenKey?{kind:re,key:e.tokenKey,label:e.label,rawText:t,reference:n}:null}}function oW(e,t=[]){let n=new Map(t.map(e=>[e.ref,e])),i=[];for(let t of e){if(t.type!==`token`)continue;let e=eW(t);if(!e)continue;if(t.tokenKind===`skill`){let r=n.get(t.tokenKey);r?.path.trim()&&i.push({kind:`skill`,ref:r.ref,name:r.name,source:r.source,path:r.path,label:t.label,rawText:e});continue}if(t.tokenKind===`project`){i.push({kind:s,key:t.tokenKey,label:t.label,rawText:e});continue}let a=aW(t,e);if(a!==void 0){a&&i.push(a);continue}if(t.tokenKind===`workspace_file`||t.tokenKind===`workspace_directory`){let n=t.tokenKind===`workspace_file`?r:p;i.push({kind:n,key:t.tokenKey,label:t.label,rawText:e})}}return rW(i)}var sW=`@panel-app:`,cW=/@panel-app:([A-Za-z0-9_-]+)/g,lW=/@project:([^\s]+)/g,uW=/@file:([^\s]+)/g,dW=/@folder:([^\s]+)/g,fW=/@object:([^\s]+)/g,pW=/@resource:([^\s]+)/g;function mW(e){let t=e.projectRoot?.trim().replace(/[\\/]+$/,``)??``,n=e.relativePath.trim().replace(/\\/g,`/`).split(`/`);if(!t||n.length===0||n.some(e=>!e||e===`.`||e===`..`))return null;let r=t.includes(`\\`)?`\\`:`/`;return`${t}${r}${n.join(r)}`}function hW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function _W(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:null}function vW(e){let t=new Set,n=[];for(let r of e){let e=`ref`in r?r.ref:r.key,i=`${r.kind}:${e}:${r.rawText}`;t.has(i)||(t.add(i),n.push(r))}return n}function yW(e){let{kind:t,pattern:n,text:r,tokens:i}=e;for(let e of r.matchAll(n)){let n=e[1];if(!n)continue;let r;try{r=decodeURIComponent(n)}catch{continue}i.push({kind:t,key:r,label:r.split(/[\\/]+/).filter(Boolean).at(-1)??r,rawText:e[0]})}}function bW(e){let t=[];for(let n of e.matchAll(cW)){let e=n[1];e&&t.push({kind:`panel_app`,key:e,label:e,rawText:`${sW}${e}`})}return yW({kind:s,pattern:lW,text:e,tokens:t}),yW({kind:o,pattern:fW,text:e,tokens:t}),yW({kind:re,pattern:pW,text:e,tokens:t}),yW({kind:r,pattern:uW,text:e,tokens:t}),yW({kind:p,pattern:dW,text:e,tokens:t}),vW(t)}function xW(e,t){let n=bW(e).filter(n=>{let r=e.indexOf(n.rawText);return!t.some(t=>t.kind===n.kind&&n.rawText.startsWith(t.rawText)&&e.indexOf(t.rawText)===r)});return vW([...t,...n])}function SW(e){let t=e?.[_];if(Array.isArray(t))return EW(t);if(!hW(t)||t.schemaVersion!==2||!Array.isArray(t.items))return[];let n=[];for(let e of t.items){let t=wW(e);t&&n.push(t)}return vW(n)}function CW(e){return e===`builtin`||e===`global`||e===`project`||e===`workspace`?e:null}function wW(e){if(!hW(e))return null;let t=gW(e.kind),n=gW(e.rawText),r=gW(e.label);if(!t||!r||!n)return null;if(t===`skill`){let i=gW(e.ref),a=gW(e.name),o=gW(e.path),s=CW(e.source);return i&&a&&o&&s?{kind:t,ref:i,name:a,source:s,path:o,label:r,rawText:n}:null}if(t===`workspace_excerpt`)return TW({entry:e,label:r,rawText:n});if(t===`conversation_excerpt`)return HU({entry:e,label:r,rawText:n});if(t===`system_object`){let i=gW(e.key),a=te(e.reference);return i&&a&&a.uri===i?{kind:t,key:i,label:r,rawText:n,reference:a}:null}if(t===`ui_resource`){let i=gW(e.key),a=x(e.reference);return i&&a&&a.uri===i?{kind:t,key:i,label:r,rawText:n,reference:a}:null}let i=gW(e.key);return i?{kind:t,key:i,rawText:n,label:r}:null}function TW(e){let{entry:t,label:n,rawText:r}=e,i=gW(t.key),a=gW(t.path),o=gW(t.excerpt);return i&&a&&o?{kind:O,key:i,path:a,label:n,excerpt:o,startLine:_W(t.startLine),endLine:_W(t.endLine),rawText:r}:null}function EW(e){let t=[];for(let n of e){if(!hW(n))continue;let e=gW(n.kind),r=gW(n.key),i=gW(n.rawText);if(!e||!r||!i)continue;let a=gW(n.label)??r;t.push(e===`skill`?{kind:e,ref:r,name:a,source:null,path:null,label:a,rawText:i}:{kind:e,key:r,label:a,rawText:i})}return vW(t)}function DW(e){return{schemaVersion:2,items:e}}var OW=/\u200B|\u200C|\u200D|\u2060|\uFEFF/g;function kW(e){let t=e.trim();return t&&t.replace(OW,``).trim()?t:null}function AW(e,t){let n=kW(e.text);if(!n)return null;let r=xW(e.text,t);return{type:`markdown`,text:n,inlineTokens:r.length>0?r:void 0}}function jW(e){return kW(e)}function MW(e){return typeof e==`object`&&!!e}function NW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function PW(e){if(typeof e==`number`&&Number.isFinite(e)&&e>=0)return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=Number(t);return Number.isFinite(n)&&n>=0?n:null}function FW(e){return MW(e)?`command`in e||`workingDir`in e||`exitCode`in e||`stdout`in e||`stderr`in e||`aggregated_output`in e||`combinedOutput`in e:!1}function IW(e){return typeof e==`string`?e.trim().toLowerCase():``}function LW(e){if(!FW(e))return null;let t=IW(e.status??e.outcome);if(e.cancelled===!0||e.aborted===!0||t===`cancelled`||t===`canceled`||t===`aborted`||t===`interrupted`)return`cancelled`;let n=PW(e.exitCode??e.exit_code);return e.ok===!1||e.blocked===!0||e.timedOut===!0||e.killed===!0||t===`error`||t===`failed`||t===`blocked`||t===`declined`||t===`timed_out`||n!=null&&n!==0?`error`:`success`}function RW(e,t){if(!MW(e))return null;let n=MW(e.asset)?e.asset:Array.isArray(e.assets)&&e.assets.length>0&&MW(e.assets[0])?e.assets[0]:null;if(!n)return null;let r=NW(n.url),i=NW(n.mimeType)??`application/octet-stream`,a=PW(n.sizeBytes);return r?{type:`file`,file:{label:NW(n.name)??(i.startsWith(`image/`)?t.imageAttachmentLabel:t.fileAttachmentLabel),mimeType:i,dataUrl:r,...a==null?{}:{sizeBytes:a},isImage:i.startsWith(`image/`)}}:null}function zW(e,t){let n=(e.statusTone===`success`?LW(e.outputData):null)??e.statusTone,r=n===`error`?t.toolStatusFailedLabel:n===`cancelled`?t.toolStatusCancelledLabel:e.statusLabel;return{kind:e.kind,toolName:e.name,...e.toolCallId?{toolCallId:e.toolCallId}:{},...`agentId`in e&&e.agentId?{agentId:e.agentId}:{},summary:e.detail,inputLabel:t.toolInputLabel,input:`input`in e&&typeof e.input==`string`?e.input:void 0,inputData:e.inputData,output:e.text,outputData:e.outputData,...e.execution?{execution:{...e.execution}}:{},hasResult:!!e.hasResult,statusTone:n,statusLabel:r,titleLabel:e.kind===`call`?t.toolCallLabel:t.toolResultLabel,outputLabel:t.toolOutputLabel,emptyLabel:t.toolNoOutputLabel,...`action`in e&&e.action?{action:e.action}:{},...`fileOperation`in e&&e.fileOperation?{fileOperation:e.fileOperation}:{},...`panelApp`in e&&e.panelApp?{panelApp:e.panelApp}:{}}}function BW(e){let{cancelled:t,error:n,result:r,status:i,texts:a}=e,o=typeof i==`string`?i.trim().toLowerCase():``,s=typeof n==`string`&&n.trim().length>0;return t===!0||o===`cancelled`?{kind:`result`,hasResult:!0,statusTone:`cancelled`,statusLabel:a.toolStatusCancelledLabel}:s||o===`error`?{kind:`result`,hasResult:!0,statusTone:`error`,statusLabel:a.toolStatusFailedLabel}:o===`result`||r!=null?{kind:`result`,hasResult:!0,statusTone:`success`,statusLabel:a.toolStatusCompletedLabel}:{kind:`call`,hasResult:!1,statusTone:`running`,statusLabel:a.toolStatusRunningLabel}}function VW(e){return typeof e==`object`&&!!e}function HW(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function UW(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function WW(e){let t=HW(e);return VW(t)?UW(t.agentId):null}function GW(e){return WW(e.parsedArgs)??WW(e.args)??WW(e.result)}var KW=12e3,qW=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function JW(e){let t=e.replace(/\r\n/g,`
93
+ `).replace(/\r/g,`
94
+ `);return t===``?[]:t.split(`
95
+ `)}function YW(e){return typeof e==`number`?e+1:void 0}function XW(e){let{kind:t,newLineNumber:n,oldLineNumber:r,text:i}=e;return{kind:t,text:i,...typeof r==`number`?{oldLineNumber:r}:{},...typeof n==`number`?{newLineNumber:n}:{}}}function ZW(e){let t=qW.exec(e);return t?{oldLineNumber:Number(t[1]),newLineNumber:Number(t[2])}:null}function QW(e){let{kind:t,newStartLine:n,oldStartLine:r,text:i}=e;return JW(i).map((e,i)=>XW(t===`add`?{kind:`add`,text:e,newLineNumber:n+i}:{kind:`context`,text:e,oldLineNumber:r+i,newLineNumber:n+i}))}function $W(e){let{afterLines:t,beforeLines:n,newStartLine:r,oldStartLine:i}=e,a=i,o=r;return[...n.map(e=>{let t=XW({kind:`remove`,text:e,oldLineNumber:a});return a=YW(a),t}),...t.map(e=>{let t=XW({kind:`add`,text:e,newLineNumber:o});return o=YW(o),t})]}function eG(e){let{afterLines:t,beforeLines:n}=e,r=Array.from({length:n.length+1},()=>Array.from({length:t.length+1},()=>0));for(let e=n.length-1;e>=0;--e)for(let i=t.length-1;i>=0;--i)r[e][i]=n[e]===t[i]?(r[e+1][i+1]??0)+1:Math.max(r[e+1][i]??0,r[e][i+1]??0);return r}function tG(e){let{afterIndex:t,afterLines:n,beforeIndex:r,beforeLines:i,lines:a,newLineNumber:o,oldLineNumber:s}=e,c=s,l=o;for(let e=r;e<i.length;e+=1)a.push(XW({kind:`remove`,text:i[e]??``,oldLineNumber:c})),c=YW(c);for(let e=t;e<n.length;e+=1)a.push(XW({kind:`add`,text:n[e]??``,newLineNumber:l})),l=YW(l)}function nG(e){let{afterText:t,beforeText:n,newStartLine:r,oldStartLine:i}=e,a=JW(n),o=JW(t);if(a.length*o.length>KW)return $W({beforeLines:a,afterLines:o,oldStartLine:i,newStartLine:r});let s=eG({beforeLines:a,afterLines:o}),c=[],l=0,u=0,d=i,f=r;for(;l<a.length&&u<o.length;){if(a[l]===o[u]){c.push(XW({kind:`context`,text:a[l]??``,oldLineNumber:d,newLineNumber:f})),l+=1,u+=1,d=YW(d),f=YW(f);continue}if((s[l+1][u]??0)>=(s[l][u+1]??0)){c.push(XW({kind:`remove`,text:a[l]??``,oldLineNumber:d})),l+=1,d=YW(d);continue}c.push(XW({kind:`add`,text:o[u]??``,newLineNumber:f})),u+=1,f=YW(f)}return tG({lines:c,beforeLines:a,afterLines:o,beforeIndex:l,afterIndex:u,oldLineNumber:d,newLineNumber:f}),c}var rG=120;function iG(e){let{lines:t,operation:n}=e,r=t.filter(e=>e.kind===`add`).length,i=t.filter(e=>e.kind===`remove`).length,a=[],o=n?.trim().toLowerCase()??``;return o&&o!==`update`&&a.push(o),r>0&&a.push(`+${r}`),i>0&&a.push(`-${i}`),a.length>0?a.join(` · `):void 0}function aG(e){let{afterText:t,beforeText:n,newStartLine:r,oldStartLine:i,operation:a}=e,o=a?.trim().toLowerCase()??``;return{oldStartLine:typeof i==`number`?i:(o===`delete`||o===`remove`)&&n!=null?1:void 0,newStartLine:typeof r==`number`?r:(o===`write`||o===`add`)&&t!=null?1:void 0}}function oG(e){return e.length<=rG?{lines:e,truncated:!1}:{lines:e.slice(0,rG),truncated:!0}}function sG(e){let{lines:t,operation:n,path:r}=e,i=oG(t);return{path:r,display:`diff`,caption:iG({operation:n,lines:t}),lines:i.lines,...i.truncated?{fullLines:t}:{},truncated:i.truncated}}function cG(e){let{newStartLine:t,oldStartLine:n,operation:r,path:i,text:a}=e,o=a.trim();if(!o)return null;let s=r?.trim().toLowerCase()===`write`?`add`:`context`,c=typeof n==`number`?n:1,l=typeof t==`number`?t:1,u=QW({text:o,kind:s,oldStartLine:c,newStartLine:l});return{path:i,display:`preview`,caption:iG({operation:r,lines:u}),lines:u,rawText:o,oldStartLine:c,newStartLine:l}}function lG(e){let{afterText:t,beforeText:n,operation:r,path:i}=e,{oldStartLine:a,newStartLine:o}=aG(e),s=nG({beforeText:n??``,afterText:t??``,oldStartLine:a,newStartLine:o}),c=oG(s);return c.lines.length===0?null:{path:i,display:`diff`,caption:iG({operation:r,lines:s}),lines:c.lines,...c.truncated?{fullLines:s}:{},...n==null?{}:{beforeText:n},...t==null?{}:{afterText:t},...typeof a==`number`?{oldStartLine:a}:{},...typeof o==`number`?{newStartLine:o}:{},truncated:c.truncated}}function uG(e){let{flushCurrent:t,line:n,setCurrent:r}=e;return n.startsWith(`*** Update File: `)?(t(),r(n.slice(17).trim(),`update`),!0):n.startsWith(`*** Add File: `)?(t(),r(n.slice(14).trim(),`add`),!0):n.startsWith(`*** Delete File: `)?(t(),r(n.slice(17).trim(),`delete`),!0):!1}function dG(e){let{currentLines:t,line:n,newLineNumber:r,oldLineNumber:i}=e;return n.startsWith(`+`)?(t.push(XW({kind:`add`,text:n.slice(1),newLineNumber:r})),{oldLineNumber:i,newLineNumber:YW(r)}):n.startsWith(`-`)?(t.push(XW({kind:`remove`,text:n.slice(1),oldLineNumber:i})),{oldLineNumber:YW(i),newLineNumber:r}):n.startsWith(` `)?(t.push(XW({kind:`context`,text:n.slice(1),oldLineNumber:i,newLineNumber:r})),{oldLineNumber:YW(i),newLineNumber:YW(r)}):{oldLineNumber:i,newLineNumber:r}}function fG(e){let t=[],n=null,r=null,i=[],a,o,s=()=>{if(!n){i=[],r=null,a=void 0,o=void 0;return}t.push(sG({path:n,operation:r,lines:i})),n=null,r=null,i=[],a=void 0,o=void 0};for(let t of JW(e)){if(uG({line:t,flushCurrent:s,setCurrent:(e,t)=>{n=e,r=t}})||t.startsWith(`*** Move to: `)||t.startsWith(`*** Begin Patch`)||t.startsWith(`*** End Patch`))continue;if(t.startsWith(`@@`)){let e=ZW(t);a=e?.oldLineNumber,o=e?.newLineNumber;continue}if(!n)continue;let e=dG({currentLines:i,line:t,oldLineNumber:a,newLineNumber:o});a=e.oldLineNumber,o=e.newLineNumber}return s(),t}function pG(e){let t=[],n=null,r=[],i,a,o=()=>{if(!n){r=[],i=void 0,a=void 0;return}t.push(sG({path:n,operation:`update`,lines:r})),n=null,r=[],i=void 0,a=void 0};for(let t of JW(e)){if(t.startsWith(`+++ `)){o(),n=t.slice(4).trim().replace(/^b\//,``).replace(/^a\//,``);continue}if(t.startsWith(`--- `))continue;if(t.startsWith(`@@`)){let e=ZW(t);i=e?.oldLineNumber,a=e?.newLineNumber;continue}if(!n)continue;let e=dG({currentLines:r,line:t,oldLineNumber:i,newLineNumber:a});i=e.oldLineNumber,a=e.newLineNumber}return o(),t}function mG(e){return e.includes(`*** Begin Patch`)?fG(e):e.includes(`--- `)&&e.includes(`+++ `)?pG(e):[]}function hG(e){switch(e){case`"`:case`\\`:case`/`:return e;case`b`:return`\b`;case`f`:return`\f`;case`n`:return`
96
+ `;case`r`:return`\r`;case`t`:return` `;default:return e}}function gG(e,t){let n=`"${t}"`,r=e.indexOf(n);if(r<0)return null;let i=e.indexOf(`:`,r+n.length);if(i<0)return null;let a=i+1;for(;a<e.length&&/\s/.test(e[a]??``);)a+=1;return e[a]===`"`?a+1:null}function _G(e,t,n=1/0){let r=``,i=!1;for(let a=t;a<e.length;a+=1){let t=e[a];if(t==null)break;if(i){r+=hG(t),i=!1;continue}if(t===`\\`){i=!0;continue}if(t===`"`)return{value:r,truncated:!1};if(r+=t,r.length>=n)return{value:r,truncated:!0}}return r.length>0?{value:r,truncated:!1}:null}function vG(e,t,n=1/0){for(let r of t){let t=gG(e,r);if(t!=null)return _G(e,t,n)}return null}function yG(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function bG(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function xG(e){return typeof e==`string`&&e.trim()?e.trim():null}function SG(e){return typeof e==`number`&&Number.isInteger(e)&&e>0?e:typeof e==`string`&&/^\d+$/.test(e.trim())?Number(e.trim()):null}function CG(e){if(yG(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`))return null;try{let e=JSON.parse(t);return yG(e)?e:null}catch{return null}}function wG(e){if(yG(e))return e;if(typeof e!=`string`)return null;let t=e.trim();if(!t.startsWith(`{`))return null;let n=vG(t,[`path`,`filePath`,`file_path`,`targetPath`,`target_path`,`filename`,`name`])?.value??null,r=vG(t,[`content`,`text`,`afterText`,`after_text`])?.value??null,i=vG(t,[`oldText`,`beforeText`,`before_text`])?.value??null,a=vG(t,[`newText`,`afterText`,`after_text`])?.value??null,o=vG(t,[`patch`,`diff`,`unifiedDiff`,`unified_diff`])?.value??null,s={};return n&&(s.path=n),r&&(s.content=r),i&&(s.oldText=i),a&&(s.newText=a),o&&(s.patch=o),Object.keys(s).length>0?s:null}function TG(e){return xG(e.path)??xG(e.filePath)??xG(e.file_path)??xG(e.targetPath)??xG(e.target_path)??xG(e.filename)??xG(e.name)}function EG(e){return bG(e.operation)??bG(e.op)??bG(e.action)??bG(e.kind)??bG(e.type)??bG(e.status)}function DG(e,t){for(let n of t){let t=SG(e[n]);if(t!==null)return t}return null}function OG(e){return DG(e,[`oldStartLine`,`old_start_line`,`startOldLine`,`start_old_line`,`oldLineStart`,`old_line_start`,`oldLineNumber`,`old_line_number`,`lineStart`,`line_start`,`startLine`,`start_line`,`lineNumber`,`line_number`])}function kG(e){return DG(e,[`newStartLine`,`new_start_line`,`startNewLine`,`start_new_line`,`newLineStart`,`new_line_start`,`newLineNumber`,`new_line_number`,`lineStart`,`line_start`,`startLine`,`start_line`,`lineNumber`,`line_number`])}function AG(e){return bG(e.patch)??bG(e.diff)??bG(e.unifiedDiff)??bG(e.unified_diff)}function jG(e){return bG(e.beforeText)??bG(e.before_text)??bG(e.oldText)??bG(e.old_text)??bG(e.oldContent)??bG(e.old_content)??bG(e.before)??bG(e.previous)}function MG(e){return bG(e.afterText)??bG(e.after_text)??bG(e.newText)??bG(e.new_text)??bG(e.newContent)??bG(e.new_content)??bG(e.content)??bG(e.text)??bG(e.after)??bG(e.updated)}var NG=new Set([`file_change`,`read_file`,`write_file`,`edit_file`,`apply_patch`]);function PG(e){let t=e.map((e,t)=>({key:`${e.path}-${t+1}`,path:e.path,display:e.display,...e.caption?{caption:e.caption}:{},lines:e.lines,...e.fullLines?{fullLines:e.fullLines}:{},...e.rawText?{rawText:e.rawText}:{},...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{},...e.truncated?{truncated:!0}:{}})).filter(e=>e.lines.length>0||!!e.rawText);if(t.length===0)return null;let n=t.map(e=>e.path);return{summary:n.length===1?n[0]:`${n.length} files · ${n.slice(0,2).join(` · `)}${n.length>2?` …`:``}`,fileOperation:{blocks:t}}}function FG(e,t){let n=TG(e)??t,r=EG(e),i=OG(e),a=kG(e),o=AG(e);if(o){let e=mG(o);if(e.length>0)return e[0]??null}let s=jG(e),c=MG(e);if(s!=null||c!=null)return lG({path:n,beforeText:s,afterText:c,operation:r,oldStartLine:i,newStartLine:a});let l=bG(e.preview);return l?cG({path:n,text:l,operation:r,oldStartLine:i,newStartLine:a}):null}function IG(e){if(!Array.isArray(e))return[];let t=[];return e.forEach((e,n)=>{if(typeof e==`string`){let n=mG(e);n.length>0&&t.push(...n);return}if(!yG(e))return;let r=FG(e,TG(e)??`file-${n+1}`);if(r){t.push(r);return}let i=Array.isArray(e.changes)?IG(e.changes):[];i.length>0&&t.push(...i)}),t}function LG(e){let t=CG(e.result)??CG(e.parsedArgs)??CG(e.args);return t?PG(IG(t.changes)):null}function RG(e){let t=CG(e.parsedArgs)??CG(e.args)??wG(e.args),n=t&&TG(t),r=bG(e.result);return!n||!r?null:PG([cG({path:n,text:r,operation:`read`})].filter(e=>!!e))}function zG(e){if(e.status===`partial-call`&&typeof e.args==`string`){let t=vG(e.args,[`path`,`filePath`,`file_path`,`targetPath`,`target_path`,`filename`,`name`]),n=vG(e.args,[`content`,`text`,`afterText`,`after_text`]);if(t?.value&&n?.value){let e=cG({path:t.value,text:n.value,operation:`write`});if(e)return PG([e])}}let t=CG(e.parsedArgs)??CG(e.args)??wG(e.args);if(!t)return null;let n=TG(t),r=bG(t.content);return!n||!r?null:PG([cG({path:n,text:r,operation:`write`})].filter(e=>!!e))}function BG(e){let t=CG(e.result),n=CG(e.parsedArgs)??CG(e.args)??wG(e.args);if(!t&&!n)return null;let r=(t?TG(t):null)??(n?TG(n):null),i=(t?jG(t):null)??(n?jG(n):null),a=(t?MG(t):null)??(n?MG(n):null),o=(t?OG(t):null)??(n?OG(n):null),s=(t?kG(t):null)??(n?kG(n):null);return!r||i==null&&a==null?null:PG([lG({path:r,beforeText:i,afterText:a,operation:`edit`,oldStartLine:o,newStartLine:s})].filter(e=>!!e))}function VG(e){let t=CG(e.parsedArgs),n=CG(e.args)??wG(e.args),r=bG(e.args)??(t?bG(t.patch):null)??(n?bG(n.patch):null);return r?PG(mG(r)):null}function HG(e){return NG.has(e.toolName)?e.toolName===`file_change`?LG(e):e.toolName===`read_file`?RG(e):e.toolName===`write_file`?zG(e):e.toolName===`edit_file`?BG(e):e.toolName===`apply_patch`?VG(e):null:null}var UG=[`show_content`,`show_file`,`show_url`,`show_panel_app`];function WG(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function GG(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function KG(e){return Number.isInteger(e)&&typeof e==`number`&&e>0?e:void 0}function qG(e){return e===`file`||e===`url`||e===`panel_app`?e:null}function JG(e){return e===`read`||e===`preview`||e===`edit`||e===`interact`?e:void 0}function YG(e){return e===`inline`||e===`side_panel`?e:void 0}function XG(e){return e===`auto`||e===`source`||e===`rendered`?e:void 0}function ZG(e){try{return a(e)}catch{return null}}function QG(e){if(!WG(e)||!WG(e.target))return null;let{target:t}=e,{payload:n,type:r}=t,i=qG(r);if(!i||!WG(n))return null;let a=GG(e.title),o=JG(e.purpose),s=YG(e.placement);if(i===`file`){let e=GG(n.path);if(!e)return null;let t=ZG(n.params);return t===null||t&&(XG(n.viewer)===`source`||!/\.html?$/i.test(e))?null:{target:{type:`file`,payload:{path:e,line:KG(n.line),column:KG(n.column),viewer:XG(n.viewer),params:t??void 0}},title:a,purpose:o,placement:s}}if(i===`url`){let e=GG(n.url);return e?{target:{type:`url`,payload:{url:e}},title:a,purpose:o,placement:s}:null}let c=GG(n.appId);if(!c)return null;let l=ZG(n.params);return l===null?null:{target:{type:`panel_app`,payload:{appId:c,path:GG(n.path),params:l??void 0}},title:a,purpose:o,placement:s}}function $G(e){return!WG(e)||e.action!==`showContent`?null:QG(e.request)}function eK(e){return e.title?e.title:e.target.type===`file`?e.target.payload.path:e.target.type===`url`?e.target.payload.url:e.target.payload.appId}function tK(e){let{actionLabel:t,invocation:n,statusLabel:r}=e;if(!UG.includes(n.toolName))return null;let i=$G(n.result);if(!i)return null;let a={kind:`show-content`,label:t,request:{...i,placement:`side_panel`}},o=i.target.type===`panel_app`&&i.placement===`inline`?{appId:i.target.payload.appId,path:i.target.payload.path,params:i.target.payload.params,title:i.title,action:a}:void 0;return{kind:`result`,name:n.toolName,detail:eK(i),text:void 0,outputData:n.result,hasResult:!0,statusTone:`success`,statusLabel:r,action:a,...o?{panelApp:o}:{}}}function nK(e){return typeof e==`object`&&!!e}function rK(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function iK(e){return!nK(e)||e.kind!==`nextclaw.session_request`?null:e}function aK(e){return!nK(e)||e.kind!==`nextclaw.session`?null:e}function oK(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.parse(t)}catch{return e}}function sK(e){return IU(oK(e)).trim()||void 0}function cK(e,t){return[rK(e.title)?`title: ${e.title?.trim()}`:null,rK(e.sessionId)?`session: ${e.sessionId?.trim()}`:null,rK(e.task)?`task: ${e.task?.trim()}`:null].filter(e=>!!e).join(` · `)||RU(t)}function lK(e,t){return[rK(e.title)?`title: ${e.title?.trim()}`:null,rK(e.sessionId)?`session: ${e.sessionId?.trim()}`:null].filter(e=>!!e).join(` · `)||RU(t)}function uK(e){let t=rK(e.requestId),n=rK(e.sessionId),r=rK(e.title),i=rK(e.task),a=rK(e.status),o=rK(e.notify),s=rK(e.lifecycle),c=rK(e.parentSessionId),l=rK(e.spawnedByRequestId),u=e.message===void 0?``:IU(e.message).trim(),d=e.finalResponseText===void 0?``:IU(e.finalResponseText).trim(),f=e.error===void 0?``:IU(e.error).trim(),p=[t?`Request ID: ${t}`:null,n?`Session ID: ${n}`:null,typeof e.isChildSession==`boolean`?`Target: ${e.isChildSession?`child`:`session`}`:null,a?`Status: ${a}`:null,o?`Notify: ${o}`:null,s?`Lifecycle: ${s}`:null,c?`Parent Session ID: ${c}`:null,l?`Spawned By Request ID: ${l}`:null,r?`Title: ${r}`:null,i?`Task:\n${i}`:null,d?`Final Response:\n${d}`:f?`Error:\n${f}`:u?`Status:\n${u}`:null].filter(e=>!!e);return p.length>0?p.join(`
97
+
98
+ `):void 0}function dK(e){let t=rK(e.sessionId),n=rK(e.title),r=rK(e.sessionType),i=rK(e.lifecycle),a=rK(e.parentSessionId),o=rK(e.createdAt),s=[t?`Session ID: ${t}`:null,typeof e.isChildSession==`boolean`?`Target: ${e.isChildSession?`child`:`session`}`:null,n?`Title: ${n}`:null,r?`Session Type: ${r}`:null,i?`Lifecycle: ${i}`:null,a?`Parent Session ID: ${a}`:null,o?`Created At: ${o}`:null].filter(e=>!!e);return s.length>0?s.join(`
99
+
100
+ `):void 0}function fK(e){let{invocation:t,texts:n}=e,{toolName:r,toolCallId:i,args:a,result:o}=t;if(r!==`spawn`&&r!==`sessions_request`&&r!==`sessions_spawn`)return null;let s=iK(o);if(s){let e=rK(s.status)?.toLowerCase(),t=cK(s,a),o=uK(s),c=rK(s.sessionId),l=GW({args:a,result:s}),u=c?{kind:`open-session`,sessionId:c,sessionKind:s.isChildSession===!0?`child`:`session`,...l?{agentId:l}:{},...rK(s.title)?{label:s.title.trim()}:{},...rK(s.parentSessionId)?{parentSessionId:s.parentSessionId.trim()}:{}}:void 0;return e===`failed`?{kind:`result`,name:r,detail:t,input:sK(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`error`,statusLabel:n.toolStatusFailedLabel,...l?{agentId:l}:{},...u?{action:u}:{}}:e===`completed`?{kind:`result`,name:r,detail:t,input:sK(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`success`,statusLabel:n.toolStatusCompletedLabel,...l?{agentId:l}:{},...u?{action:u}:{}}:{kind:`result`,name:r,detail:t,input:sK(a),text:o,callId:i||void 0,hasResult:!!o,statusTone:`running`,statusLabel:n.toolStatusRunningLabel,...l?{agentId:l}:{},...u?{action:u}:{}}}let c=aK(o);if(!c)return null;let l=lK(c,a),u=dK(c),d=rK(c.sessionId),f=GW({args:a,result:c}),p=d?{kind:`open-session`,sessionId:d,sessionKind:c.isChildSession===!0?`child`:`session`,...f?{agentId:f}:{},...rK(c.title)?{label:c.title.trim()}:{},...rK(c.parentSessionId)?{parentSessionId:c.parentSessionId.trim()}:{}}:void 0;return{kind:`result`,name:r,detail:l,input:sK(a),text:u,callId:i||void 0,hasResult:!!u,statusTone:`success`,statusLabel:n.toolStatusCompletedLabel,...f?{agentId:f}:{},...p?{action:p}:{}}}var pK=`ncp_internal_visibility`,mK=`observation.event`;function hK(e){return e?.metadata?.[pK]===`hidden`}var gK=`ai_execution`;function _K(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function vK(e){return e===null||typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function yK(e){return e===`reported`||e===`partial`||e===`unavailable`}function bK(e){return e===`completed`||e===`failed`||e===`aborted`}function xK(e){let t=e?.[gK];if(!_K(t)||t.version!==1||!_K(t.usage))return null;let n=t.usage;return typeof t.runId!=`string`||!t.runId.trim()||typeof t.runtimeId!=`string`||!t.runtimeId.trim()||typeof t.model!=`string`||!t.model.trim()||!(t.requestedModel===null||typeof t.requestedModel==`string`)||!bK(t.outcome)||!vK(n.inputTokens)||!vK(n.outputTokens)||!vK(n.cachedInputTokens)||!vK(n.totalTokens)||!vK(n.modelCallCount)||!vK(n.reportedModelCallCount)||!yK(n.status)?null:t}var SK=function(e){return e.EndpointReady=`endpoint.ready`,e.EndpointError=`endpoint.error`,e.MessageRequest=`message.request`,e.MessageStreamRequest=`message.stream-request`,e.MessageSent=`message.sent`,e.MessageAccepted=`message.accepted`,e.MessageIncoming=`message.incoming`,e.MessageCompleted=`message.completed`,e.MessageFailed=`message.failed`,e.MessageAbort=`message.abort`,e.MessageTextStart=`message.text-start`,e.MessageTextDelta=`message.text-delta`,e.MessageTextEnd=`message.text-end`,e.MessageReasoningStart=`message.reasoning-start`,e.MessageReasoningDelta=`message.reasoning-delta`,e.MessageReasoningEnd=`message.reasoning-end`,e.MessageToolCallStart=`message.tool-call-start`,e.MessageToolCallArgs=`message.tool-call-args`,e.MessageToolCallArgsDelta=`message.tool-call-args-delta`,e.MessageToolCallOutputDelta=`message.tool-call-output-delta`,e.MessageToolCallEnd=`message.tool-call-end`,e.MessageToolExecutionStarted=`message.tool-execution-started`,e.MessageToolCallResult=`message.tool-call-result`,e.MessageRead=`message.read`,e.MessageDelivered=`message.delivered`,e.MessageRecalled=`message.recalled`,e.MessageReaction=`message.reaction`,e.RunStarted=`run.started`,e.RunFinished=`run.finished`,e.RunError=`run.error`,e.RunMetadata=`run.metadata`,e.ContextWindowUpdated=`context-window.updated`,e.TypingStart=`typing.start`,e.TypingEnd=`typing.end`,e.PresenceUpdated=`presence.updated`,e}({});function CK(e,t=e.occurredAt??new Date().toISOString()){return{...e,occurredAt:t}}var wK=/\[\[\s*reply_to_current\s*\]\]/gi,TK=/\[\[\s*reply_to\s*:\s*([^\]]+?)\s*\]\]/i;function EK(e){if(typeof e!=`string`)return;let t=e.trim();return t.length>0?t:void 0}function DK(e,t){let n=e,r;wK.test(n)&&(r=EK(t),n=n.replace(wK,``).trim());let i=n.match(TK)?.[1];return i&&(r=EK(i),n=n.replace(TK,``).trim()),r?{content:n,replyTo:r}:{content:n}}function OK(e,t=e.id){if(e.role!==`assistant`)return{...e,parts:[...e.parts],metadata:e.metadata?{...e.metadata}:void 0};let n=e.parts.findIndex(e=>e.type===`text`),r=e.metadata?{...e.metadata}:void 0,i=EK(r?.reply_to);if(n<0)return{...e,parts:[...e.parts],metadata:r};let a=e.parts[n];if(!a||a.type!==`text`)return{...e,parts:[...e.parts],metadata:r};let{content:o,replyTo:s}=DK(a.text,t),c=s??i,l=e.parts.flatMap((e,t)=>t!==n||e.type!==`text`?[e]:o.length===0?[]:[{...e,text:o}]);return c?{...e,parts:l,metadata:{...r,reply_to:c}}:{...e,parts:l,metadata:r}}function kK(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function AK(e){if(typeof e!=`number`||!Number.isFinite(e))return null;let t=Math.trunc(e);return t>=0?t:null}function jK(e){return e===!0}function MK(e){let t=e;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,r=AK(n.usedContextTokens),i=AK(n.totalContextTokens),a=AK(n.prunedUsedContextTokens),o=kK(n.updatedAt);if(r===null||i===null||a===null||!o)return null;let s=AK(n.compactedUsedContextTokens),c=AK(n.fixedInputTokens),l=AK(n.dynamicInputTokens),u=AK(n.reservedContextTokens),d=AK(n.triggerContextTokens),f=AK(n.availableBeforeCompactionTokens);return{completeInputBudget:jK(n.completeInputBudget),usedContextTokens:r,totalContextTokens:i,prunedUsedContextTokens:a,availableContextTokens:AK(n.availableContextTokens)??Math.max(0,i-r),...c===null?{}:{fixedInputTokens:c},...l===null?{}:{dynamicInputTokens:l},...u===null?{}:{reservedContextTokens:u},...d===null?{}:{triggerContextTokens:d},...f===null?{}:{availableBeforeCompactionTokens:f},droppedHistoryCount:AK(n.droppedHistoryCount)??0,truncatedToolResultCount:AK(n.truncatedToolResultCount)??0,truncatedSystemPrompt:jK(n.truncatedSystemPrompt),truncatedUserMessage:jK(n.truncatedUserMessage),compacted:jK(n.compacted),...kK(n.checkpointId)?{checkpointId:kK(n.checkpointId)??void 0}:{},compactedMessageCount:AK(n.compactedMessageCount)??0,...s===null?{}:{compactedUsedContextTokens:s},updatedAt:o}}function NK(e){let{metadata:t}=e;if(!t||t.nextclaw_timeline_kind!==`context_compaction`)return null;let n=t.checkpoint&&typeof t.checkpoint==`object`&&!Array.isArray(t.checkpoint)?t.checkpoint:null;if(!n)return null;let r=kK(n.id),i=n.status===`compressing`?`compressing`:n.status===`compressed`?`compressed`:n.status===`failed`?`failed`:n.status===`cancelled`?`cancelled`:null,a=n.phase===`pre-run`?`pre-run`:n.phase===`mid-run`?`mid-run`:null,o=kK(n.continuationMessageId),s=AK(n.continuationMessageCoveredPartCount),c=typeof n.summary==`string`?n.summary:void 0,l=AK(n.coveredMessageCount),u=AK(n.coveredSessionMessageCount),d=AK(n.originalEstimatedTokens),f=AK(n.projectedEstimatedTokens),p=kK(n.createdAt),m=kK(n.updatedAt);return!r||!i||l===null||u===null||d===null||f===null||!p||!m?null:{id:r,status:i,...a?{phase:a}:{},...o?{continuationMessageId:o}:{},...s===null?{}:{continuationMessageCoveredPartCount:s},...c===void 0?{}:{summary:c},coveredMessageCount:l,coveredSessionMessageCount:u,originalEstimatedTokens:d,projectedEstimatedTokens:f,createdAt:p,updatedAt:m}}var PK=mK,FK=`nextclaw.observation.event`,IK=`ncp.observation.event`;function LK(e){return e===PK||e===IK||e===FK}function RK(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function zK(e,t){let n=e[t];return typeof n==`string`&&n.trim()?n.trim():null}function BK(e){if(!RK(e))return null;let t=zK(e,`deliveryId`),n=zK(e,`extensionId`),r=zK(e,`eventId`),i=zK(e,`eventType`),a=zK(e,`occurredAt`);return!t||!n||!r||!i||!a?null:{deliveryId:t,extensionId:n,eventId:r,eventType:i,occurredAt:a,payload:e.payload,...e.sourceRefs===void 0?{}:{sourceRefs:e.sourceRefs},...typeof e.causationId==`string`&&e.causationId.trim()?{causationId:e.causationId.trim()}:{}}}function VK(e,t=6e3){let n;if(typeof e==`string`)n=e;else try{n=JSON.stringify(e,null,2)??``}catch{n=String(e)}return n.length<=t?n:`${n.slice(0,Math.max(0,t-16))}\n…`}var HK=`inherited_from_session_id`,UK=`nextclaw.context-compaction`;function WK(e){let t=e.metadata?.[HK];return typeof t==`string`&&t.trim()?t.trim():null}function GK(e){if(e.parts.length!==1)return null;let t=e.parts[0];return!t||t.type!==`extension`||!LK(t.extensionType)?null:BK(t.data)}function KK(e){return!hK(e)&&!C(e)&&!NK(e)&&!WK(e)}function qK(e){let t=e.metadata?.[f];return typeof t==`string`&&t.trim()?t.trim():null}function JK(e,t){return[...e,...t]}function YK(e,t){let n=e.lifecycle?.startedAt??t.lifecycle?.startedAt,r=t.lifecycle?.endedAt??e.lifecycle?.endedAt;return{...e,status:t.status,parts:JK(e.parts,t.parts),lifecycle:n||r?{startedAt:n,endedAt:r}:void 0,metadata:e.metadata||t.metadata?{...e.metadata,...t.metadata}:void 0}}function XK(e,t={}){let n=[],r=new Map,i=new Map,a=new Map(e.map(e=>[e.id,e.parts.length])),o=[],s=new Set,c=[],l=null;e.forEach((e,t)=>{let u=NK(e),d=u?.continuationMessageId,f=u?.phase===`pre-run`?l:null,p=d??f,m=u?.continuationMessageCoveredPartCount??(f?a.get(f):void 0),h=p?i.get(p):void 0;if((u?.phase===`mid-run`||u?.phase===`pre-run`)&&h&&m!==void 0){o.push({boundaryIndex:h.partOffset+m,checkpoint:u,messageIndex:h.messageIndex,rawOrder:t,serviceMessageId:e.id}),s.add(e.id);return}let g=qK(e);if(g&&hK(e)){l=g;return}if(!KK(e))return;let _=GK(e);if(_){c.push({boundaryIndex:n.length,event:_,messageId:e.id});return}let v=l&&e.role===`assistant`?r.get(l):void 0;if(v!==void 0&&n[v]?.role===`assistant`){let t=n[v].parts.length;n[v]=YK(n[v],e),r.set(e.id,v),i.set(e.id,{messageIndex:v,partOffset:t}),l=null;return}l=null,r.set(e.id,n.length),i.set(e.id,{messageIndex:n.length,partOffset:0}),n.push(e)});let u=new Map;for(let e of o){let t=u.get(e.messageIndex)??[];t.push(e),u.set(e.messageIndex,t)}for(let[e,t]of u){let r=n[e];if(!r)continue;let i=[...r.parts],a=0;t.sort((e,t)=>e.boundaryIndex-t.boundaryIndex||e.rawOrder-t.rawOrder).forEach(e=>{if(!Number.isSafeInteger(e.boundaryIndex)||e.boundaryIndex<0||e.boundaryIndex>r.parts.length){s.delete(e.serviceMessageId);return}i.splice(e.boundaryIndex+a,0,{type:`extension`,extensionType:UK,data:{id:e.serviceMessageId,checkpoint:e.checkpoint}}),a+=1}),n[e]={...r,parts:i}}let d=l?r.get(l):void 0;return t.continuationRunning&&d!==void 0&&(n[d]={...n[d],status:`pending`}),{messages:n,inlineCompactionMessageIds:s,observationEvents:c}}function ZK(e,t={}){return XK(e,t).messages}function QK(e){let{rawMessageId:t,rawMessages:n,visibleRawMessages:r}=e,i=n.findIndex(e=>e.id===t);return i<0?r.length-1:ZK(n.slice(0,i)).length-1}function $K(e){let t=e.findIndex(e=>WK(e));if(t<0)return null;let n=WK(e[t]);return n?{boundaryIndex:ZK(e.slice(0,t)).length,sourceSessionId:n,inheritedMessageCount:e.filter(e=>WK(e)===n).length}:null}function eq(e){let t=XK(e.rawMessages),n=t.messages,r=t.observationEvents,i=e.rawMessages.map(e=>({rawMessageId:e.id,checkpoint:NK(e)})).filter(e=>!!(e.checkpoint&&!t.inlineCompactionMessageIds.has(e.rawMessageId))).map(t=>({key:`compaction:${t.rawMessageId}`,checkpoint:t.checkpoint,boundaryIndex:QK({rawMessages:e.rawMessages,visibleRawMessages:n,rawMessageId:t.rawMessageId})})).sort((e,t)=>e.boundaryIndex-t.boundaryIndex),a=$K(e.rawMessages),o=[],s=[],c=0,l=0,u=()=>{s.length!==0&&(o.push(...s.map(e=>({kind:`message`,key:`message:${e.id}`,message:e}))),s=[])},d=e=>{for(;l<r.length&&r[l].boundaryIndex<=e;){let e=r[l];u(),o.push({kind:`observation-event`,key:`observation-event:${e.messageId}`,event:e.event}),l+=1}};for(n.forEach((t,n)=>{d(n),a?.boundaryIndex===n&&(u(),o.push({kind:`context-inheritance`,key:`context-inheritance:${a.sourceSessionId}`,inheritance:a}));let r=e.messages[n];for(r&&s.push(r);c<i.length&&i[c]?.boundaryIndex<=n;){let e=i[c];u(),o.push({kind:`compaction`,key:e.key,checkpoint:e.checkpoint}),c+=1}}),a?.boundaryIndex===n.length&&(u(),o.push({kind:`context-inheritance`,key:`context-inheritance:${a.sourceSessionId}`,inheritance:a})),d(n.length);c<i.length;){let e=i[c];u(),o.push({kind:`compaction`,key:e.key,checkpoint:e.checkpoint}),c+=1}return u(),o.length===0&&o.push({kind:`empty`,key:`empty`}),o}function tq(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e.error:null;return typeof t==`object`&&t&&!Array.isArray(t)&&t.code===`invalid_tool_arguments`?t:null}function nq(e,t){let n=jW(e.reasoning);return n?{type:`reasoning`,text:n,label:t.reasoningLabel}:null}function rq(e,t){let n=e.mimeType.startsWith(`image/`),r=PW(e.sizeBytes);return{type:`file`,file:{label:typeof e.name==`string`&&e.name.trim()?e.name.trim():n?t.imageAttachmentLabel:t.fileAttachmentLabel,mimeType:e.mimeType,dataUrl:typeof e.url==`string`&&e.url.trim().length>0?e.url.trim():`data:${e.mimeType};base64,${e.data}`,...r==null?{}:{sizeBytes:r},isImage:n}}}function iq(e,t){let n=e.toolInvocation,r=RW(n.result,t);if(r)return r;let i=fK({invocation:n,texts:{toolStatusRunningLabel:t.toolStatusRunningLabel,toolStatusCompletedLabel:t.toolStatusCompletedLabel,toolStatusFailedLabel:t.toolStatusFailedLabel}});if(i)return{type:`tool-card`,card:zW(i,t)};let a=tK({invocation:n,actionLabel:t.showContentActionLabel??`Show content`,statusLabel:t.toolStatusCompletedLabel});if(a)return{type:`tool-card`,card:zW(a,t)};let o=BW({status:n.status,error:n.error,cancelled:n.cancelled,result:n.result,texts:t}),s=tq(n.result),c=Array.isArray(s?.issues)?s.issues.find(e=>typeof e==`string`&&e.trim().length>0):void 0,l=HG({toolName:n.toolName,status:n.status,toolCallId:n.toolCallId,args:n.args,parsedArgs:n.parsedArgs,result:n.result}),u=c?`Invalid arguments: ${c}`:l?.summary??RU(n.parsedArgs??n.args),d=c||(typeof n.error==`string`&&n.error.trim()?n.error.trim():``),f=!n.error&&FW(n.result),p=(!l?.fileOperation||!!n.error)&&!f,m=GW(n);return{type:`tool-card`,card:zW({kind:o.kind,name:n.toolName,...m?{agentId:m}:{},detail:u,inputData:l?void 0:n.parsedArgs??n.args,text:p&&d?d:void 0,outputData:n.result,callId:n.toolCallId||void 0,toolCallId:n.toolCallId||void 0,...n.execution?{execution:n.execution}:{},hasResult:o.hasResult,statusTone:s?`error`:o.statusTone,statusLabel:s?t.toolStatusFailedLabel:o.statusLabel,...l?.fileOperation?{fileOperation:l.fileOperation}:{}},t)}}function aq(e,t){return{type:`unknown`,label:t.unknownPartLabel,rawType:typeof e.type==`string`?e.type:`unknown`,text:IU(e)}}function oq(e){return e.type===`text`&&typeof e.text==`string`}function sq(e){return e.type===`reasoning`&&typeof e.reasoning==`string`}function cq(e){return e.type===`file`&&typeof e.mimeType==`string`&&typeof e.data==`string`}function lq(e){return e.type!==`tool-invocation`||typeof e.toolInvocation!=`object`||e.toolInvocation===null||Array.isArray(e.toolInvocation)?!1:`toolName`in e.toolInvocation&&typeof e.toolInvocation.toolName==`string`}function uq(e){if(LK(e.extensionType)){let t=BK(e.data);return t?{type:`custom`,id:t.deliveryId,customType:e.extensionType,data:t}:null}if(e.extensionType!==`nextclaw.context-compaction`)return null;let t=e.data;return!t||typeof t.id!=`string`||!t.checkpoint?null:{type:`custom`,id:t.id,customType:e.extensionType,data:{id:t.id,checkpoint:t.checkpoint},process:!0}}function dq(e){return e.type===`extension`&&`extensionType`in e&&typeof e.extensionType==`string`&&`data`in e}function fq(e){let{inlineTokens:t,part:n,texts:r}=e;return oq(n)?AW(n,t):sq(n)?nq(n,r):cq(n)?rq(n,r):lq(n)?iq(n,r):dq(n)?uq(n)??aq(n,r):aq(n,r)}function pq(e){let t=e.meta?.timestamp;return t&&Number.isFinite(Date.parse(t))?t:new Date().toISOString()}function mq(e,t){return e===`user`?t.user:e===`assistant`?t.assistant:e===`tool`?t.tool:e===`system`?t.system:t.fallback}function hq(e){return e===`user`||e===`assistant`||e===`tool`||e===`system`?e:`message`}function gq(e,t){return{id:e.id,role:hq(e.role),roleLabel:mq(e.role,t.texts.roleLabels),timestampLabel:t.formatTimestamp(pq(e)),status:e.meta?.status,processSummary:e.meta?.processSummary,executionSummaryLabel:e.meta?.executionSummaryLabel,moreActions:e.meta?.moreActions,parts:e.parts.map(n=>fq({part:n,inlineTokens:e.meta?.inlineTokens??[],texts:t.texts})).filter(e=>e!==null)}}var _q=`nextclawUiHistoryToolPayloadSummary`;function vq(e){let t=e.metadata?.[_q];if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t,{toolCallCount:r}=n;return!Number.isInteger(r)||r<=0?null:{toolCallCount:r,toolNames:Array.isArray(n.toolNames)?n.toolNames.filter(e=>typeof e==`string`&&e.trim().length>0):[]}}function yq(e){return e.type===`reasoning`||e.type===`tool-invocation`}function bq(e){return e.type===`text`||e.type===`rich-text`?e.text.trim().length>0:e.type===`file`||e.type===`source`||e.type===`card`}function xq(e){if(e.role!==`assistant`||e.status===`pending`||e.status===`streaming`)return!1;let t=-1;for(let n=e.parts.length-1;n>=0;--n){let r=e.parts[n];if(r&&yq(r)){t=n;break}}return t>=0&&t<e.parts.length-1&&e.parts.slice(t+1).some(bq)}function Sq(e){let t=e.lifecycle?.startedAt,n=e.lifecycle?.endedAt;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=Math.round((i-r)/1e3),o=Math.floor(a/3600),s=Math.floor(a%3600/60),c=a%60;return o>0?s>0?`${o}h ${s}m`:`${o}h`:s>0?`${s}m ${c}s`:`${c}s`}function Cq({formatDeferredToolSummary:e,message:t,processedLabel:n}){if(!xq(t))return;let r=Sq(t),i=r?`${n} ${r}`:n,a=vq(t);return{label:a&&e?`${i} · ${e(a.toolCallCount,a.toolNames)}`:i}}function wq(e){let t=e>=1e9?{divisor:1e9,suffix:`b`}:e>=1e6?{divisor:1e6,suffix:`m`}:e>=1e3?{divisor:1e3,suffix:`k`}:null;return t?`${Math.round(e/t.divisor*10)/10}${t.suffix}`:String(e)}function Tq(e,t){if(e===null)return t;let n=wq(e);return e>=1e3?`${n} (${e})`:n}function Eq(e,t){let n=[];if(e.usage.inputTokens!==null&&n.push(`${wq(e.usage.inputTokens)} ${t.input}`),e.usage.outputTokens!==null&&n.push(`${wq(e.usage.outputTokens)} ${t.output}`),n.length===0&&e.usage.totalTokens!==null&&n.push(`${wq(e.usage.totalTokens)} ${t.tokens}`),n.length===0)return e.model;let r=`${e.model} · ${n.join(` / `)}`;return e.usage.status===`partial`?`${r} · ${t.partial}`:r}function Dq(e){let{labels:t,message:n}=e;if(n.role!==`assistant`)return null;let r=xK(n.metadata);if(!r)return null;let{usage:i}=r,a=[{label:t.fields.runId,value:r.runId},{label:t.fields.runtime,value:r.runtimeId},{label:t.fields.model,value:r.model},{label:t.fields.requestedModel,value:r.requestedModel??t.notAvailable},{label:t.fields.outcome,value:t.outcomes[r.outcome]},{label:t.fields.inputTokens,value:Tq(i.inputTokens,t.notAvailable)},{label:t.fields.outputTokens,value:Tq(i.outputTokens,t.notAvailable)},{label:t.fields.cachedInputTokens,value:Tq(i.cachedInputTokens,t.notAvailable)},{label:t.fields.totalTokens,value:Tq(i.totalTokens,t.notAvailable)},{label:t.fields.modelCallCount,value:i.modelCallCount?.toString()??t.notAvailable},{label:t.fields.reportedModelCallCount,value:i.reportedModelCallCount?.toString()??t.notAvailable},{label:t.fields.usageStatus,value:t.usageStatuses[i.status]}];return{cacheKey:JSON.stringify(r),summaryLabel:Eq(r,t),moreActions:{triggerLabel:t.moreActions,items:[{key:`ai-execution-metadata`,label:t.viewMetadata,dialog:{title:t.metadataTitle,description:t.metadataDescription,closeLabel:t.close,rows:a}}]}}}function Oq(e){return{roleLabels:{user:b(`chatRoleUser`),assistant:b(`chatRoleAssistant`),tool:b(`chatRoleTool`),system:b(`chatRoleSystem`),fallback:b(`chatRoleMessage`)},reasoningLabel:b(`chatReasoning`),toolCallLabel:b(`chatToolCall`),toolResultLabel:b(`chatToolResult`),toolInputLabel:b(`chatToolInput`),toolNoOutputLabel:b(`chatToolNoOutput`),toolOutputLabel:b(`chatToolOutput`),toolStatusPreparingLabel:b(`chatToolStatusPreparing`),toolStatusRunningLabel:b(`chatToolStatusRunning`),toolStatusCompletedLabel:b(`chatToolStatusCompleted`),toolStatusFailedLabel:b(`chatToolStatusFailed`),toolStatusCancelledLabel:b(`chatToolStatusCancelled`),showContentActionLabel:b(`chatShowContentAction`),imageAttachmentLabel:b(`chatImageAttachment`),fileAttachmentLabel:b(`chatFileAttachment`),unknownPartLabel:b(`chatUnknownPart`)}}function kq(){return{directory:{running:b(`chatToolDirectoryRunning`),success:b(`chatToolDirectorySuccess`),error:b(`chatToolDirectoryError`),cancelled:b(`chatToolDirectoryCancelled`)},web:{running:b(`chatToolWebRunning`),success:b(`chatToolWebSuccess`),error:b(`chatToolWebError`),cancelled:b(`chatToolWebCancelled`)},message:{running:b(`chatToolMessageRunning`),success:b(`chatToolMessageSuccess`),error:b(`chatToolMessageError`),cancelled:b(`chatToolMessageCancelled`)},session:{running:b(`chatToolSessionRunning`),success:b(`chatToolSessionSuccess`),error:b(`chatToolSessionError`),cancelled:b(`chatToolSessionCancelled`)},agent:{running:b(`chatToolAgentRunning`),success:b(`chatToolAgentSuccess`),error:b(`chatToolAgentError`),cancelled:b(`chatToolAgentCancelled`)},memory:{running:b(`chatToolMemoryRunning`),success:b(`chatToolMemorySuccess`),error:b(`chatToolMemoryError`),cancelled:b(`chatToolMemoryCancelled`)},schedule:{running:b(`chatToolScheduleRunning`),success:b(`chatToolScheduleSuccess`),error:b(`chatToolScheduleError`),cancelled:b(`chatToolScheduleCancelled`)},system:{running:b(`chatToolSystemRunning`),success:b(`chatToolSystemSuccess`),error:b(`chatToolSystemError`),cancelled:b(`chatToolSystemCancelled`)},image:{running:b(`chatToolImageRunning`),success:b(`chatToolImageSuccess`),error:b(`chatToolImageError`),cancelled:b(`chatToolImageCancelled`)},display:{running:b(`chatToolDisplayRunning`),success:b(`chatToolDisplaySuccess`),error:b(`chatToolDisplayError`),cancelled:b(`chatToolDisplayCancelled`)}}}function Aq(e){return{input:b(`chatAiExecutionInput`),output:b(`chatAiExecutionOutput`),tokens:b(`chatAiExecutionTokens`),partial:b(`chatAiExecutionPartial`),moreActions:b(`chatMessageMoreActions`),viewMetadata:b(`chatAiExecutionViewMetadata`),metadataTitle:b(`chatAiExecutionMetadataTitle`),metadataDescription:b(`chatAiExecutionMetadataDescription`),close:b(`chatAiExecutionMetadataClose`),notAvailable:b(`chatAiExecutionNotAvailable`),fields:{runId:b(`chatAiExecutionRunId`),runtime:b(`chatAiExecutionRuntime`),model:b(`chatAiExecutionModel`),requestedModel:b(`chatAiExecutionRequestedModel`),outcome:b(`chatAiExecutionOutcome`),inputTokens:b(`chatAiExecutionInputTokens`),outputTokens:b(`chatAiExecutionOutputTokens`),cachedInputTokens:b(`chatAiExecutionCachedInputTokens`),totalTokens:b(`chatAiExecutionTotalTokens`),modelCallCount:b(`chatAiExecutionModelCallCount`),reportedModelCallCount:b(`chatAiExecutionReportedModelCallCount`),usageStatus:b(`chatAiExecutionUsageStatus`)},outcomes:{completed:b(`chatAiExecutionOutcomeCompleted`),failed:b(`chatAiExecutionOutcomeFailed`),aborted:b(`chatAiExecutionOutcomeAborted`)},usageStatuses:{reported:b(`chatAiExecutionUsageReported`),partial:b(`chatAiExecutionUsagePartial`),unavailable:b(`chatAiExecutionUsageUnavailable`)}}}function jq(e){return{addSelectionToChatLabel:b(`chatWorkspaceAddToChat`),selectionTooLongLabel:b(`chatWorkspaceExcerptSelectionTooLong`),copyCodeLabel:b(`chatCodeCopy`),copiedCodeLabel:b(`chatCodeCopied`),copyMessageLabel:b(`chatMessageCopy`),copiedMessageLabel:b(`chatMessageCopied`),excerptCharacterCountTemplate:b(`chatWorkspaceExcerptCharacterCount`),mermaidDiagramLabel:b(`chatMermaidDiagram`),mermaidExpandLabel:b(`chatMermaidExpand`),mermaidLoadingLabel:b(`chatMermaidLoading`),mermaidRenderErrorLabel:b(`chatMermaidRenderError`),previewZoomInLabel:b(`chatPreviewZoomIn`),previewZoomOutLabel:b(`chatPreviewZoomOut`),previewResetZoomLabel:b(`chatPreviewResetZoom`),typingLabel:b(`chatTyping`),pendingInputLabel:b(`chatSteeringPending`),reasoningCharacterCountTemplates:{inProgress:b(`chatReasoningInProgressCharacterCount`),completed:b(`chatReasoningCompletedCharacterCount`)},toolStatusLabels:{terminal:{running:b(`chatToolTerminalRunning`),success:b(`chatToolTerminalSuccess`),error:b(`chatToolTerminalError`),cancelled:b(`chatToolTerminalCancelled`)},fileRead:{running:b(`chatToolFileReadRunning`),success:b(`chatToolFileReadSuccess`),error:b(`chatToolFileReadError`),cancelled:b(`chatToolFileReadCancelled`)},fileEdit:{running:b(`chatToolFileEditRunning`),success:b(`chatToolFileEditSuccess`),error:b(`chatToolFileEditError`),cancelled:b(`chatToolFileEditCancelled`)},search:{running:b(`chatToolSearchRunning`),success:b(`chatToolSearchSuccess`),error:b(`chatToolSearchError`),cancelled:b(`chatToolSearchCancelled`)},builtIn:kq()},attachmentOpenLabel:b(`chatAttachmentOpen`),attachmentAttachedLabel:b(`chatAttachmentAttached`),attachmentExpandLabel:b(`chatAttachmentExpand`),attachmentCloseLabel:b(`chatAttachmentClosePreview`),attachmentCategoryLabels:{archive:b(`chatAttachmentCategoryArchive`),audio:b(`chatAttachmentCategoryAudio`),code:b(`chatAttachmentCategoryCode`),data:b(`chatAttachmentCategoryData`),document:b(`chatAttachmentCategoryDocument`),generic:b(`chatAttachmentCategoryGeneric`),image:b(`chatAttachmentCategoryImage`),pdf:b(`chatAttachmentCategoryPdf`),sheet:b(`chatAttachmentCategorySheet`),video:b(`chatAttachmentCategoryVideo`)},toolActivitySegmentTemplates:{read:{one:b(`chatToolActivityReadOne`),other:b(`chatToolActivityReadOther`)},edit:{one:b(`chatToolActivityEditOne`),other:b(`chatToolActivityEditOther`)},directory:{one:b(`chatToolActivityDirectoryOne`),other:b(`chatToolActivityDirectoryOther`)},search:{one:b(`chatToolActivitySearchOne`),other:b(`chatToolActivitySearchOther`)},bash:{one:b(`chatToolActivityBashOne`),other:b(`chatToolActivityBashOther`)},web:{one:b(`chatToolActivityWebOne`),other:b(`chatToolActivityWebOther`)},agent:{one:b(`chatToolActivityAgentOne`),other:b(`chatToolActivityAgentOther`)},panel:{one:b(`chatToolActivityPanelOne`),other:b(`chatToolActivityPanelOther`)},other:{one:b(`chatToolActivityOtherOne`),other:b(`chatToolActivityOtherOther`)}},toolActivityFailedLabel:b(`chatProcessSummaryFailed`),toolActivityCancelledLabel:b(`chatProcessSummaryCancelled`),toolPayloadLoadingLabel:b(`chatToolPayloadLoading`),toolPayloadLoadFailedLabel:b(`chatToolPayloadLoadFailed`),toolActivityShowMoreTemplate:b(`chatToolActivityShowMore`)}}async function Mq(e){let t=await bk(e);R[t?`success`:`error`](b(t?`chatCodeCopied`:`chatWorkspaceCopyPathFailed`))}function Nq({busy:e,downloadUrl:t,entry:n,onAddToChat:r,onCreateFolder:i,onCreateFile:a,onDelete:o,onOpen:s,onRenameRequest:c,onRevealPath:l,onUpload:u,ownCreateTarget:d,parentRefresh:f,relativePath:p}){let m=n.kind===`directory`,h={key:`open`,items:[{key:`open`,label:b(`chatWorkspaceOpen`),icon:(0,H.jsx)(fe,{className:`h-4 w-4`}),onSelect:s}]},g={key:`manage`,items:m?[...a?[{key:`new-file`,label:b(`chatWorkspaceNewFile`),icon:(0,H.jsx)(Pa,{className:`h-4 w-4`}),disabled:e,restoreFocus:!1,onSelect:()=>a(d)}]:[],...i?[{key:`new-folder`,label:b(`chatWorkspaceNewFolder`),icon:(0,H.jsx)(Va,{className:`h-4 w-4`}),disabled:e,restoreFocus:!1,onSelect:()=>i(d)}]:[],...u?[{key:`upload`,label:b(`chatWorkspaceUploadFilesHere`),icon:(0,H.jsx)(Wo,{className:`h-4 w-4`}),disabled:e,restoreFocus:!1,onSelect:()=>u(d)}]:[]]:[]},_={key:`nextclaw`,items:[...p&&r?[{key:`add-to-chat`,label:b(`chatWorkspaceAddToChat`),icon:(0,H.jsx)(to,{className:`h-4 w-4`}),restoreFocus:!1,onSelect:()=>r(n,p)}]:[],...t?[{key:`download`,label:b(`chatWorkspaceDownloadFile`),icon:(0,H.jsx)(wa,{className:`h-4 w-4`}),href:t,download:n.name}]:[]]},v={key:`path`,items:[...l?[{key:`reveal`,label:b(`chatWorkspaceRevealInFileManager`),icon:(0,H.jsx)(Qa,{className:`h-4 w-4`}),onSelect:()=>l(n.path)}]:[],{key:`copy-path`,label:b(`chatWorkspaceCopyPath`),icon:(0,H.jsx)(xa,{className:`h-4 w-4`}),onSelect:()=>void Mq(n.path)},...p?[{key:`copy-relative-path`,label:b(`chatWorkspaceCopyRelativePath`),icon:(0,H.jsx)(xa,{className:`h-4 w-4`}),onSelect:()=>void Mq(p)}]:[]]},y={key:`rename`,items:c?[{key:`rename`,label:b(`chatWorkspaceRename`),icon:(0,H.jsx)(yo,{className:`h-4 w-4`}),disabled:e,restoreFocus:!1,onSelect:c}]:[]},x={key:`danger`,items:o?[{key:`delete`,label:b(`chatWorkspaceDelete`),icon:(0,H.jsx)(Vo,{className:`h-4 w-4`}),destructive:!0,disabled:e,restoreFocus:!1,onSelect:()=>o(n,f)}]:[]};return m?[_,g,v,y,x]:[h,_,v,y,x]}var Pq=`nextclaw.chat.workspace-project-tree.state`,Fq=1,Iq=12,Lq=256,Rq=1e7;function zq(e){return!!e&&typeof e==`object`}function Bq(e){return(e?.trim().replace(/\\/g,`/`).replace(/\/+$/g,``)??``)||(e?.trim()===`/`?`/`:``)}function Vq(e){return e?.trim().replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``).replace(/\/{2,}/g,`/`)??``}function Hq(e){return typeof e!=`number`||!Number.isFinite(e)?0:Math.min(Math.max(0,Math.round(e)),Rq)}function Uq(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:0}function Wq(e){return Array.isArray(e)?Array.from(new Set(e.map(e=>typeof e==`string`?Vq(e):``).filter(Boolean))).slice(0,Lq):[]}function Gq(e){return zq(e)?Object.entries(e).map(([e,t])=>{let n=Bq(e);return!n||!zq(t)?null:[n,{expandedPaths:Wq(t.expandedPaths),scrollTop:Hq(t.scrollTop),updatedAt:Uq(t.updatedAt)}]}).filter(e=>e!==null).sort((e,t)=>t[1].updatedAt-e[1].updatedAt).slice(0,Iq).reduce((e,[t,n])=>(e[t]=n,e),{}):{}}function Kq(e){return Gq(e)}function qq(){return{expandedPaths:[],scrollTop:0,updatedAt:Date.now()}}var Jq=N()(_i(e=>({trees:{},collapseAll:t=>{let n=Bq(t);n&&e(e=>{let t=e.trees[n];return!t||t.expandedPaths.length===0?e:{trees:Kq({...e.trees,[n]:{...t,expandedPaths:[],updatedAt:Date.now()}})}})},setDirectoryExpanded:(t,n,r)=>{let i=Bq(t),a=Vq(n);!i||!a||e(e=>{let t=e.trees[i]??qq(),n=r?Array.from(new Set([...t.expandedPaths,a])).slice(0,Lq):t.expandedPaths.filter(e=>e!==a);return n.length===t.expandedPaths.length&&n.every((e,n)=>e===t.expandedPaths[n])?e:{trees:Kq({...e.trees,[i]:{...t,expandedPaths:n,updatedAt:Date.now()}})}})},setScrollTop:(t,n)=>{let r=Bq(t);if(!r)return;let i=Hq(n);e(e=>{let t=e.trees[r]??qq();return t.scrollTop===i?e:{trees:Kq({...e.trees,[r]:{...t,scrollTop:i,updatedAt:Date.now()}})}})}}),{name:Pq,version:Fq,storage:vi(()=>window.localStorage),partialize:e=>({trees:e.trees}),merge:(e,t)=>({...t,trees:Gq(zq(e)?e.trees:null)})}));function Yq(e){return`${e.kind===`directory`?b(`chatWorkspaceOpenDirectory`):b(`chatWorkspaceOpenFile`)}: ${e.name}`}function Xq(e){return e instanceof Error?e.message:String(e)}function Zq(e){return e.error?Xq(e.error):null}function Qq({fileName:e,isDirectory:t,isExpanded:n}){return t?n?(0,H.jsx)(Ba,{className:`h-4 w-4 shrink-0 text-amber-500`}):(0,H.jsx)(Ga,{className:`h-4 w-4 shrink-0 text-amber-500`}):(0,H.jsx)(EU,{fileName:e})}function $q({browseQuery:e,level:t,onFileOpen:n,onRevealPath:r,parentCreateTarget:i,parentRelativePath:a,...o}){let s=e.data?.entries??[],c=Zq(e),l={paddingLeft:`${36+t*14}px`};return e.isLoading&&!e.data?(0,H.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-gray-400`,style:l,children:b(`chatWorkspaceLoadingDirectory`)}):c&&!e.data?(0,H.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-rose-600`,style:l,title:c,children:b(`chatWorkspaceDirectoryLoadFailed`)}):s.length===0?(0,H.jsx)(`div`,{className:`h-7 truncate pr-2 text-[11px] leading-7 text-gray-400`,style:l,children:b(`chatWorkspaceDirectoryEmpty`)}):s.map(s=>(0,H.jsx)(iJ,{...o,browseParentRefresh:()=>e.refetch(),entry:s,level:t+1,onFileOpen:n,onRevealPath:r,parentCreateTarget:i,relativePath:a?`${a}/${s.name}`:null},s.path))}function eJ({entry:e,onRename:t,refresh:n}){let[r,i]=(0,V.useState)(!1),[a,o]=(0,V.useState)(e.name),[s,c]=(0,V.useState)(null),l=()=>i(!1);return{active:r,cancel:l,error:s,name:a,start:()=>{o(e.name),c(null),i(!0)},submit:async()=>{let r=a.trim();if(!(!t||!r||r===`.`||r===`..`||r.includes(`/`)||r.includes(`\\`))){if(r===e.name){l();return}try{await t(e,r,n),l()}catch(e){c(`${b(`chatWorkspaceRenameFailed`)}: ${Xq(e)}`)}}},updateName:e=>{o(e),c(null)}}}function tJ(e,t,n,r){let i=!n&&e!==null&&e===t;return[i,n===null?i:n===r]}function nJ(e,t,n,r,i){return e||!!(!i&&t&&r&&n?.startsWith(`${r}/`))}function rJ(e,t){let[n,r]=(0,V.useState)(!1),i=Vq(t),a=Jq(t=>!!(e&&i&&t.trees[e]?.expandedPaths.includes(i))),o=Jq(e=>e.setDirectoryExpanded);return{manuallyExpanded:e&&i?a:n,updateExpanded:(0,V.useCallback)(t=>{if(e&&i){o(e,i,t);return}r(t)},[i,o,e])}}function iJ({activeRelativePath:e,browseParentRefresh:t,busy:n,createTarget:r,entry:i,level:a,onAddToChat:o,onCreateFolder:s,onCreateFile:c,onDelete:l,onRename:d,onFileOpen:f,onRevealComplete:p,onRevealPath:m,onSelect:h,onUpload:g,parentCreateTarget:_,relativePath:v,renderCreateFolder:y,revealPath:x,selectedPath:S,treeRootKey:C}){let w=(0,V.useRef)(null),T=(0,V.useRef)(null),E=i.kind===`directory`,{manuallyExpanded:D,updateExpanded:O}=rJ(C,v),k=nJ(D,E,e,v,S),A=eJ({entry:i,onRename:d,refresh:t}),ee=NF({path:i.path,includeFiles:!0,enabled:E&&k}),j=ee.refetch,M=E?null:on(i.path),N=(0,V.useMemo)(()=>E?{label:i.name,path:i.path,refresh:()=>j(),expand:()=>O(!0)}:_,[i.name,i.path,E,_,j,O]),te=(0,V.useMemo)(()=>({path:i.path,createTarget:N}),[i.path,N]),[P,ne]=tJ(e,v,S,i.path);(0,V.useLayoutEffect)(()=>{P&&w.current?.scrollIntoView?.({block:`nearest`})},[P]),(0,V.useLayoutEffect)(()=>{x===i.path&&(w.current?.scrollIntoView?.({block:`nearest`}),h(te),T.current?.focus(),p())},[i.path,p,h,x,te]);let re=()=>{h(te),E?O(!k):f({path:i.path,label:i.name,viewMode:`preview`})},ie=Nq({busy:n,downloadUrl:M,entry:i,onAddToChat:o,onCreateFolder:s,onCreateFile:c,onDelete:l,onOpen:re,onRenameRequest:d?A.start:void 0,onRevealPath:m,onUpload:g,ownCreateTarget:N,parentRefresh:t,relativePath:v});return(0,H.jsxs)(`div`,{role:`treeitem`,"aria-expanded":E?k:void 0,"aria-label":Yq(i),"aria-selected":ne,children:[(0,H.jsx)(Qr,{groups:ie,label:b(`chatWorkspaceFileContextMenu`),children:(0,H.jsxs)(`div`,{ref:w,"data-workspace-tree-entry":``,className:u(`group flex h-[26px] w-full min-w-0 items-center text-gray-700 transition-colors hover:bg-gray-100 focus-within:bg-gray-100`,ne?`bg-primary/10`:null,i.hidden?`opacity-65`:null),style:{paddingLeft:`${6+a*12}px`},onContextMenu:()=>h(te),children:[A.active?(0,H.jsxs)(`form`,{className:`flex h-full min-w-0 flex-1 items-center gap-1`,onSubmit:e=>{e.preventDefault(),A.submit()},children:[(0,H.jsx)(vt,{autoFocus:!0,"aria-label":b(`chatWorkspaceRenameName`),className:`h-6 min-w-0 flex-1 px-1.5 text-xs`,value:A.name,onChange:e=>A.updateName(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),A.cancel())}}),(0,H.jsx)(B,{icon:(0,H.jsx)(wr,{className:`h-3.5 w-3.5`}),label:b(`chatWorkspaceRename`),size:`sm`,onClick:()=>void A.submit()}),(0,H.jsx)(B,{icon:(0,H.jsx)(hi,{className:`h-3.5 w-3.5`}),label:b(`cancel`),size:`sm`,onClick:A.cancel})]}):(0,H.jsxs)(`button`,{ref:T,type:`button`,"aria-label":i.name,className:`flex h-full min-w-0 flex-1 items-center gap-1 text-left text-[13px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border`,onClick:re,onKeyDown:e=>{e.key===`F2`&&d&&(e.preventDefault(),A.start())},children:[(0,H.jsx)(`span`,{className:`inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-gray-400`,children:E?k?(0,H.jsx)($n,{className:`h-3.5 w-3.5`}):(0,H.jsx)(sa,{className:`h-3.5 w-3.5`}):null}),(0,H.jsx)(Qq,{fileName:i.name,isDirectory:E,isExpanded:k}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:i.name,children:i.name})]}),A.active?null:(0,H.jsx)(Gr,{children:(0,H.jsx)(B,{className:`mr-1 opacity-0 pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 data-[context-menu-open]:pointer-events-auto data-[context-menu-open]:opacity-100`,icon:(0,H.jsx)(Ea,{className:`h-3.5 w-3.5`}),label:b(`chatWorkspaceMoreActionsFor`).replace(`{name}`,i.name),size:`sm`,tooltipSide:`left`,onClick:()=>h(te)})})]})}),A.error?(0,H.jsx)(`p`,{role:`alert`,className:`py-1 pr-2 text-[11px] text-destructive`,style:{paddingLeft:`${36+a*14}px`},children:A.error}):null,E&&k?(0,H.jsxs)(`div`,{role:`group`,children:[r?.path===i.path?y(a+1):null,(0,H.jsx)($q,{activeRelativePath:e,browseQuery:ee,busy:n,createTarget:r,level:a,onAddToChat:o,onCreateFolder:s,onCreateFile:c,onDelete:l,onRename:d,onFileOpen:f,onRevealComplete:p,onRevealPath:m,onSelect:h,onUpload:g,parentCreateTarget:N,parentRelativePath:v,renderCreateFolder:y,revealPath:x,selectedPath:S,treeRootKey:C})]}):null]})}function aJ(e){let t=e.trim();return!!(t&&t!==`.`&&t!==`..`&&!t.includes(`/`)&&!t.includes(`\\`))}function oJ({error:e,kind:t,isCreating:n,level:r,name:i,onCancel:a,onNameChange:o,onSubmit:s}){let c=(0,V.useRef)(null),l=(0,V.useRef)(null),u=aJ(i);(0,V.useLayoutEffect)(()=>{let e=c.current;typeof e?.scrollIntoView==`function`&&e.scrollIntoView({block:`nearest`}),l.current?.focus(),l.current?.select()},[]);let d=e=>{e.preventDefault(),u&&!n&&s()};return(0,H.jsxs)(`form`,{ref:c,role:`treeitem`,"aria-label":b(t===`file`?`chatWorkspaceNewFile`:`chatWorkspaceNewFolder`),className:`bg-primary/5`,onSubmit:d,children:[(0,H.jsxs)(`div`,{className:`flex min-h-8 min-w-0 items-center gap-1 py-0.5 pr-1`,style:{paddingLeft:`${8+r*14}px`},children:[(0,H.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0`}),t===`file`?(0,H.jsx)(La,{className:`h-4 w-4 shrink-0 text-gray-500`}):(0,H.jsx)(Ga,{className:`h-4 w-4 shrink-0 text-amber-500`}),(0,H.jsx)(vt,{ref:l,"aria-label":b(t===`file`?`chatWorkspaceFileName`:`chatWorkspaceFolderName`),className:`h-7 min-w-0 flex-1 rounded-md px-2 text-xs`,disabled:n,placeholder:b(t===`file`?`chatWorkspaceFileNamePlaceholder`:`chatWorkspaceFolderNamePlaceholder`),value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),a())}}),(0,H.jsx)(B,{disabled:!u||n,icon:(0,H.jsx)(wr,{className:`h-3.5 w-3.5`}),label:b(`chatWorkspaceCreateFolder`),size:`sm`,tooltipSide:`top`,onClick:s}),(0,H.jsx)(B,{disabled:n,icon:(0,H.jsx)(hi,{className:`h-3.5 w-3.5`}),label:b(`cancel`),size:`sm`,tooltipSide:`top`,onClick:a})]}),e?(0,H.jsx)(`p`,{role:`alert`,className:`pb-1 pr-2 text-[11px] text-destructive`,style:{paddingLeft:`${42+r*14}px`},children:e}):null]})}function sJ({disabled:e,rootLabel:t,onCollapseAll:n,onNewFile:r,onNewFolder:i,onRefresh:a}){return(0,H.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-0.5 border-b border-gray-200/80 bg-gray-50/55 px-1.5`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-0.5 text-[11px] font-semibold uppercase tracking-[0.03em] text-gray-800`,title:t,children:t}),(0,H.jsx)(B,{icon:(0,H.jsx)(Pa,{className:`h-4 w-4`}),label:b(`chatWorkspaceNewFile`),size:`sm`,disabled:e,onClick:r}),(0,H.jsx)(B,{icon:(0,H.jsx)(Va,{className:`h-4 w-4`}),label:b(`chatWorkspaceNewFolder`),size:`sm`,disabled:e,onClick:i}),(0,H.jsx)(B,{icon:(0,H.jsx)(mi,{className:`h-4 w-4`}),label:b(`chatWorkspaceRefreshExplorer`),size:`sm`,onClick:a}),(0,H.jsx)(B,{icon:(0,H.jsx)(la,{className:`h-4 w-4`}),label:b(`chatWorkspaceCollapseAll`),size:`sm`,onClick:n}),(0,H.jsx)(Gr,{children:(0,H.jsx)(B,{icon:(0,H.jsx)(Ea,{className:`h-4 w-4`}),label:b(`chatWorkspaceRootMoreActions`),size:`sm`})})]})}function cJ(e){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/g,``)||`/`;return/^[a-z]:/i.test(t)?t.toLowerCase():t}function lJ(e,t){if(e[0]!==`server-path-browse`||e[3]!==!0||typeof e[1]!=`string`)return!1;let n=cJ(t),r=cJ(e[1]);return r===n||(n===`/`?r.startsWith(`/`):r.startsWith(`${n}/`))}function uJ({children:e,currentPath:t,onBlankContext:n,onContextMenu:r,rootDraft:i,showRoot:a}){let o=(0,V.useRef)(null),s=(0,V.useRef)(null),c=(0,V.useRef)(null),l=Bq(t),u=Jq(e=>l?e.trees[l]?.scrollTop??0:0),d=Jq(e=>e.setScrollTop);return(0,V.useLayoutEffect)(()=>{o.current&&l&&(o.current.scrollTop=u)},[u,l]),(0,V.useEffect)(()=>()=>{c.current&&clearTimeout(c.current),l&&s.current!==null&&d(l,s.current)},[d,l]),(0,H.jsx)(`div`,{ref:o,"data-testid":`workspace-directory-browser`,role:`tree`,tabIndex:-1,"aria-label":b(`chatWorkspaceProjectFiles`),className:`min-h-0 flex-1 overflow-auto py-1 custom-scrollbar`,onContextMenu:e=>{e.target.closest(`[data-workspace-tree-entry]`)||n(),r?.(e)},onScroll:e=>{l&&(s.current=e.currentTarget.scrollTop,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,s.current!==null&&d(l,s.current)},120))},children:a&&t?(0,H.jsxs)(H.Fragment,{children:[i,e]}):e})}function dJ(e){return e instanceof Error?e.message:String(e)}function fJ(e,t){return e.replace(`{count}`,String(t))}function pJ(){let[e,t]=(0,V.useState)(null),n=(0,V.useRef)(null),r=async(e,r)=>{if(n.current)throw Error(`another workspace file operation is already running`);n.current=e,t(e);try{return await r()}finally{n.current=null,t(null)}};return{pendingAction:e,createDirectory:e=>r(`create-directory`,()=>Wt(e)),createFile:e=>r(`create-file`,()=>$t(e)),deleteEntry:e=>r(`delete`,()=>Nt(e)),renameEntry:e=>r(`rename`,()=>_t(e)),uploadFiles:e=>r(`upload`,()=>cn(e))}}async function mJ({actions:e,confirm:t,files:n,rootPath:r,target:i}){try{let a;try{a=await e.uploadFiles({basePath:r,targetPath:i.path,files:n})}catch(o){if(!(o instanceof Ct)||o.code!==`SERVER_PATH_FILE_EXISTS`)throw o;let s=Array.isArray(o.details?.conflicts)?o.details.conflicts.length:n.length;if(!await t({title:b(`chatWorkspaceUploadConflictTitle`),description:fJ(b(`chatWorkspaceUploadConflictDescription`),s),confirmLabel:b(`chatWorkspaceReplaceFiles`),variant:`destructive`}))return;a=await e.uploadFiles({basePath:r,targetPath:i.path,files:n,overwrite:!0})}await i.refresh(),R.success(fJ(b(`chatWorkspaceUploadSucceeded`),a.files.length))}catch(e){R.error(`${b(`chatWorkspaceUploadFailed`)}: ${dJ(e)}`)}}async function hJ({actions:e,confirm:t,entry:n,refresh:r,rootPath:i}){let a=n.kind===`directory`;if(!await t({title:b(a?`chatWorkspaceDeleteFolderTitle`:`chatWorkspaceDeleteFileTitle`).replace(`{name}`,n.name),description:b(a?`chatWorkspaceDeleteFolderDescription`:`chatWorkspaceDeleteFileDescription`),confirmLabel:b(`chatWorkspaceDelete`),variant:`destructive`}))return;let o=R.loading(b(`chatWorkspaceDeleting`).replace(`{name}`,n.name));try{let t=await e.deleteEntry({basePath:i,path:n.path});return await r(),R.dismiss(o),R.success(b(`chatWorkspaceDeleteSucceeded`).replace(`{name}`,n.name)),t}catch(e){return R.dismiss(o),R.error(`${b(`chatWorkspaceDeleteFailed`).replace(`{name}`,n.name)}: ${dJ(e)}`),null}}async function gJ({actions:e,kind:t,name:n,rootPath:r,setError:i,target:a}){i(null);try{let i=await(t===`file`?e.createFile:e.createDirectory)({basePath:r,parentPath:a.path,name:n});return await a.refresh(),R.success(b(t===`file`?`chatWorkspaceFileCreated`:`chatWorkspaceFolderCreated`)),i}catch(e){return i(`${b(t===`file`?`chatWorkspaceFileCreateFailed`:`chatWorkspaceFolderCreateFailed`)}: ${dJ(e)}`),null}}function _J({activeRelativePath:e,confirm:t,onEntryDeleted:n,onEntryRenamed:r,rootPath:i}){let a=(0,V.useRef)(null),o=pJ(),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(``),[d,f]=(0,V.useState)(`directory`),[p,m]=(0,V.useState)(null),[h,g]=(0,V.useState)(null),[_,v]=(0,V.useState)(null),[y,x]=(0,V.useState)(null),S=h?.activeRelativePath===e?h.selection:null,C=e=>{x(e),a.current&&(a.current.value=``,a.current.click())},w=t=>{g({activeRelativePath:e,selection:t})},T=(e,t)=>{t.expand?.(),f(e),u(``),m(null),c(t)};return{actions:{cancelCreateFolder:()=>{c(null),u(``),m(null)},clearSelection:()=>{g(null)},completeReveal:()=>v(null),deleteEntry:async(e,r)=>{if(!i)return;let a=await hJ({actions:o,confirm:t,entry:e,refresh:r,rootPath:i});a&&n?.(a.path)},openCreateFile:e=>T(`file`,e),openCreateFolder:e=>T(`directory`,e),renameEntry:async(t,n,a)=>{if(!i)return null;let s=await o.renameEntry({basePath:i,path:t.path,name:n});return r?.({previousPath:s.oldPath,path:s.path,label:s.name}),await a(),g(n=>n?.activeRelativePath===e?{activeRelativePath:e,selection:{path:s.path,createTarget:n.selection.createTarget.path===t.path?{...n.selection.createTarget,label:s.name,path:s.path}:n.selection.createTarget}}:null),v(s.path),R.success(b(`chatWorkspaceRenameSucceeded`).replace(`{name}`,s.name)),s},requestUpload:C,selectEntry:w,setCreateError:m,setCreateName:u,submitCreate:async()=>{if(!i||!s)return;let t=await gJ({actions:o,kind:d,name:l,rootPath:i,setError:m,target:s});t&&(c(null),g({activeRelativePath:e,selection:{path:t.path,createTarget:{label:l.trim(),path:t.path,refresh:s.refresh}}}),v(t.path))},uploadFiles:async e=>{!i||!y||e.length===0||await mJ({actions:o,confirm:t,files:e,rootPath:i,target:y})}},refs:{fileInputRef:a},state:{createError:p,createKind:d,createName:l,createTarget:s,pendingAction:o.pendingAction,revealPath:_,selectedCreateTarget:S?.createTarget??null,selectedPath:S?.path??null}}}var vJ=2*6e4;function yJ(e){let t=e.join(`
101
+ `);(0,V.useEffect)(()=>{let e=t.split(`
102
+ `).filter(Boolean);if(e.length===0)return;let n=!1,r=null,i=null,a=async()=>{try{let t=await bt({directories:e,subscriptionId:r});if(n){await Bt(t.subscriptionId).catch(()=>void 0);return}r=t.subscriptionId}catch(e){console.warn(`Project file auto-refresh is unavailable; manual refresh remains available.`,e)}};return a().then(()=>{!n&&r&&(i=setInterval(()=>void a(),vJ))}),()=>{n=!0,i&&clearInterval(i),r&&Bt(r).catch(()=>void 0)}},[t])}var bJ=[];function xJ(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function SJ({activeRelativePath:e,busy:t,createTarget:n,entries:r,fallbackParentTarget:i,mutable:a,onAddToChat:o,onCreateFile:s,onCreateFolder:c,onDelete:l,onFileOpen:u,onRevealComplete:d,onRename:f,onRevealPath:p,onSelect:m,onUpload:h,refresh:g,relativePaths:_,renderCreateFolder:v,revealPath:y,selectedPath:x,showRoot:S,treeRootKey:C}){return r.length===0?(0,H.jsx)(`div`,{className:`px-4 py-8 text-center text-xs text-gray-400`,children:b(`chatWorkspaceDirectoryEmpty`)}):r.map(r=>(0,H.jsx)(iJ,{activeRelativePath:e,browseParentRefresh:g,busy:t,createTarget:n,entry:r,level:S?1:0,onAddToChat:o,onCreateFile:a?s:void 0,onCreateFolder:a?c:void 0,onDelete:a?l:void 0,onFileOpen:u,onRevealComplete:d,onRename:f,onRevealPath:p,onSelect:m,onUpload:a?h:void 0,parentCreateTarget:i,relativePath:_?r.name:null,renderCreateFolder:v,revealPath:y,selectedPath:x,treeRootKey:C},r.path))}function CJ({busy:e,onCollapseAll:t,onCreateFile:n,onCreateFolder:r,onRefresh:i,onRevealPath:a,onUpload:o,target:s}){return[{key:`manage`,items:[{key:`new-file`,label:b(`chatWorkspaceNewFile`),icon:(0,H.jsx)(Pa,{className:`h-4 w-4`}),disabled:e,restoreFocus:!1,onSelect:n},{key:`new-folder`,label:b(`chatWorkspaceNewFolder`),icon:(0,H.jsx)(Va,{className:`h-4 w-4`}),disabled:e,restoreFocus:!1,onSelect:r},{key:`upload`,label:b(`chatWorkspaceUploadFilesHere`),icon:(0,H.jsx)(Wo,{className:`h-4 w-4`}),disabled:e,restoreFocus:!1,onSelect:o}]},{key:`view`,items:[{key:`refresh`,label:b(`chatWorkspaceRefreshExplorer`),icon:(0,H.jsx)(mi,{className:`h-4 w-4`}),onSelect:i},{key:`collapse`,label:b(`chatWorkspaceCollapseAll`),icon:(0,H.jsx)(la,{className:`h-4 w-4`}),onSelect:t}]},{key:`path`,items:[...a?[{key:`reveal`,label:b(`chatWorkspaceRevealInFileManager`),icon:(0,H.jsx)(Qa,{className:`h-4 w-4`}),onSelect:()=>a(s.path)}]:[],{key:`copy-path`,label:b(`chatWorkspaceCopyPath`),icon:(0,H.jsx)(xa,{className:`h-4 w-4`}),onSelect:()=>void Mq(s.path)}]}]}function wJ({activeRelativePath:e,browseQuery:t,ConfirmDialog:n,controller:r,entries:i,onAddToChat:a,onFileOpen:o,onRevealPath:s,rootLabel:c,rootPath:l,showRoot:u}){let d=F(),{cancelCreateFolder:f,clearSelection:p,completeReveal:m,submitCreate:h,deleteEntry:g,openCreateFile:_,openCreateFolder:v,requestUpload:y,renameEntry:x,selectEntry:S,setCreateError:C,setCreateName:w,uploadFiles:T}=r.actions,{fileInputRef:E}=r.refs,{createError:D,createKind:O,createName:k,createTarget:A,pendingAction:ee,revealPath:j,selectedCreateTarget:M,selectedPath:N}=r.state,te=ee!==null,P=Bq(l),ne=Jq(e=>e.collapseAll),re=()=>l?d.refetchQueries({predicate:e=>lJ(e.queryKey,l),type:`active`}):t.refetch(),ie=l?{label:c,path:l,refresh:re}:null,ae=M??ie,oe=e=>(0,H.jsx)(oJ,{error:D,kind:O,isCreating:ee===`create-directory`||ee===`create-file`,level:e,name:k,onCancel:f,onNameChange:e=>{w(e),C(null)},onSubmit:()=>void h()}),se=(0,H.jsx)(SJ,{activeRelativePath:e,busy:te,createTarget:A,entries:i,fallbackParentTarget:ie??{label:``,path:t.data?.currentPath??``,refresh:re},mutable:!!l,onAddToChat:a,onCreateFile:_,onCreateFolder:v,onDelete:(e,t)=>void g(e,t),onFileOpen:o,onRevealComplete:m,onRename:x,onRevealPath:s,onSelect:S,onUpload:y,refresh:re,relativePaths:!!a,renderCreateFolder:oe,revealPath:j,selectedPath:N,showRoot:!1,treeRootKey:P||null}),ce=(0,H.jsx)(uJ,{currentPath:l,onBlankContext:p,rootDraft:A?.path===l?oe(0):null,showRoot:u,children:se}),le=ie?CJ({busy:te,onCollapseAll:()=>{P&&ne(P)},onCreateFile:()=>_(ie),onCreateFolder:()=>v(ie),onRefresh:()=>void re(),onRevealPath:s,onUpload:()=>y(ie),target:ie}):[],ue=(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-white`,onContextMenu:e=>{e.target.closest(`[data-workspace-tree-entry]`)||p()},children:[l&&ae?(0,H.jsx)(sJ,{disabled:te,rootLabel:c,onCollapseAll:()=>{P&&ne(P)},onNewFile:()=>_(ae),onNewFolder:()=>v(ae),onRefresh:()=>void re()}):null,l?(0,H.jsx)(`input`,{ref:E,type:`file`,multiple:!0,className:`sr-only`,"aria-label":b(`chatWorkspaceUploadFiles`),onChange:e=>void T(Array.from(e.currentTarget.files??[]))}):null,ce,(0,H.jsx)(n,{})]});return ie?(0,H.jsx)(Qr,{groups:le,label:b(`chatWorkspaceRootContextMenu`),children:ue}):ue}function TJ({activeRelativePath:e=null,browseQuery:t,onFileOpen:n,sessionKey:r,renderStatus:i,showRoot:a=!1}){let o=tI(),{confirm:s,ConfirmDialog:c}=On(),l=t.data?.entries??[],u=Zq(t),d=a?t.data?.currentPath??null:null,f=Bq(d),p=Jq(e=>f?e.trees[f]?.expandedPaths??bJ:bJ);yJ((0,V.useMemo)(()=>{if(!d)return[];let e=d.includes(`\\`)&&!d.includes(`/`)?`\\`:`/`,t=d.replace(/[\\/]+$/g,``),n=new Set(p);return[d,...p.filter(e=>{let t=e.split(`/`);return t.slice(0,-1).every((e,r)=>n.has(t.slice(0,r+1).join(`/`)))}).map(n=>`${t}${e}${n.replace(/[\\/]+/g,e)}`)]},[p,d]));let m=d?xJ(d):``,h=_J({activeRelativePath:e,confirm:s,onEntryDeleted:o.chatThreadManager.removeWorkspacePath,onEntryRenamed:o.chatThreadManager.renameWorkspacePath,rootPath:d}),g=gi.canRevealPath()?e=>{gi.revealPath(e).then(e=>{e.revealed||R.error(b(`chatWorkspaceRevealPathFailed`))})}:void 0,_=r===void 0?void 0:(e,t)=>{(e.kind===`directory`?o.chatComposerIntentManager.requestDirectoryReference:o.chatComposerIntentManager.requestFileReference)({targetSessionKey:r,tokenKey:t,label:e.name})};return t.isLoading&&!t.data?i({text:b(`chatWorkspaceLoadingDirectory`)}):u&&!t.data?i({tone:`error`,text:`${b(`chatWorkspaceDirectoryLoadFailed`)}: ${u}`}):(0,H.jsx)(wJ,{activeRelativePath:e,browseQuery:t,ConfirmDialog:c,controller:h,entries:l,onAddToChat:_,onFileOpen:n,onRevealPath:g,rootLabel:m,rootPath:d,showRoot:a})}function EJ({name:e,kind:t}){return t===`directory`?(0,H.jsx)(Ga,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600`}):(0,H.jsx)(EU,{fileName:e,size:`compact`})}function DJ({browsePath:e,onBrowsePathChange:t,onClose:n,onFileOpen:r}){let i=NF({path:e,includeFiles:!0,enabled:!!e}),a=i.error?i.error instanceof Error?i.error.message:String(i.error):null,o=i.data?.entries??[],s=e=>{if(e.kind===`directory`){t(e.path);return}r({path:e.path,label:e.name,viewMode:`preview`}),n()};return(0,H.jsxs)(`div`,{"data-testid":`workspace-breadcrumb-browser`,className:`flex max-h-72 flex-col overflow-hidden`,children:[(0,H.jsx)(`div`,{className:`border-b border-gray-200 px-2 py-1`,children:(0,H.jsx)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-0.5 text-[11px] leading-none text-gray-600`,children:i.data?.breadcrumbs.map((e,n)=>(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,className:`h-5 rounded-sm px-1 text-left hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>t(e.path),children:e.label}),n<i.data.breadcrumbs.length-1?(0,H.jsx)(sa,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},e.path))})}),(0,H.jsx)(IF,{className:`min-h-0 flex-1 px-1 py-1`,children:i.isLoading?(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-4 text-[11px] text-gray-500`,children:[(0,H.jsx)(fi,{className:`h-3.5 w-3.5 animate-spin`}),b(`loading`)]}):a?(0,H.jsxs)(`div`,{className:`px-2 py-3 text-[11px] text-rose-600`,children:[b(`pathBrowseFailed`),`: `,a]}):o.length>0?(0,H.jsx)(`div`,{className:`space-y-0.5`,children:o.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:u(`flex h-6 w-full items-center gap-1.5 rounded-sm px-1.5 text-left text-[11px] text-gray-700 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e.hidden?`opacity-65`:null),onClick:()=>s(e),children:[(0,H.jsx)(EJ,{kind:e.kind,name:e.name}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.name}),e.kind===`directory`?(0,H.jsx)(sa,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},e.path))}):(0,H.jsx)(`div`,{className:`px-2 py-4 text-[11px] text-gray-500`,children:b(`emptyDirectory`)})})]})}function OJ({value:e}){return(0,H.jsx)(`span`,{className:`inline-flex h-5 items-center rounded-sm border border-amber-200 bg-amber-50 px-1.5 text-[10px] font-medium leading-none text-amber-700`,children:e})}function kJ({onFileOpen:e,segment:t}){let[n,r]=(0,V.useState)(!1),[i,a]=(0,V.useState)(t.browsePath);return(0,H.jsxs)(wF,{open:n,onOpenChange:e=>{e&&a(t.browsePath),r(e)},children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,"aria-current":t.isCurrent?`page`:void 0,className:u(`inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-sm px-1 text-[11px] leading-none transition-colors hover:bg-gray-200/80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,t.kind===`workspace`?`bg-primary/8 text-primary hover:bg-primary/12`:t.isCurrent?`bg-gray-200/70 text-gray-900`:`text-gray-500`),disabled:!t.browsePath,children:[t.kind===`workspace`?(0,H.jsx)(Ha,{className:`h-3 w-3 shrink-0`}):t.kind===`directory`&&t.isCurrent?(0,H.jsx)(Ga,{className:`h-3 w-3 shrink-0`}):t.isCurrent?(0,H.jsx)(EU,{fileName:t.label,size:`compact`}):null,(0,H.jsx)(`span`,{children:t.label})]})}),(0,H.jsx)(DF,{"data-testid":`workspace-breadcrumb-popover`,className:`w-[22rem] rounded-md p-0`,align:`start`,children:(0,H.jsx)(DJ,{browsePath:i,onBrowsePathChange:a,onClose:()=>r(!1),onFileOpen:e})})]})}function AJ({breadcrumb:e,leading:t,onFileOpen:n}){let r=(0,V.useRef)(null);return(0,V.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=e.querySelector(`[aria-current="page"]`);if(!t)return;let n=()=>{let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.right>n.right?e.scrollLeft+=r.right-n.right:r.left<n.left&&(e.scrollLeft-=n.left-r.left)};if(n(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(n);return i.observe(e),i.observe(t),()=>i.disconnect()},[e.fullPath]),(0,H.jsxs)(`div`,{"data-testid":`workspace-file-breadcrumbs`,title:e.fullPath,className:`flex min-w-0 items-center border-b border-gray-200/80 bg-gray-50/55`,children:[t?(0,H.jsx)(`div`,{className:`flex h-full shrink-0 items-center pl-1 pr-0.5`,children:t}):null,(0,H.jsxs)(`div`,{ref:r,"data-testid":`workspace-file-breadcrumb-scroll`,className:`workspace-horizontal-scrollbar flex min-w-0 flex-1 items-center gap-2.5 overflow-x-auto overflow-y-hidden px-3 py-1.5`,children:[(0,H.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 pr-1`,children:e.segments.map((t,r)=>(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(kJ,{segment:t,onFileOpen:n}),r<e.segments.length-1?(0,H.jsx)(sa,{className:`h-3 w-3 shrink-0 text-gray-300`}):null]},t.key))}),e.truncated?(0,H.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-1`,children:(0,H.jsx)(OJ,{value:b(`chatWorkspacePreviewTruncated`)})}):null]})]})}var jJ=8e3;function MJ(e){return e.match(/\n/g)?.length??0}function NJ(e){let{label:t,path:n,selectedText:r,sourceStartLine:i=1,sourceText:a}=e,o=n.trim(),s=t.trim(),c=r.trim();if(!o||!s||!c)return null;let l=a.indexOf(c),u=l>=0&&l===a.lastIndexOf(c)?(i??1)+MJ(a.slice(0,l)):null;return{path:o,label:s,excerpt:c,startLine:u,endLine:u===null?null:u+MJ(c)}}function PJ({children:e,fileLabel:t,filePath:n,onAddToChat:r,sourceStartLine:i,sourceText:a}){return(0,H.jsx)(vF,{actionLabel:b(`chatWorkspaceAddToChat`),className:`h-full min-h-0`,maxCharacters:jJ,selectionTooLongLabel:b(`chatWorkspaceExcerptSelectionTooLong`),onAddToChat:({text:e})=>{let o=NJ({path:n,label:t,selectedText:e,sourceText:a,sourceStartLine:i});o&&r?.(o)},children:e})}function FJ(e){let[t,n]=(0,V.useState)(null),r=t?.contentUrl===e?t:null;return(0,V.useEffect)(()=>{let t=new AbortController;return fetch(e,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`Unable to load document (${e.status}).`);return e.arrayBuffer()}).then(r=>{t.signal.aborted||n({contentUrl:e,status:`ready`,data:r})}).catch(r=>{t.signal.aborted||(console.error(`Failed to load workspace document`,r),n({contentUrl:e,status:`error`,data:null}))}),()=>t.abort()},[e]),{status:r?.status??`loading`,data:r?.data??null}}function IJ({status:e}){return e===`ready`?null:(0,H.jsx)(`div`,{className:`absolute inset-0 z-10 flex items-center justify-center bg-background/90 px-6 text-center text-sm text-muted-foreground`,children:b(e===`loading`?`chatWorkspaceLoadingPreview`:`chatWorkspacePreviewFailed`)})}function LJ(e){let t=Array.from(e.querySelectorAll(`.docx-wrapper > section.docx`)).some(e=>!e.style.width&&!e.style.padding);if(e.classList.toggle(`workspace-docx-preview--reflow`,t),t)for(let t of e.querySelectorAll(`table`)){if(t.querySelectorAll(`col`).length<5)continue;let e=document.createElement(`div`);e.className=`workspace-docx-wide-table`,t.before(e),e.append(t)}}function RJ({contentUrl:e}){let t=(0,V.useRef)(null),n=FJ(e),[r,i]=(0,V.useState)(null),a=r?.contentUrl===e?r.status:`loading`,o=n.status===`ready`?a:n.status;return(0,V.useEffect)(()=>{let r=t.current;if(!r||!n.data)return;let a=!1;return r.replaceChildren(),ae(()=>import(`./docx-preview-BqwAjrj3.js`).then(async t=>{await t.renderAsync(n.data,r,r,{breakPages:!0,inWrapper:!0,ignoreLastRenderedPageBreak:!1}),a||(LJ(r),i({contentUrl:e,status:`ready`}))}),__vite__mapDeps([22,4,23])).catch(t=>{a||(console.error(`Failed to render DOCX preview`,t),i({contentUrl:e,status:`error`}))}),()=>{a=!0,r.replaceChildren()}},[e,n.data]),(0,H.jsxs)(`div`,{className:`relative h-full overflow-auto bg-muted/40 p-4 custom-scrollbar`,children:[(0,H.jsx)(IJ,{status:o}),(0,H.jsx)(`div`,{ref:t,className:`workspace-docx-preview min-h-full`,"data-testid":`workspace-content-docx`})]})}function zJ({contentUrl:e}){let t=(0,V.useRef)(null),n=FJ(e),[r,i]=(0,V.useState)(null),a=r?.contentUrl===e?r.status:`loading`,o=n.status===`ready`?a:n.status;return(0,V.useEffect)(()=>{let r=t.current;if(!r||!n.data)return;let a=new AbortController,o=null;return r.replaceChildren(),ae(async()=>{let{PptxViewer:e,RECOMMENDED_ZIP_LIMITS:t}=await import(`./aiden0z-pptx-renderer.es-Dp2ezlQn.js`);return{PptxViewer:e,RECOMMENDED_ZIP_LIMITS:t}},__vite__mapDeps([24,4,23])).then(async({PptxViewer:t,RECOMMENDED_ZIP_LIMITS:s})=>{if(o=await t.open(n.data,r,{renderMode:`list`,fitMode:`contain`,lazySlides:!0,lazyMedia:!0,pdfjs:!1,scrollContainer:r,signal:a.signal,zipLimits:s,listOptions:{windowed:!0,batchSize:8,initialSlides:4,overscanViewport:1.5}}),a.signal.aborted){o.destroy(),o=null;return}i({contentUrl:e,status:`ready`})}).catch(t=>{a.signal.aborted||(console.error(`Failed to render presentation preview`,t),i({contentUrl:e,status:`error`}))}),()=>{a.abort(),o?.destroy(),r.replaceChildren()}},[e,n.data]),(0,H.jsxs)(`div`,{className:`relative h-full bg-muted/40`,children:[(0,H.jsx)(IJ,{status:o}),(0,H.jsx)(`div`,{ref:t,className:`h-full overflow-auto p-4 custom-scrollbar`,"data-testid":`workspace-content-presentation`})]})}var BJ=500,VJ=100;function HJ(e){let t=``,n=e+1;for(;n>0;)--n,t=String.fromCharCode(65+n%26)+t,n=Math.floor(n/26);return t}function UJ({contentUrl:e}){let t=FJ(e),[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(``),o=n?.contentUrl===e?n:null,s=t.status===`ready`?o?.status??`loading`:t.status,c=o?.sheets.find(e=>e.name===i)??o?.sheets[0]??null;return(0,V.useEffect)(()=>{if(!t.data)return;let n=!1;return ae(()=>import(`./xlsx-DrDuDNAa.js`).then(i=>{let a=i.read(t.data,{dense:!0,sheetRows:BJ+1}),o=a.SheetNames.map(e=>{let t=a.Sheets[e],n=t?i.utils.sheet_to_json(t,{header:1,raw:!1,defval:``,blankrows:!1}):[],r=n.slice(0,BJ).map(e=>e.slice(0,VJ).map(e=>String(e??``)));return{name:e,rows:r,columnCount:Math.min(VJ,r.reduce((e,t)=>Math.max(e,t.length),0)),truncated:n.length>BJ||n.some(e=>e.length>VJ)}});n||r({contentUrl:e,status:`ready`,sheets:o})}),[]).catch(t=>{n||(console.error(`Failed to render spreadsheet preview`,t),r({contentUrl:e,status:`error`,sheets:[]}))}),()=>{n=!0}},[e,t.data]),(0,H.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col bg-white`,"data-testid":`workspace-content-spreadsheet`,children:[(0,H.jsx)(IJ,{status:s}),o&&o.sheets.length>1?(0,H.jsx)(`div`,{className:`flex shrink-0 gap-1 overflow-x-auto border-b border-border px-2 py-1.5 custom-scrollbar`,children:o.sheets.map(e=>(0,H.jsx)(`button`,{type:`button`,className:u(`h-7 shrink-0 rounded-md px-2.5 text-xs transition-colors`,e.name===c?.name?`bg-accent font-medium text-accent-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),onClick:()=>a(e.name),children:e.name},e.name))}):null,c?(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto custom-scrollbar`,children:(0,H.jsxs)(`table`,{className:`min-w-full border-collapse text-xs text-foreground`,children:[(0,H.jsx)(`thead`,{className:`sticky top-0 z-[1] bg-muted`,children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:`sticky left-0 z-[2] h-7 min-w-10 border border-border bg-muted px-2`}),Array.from({length:c.columnCount},(e,t)=>(0,H.jsx)(`th`,{className:`h-7 min-w-24 border border-border px-2 text-center font-medium text-muted-foreground`,children:HJ(t)},t))]})}),(0,H.jsx)(`tbody`,{children:c.rows.map((e,t)=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{className:`sticky left-0 min-w-10 border border-border bg-muted px-2 text-right font-normal text-muted-foreground`,children:t+1}),Array.from({length:c.columnCount},(t,n)=>(0,H.jsx)(`td`,{className:`max-w-80 whitespace-pre-wrap border border-border px-2 py-1.5 align-top`,children:e[n]??``},n))]},t))})]})}):null,c?.truncated?(0,H.jsx)(`div`,{className:`shrink-0 border-t border-border bg-muted/60 px-3 py-1.5 text-xs text-muted-foreground`,children:b(`chatWorkspaceSpreadsheetPreviewTruncated`)}):null]})}function WJ(e){let t=e.mimeType?.trim().toLowerCase()??``,n=e.path.trim().toLowerCase();return t.startsWith(`image/`)||/\.(avif|bmp|gif|heic|heif|ico|jpe?g|png|svg|tiff?|webp)$/i.test(n)?`image`:t.startsWith(`audio/`)||/\.(aac|flac|m4a|mp3|ogg|opus|wav|weba)$/i.test(n)?`audio`:t.startsWith(`video/`)||/\.(avi|m4v|mkv|mov|mp4|webm|wmv)$/i.test(n)?`video`:t.includes(`pdf`)||n.endsWith(`.pdf`)?`pdf`:t===`application/vnd.openxmlformats-officedocument.wordprocessingml.document`||n.endsWith(`.docx`)?`docx`:t.includes(`spreadsheet`)||t.includes(`excel`)||/\.(ods|xls|xlsb|xlsm|xlsx)$/i.test(n)?`spreadsheet`:t===`application/vnd.openxmlformats-officedocument.presentationml.presentation`||n.endsWith(`.pptx`)?`presentation`:t.includes(`html`)||/\.html?$/i.test(n)?`html`:`other`}function GJ({contentUrl:e,label:t}){return(0,H.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-6 text-center`,"data-testid":`workspace-content-unsupported`,children:[(0,H.jsxs)(`div`,{className:`max-w-sm space-y-1.5`,children:[(0,H.jsx)(`p`,{className:`truncate text-sm font-medium text-foreground`,title:t,children:t}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:b(`chatWorkspacePreviewUnsupported`)}),(0,H.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground/80`,children:b(`chatWorkspacePreviewUnsupportedHint`)})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,H.jsx)(`a`,{href:e,download:t,className:`inline-flex h-8 items-center rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted`,children:b(`chatWorkspacePreviewDownload`)}),(0,H.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,className:`inline-flex h-8 items-center rounded-lg bg-primary px-3 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:b(`chatWorkspacePreviewOpenExternally`)})]})]})}function KJ({contentUrl:e,contentParams:t,label:n,onContentHeightChange:r}){let i=(0,V.useRef)(null),a=(0,V.useRef)(null),o=g(t);(0,V.useEffect)(()=>()=>{a.current?.()},[]);let s=()=>{a.current?.(),a.current=null;let e=i.current;if(!(!e||!r||typeof ResizeObserver>`u`))try{let t=e.contentDocument;if(!t)return;let n=()=>{let e=ee(t.body,t.documentElement);e>0&&r(e)},i=new ResizeObserver(n);i.observe(t.documentElement),t.body&&i.observe(t.body),n(),a.current=()=>i.disconnect()}catch{}};return(0,H.jsx)(`iframe`,{ref:i,allowFullScreen:!0,className:`h-full w-full border-0 bg-white`,"data-testid":`workspace-html-preview`,name:o,src:ne(e,t),title:n,onLoad:s},o??`no-content-params`)}function qJ({contentUrl:e,contentParams:t,kind:n,label:r,onHtmlContentHeightChange:i}){return n===`image`?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center overflow-auto bg-white p-4 custom-scrollbar`,children:(0,H.jsx)(`img`,{src:e,alt:r,className:`max-h-full max-w-full object-contain`,"data-testid":`workspace-content-image`})}):n===`audio`?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center bg-white px-6`,children:(0,H.jsx)(`audio`,{controls:!0,preload:`metadata`,"aria-label":r,className:`w-full max-w-xl`,"data-testid":`workspace-content-audio`,src:e})}):n===`video`?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center bg-black`,children:(0,H.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,"aria-label":r,className:`max-h-full max-w-full`,"data-testid":`workspace-content-video`,src:e})}):n===`html`?(0,H.jsx)(KJ,{contentUrl:e,contentParams:t,label:r,onContentHeightChange:i}):n===`pdf`?(0,H.jsx)(`iframe`,{allowFullScreen:!0,className:`h-full w-full border-0 bg-white`,"data-testid":`workspace-content-pdf`,src:e,title:r}):n===`docx`?(0,H.jsx)(RJ,{contentUrl:e}):n===`spreadsheet`?(0,H.jsx)(UJ,{contentUrl:e}):n===`presentation`?(0,H.jsx)(zJ,{contentUrl:e}):(0,H.jsx)(GJ,{contentUrl:e,label:r})}function JJ(e){return[`server-path-read`,e.path?.trim()??``,e.basePath??null,e.line??null]}function YJ(e){let{basePath:t,enabled:n=!0,line:r,path:i}=e,a=i?.trim()??``;return Ot({queryKey:JJ({path:a,basePath:t,line:r}),queryFn:()=>qt({path:a,basePath:t,line:r}),enabled:n&&a.length>0,staleTime:0})}function XJ(e){return e.serverKind?e.serverKind:/\.mdx?$/i.test(e.path)?`markdown`:`text`}function ZJ(e,t){return t<=0?e:`${e}${e.includes(`?`)?`&`:`?`}refresh=${t}`}function QJ(e){let{languageHint:t,path:n,startLine:r,text:i}=e,a=r??1;return{key:`preview:${n}`,path:n,display:`preview`,lines:QW({text:i,kind:`context`,oldStartLine:a,newStartLine:a}),rawText:i,languageHint:t??null,oldStartLine:a,newStartLine:a}}function $J(e){if(Array.isArray(e.fullLines)&&e.fullLines.length>0)return{key:`diff:${e.key}`,path:e.path,display:`diff`,lines:e.fullLines,fullLines:e.fullLines,...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...e.patchText?{patchText:e.patchText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{}};if(e.beforeText==null&&e.afterText==null)return null;let t=nG({beforeText:e.beforeText??``,afterText:e.afterText??``,oldStartLine:e.oldStartLine??void 0,newStartLine:e.newStartLine??void 0});return{key:`diff:${e.key}`,path:e.path,display:`diff`,lines:t,fullLines:t,...e.beforeText?{beforeText:e.beforeText}:{},...e.afterText?{afterText:e.afterText}:{},...typeof e.oldStartLine==`number`?{oldStartLine:e.oldStartLine}:{},...typeof e.newStartLine==`number`?{newStartLine:e.newStartLine}:{}}}function eY({text:e,tone:t=`muted`}){return(0,H.jsx)(`div`,{className:u(`flex h-full items-center justify-center px-6 text-center text-sm`,t===`error`?`text-rose-600`:`text-gray-500`),children:e})}function tY(e){return e instanceof Ct&&e.code===`SERVER_PATH_NOT_FOUND`?b(`chatWorkspacePreviewNotFound`):b(`chatWorkspacePreviewFailed`)}function nY({diffBlock:e}){return e?(0,H.jsx)(rY,{block:e}):(0,H.jsx)(eY,{text:b(`chatWorkspaceDiffEmpty`)})}function rY({block:e,targetColumn:t,targetLine:n}){return(0,H.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar bg-white`,children:(0,H.jsx)(pN,{block:e,layout:`workspace`,targetColumn:t,targetLine:n})})}function iY({contentUrl:e,contentUrlKind:t,contentLabel:n,contentParams:r,directoryQuery:i,fileBasePath:a,onFileOpen:o,onHtmlContentHeightChange:s,previewBlock:c,previewKind:l,previewViewer:u,previewQuery:d,previewText:f,targetColumn:p,targetLine:m}){return e&&t?(0,H.jsx)(qJ,{contentUrl:e,contentParams:r??void 0,kind:t,label:n,onHtmlContentHeightChange:s}):i?.data?(0,H.jsx)(TJ,{browseQuery:i,onFileOpen:o,renderStatus:e=>(0,H.jsx)(eY,{...e})}):i?.isLoading&&d?.error&&!c?(0,H.jsx)(eY,{text:b(`chatWorkspaceLoadingDirectory`)}):(i?.isLoading||d?.isLoading)&&!c?(0,H.jsx)(eY,{text:b(`chatWorkspaceLoadingPreview`)}):d?.data?.kind===`binary`?(0,H.jsx)(eY,{text:b(`chatWorkspacePreviewUnsupported`)}):d?.error&&!c?(0,H.jsx)(eY,{tone:`error`,text:tY(d.error)}):l===`markdown`&&u!==`source`&&f?(0,H.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar px-5 py-4`,children:(0,H.jsx)(Wj,{text:f,role:`assistant`,texts:{copyCodeLabel:b(`chatCodeCopy`),copiedCodeLabel:b(`chatCodeCopied`)},onFileOpen:o,resolveFileContentUrl:e=>on(e.path,a)})}):c?(0,H.jsx)(rY,{block:c,targetColumn:p,targetLine:m}):(0,H.jsx)(eY,{text:b(`chatWorkspacePreviewEmpty`)})}function aY({breadcrumbLeading:e,file:t,refreshVersion:n=0,sessionProjectRoot:r,sessionWorkingDir:i,showBreadcrumbs:a=!0,onHtmlContentHeightChange:o,onFileOpen:s,onTextExcerptAdd:c}){let l=t.viewMode===`preview`,u=t.contentUrl?.trim()||null,d=l&&!u,f=YJ({path:t.path,basePath:i,line:t.line,enabled:d}),p=NF({path:t.path,basePath:i,includeFiles:!0,enabled:d}),m=(0,V.useMemo)(()=>t.viewMode===`diff`?$J(t):null,[t]),h=l?f?.data?.text??t.rawText??null:null,g=XJ({path:f?.data?.resolvedPath??t.path,serverKind:f?.data?.kind}),_=u?WJ({path:t.path,mimeType:t.mimeType}):null,v=p?.data?.currentPath??f?.data?.resolvedPath??t.path,y=p?.data?`directory`:`file`,b=RR(v,t.previewViewer),x=WJ({path:v}),S=on(t.path,i),C=!u&&l&&S&&t.previewViewer!==`source`&&x!==`other`&&(x!==`html`||b===`rendered`)&&S?ZJ(S,n):null,w=u??C,T=_??(C?x:null),E=(0,V.useMemo)(()=>!l||!h||w?null:QJ({path:f?.data?.resolvedPath??t.path,text:h,languageHint:f?.data?.languageHint??null,startLine:f?.data?.startLine??1}),[w,t.path,l,f?.data?.languageHint,f?.data?.resolvedPath,f?.data?.startLine,h]),D=!w&&!!f?.data?.truncated,O=r??i,k=SI({path:v,sessionProjectRoot:O})??v.trim(),A=(0,V.useMemo)(()=>wI({path:v,kind:y,sessionProjectRoot:O,truncated:D}),[O,D,y,v]),ee=(0,H.jsx)(iY,{contentUrl:w,contentUrlKind:T,contentLabel:t.label?.trim()||v,contentParams:t.params,directoryQuery:p,fileBasePath:i,onFileOpen:s,onHtmlContentHeightChange:o,previewBlock:E,previewKind:g,previewViewer:b,previewQuery:f,previewText:h,targetColumn:t.column,targetLine:t.line});return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-white`,children:[a?(0,H.jsx)(AJ,{breadcrumb:A,leading:e,onFileOpen:s}):null,(0,H.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:t.viewMode===`diff`?(0,H.jsx)(nY,{diffBlock:m}):k&&h?(0,H.jsx)(PJ,{fileLabel:t.label?.trim()||k.split(`/`).at(-1)||k,filePath:k,sourceStartLine:f?.data?.startLine??1,sourceText:h,onAddToChat:c,children:ee}):ee})]})}var oY=240;function sY({actions:e,children:t,contentHeight:n,isLoading:r=!1}){return(0,H.jsxs)(`section`,{className:`group/inline-content relative my-2 w-full max-w-[48rem] overflow-visible`,"data-chat-inline-content-surface":`true`,"data-chat-message-wide-content":`true`,children:[e?(0,H.jsx)(`div`,{className:u(`pointer-events-none absolute bottom-full left-1/2 z-10 -translate-x-1/2 pb-2 opacity-0 transition-opacity duration-150`,`group-hover/inline-content:pointer-events-auto group-hover/inline-content:opacity-100 group-focus-within/inline-content:pointer-events-auto group-focus-within/inline-content:opacity-100`),"data-chat-inline-content-actions":`true`,children:(0,H.jsx)(`div`,{className:`flex items-center gap-0.5 rounded-lg bg-background/95 p-0.5 shadow-md ring-1 ring-border/60 backdrop-blur-sm`,"data-chat-inline-content-actions-surface":`true`,children:e})}):null,(0,H.jsx)(`div`,{className:u(`h-[240px] min-h-[240px] max-h-[min(90vh,1440px)] overflow-hidden rounded-lg`,r&&`animate-pulse bg-muted/45`),"data-chat-inline-content-viewport":`true`,style:n?{height:Math.max(oY,n)}:void 0,children:t})]})}function cY({display:e,parentSessionKey:t,sessionProjectRoot:n,sessionWorkingDir:r,onFileOpen:i}){let[a,o]=(0,V.useState)(null);if(e.target.type!==`file`)return null;let{path:s,line:c,column:l,params:u,viewer:d}=e.target.payload,f=VR({path:s,label:e.title,viewMode:`preview`,previewViewer:d,line:c,column:l,params:u},t);if(!f)return null;let p=f.label??f.path.split(/[\\/]/).filter(Boolean).pop()??f.path,m=f.previewViewer===`rendered`&&/\.html?$/i.test(f.path),h=e=>{i({path:f.path,label:f.label??void 0,viewMode:`preview`,previewViewer:e,line:f.line??void 0,column:f.column??void 0,params:f.params??void 0})};return m?(0,H.jsx)(sY,{actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(B,{size:`sm`,icon:(0,H.jsx)(Wr,{className:`h-3.5 w-3.5`}),label:b(`chatPanelCardExpand`),tooltipSide:`top`,onClick:()=>h(`rendered`)}),(0,H.jsx)(B,{size:`sm`,icon:(0,H.jsx)(va,{className:`h-3.5 w-3.5`}),label:b(`chatWorkspaceOpenSource`),tooltipSide:`top`,onClick:()=>h(`source`)})]}),contentHeight:a,children:(0,H.jsx)(aY,{file:f,sessionProjectRoot:n,sessionWorkingDir:r,showBreadcrumbs:!1,onHtmlContentHeightChange:o,onFileOpen:i})}):(0,H.jsxs)(`section`,{className:`my-2 w-full max-w-[48rem] overflow-hidden rounded-lg border border-border bg-card shadow-sm`,"data-chat-inline-file-preview":`true`,"data-chat-message-wide-content":`true`,children:[(0,H.jsxs)(`header`,{className:`border-b border-border bg-muted/45 px-3 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium text-foreground`,children:[(0,H.jsx)(Cn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`truncate`,children:p})]}),(0,H.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] font-normal text-muted-foreground`,title:f.path,children:f.path})]}),(0,H.jsx)(`div`,{className:`h-[420px] min-h-[240px] max-h-[min(60vh,420px)] overflow-hidden`,children:(0,H.jsx)(aY,{file:f,sessionProjectRoot:n,sessionWorkingDir:r,showBreadcrumbs:!1,onFileOpen:i})})]})}function lY({className:e,icon:t,imageClassName:n,title:r}){let i=t?.trim();return i?uY(i)?(0,H.jsx)(`img`,{src:i,alt:``,"aria-hidden":`true`,className:u(`h-5 w-5 rounded-sm object-contain`,n,e),title:r}):(0,H.jsx)(`span`,{"aria-hidden":`true`,className:u(`max-w-6 truncate text-center leading-none`,e),title:r,children:i}):(0,H.jsx)(Ur,{className:u(`h-4 w-4`,e)})}function uY(e){return e.startsWith(`data:image/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)}var dY=[`panel-apps`];function fY(e,t){return e.id===t||e.appId===t}function pY(e,t,n){return e&&{...e,entries:e.entries.map(e=>fY(e,t)?n(e):e)}}function mY(e,t){return pY(e,t.id,()=>t)}function hY(e,t){let n=e?.entries.reduce((e,t)=>Math.max(e,t.mainSidebarOrder??-1),-1)??-1;return pY(e,t.id,e=>({...e,...typeof t.preferences.favorite==`boolean`?{favorite:t.preferences.favorite}:{},...typeof t.preferences.mainSidebar==`boolean`?t.preferences.mainSidebar?{mainSidebar:!0,mainSidebarOrder:e.mainSidebar?e.mainSidebarOrder:n+1}:{mainSidebar:!1,mainSidebarOrder:void 0}:{}}))}function gY(e={}){return Ot({queryKey:dY,queryFn:()=>I.panelApps.listPanelApps(),enabled:e.enabled??!0,staleTime:0})}function _Y(){let e=F();return jt({mutationFn:({id:e,preferences:t})=>I.panelApps.updatePanelAppPreferences(e,t),onMutate:async t=>{await e.cancelQueries({queryKey:dY});let n=e.getQueryData(dY)?.entries.find(e=>fY(e,t.id));return e.setQueryData(dY,e=>hY(e,t)),{previousEntry:n}},onSuccess:t=>{e.setQueryData(dY,e=>mY(e,t))},onError:(t,n,r)=>{let i=r?.previousEntry;i&&e.setQueryData(dY,e=>pY(e,n.id,()=>i));let a=t instanceof Error?t.message:String(t);R.error(`${b(`panelAppsPreferenceUpdateFailed`)}: ${a}`)}})}function vY(){let e=F();return jt({mutationFn:e=>I.panelApps.recordPanelAppOpened(e),onSuccess:t=>{e.setQueryData(dY,e=>mY(e,t))}})}function yY(){let e=F();return jt({mutationFn:e=>I.panelApps.grantClient(e),onSuccess:()=>{e.invalidateQueries({queryKey:dY})}})}function bY(){let e=F();return jt({mutationFn:e=>I.panelApps.deletePanelApp(e),onSuccess:()=>{e.invalidateQueries({queryKey:dY})}})}function xY({entry:e,onSelect:t}){let n=_Y(),r=e.mainSidebar?b(`panelAppsRemoveFromMainSidebar`):b(`panelAppsAddToMainSidebar`),i=e.mainSidebar?fo:mo;return(0,H.jsxs)(`button`,{type:`button`,disabled:n.isPending,"aria-pressed":e.mainSidebar,className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50`,onClick:()=>{t?.(),e.mainSidebar||ks.setMainSidebarAppGroupCollapsed(!1),n.mutate({id:e.id,preferences:{mainSidebar:!e.mainSidebar}})},children:[(0,H.jsx)(i,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:r})]})}function SY({deletePending:e,entry:t,favoritePending:n,onDelete:r,onOpen:i,onToggleFavorite:a}){let[o,s]=(0,V.useState)(!1),[c,l]=(0,V.useState)(!1),u=t.favorite?b(`panelAppsUnfavorite`):b(`panelAppsFavorite`),d=t.lastOpenedAt?`${b(`panelAppsLastOpened`)} ${wY(t.lastOpenedAt)}`:`${b(`panelAppsUpdated`)} ${wY(t.updatedAt)}`,f=e=>{e.stopPropagation(),a()},p=()=>{s(!1),l(!0)};return(0,H.jsxs)(`div`,{className:`group w-full min-w-0 rounded-lg border border-border/60 bg-card px-2.5 py-2.5 transition-colors hover:bg-muted/40`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:i,className:`min-w-0 flex-1 text-left`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-base text-muted-foreground`,children:(0,H.jsx)(lY,{icon:t.icon,title:t.title})}),(0,H.jsx)(`span`,{className:`block min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:t.title})]}),t.description?(0,H.jsx)(`span`,{className:`mt-1.5 block truncate text-xs leading-5 text-muted-foreground`,children:t.description}):null,(0,H.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] leading-4 text-muted-foreground/70`,children:d})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-70 transition-opacity group-hover:opacity-100`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:f,disabled:n,className:`rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground disabled:opacity-50`,title:u,"aria-label":u,children:(0,H.jsx)(Lo,{className:t.favorite?`h-4 w-4 fill-current text-foreground`:`h-4 w-4`})}),(0,H.jsxs)(wF,{open:o,onOpenChange:s,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground`,"aria-label":b(`panelAppsMoreActions`),disabled:e,children:(0,H.jsx)(ci,{className:`h-4 w-4`})})}),(0,H.jsxs)(DF,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:[(0,H.jsx)(xY,{entry:t,onSelect:()=>s(!1)}),(0,H.jsx)(CY,{destructive:!0,disabled:e,icon:Vo,label:b(`panelAppsDelete`),onClick:p})]})]})]})]}),(0,H.jsx)(Vr,{open:c,onOpenChange:l,title:b(`panelAppsDeleteConfirmTitle`),description:`${b(`panelAppsDeleteConfirmDescription`)} ${t.fileName}`,confirmLabel:b(`delete`),variant:`destructive`,onConfirm:r,onCancel:()=>void 0})]})}function CY({destructive:e=!1,disabled:t=!1,icon:n,label:r,onClick:i}){return(0,H.jsxs)(`button`,{type:`button`,className:u(`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`),disabled:t,onClick:i,children:[(0,H.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:r})]})}function wY(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=S(M()),r=new Date;return t.toDateString()===r.toDateString()?new Intl.DateTimeFormat(n,{hour:`2-digit`,minute:`2-digit`}).format(t):t.getFullYear()===r.getFullYear()?new Intl.DateTimeFormat(n,{month:`numeric`,day:`numeric`}).format(t):new Intl.DateTimeFormat(n,{year:`2-digit`,month:`numeric`,day:`numeric`}).format(t)}function TY(){let e=F9(),{isPending:t,mutateAsync:n}=yY(),r=(0,V.useRef)(new Map);return{ensurePanelAppClientGrant:(0,V.useCallback)(async t=>{if(!t.clientDeclared||t.clientGranted)return!0;let i=r.current.get(t.appId);if(i)return await i;let a=(async()=>await e.serviceActionAuthorizationManager.requestAuthorization({panelAppId:t.appId,actions:[{actionId:`nextclaw.client`,actionTitle:b(`panelAppsClientGrantTitle`),actionDescription:b(`panelAppsClientGrantDescription`),risk:`dangerous`}]})?(await n(t.appId),!0):!1)();r.current.set(t.appId,a);try{return await a}finally{r.current.delete(t.appId)}},[n,e]),isPending:t}}function EY(e,t){return t===`favorites`?DY(e.filter(e=>e.favorite),`smart`):DY(t===`recent-open`?e.filter(e=>e.lastOpenedAt):e,t)}function DY(e,t){return[...e].sort((e,n)=>OY(e,n,t))}function OY(e,t,n){return n===`recent-open`?MY(e.lastOpenedAt,t.lastOpenedAt)||kY(e,t):n===`updated`?MY(e.updatedAt,t.updatedAt)||kY(e,t):n===`name`?kY(e,t):AY(e,t)||Number(t.favorite)-Number(e.favorite)||kY(e,t)}function kY(e,t){return e.title.localeCompare(t.title)}function AY(e,t){return jY(t)-jY(e)}function jY(e){return Math.max(new Date(e.lastOpenedAt??0).getTime(),new Date(e.createdAt).getTime(),new Date(e.updatedAt).getTime())}function MY(e,t){return new Date(t??0).getTime()-new Date(e??0).getTime()}var NY=V.createContext(null);function PY({defaultValue:e,value:t,onValueChange:n,children:r}){return(0,H.jsx)(NY.Provider,{value:{value:t,onValueChange:n},children:r})}function FY({children:e,className:t}){return(0,H.jsx)(`div`,{role:`tablist`,onKeyDown:e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role="tab"]:not(:disabled)`));if(t.length===0)return;let n=t.indexOf(document.activeElement),r=e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowRight`?(Math.max(n,-1)+1)%t.length:(n<=0?t.length:n)-1;e.preventDefault(),t[r]?.focus(),t[r]?.click()},className:u(`inline-flex h-9 items-center justify-center rounded-xl bg-muted p-1 text-muted-foreground`,t),children:e})}function IY({value:e,children:t,className:n}){let r=V.useContext(NY);if(!r)throw Error(`TabsTrigger must be used within Tabs`);let i=r.value===e;return(0,H.jsx)(`button`,{type:`button`,onClick:()=>r.onValueChange(e),role:`tab`,"aria-selected":i,tabIndex:i?0:-1,"data-state":i?`active`:`inactive`,className:u(`inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-[13px] font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none disabled:opacity-50`,i?`bg-card text-foreground shadow-sm`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,n),children:t})}function LY({value:e,children:t,className:n}){let r=V.useContext(NY);if(!r)throw Error(`TabsContent must be used within Tabs`);return r.value===e?(0,H.jsx)(`div`,{className:u(`mt-2 animate-fade-in`,n),children:t}):null}var RY=[];function zY({onOpenPanelApp:e}){let t=gY(),n=bY(),r=_Y(),i=vY(),{ensurePanelAppClientGrant:a}=TY(),o=F9(),s=ce(),[c,l]=(0,V.useState)(`smart`),u=t.data?.entries??RY,d=(0,V.useMemo)(()=>EY(u,c),[u,c]),f=async t=>{await a(t)&&(e(t),i.mutate(t.id))},p=e=>{r.mutate({id:e.id,preferences:{favorite:!e.favorite}})},m=e=>{n.mutate(e.id)},h=()=>{s(`/chat`),o.chatDraftIntentManager.requestDraft(b(`panelAppsExamplePrompt`))};return t.isLoading?(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:b(`panelAppsLoading`)}):t.isError?(0,H.jsx)(`div`,{className:`p-4 text-sm text-rose-600`,children:t.error instanceof Error?t.error.message:b(`panelAppsLoadFailed`)}):(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card text-card-foreground`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-12 shrink-0 items-center justify-end gap-2 border-b border-border/70 px-4 py-2`,children:[(0,H.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:t.data?.panelsPath?(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:`rounded p-0.5 text-muted-foreground/70 transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,"aria-label":b(`panelAppsTitle`),children:(0,H.jsx)(fa,{className:`h-3.5 w-3.5`})})}),(0,H.jsx)(qr,{side:`bottom`,className:`max-w-[320px] break-all font-mono text-xs`,children:t.data.panelsPath})]})}):null}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void t.refetch(),className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,title:b(`panelAppsRefresh`),"aria-label":b(`panelAppsRefresh`),children:(0,H.jsx)(mi,{className:`h-3.5 w-3.5`})})]}),(0,H.jsx)(`div`,{className:`border-b border-border/70 px-3 py-2`,children:(0,H.jsx)(PY,{value:c,onValueChange:e=>l(e),children:(0,H.jsxs)(FY,{className:`grid h-auto w-full grid-cols-5 rounded-lg bg-muted/70 p-0.5`,children:[(0,H.jsx)(IY,{value:`smart`,className:`px-2 py-1 text-xs`,children:b(`panelAppsSortSmart`)}),(0,H.jsx)(IY,{value:`favorites`,className:`px-2 py-1 text-xs`,children:b(`panelAppsFavorites`)}),(0,H.jsx)(IY,{value:`recent-open`,className:`px-2 py-1 text-xs`,children:b(`panelAppsSortRecentOpen`)}),(0,H.jsx)(IY,{value:`updated`,className:`px-2 py-1 text-xs`,children:b(`panelAppsSortUpdated`)}),(0,H.jsx)(IY,{value:`name`,className:`px-2 py-1 text-xs`,children:b(`panelAppsSortName`)})]})})}),u.length===0?(0,H.jsx)(BY,{panelsPath:t.data?.panelsPath,onCreateExample:h,onRefresh:()=>void t.refetch()}):d.length===0?(0,H.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground`,children:b(`panelAppsEmptyFiltered`)}):(0,H.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto p-3`,children:(0,H.jsx)(`div`,{className:`space-y-1.5`,children:d.map(e=>(0,H.jsx)(SY,{entry:e,deletePending:n.isPending,favoritePending:r.isPending,onDelete:()=>m(e),onOpen:()=>void f(e),onToggleFavorite:()=>p(e)},e.id))})})]})}function BY({onCreateExample:e,panelsPath:t,onRefresh:n}){return(0,H.jsx)(`div`,{className:`flex flex-1 items-center justify-center overflow-y-auto px-5 py-6 text-center`,children:(0,H.jsxs)(`div`,{className:`w-full max-w-sm`,children:[(0,H.jsx)(`div`,{className:`mx-auto flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,H.jsx)(Ur,{className:`h-5 w-5`})}),(0,H.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-foreground`,children:b(`panelAppsEmptyTitle`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:b(`panelAppsEmptyDescription`)}),(0,H.jsxs)(`div`,{className:`mt-4 space-y-2 text-left`,children:[(0,H.jsx)(VY,{icon:(0,H.jsx)(to,{className:`h-4 w-4`}),title:b(`panelAppsEmptyAskTitle`),description:b(`panelAppsEmptyAskDescription`),actionLabel:b(`panelAppsEmptyAskAction`),onAction:e}),(0,H.jsx)(VY,{icon:(0,H.jsx)(ja,{className:`h-4 w-4`}),title:b(`panelAppsEmptyFileTitle`),description:b(`panelAppsEmptyFileDescription`)})]}),t?(0,H.jsxs)(`div`,{className:`mt-4 rounded-md bg-muted/60 px-3 py-2 text-left`,children:[(0,H.jsx)(`div`,{className:`text-[11px] font-medium uppercase text-muted-foreground/70`,children:b(`panelAppsPanelsPath`)}),(0,H.jsx)(`code`,{className:`mt-1 block break-all text-xs text-muted-foreground`,children:t})]}):null,(0,H.jsxs)(`button`,{type:`button`,onClick:n,className:`mt-4 inline-flex items-center justify-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,H.jsx)(mi,{className:`h-3.5 w-3.5`}),b(`panelAppsRefresh`)]})]})})}function VY({actionLabel:e,description:t,icon:n,onAction:r,title:i}){let a=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`mt-0.5 text-muted-foreground`,children:n}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:i}),(0,H.jsx)(`div`,{className:`mt-0.5 text-xs leading-5 text-muted-foreground`,children:t}),e?(0,H.jsx)(`div`,{className:`mt-2 text-xs font-medium text-primary`,children:e}):null]})]});return r?(0,H.jsx)(`button`,{type:`button`,onClick:r,className:`flex w-full gap-2 rounded-md bg-muted/60 px-3 py-2.5 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:a}):(0,H.jsx)(`div`,{className:`flex gap-2 rounded-md bg-muted/60 px-3 py-2.5`,children:a})}var HY=`w-[56px]`,UY=`px-2`,WY=`h-9 w-9 rounded-xl`,GY=`h-4 w-4`,KY=`space-y-1`,qY=`gap-1`,JY=`text-muted-foreground transition-colors duration-base hover:bg-gray-200/60 hover:text-gray-900 active:bg-gray-200/80 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,YY=`bg-gray-200/80 text-gray-900`,XY={default:{row:`gap-3 px-3 py-2.5 text-[14px]`,icon:`h-[17px] w-[17px]`,value:`text-xs`,gap:`gap-3`,stack:`space-y-1`},compact:{row:`gap-2.5 px-3 py-2 text-[13px]`,icon:`h-4 w-4`,value:`text-[11px]`,gap:`gap-2.5`,stack:`space-y-0.5`}};function ZY(e){return XY[e]}function QY(e){return ZY(e).stack}function $Y(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function eX({children:e,label:t,side:n=`right`}){return(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:e}),(0,H.jsx)(qr,{side:n,className:`text-xs`,children:t})]})})}function tX({collapsed:e,icon:t,iconNode:n,indicator:r,isActive:i,tone:a}){let o=u(e?GY:a.icon,`transition-colors`,i?`text-gray-700`:`text-muted-foreground group-hover:text-gray-700`);return(0,H.jsxs)(`span`,{className:`relative shrink-0`,children:[n?(0,H.jsx)(`span`,{className:u(o,`flex items-center justify-center overflow-hidden`),children:n}):t?(0,H.jsx)(t,{className:u(o,`block`)}):null,r?(0,H.jsx)(`span`,{className:`absolute -right-1 -top-1 h-1.5 w-1.5 rounded-full bg-primary ring-2 ring-background`}):null]})}function nX({to:e,label:t,icon:n,iconNode:r,density:i=`default`,className:a,collapsed:o=!1,indicator:s=!1,trailing:c}){let l=ZY(i),{pathname:d}=_e(),f=$Y(d,e),p=(0,H.jsxs)(ue,{to:e,"aria-label":t,"aria-current":f?`page`:void 0,className:u(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,o?u(WY,`justify-center px-0 py-0`):l.row,f?o?YY:`bg-gray-200/80 text-gray-900 shadow-sm`:o?JY:`text-muted-foreground hover:bg-gray-200/60 hover:text-gray-900`,a),children:[(0,H.jsx)(tX,{collapsed:o,icon:n,iconNode:r,indicator:s,isActive:f,tone:l}),(0,H.jsx)(`span`,{className:o?`sr-only`:`min-w-0 flex-1 text-left`,children:t}),!o&&c?(0,H.jsx)(`span`,{className:u(`shrink-0 text-muted-foreground`,l.value),children:c}):null]});return o?(0,H.jsx)(eX,{label:t,children:p}):p}function rX({isCollapsed:e,items:t,density:n,className:r}){return(0,H.jsx)(`ul`,{className:u(QY(n),r),children:t.map(t=>(0,H.jsx)(`li`,{className:e?`flex justify-center`:void 0,children:(0,H.jsx)(nX,{to:t.target,label:t.label,icon:t.icon,density:n,collapsed:e})},t.target))})}function iX({label:e,icon:t,onClick:n,density:r=`default`,className:i,labelClassName:a,trailing:o,trailingClassName:s,testId:c,trailingTestId:l,collapsed:d=!1}){let f=ZY(r),p=(0,H.jsxs)(`button`,{type:`button`,onClick:n,"aria-label":e,className:u(`group flex w-full items-center rounded-xl font-medium text-muted-foreground transition-colors duration-base hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,d?u(WY,`justify-center px-0 py-0`,JY):f.row,i),"data-testid":c,children:[(0,H.jsx)(t,{className:u(d?GY:f.icon,`shrink-0 text-muted-foreground transition-colors group-hover:text-gray-700`)}),(0,H.jsx)(`span`,{className:u(d?`sr-only`:`min-w-0 flex-1 text-left`,a),children:e}),!d&&o?(0,H.jsx)(`span`,{className:u(`shrink-0 text-muted-foreground`,f.value,s),"data-testid":l,children:o}):null]});return d?(0,H.jsx)(eX,{label:e,children:p}):p}var aX=2**53-1;function oX(e){return e.filter(e=>e.mainSidebar).sort((e,t)=>(e.mainSidebarOrder??aX)-(t.mainSidebarOrder??aX)||e.title.localeCompare(t.title))}function sX({isCollapsed:e}){let t=gY(),n=(0,V.useMemo)(()=>oX(t.data?.entries??[]),[t.data?.entries]),r=Os(e=>e.isMainSidebarAppGroupCollapsed);return n.length===0?null:e?(0,H.jsx)(dX,{entries:n}):(0,H.jsxs)(`div`,{className:`mt-1 border-t border-border/50 px-3 pt-1`,"data-testid":`panel-app-main-sidebar-nav`,children:[(0,H.jsx)(uX,{entries:n,isCollapsed:r}),r?null:(0,H.jsx)(`ul`,{className:`mt-0.5 space-y-0.5`,children:n.map(e=>(0,H.jsx)(fX,{entry:e},e.appId))})]})}function cX(e){return`/apps/panel/${encodeURIComponent(e)}`}function lX(e){let{pathname:t}=_e();return e.some(e=>t===cX(e.appId))}function uX({entries:e,isCollapsed:t}){let n=lX(e),r=b(t?`panelAppsMainSidebarGroupExpand`:`panelAppsMainSidebarGroupCollapse`);return(0,H.jsxs)(`button`,{type:`button`,"aria-label":r,"aria-expanded":!t,className:u(`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-[13px] font-medium text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,t&&n&&`bg-gray-200/80 text-gray-900`),onClick:ks.toggleMainSidebarAppGroupCollapsed,children:[(0,H.jsx)($n,{"aria-hidden":`true`,className:u(`h-3.5 w-3.5 shrink-0 transition-transform`,t&&`-rotate-90`)}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:b(`panelAppsMainSidebarGroup`)}),(0,H.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground`,children:e.length})]})}function dX({entries:e}){let[t,n]=(0,V.useState)(!1),r=lX(e),i=b(`panelAppsMainSidebarGroup`);return(0,H.jsx)(`div`,{className:`mt-1 flex justify-center border-t border-border/50 pt-1`,"data-testid":`panel-app-main-sidebar-nav`,children:(0,H.jsxs)(wF,{open:t,onOpenChange:n,children:[(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(ii,{disableHoverableContent:!0,children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(B,{icon:(0,H.jsx)(_ee,{className:GY}),label:i,tooltip:!1,className:u(WY,r?YY:JY)})})}),(0,H.jsx)(qr,{side:`right`,className:`text-xs`,children:i})]})}),(0,H.jsxs)(DF,{side:`right`,align:`start`,className:`w-60 rounded-xl p-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 text-xs font-semibold text-muted-foreground`,children:[(0,H.jsx)(`span`,{children:i}),(0,H.jsx)(`span`,{className:`font-medium text-muted-foreground/60`,children:e.length})]}),(0,H.jsx)(`ul`,{className:`mt-1 space-y-0.5`,children:e.map(e=>(0,H.jsx)(fX,{entry:e,onNavigate:()=>n(!1)},e.appId))})]})]})})}function fX({entry:e,onNavigate:t}){let[n,r]=(0,V.useState)(!1),i=(0,H.jsx)(nX,{to:cX(e.appId),label:e.title,iconNode:(0,H.jsx)(lY,{icon:e.icon,title:e.title,className:`h-full w-full text-[13px]`,imageClassName:`rounded-[3px]`}),density:`compact`,className:`rounded-lg py-1.5 pl-5 pr-9`}),a=t?(0,H.jsx)(`div`,{onClick:t,children:i}):i,o=`${b(`panelAppsMoreActions`)}: ${e.title}`;return(0,H.jsx)(`li`,{children:(0,H.jsxs)(`div`,{className:`group/panel-app relative`,children:[a,(0,H.jsxs)(wF,{open:n,onOpenChange:r,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":o,className:u(`absolute right-1 top-1/2 z-[1] -translate-y-1/2 rounded-md p-1 text-muted-foreground/70 transition-[color,background-color,opacity] hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,n?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0 group-hover/panel-app:pointer-events-auto group-hover/panel-app:opacity-100 group-focus-within/panel-app:pointer-events-auto group-focus-within/panel-app:opacity-100`),children:(0,H.jsx)(ci,{className:`h-4 w-4`})})}),(0,H.jsx)(DF,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:(0,H.jsx)(xY,{entry:e,onSelect:()=>r(!1)})})]})]})})}function pX(e){let t=F(),n=(0,V.useId)(),{ensurePanelAppClientGrant:r}=TY(),i=!!(e?.clientDeclared&&!e.clientGranted),a=Ot({queryKey:[`panel-app-main-client-grant`,e?.appId??`none`,e?.clientGranted??!1],queryFn:async()=>await r(e),enabled:i,gcTime:0,retry:!1,staleTime:1/0}),o=e?i?a.isError?`error`:a.isPending?`checking`:a.data?`allowed`:`denied`:`allowed`:`idle`;return Ot({queryKey:[`panel-app-main-open`,n,e?.appId??`none`],queryFn:async()=>{let n=await I.panelApps.recordPanelAppOpened(e.id);return t.setQueryData(dY,e=>mY(e,n)),n},enabled:!!(e&&o===`allowed`),retry:!1,staleTime:1/0}),{retryClientGrant:a.refetch,state:o}}var mX=`allow-scripts allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-downloads allow-pointer-lock allow-presentation`;function hX(e){e?.focus({preventScroll:!0}),e?.contentWindow?.focus()}function gX({className:e,icon:t,name:n}){let[r,i]=(0,V.useState)(),a=_X(t),o=r===t;return(0,H.jsx)(`span`,{className:u(`relative flex h-11 w-11 shrink-0 items-center justify-center overflow-hidden rounded-[13px] bg-gradient-to-br from-violet-500/15 via-primary/10 to-emerald-500/15 text-sm font-semibold text-foreground ring-1 ring-black/[0.04] dark:ring-white/[0.06]`,e),children:a&&!o?(0,H.jsx)(`img`,{src:t,alt:``,className:`h-full w-full object-cover`,onError:()=>i(t)}):t&&!a?(0,H.jsx)(`span`,{className:`text-base leading-none`,"aria-hidden":`true`,children:t}):(0,H.jsx)(`span`,{"aria-hidden":`true`,children:vX(n)})})}function _X(e){return!!e&&(e.startsWith(`data:`)||e.startsWith(`/`)||e.startsWith(`http://`)||e.startsWith(`https://`))}function vX(e){return[...e.trim()][0]?.toLocaleUpperCase()??`A`}function yX({accentColor:e,className:t,coverPreview:n,coverUrl:r,name:i}){let[a,o]=(0,V.useState)(),s=r&&a!==r?r:void 0;return(0,H.jsx)(`span`,{className:u(`relative block aspect-[8/5] overflow-hidden rounded-2xl bg-muted ring-1 ring-black/[0.05] dark:ring-white/[0.07]`,t),style:{"--app-accent":e??`#78716c`},children:s?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`img`,{src:s,alt:`${i} app cover`,className:`h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.015]`,loading:`lazy`,onError:()=>o(s)}),null]}):(0,H.jsx)(`span`,{"aria-label":`${i} 暂无封面`,className:`flex h-full w-full items-center justify-center bg-[radial-gradient(circle_at_30%_25%,color-mix(in_srgb,var(--app-accent)_28%,transparent),transparent_50%),linear-gradient(145deg,var(--muted),var(--background))]`,children:(0,H.jsx)(`span`,{className:`flex h-14 w-14 items-center justify-center rounded-2xl bg-background/65 text-xl font-semibold text-foreground/65 shadow-sm ring-1 ring-black/[0.05] backdrop-blur-sm`,children:bX(i)})})})}function bX(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length>1?t.slice(0,2).map(e=>e[0]).join(``).toLocaleUpperCase():[...t[0]??`?`].slice(0,1).join(``).toLocaleUpperCase()}function xX(e,t){if(e.status!==`compatible`)return e.status===`unknown`?{actionLabel:b(`appPackagesTemporarilyUnavailable`),reason:b(`appPackagesCompatibilityUnknownReason`),statusLabel:b(`appPackagesCompatibilityUnknown`)}:{actionLabel:b(`appPackagesUnavailable`),badgeLabel:b(`appPackagesPlatformOnly`).replace(`{platforms}`,t),reason:e.reason===`unsupported-os`?b(`appPackagesUnsupportedOsReason`).replace(`{platforms}`,t):b(`appPackagesUnsupportedTargetReason`).replace(`{platforms}`,t),statusLabel:b(`appPackagesUnavailableOnDevice`)}}function SX({presentation:e}){return e?.badgeLabel?(0,H.jsx)(`span`,{className:`mt-1.5 inline-flex rounded-full bg-amber-500/12 px-2 py-0.5 text-[10px] font-semibold text-amber-700 ring-1 ring-inset ring-amber-500/20 dark:text-amber-300`,children:e.badgeLabel}):null}function CX({blocked:e,presentation:t,className:n}){return!e||!t?null:(0,H.jsx)(`p`,{className:n,children:t.statusLabel})}function wX({active:e,canUpdate:t,installed:n,isStarting:r,onAction:i,operation:a,unavailableLabel:o,unavailableReason:s}){let c=(0,H.jsx)(L,{type:`button`,size:`sm`,variant:n&&!t||e?`secondary`:`default`,disabled:!!s||n&&!t||e||r,onClick:i,className:`shrink-0 rounded-full px-4`,children:TX({active:e,canUpdate:t,installed:n,isStarting:r,operation:a,unavailableLabel:o,unavailableReason:s})});return s?(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`span`,{tabIndex:0,className:`inline-flex cursor-not-allowed rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:c})}),(0,H.jsx)(qr,{side:`top`,className:`max-w-64 text-xs`,children:s})]}):c}function TX({active:e,canUpdate:t,installed:n,isStarting:r,operation:i,unavailableLabel:a,unavailableReason:o}){return o?a??b(`appPackagesUnavailable`):n&&!t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(wr,{className:`mr-1.5 h-3.5 w-3.5`}),b(`appPackagesMarketplaceInstalled`)]}):e||r?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(fi,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}),i?OX(i):b(`appPackagesPreparing`)]}):b(t?`appPackagesUpdate`:`appPackagesInstall`)}function EX({operation:e}){let t=Math.max(4,Math.round(e.completedSteps/e.totalSteps*100));return(0,H.jsxs)(`div`,{className:`mt-2`,role:`status`,"aria-live":`polite`,children:[(0,H.jsx)(`div`,{className:`h-1 overflow-hidden rounded-full bg-muted`,children:(0,H.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width] duration-300`,style:{width:`${t}%`}})}),(0,H.jsx)(`p`,{className:`mt-1.5 truncate text-[11px] text-muted-foreground`,children:OX(e)})]})}function DX(e,t,n){return e.find(e=>e.appId===t||e.source===n)}function OX(e){switch(e.status){case`queued`:return b(`appPackagesPreparing`);case`resolving`:return b(`appPackagesResolving`);case`downloading`:return b(`appPackagesDownloading`);case`verifying`:return b(`appPackagesVerifying`);case`installing`:return e.action===`rollback`?b(`appPackagesSwitchingVersion`):e.action===`uninstall`?b(`appPackagesUninstalling`):b(`appPackagesInstalling`);case`finalizing`:return b(`appPackagesFinalizing`);case`succeeded`:return b(`appPackagesCompleted`);case`failed`:case`interrupted`:return b(`appPackagesActionFailed`)}}function kX({checked:e,description:t,destructive:n=!1,disabled:r=!1,label:i,onClick:a}){return(0,H.jsxs)(`button`,{type:`button`,"aria-pressed":e,"aria-disabled":r,disabled:r,onClick:a,className:u(`flex items-start gap-3 rounded-xl border px-3 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed disabled:opacity-50`,e?`border-foreground/25 bg-muted/55`:`border-border/60 hover:bg-muted/35`),children:[(0,H.jsx)(`span`,{className:u(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border`,e?`border-foreground bg-foreground text-background`:`border-border`),children:e?(0,H.jsx)(wr,{className:`h-2.5 w-2.5`}):null}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:u(`block text-sm font-medium`,n?`text-destructive`:`text-foreground`),children:i}),(0,H.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-muted-foreground`,children:t})]})]})}function AX({storage:e,usage:t}){let n=[[b(`appDataClassData`),t.dataBytes],[b(`appDataClassConfig`),t.configBytes],[b(`appDataClassState`),t.stateBytes],[b(`appDataClassCache`),t.cacheBytes],[b(`appDataClassTemporary`),t.temporaryBytes],[b(`appDataClassLogs`),t.logsBytes]];return(0,H.jsxs)(`div`,{className:`rounded-xl bg-muted/45 px-3 py-2.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,children:[(0,H.jsx)(Ja,{className:`h-3.5 w-3.5`}),b(`appDataStorageTotal`)]}),(0,H.jsx)(`span`,{className:`tabular-nums text-foreground`,children:jX(t.totalBytes)})]}),(0,H.jsx)(`dl`,{className:`mt-2 grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] sm:grid-cols-3`,children:n.map(([e,t])=>(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,H.jsx)(`dt`,{className:`truncate text-muted-foreground`,children:e}),(0,H.jsx)(`dd`,{className:`shrink-0 tabular-nums text-foreground/80`,children:jX(t)})]},e))}),(0,H.jsxs)(`div`,{className:`mt-2 border-t border-border/50 pt-2`,children:[(0,H.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:b(`appDataStoragePath`)}),(0,H.jsx)(`code`,{"aria-label":b(`appDataStoragePath`),className:`mt-0.5 block select-all break-all font-mono text-[10px] leading-4 text-foreground/75`,tabIndex:0,children:e.instanceDirectory})]})]})}function jX(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}var MX=[`app-data`];function NX(){return Ot({queryKey:MX,queryFn:()=>I.appData.list(),staleTime:0})}function PX(){let e=F();return jt({mutationFn:({dataId:e,confirmAppId:t})=>I.appData.deleteRetained(e,t),onSuccess:async()=>{await e.invalidateQueries({queryKey:MX}),R.success(b(`appDataDeleteCompleted`))}})}function FX({diagnostics:e,entries:t,error:n,isLoading:r,onDeletionFocusReturn:i}){let[a,o]=(0,V.useState)(null),s=(0,V.useRef)(null),c=(0,V.useRef)(null),l=PX(),u=t.filter(e=>e.lifecycle===`retained`),d=()=>{l.isPending||o(null)};return(0,V.useEffect)(()=>{l.isError&&s.current?.focus()},[l.isError]),!r&&!n&&e.length===0&&u.length===0?null:(0,H.jsxs)(`section`,{className:`mt-6`,"aria-labelledby":`retained-app-data-title`,children:[(0,H.jsxs)(`div`,{className:`mb-2.5 px-1`,children:[(0,H.jsx)(`h2`,{ref:c,id:`retained-app-data-title`,tabIndex:-1,className:`text-sm font-semibold text-foreground`,children:b(`appDataRetainedTitle`)}),(0,H.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-muted-foreground`,children:b(`appDataRetainedDescription`)})]}),r?(0,H.jsx)(yi,{className:`h-28 w-full rounded-xl`}):null,n?(0,H.jsx)(`div`,{role:`alert`,className:`rounded-xl border border-destructive/20 bg-destructive/5 px-3 py-2.5 text-xs text-destructive`,children:n instanceof Error?n.message:b(`appDataLoadFailed`)}):null,e.length>0?(0,H.jsxs)(`div`,{role:`alert`,className:`mb-2.5 rounded-xl border border-amber-500/20 bg-amber-500/5 px-3 py-2.5 text-xs text-amber-800 dark:text-amber-200`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 font-medium`,children:[(0,H.jsx)(Pr,{className:`h-3.5 w-3.5`}),b(`appDataDiagnosticsTitle`)]}),(0,H.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.map(e=>(0,H.jsxs)(`li`,{className:`break-all`,children:[e.message,` — `,e.instanceDirectory]},e.instanceDirectory))})]}):null,(0,H.jsx)(`div`,{className:`space-y-2.5`,children:u.map(e=>(0,H.jsxs)(`article`,{className:`rounded-xl border border-border/65 bg-card p-3.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,H.jsx)(Wi,{className:`h-4 w-4`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.displayName}),(0,H.jsxs)(`div`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted-foreground`,children:[e.appId,e.publisherId?` · ${e.publisherId}`:``]})]}),(0,H.jsxs)(L,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>{l.reset(),o(e)},children:[(0,H.jsx)(Vo,{className:`mr-1.5 h-3.5 w-3.5`}),b(`appDataDeleteAction`)]})]}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(AX,{storage:e.storage,usage:e.usage})})]},e.id))}),(0,H.jsx)(Ir,{open:!!a,onOpenChange:e=>!e&&d(),children:(0,H.jsx)(zr,{className:`max-w-md [&>:last-child]:hidden`,onEscapeKeyDown:e=>l.isPending&&e.preventDefault(),onInteractOutside:e=>l.isPending&&e.preventDefault(),children:a?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Lr,{children:[(0,H.jsx)(Br,{children:b(`appDataDeleteTitle`)}),(0,H.jsx)(Nr,{children:b(`appDataDeleteDescription`)})]}),(0,H.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`rounded-lg border border-destructive/20 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:[a.displayName,` · `,a.appId]}),(0,H.jsx)(AX,{storage:a.storage,usage:a.usage}),l.isError?(0,H.jsx)(`p`,{ref:s,role:`alert`,tabIndex:-1,className:`text-xs text-destructive`,children:l.error instanceof Error?l.error.message:b(`appDataDeleteFailed`)}):null]}),(0,H.jsxs)(Dr,{className:`mt-5 gap-2 sm:gap-0`,children:[(0,H.jsx)(L,{autoFocus:!0,type:`button`,variant:`outline`,disabled:l.isPending,onClick:d,children:b(`cancel`)}),(0,H.jsxs)(L,{type:`button`,variant:`destructive`,disabled:l.isPending,onClick:()=>l.mutate({dataId:a.id,confirmAppId:a.appId},{onSuccess:()=>{o(null),window.requestAnimationFrame(()=>{c.current?c.current.focus():i?.()})}}),children:[l.isPending?(0,H.jsx)(fi,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}):null,l.isPending?b(`appDataDeleting`):b(`appDataDeletePermanently`)]})]})]}):null})})]})}var IX=[`app-packages`],LX=[`panel-apps`],RX=[`service-apps`],zX=[`service-actions`],BX=[`app-package-operations`],VX=new Set([`queued`,`resolving`,`downloading`,`verifying`,`installing`,`finalizing`]);function HX(){return Ot({queryKey:IX,queryFn:()=>I.appPackages.list({includeStorageUsage:!1}),staleTime:0})}function UX(){return Ot({queryKey:BX,queryFn:()=>I.appPackages.listOperations(),refetchInterval:e=>(e.state.data?.entries??[]).some(e=>WX(e.status))?500:!1,staleTime:0})}function WX(e){return VX.has(e)}function GX({isLoaded:e,operations:t,refetchPackages:n,refetchPanels:r,refetchAppData:i,settlementManager:a}){(0,V.useEffect)(()=>{a.settle({isLoaded:e,operations:t,refetchPackages:n,refetchPanels:r,refetchAppData:i})},[e,t,n,r,i,a])}function KX(){let e=F();return jt({mutationFn:async e=>{switch(e.action){case`enable`:return await I.appPackages.enable(e.appId);case`disable`:return await I.appPackages.disable(e.appId);case`install`:return await I.appPackages.startInstall({source:e.source,registryUrl:e.registryUrl});case`update`:return await I.appPackages.startUpdate(e.appId);case`rollback`:return await I.appPackages.startRollback(e.appId,e.version);case`uninstall`:return await I.appPackages.startUninstall(e.appId,e.purgeData??!1)}},onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:IX}),e.invalidateQueries({queryKey:LX}),e.invalidateQueries({queryKey:RX}),e.invalidateQueries({queryKey:zX}),e.invalidateQueries({queryKey:BX}),e.invalidateQueries({queryKey:MX})])}})}var qX={darwin:`macOS`,linux:`Linux`,win32:`Windows`};function JX(e,t){return!e||e.mode===`universal`?t:e.operatingSystems.map(e=>qX[e]).join(` · `)}function YX(e,t){return!e||e.mode===`universal`?{status:`compatible`}:t?e.targets.includes(t.key)?{status:`compatible`}:e.operatingSystems.includes(t.operatingSystem)?{status:`incompatible`,reason:`unsupported-target`}:{status:`incompatible`,reason:`unsupported-os`}:{status:`unknown`}}function XX(e){return e.status===`compatible`?0:e.status===`unknown`?1:2}function ZX(e){return Array.from(new Set(e.map(e=>e.spec).filter(Boolean)))}function QX(e){let{request:t,result:n}=e,r=new Date().toISOString();return n.type===`skill`?{type:`skill`,spec:n.spec,id:t.skill??n.spec,label:t.skill??n.name??n.spec,source:`workspace`,installPath:t.installPath,installedAt:r}:{type:n.type,spec:n.spec,id:n.name??n.spec,label:n.name??n.spec,source:`marketplace`,origin:`marketplace`,enabled:t.enabled??!0,runtimeStatus:t.enabled===!1?`disabled`:`ready`,installedAt:r}}function $X(e,t){let{id:n,spec:r}=t;return!!(r&&e.spec===r||n&&e.id===n)}function eZ(e,t){return t??{type:e,total:0,specs:[],records:[]}}function tZ(e){let{result:t,view:n}=e,r=eZ(t.type,n),i=QX(e),a=r.records.findIndex(e=>$X(e,{id:i.id,spec:i.spec})),o=[...r.records];return a>=0?o[a]={...o[a],...i}:o.unshift(i),{...r,type:t.type,records:o,specs:ZX(o),total:o.length}}function nZ(e){let{request:t,result:n,view:r}=e,i=eZ(n.type,r);if(n.action===`uninstall`||n.action===`remove`){let e=i.records.filter(e=>!$X(e,{id:n.id,spec:t.spec}));return{...i,records:e,specs:ZX(e),total:e.length}}let a=i.records.map(e=>$X(e,{id:n.id,spec:t.spec})?n.action===`disable`?{...e,enabled:!1,runtimeStatus:`disabled`}:n.action===`update`?{...e,installedAt:new Date().toISOString(),origin:e.origin??`marketplace`}:{...e,enabled:!0,runtimeStatus:`ready`}:e);return{...i,records:a,specs:ZX(a),total:a.length}}var rZ=3e4;function iZ(e){return e instanceof Ct&&e.code===`MARKETPLACE_SKILL_LOCAL_CHANGES`}function aZ(e){let t=Rn({queryKey:[`marketplace-items`,e],initialPageParam:1,queryFn:({pageParam:t})=>at({...e,page:t}),getNextPageParam:e=>e.page<e.totalPages?e.page+1:void 0,placeholderData:(t,n)=>{let r=n?.queryKey?.[1];if(!(!r||typeof r!=`object`||!r))return(`type`in r?r.type:void 0)===e.type&&sZ(r,e)?t:void 0},staleTime:15e3,refetchInterval:e.q?!1:rZ,refetchOnMount:`always`,refetchOnReconnect:`always`,refetchOnWindowFocus:`always`}),n=(0,V.useMemo)(()=>see(t.data),[t.data]);return{...t,data:n}}function oZ(e,t=!0){return Ot({queryKey:[`marketplace-recent-items`,e],queryFn:()=>at({type:e,sort:`updated`,page:1,pageSize:6}),enabled:t,staleTime:15e3,refetchInterval:rZ,refetchOnMount:`always`,refetchOnReconnect:`always`,refetchOnWindowFocus:`always`})}function sZ(e,t){return e.tag===t.tag&&e.scene===t.scene&&e.pageSize===t.pageSize}function cZ(e=!0){return Ot({queryKey:[`marketplace-skill-scenes`],queryFn:st,enabled:e,staleTime:6e4})}function lZ(e,t=!0){let n=Vi({queries:e.map(e=>({queryKey:[`marketplace-skill-scene-count`,e.scene],queryFn:()=>at({type:`skill`,scene:e.scene,pageSize:1}),enabled:t&&typeof e.count!=`number`,staleTime:6e4}))});return(0,V.useMemo)(()=>{let t=new Map;return e.forEach((e,r)=>{let i=typeof e.count==`number`?e.count:n[r]?.data?.total;typeof i==`number`&&t.set(e.scene,i)}),t},[n,e])}function uZ(e){return Ot({queryKey:[`marketplace-installed`,e],queryFn:()=>Le(e),staleTime:1e4})}function dZ(){let e=F();return jt({mutationFn:e=>Ze(e),onSuccess:(t,n)=>{e.setQueryData([`marketplace-installed`,t.type],e=>tZ({view:e,request:n,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`}),R.success(t.message||b(`marketplaceInstallSuccessSkill`))},onError:e=>{R.error(e.message||b(`marketplaceInstallFailed`))}})}function fZ(){let e=F();return jt({mutationFn:e=>ve(e),onSuccess:(t,n)=>{e.setQueryData([`marketplace-installed`,t.type],e=>nZ({view:e,request:n,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`});let r=t.action===`enable`?b(`marketplaceEnableSuccess`):t.action===`disable`?b(`marketplaceDisableSuccess`):t.action===`update`?b(`marketplaceUpdateSuccess`):b(`marketplaceUninstallSuccess`);R.success(t.message||r)},onError:e=>{iZ(e)||R.error(e.message||b(`marketplaceOperationFailed`))}})}var pZ=[`bg-amber-600`,`bg-orange-500`,`bg-yellow-600`,`bg-emerald-600`,`bg-teal-600`,`bg-cyan-600`,`bg-stone-600`,`bg-rose-500`,`bg-violet-500`];function mZ(e){let{name:t,fallback:n,className:r}=e,i=t||n,a=i.substring(0,2).toUpperCase();return(0,H.jsx)(`div`,{className:u(`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl text-sm font-semibold text-white`,hZ(i),r),children:a})}function hZ(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return pZ[Math.abs(t)%pZ.length]}function gZ({title:e,spec:t}){return(0,H.jsxs)($r,{delayDuration:400,children:[(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`div`,{className:`truncate text-[14px] font-semibold leading-tight text-gray-950`,children:e})}),(0,H.jsx)(qr,{className:`max-w-[300px] text-xs`,children:e})]}),(0,H.jsx)(`div`,{className:`mb-2 mt-1 flex min-w-0 items-center gap-1.5`,children:t?(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`span`,{className:`max-w-full truncate text-[11px] font-mono leading-tight text-gray-400`,children:t})}),(0,H.jsx)(qr,{className:`max-w-[300px] break-all font-mono text-xs`,children:t})]}):null})]})}function _Z(e){let{item:t,record:n,state:r,onInstall:i,onManage:a}=e,{isInstalling:o,canUpdate:s,canUninstall:c,busyAction:l}=r,d=!!l;return t&&!n||n&&(s||c)?(0,H.jsxs)(`div`,{className:u(`flex shrink-0 items-center justify-end gap-1.5 opacity-100 transition-opacity duration-150`,`md:pointer-events-none md:opacity-0`,`md:group-hover:pointer-events-auto md:group-hover:opacity-100`,`md:group-focus-within:pointer-events-auto md:group-focus-within:opacity-100`),children:[t&&!n&&(0,H.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),i(t)},disabled:o,className:`inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md bg-primary px-2 text-[11px] font-medium text-white transition-colors hover:bg-primary-600 disabled:opacity-50`,children:[(0,H.jsx)(wa,{className:`h-3 w-3`}),b(o?`marketplaceInstalling`:`marketplaceInstall`)]}),n&&s&&(0,H.jsxs)(`button`,{disabled:d,onClick:e=>{e.stopPropagation(),a(`update`,n)},className:`inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md border border-blue-200/80 bg-white px-2 text-[11px] font-medium text-blue-600 transition-colors hover:border-blue-300 hover:bg-blue-50 disabled:opacity-50`,children:[(0,H.jsx)(mi,{className:`h-3 w-3`}),b(l===`update`?`marketplaceUpdating`:`marketplaceUpdate`)]}),n&&c&&(0,H.jsxs)(`button`,{disabled:d,onClick:e=>{e.stopPropagation(),a(`uninstall`,n)},className:`inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md border border-gray-200/80 bg-white px-2 text-[11px] font-medium text-gray-500 transition-colors hover:border-rose-200 hover:bg-rose-50 hover:text-rose-600 disabled:opacity-50`,children:[(0,H.jsx)(Vo,{className:`h-3 w-3`}),b(l===`uninstall`?`marketplaceRemoving`:`marketplaceUninstall`)]})]}):null}function vZ(e){let{record:t,disabled:n}=e;return t?(0,H.jsx)(`div`,{className:`flex h-5 w-5 shrink-0 items-center justify-end`,children:(0,H.jsx)(yZ,{disabled:n})}):null}function yZ(e){let{disabled:t}=e,n=b(t?`marketplaceDisabledStatus`:`marketplaceInstalledStatus`);return(0,H.jsx)($r,{delayDuration:300,children:(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`span`,{"aria-label":n,className:u(`inline-flex h-5 w-5 items-center justify-center`,t?`text-gray-400`:`text-emerald-700`),children:t?(0,H.jsx)(ua,{className:`h-4 w-4 opacity-40`}):(0,H.jsx)(ua,{className:`h-4 w-4`})})}),(0,H.jsx)(qr,{className:`text-xs`,children:n})]})})}function bZ(e){let{item:t,record:n,installState:r,manageState:i,onOpen:a,onInstall:o,onManage:s}=e,{language:c}=jn(),l=In(c),u=t?.name??n?.label??n?.id??n?.spec??b(`marketplaceUnknownItem`),d=Tn(t?.summaryI18n,t?.summary,l)||(n?b(`marketplaceInstalledLocalSummary`):``),f=t?.install.spec??n?.spec??``,p=t?.tags??[],m=n?.id||n?.spec,h=m?i.actionsByTarget.get(m):void 0,g=n?.type===`skill`&&n.source===`workspace`,_=n?.type===`skill`&&n.origin===`marketplace`,v=n?n.enabled===!1||n.runtimeStatus===`disabled`:!1,y=t?.install.spec,x=typeof y==`string`&&r.installingSpecs.has(y);return(0,H.jsxs)(`article`,{onClick:a,className:`group flex h-full min-h-[156px] cursor-pointer flex-col rounded-xl border border-gray-200/60 bg-white p-3.5 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/60`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[(0,H.jsx)(mZ,{name:u,fallback:f||b(`marketplaceTypeSkill`),className:`h-9 w-9 rounded-lg text-xs`}),(0,H.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:(0,H.jsx)(gZ,{title:u,spec:f})}),(0,H.jsx)(vZ,{record:n,disabled:v})]}),(0,H.jsxs)(`div`,{className:`mt-2 flex min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(`p`,{className:`line-clamp-2 text-left text-[12px] leading-relaxed text-gray-500`,children:d}),(0,H.jsxs)(`div`,{className:`mt-auto flex min-w-0 items-end justify-between gap-2 pt-2`,children:[(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(xZ,{tags:p})}),(0,H.jsx)(_Z,{item:t,record:n,state:{isInstalling:x,canUpdate:_,canUninstall:g,busyAction:h},onInstall:o,onManage:s})]})]})]})}function xZ({tags:e}){let t=e.filter(SZ).slice(0,3);return t.length===0?null:(0,H.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-1.5 overflow-hidden`,children:t.map(e=>(0,H.jsx)(`span`,{className:`max-w-[104px] truncate rounded-md bg-gray-100 px-2 py-0.5 text-[11px] font-medium leading-5 text-gray-500`,children:e},e))})}function SZ(e){let t=e.trim().toLowerCase();return t.length>0&&t!==`skill`}function CZ({model:e,showTitle:t,operationState:n,scroll:r,actions:i}){let{scope:a,entries:o,header:s,status:c,emptyLabel:l,errorLabel:d}=e,{showSkeleton:f,isRefreshing:p,error:m}=c,{hasMore:h,loadingMore:g,sentinelRef:_}=r,{installState:v,manageState:y}=n,{onOpen:b,onInstall:x,onManage:S}=i;return(0,H.jsxs)(`section`,{className:u(`flex min-h-full flex-col`,t&&`gap-3`),children:[t&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsx)(`h3`,{className:`text-[14px] font-semibold text-gray-950`,children:s.title}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[12px] text-gray-500`,children:[p&&(0,H.jsx)(`span`,{className:`font-medium text-primary`,children:s.refreshingLabel}),(0,H.jsx)(`span`,{children:s.summary})]})]}),m&&(0,H.jsxs)(`div`,{className:`rounded-xl border border-rose-200 bg-rose-50 p-4 text-sm text-rose-700`,children:[d,`: `,m.message]}),p&&(0,H.jsx)(`div`,{"data-testid":`marketplace-list-refreshing`,className:`h-0.5 overflow-hidden rounded-full bg-primary/10`,children:(0,H.jsx)(`div`,{className:`h-full w-1/3 animate-pulse rounded-full bg-primary`})}),(0,H.jsxs)(`div`,{"data-testid":f?`marketplace-list-skeleton`:void 0,className:u(`grid grid-cols-1 gap-2.5 md:grid-cols-2 xl:grid-cols-3`,f&&`min-h-0 flex-1 auto-rows-[156px] content-start`),children:[f&&(0,H.jsx)(En,{count:36}),!f&&!m&&o.map(e=>(0,H.jsx)(bZ,{item:e.item,record:e.record,installState:v,manageState:y,onOpen:()=>b(e.item,e.record),onInstall:x,onManage:S},e.key))]}),!f&&!m&&o.length===0&&(0,H.jsx)(`div`,{className:`py-8 text-center text-[13px] text-gray-500`,children:l}),a===`all`&&!f&&!m&&(0,H.jsx)(Ln,{hasMore:h,loading:g,sentinelRef:_})]})}function wZ(e){let{entry:t,language:n,localeFallbacks:r,installState:i,layout:a=`rail`,onOpen:o,onInstall:s}=e,{item:c,record:l}=t,d=Tn(c.summaryI18n,c.summary,r),f=c.install.spec,p=i.installingSpecs.has(f),m=!!l;return(0,H.jsxs)(`article`,{onClick:()=>o(t),className:u(`group flex min-h-[166px] cursor-pointer flex-col justify-between rounded-xl border border-gray-200/70 bg-white p-3 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/60`,a===`rail`?`w-[260px] shrink-0`:`w-full min-w-0`),children:[(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsxs)(`div`,{className:`mb-2.5 flex min-w-0 items-start gap-2.5`,children:[(0,H.jsx)(mZ,{name:c.name,fallback:c.install.spec}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,H.jsx)(`div`,{className:`truncate text-[13px] font-semibold leading-tight text-gray-950`,children:c.name}),(0,H.jsx)(`div`,{className:`mt-0.5 truncate text-[11px] font-mono leading-tight text-gray-400`,children:TZ(c)})]})]}),(0,H.jsx)(`p`,{className:`line-clamp-2 text-[12px] leading-relaxed text-gray-500`,children:d}),(0,H.jsx)(EZ,{tags:c.tags})]}),(0,H.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 border-t border-gray-100 pt-2.5`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate text-[11px] text-gray-400`,children:OZ(c.updatedAt)}),m?(0,H.jsxs)(`span`,{className:`inline-flex h-7 items-center gap-1.5 text-[11px] font-semibold text-emerald-700`,children:[(0,H.jsx)(ua,{className:`h-3.5 w-3.5`}),kZ({zh:`已安装`,en:`Installed`},n)]}):(0,H.jsxs)(`button`,{type:`button`,disabled:p,onClick:e=>{e.stopPropagation(),s(c)},className:`inline-flex h-7 items-center gap-1.5 rounded-md border border-gray-200 bg-white px-2 text-[11px] font-semibold text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50 disabled:opacity-50`,children:[(0,H.jsx)(wa,{className:`h-3.5 w-3.5`}),b(p?`marketplaceInstalling`:`marketplaceInstall`)]})]})]})}function TZ(e){return e.slug||e.install.spec}function EZ({tags:e}){let t=e.filter(DZ).slice(0,2);return t.length===0?null:(0,H.jsx)(`div`,{className:`mt-auto truncate pt-2 text-[11px] font-medium text-gray-400`,children:t.join(` / `)})}function DZ(e){let t=e.trim().toLowerCase();return t.length>0&&t!==`skill`}function OZ(e){return e.slice(0,10)||e}function kZ(e,t){return t.startsWith(`zh`)?e.zh:e.en}var AZ=[{scene:`development-debugging`,title:{zh:`开发与调试`,en:`Development`},summary:{zh:`代码审查、错误定位、架构分析与交付验证。`,en:`Review, debug, analyze, and verify delivery work.`},icon:Fo,tone:`dark`,span:`md:col-span-2`},{scene:`office-collaboration`,title:{zh:`办公协作`,en:`Office Work`},summary:{zh:`连接文档、日历、会议、邮件和团队通信。`,en:`Connect docs, calendars, meetings, mail, and teams.`},icon:ta,tone:`green`,span:`md:col-span-2`},{scene:`writing-content`,title:{zh:`写作与内容`,en:`Writing`},summary:{zh:`把调研、写作、润色和发布组织成连续工作流。`,en:`Turn research, writing, polishing, and publishing into one flow.`},icon:vo,tone:`amber`,span:`md:col-span-2`},{scene:`browser-automation`,title:{zh:`浏览器自动化`,en:`Browser`},summary:{zh:`操作网页、捕获动态内容并验证真实用户路径。`,en:`Operate pages, capture dynamic content, and verify user paths.`},icon:Ta,tone:`blue`,span:`md:col-span-2`},{scene:`local-environment`,title:{zh:`本地环境`,en:`Local`},summary:{zh:`管理终端、文件、运行时和本地服务。`,en:`Manage shells, files, runtimes, and local services.`},icon:Ca,tone:`violet`,span:`md:col-span-1`},{scene:`social-platforms`,title:{zh:`社交平台`,en:`Social`},summary:{zh:`处理发布、互动、检索和内容分发。`,en:`Handle posting, interaction, search, and distribution.`},icon:wee,tone:`sky`,span:`md:col-span-1`},{scene:`nextclaw-official`,title:{zh:`NextClaw 官方`,en:`NextClaw Official`},summary:{zh:`优先查看由 NextClaw 维护的原生能力。`,en:`Browse native capabilities maintained by NextClaw.`},icon:Or,tone:`teal`,span:`md:col-span-2`}],jZ={icon:Or,tone:`dark`,span:`md:col-span-2`},MZ={dark:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-stone-600 bg-stone-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},blue:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-cyan-600 bg-cyan-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},green:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-emerald-600 bg-emerald-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},amber:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-amber-600 bg-amber-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},violet:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-violet-500 bg-violet-500 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},sky:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-sky-500 bg-sky-500 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`},teal:{card:`border-gray-200/80 bg-white text-gray-950`,icon:`border-teal-600 bg-teal-600 text-white`,title:`text-gray-950`,text:`text-gray-500`,meta:`text-gray-400`}},NZ=`grid grid-cols-[repeat(auto-fill,minmax(240px,320px))] justify-start gap-3`;function PZ(e){let{recentEntries:t,scenes:n,isScenesLoading:r,isItemsLoading:i,language:a,installState:o,onOpen:s,onInstall:c,onOpenScene:l}=e,u=In(a);return(0,H.jsxs)(`div`,{className:`mb-4 space-y-5`,children:[(0,H.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,H.jsx)(RZ,{icon:ba,title:zZ({zh:`场景`,en:`Scenes`},a),description:zZ({zh:`按使用场景浏览适合的技能组合。`,en:`Browse skills by how you plan to use them.`},a)}),r?(0,H.jsx)(`div`,{"data-testid":`marketplace-scenes-skeleton`,className:`grid auto-rows-[104px] grid-cols-2 gap-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5`,children:(0,H.jsx)(En,{count:AZ.length})}):(0,H.jsx)(`div`,{className:`grid grid-cols-2 gap-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5`,children:n.map(e=>(0,H.jsx)(FZ,{scene:e,language:a,onSelect:l},e.scene))})]}),(i||t.length>0)&&(0,H.jsx)(LZ,{icon:ha,title:zZ({zh:`最近更新`,en:`Recently updated`},a),description:zZ({zh:`看看生态最近在补齐哪些能力。`,en:`See what the ecosystem has been improving lately.`},a),entries:t,language:a,localeFallbacks:u,isLoading:i,installState:o,onOpen:s,onInstall:c})]})}function FZ(e){let{scene:t,language:n,onSelect:r}=e,i=BZ(t.scene),a=i.icon,o=MZ[i.tone];return(0,H.jsx)(`button`,{type:`button`,onClick:()=>r(t.scene),className:u(`group flex min-h-[74px] flex-col justify-center rounded-lg border px-3 py-2.5 text-left shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/70`,o.card),children:(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:u(`flex h-7 w-7 shrink-0 items-center justify-center rounded-md border`,o.icon),children:(0,H.jsx)(a,{className:`h-3.5 w-3.5`})}),(0,H.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-[13px] font-semibold text-gray-950`,children:VZ(t,i,n)}),typeof t.count==`number`&&(0,H.jsx)(`span`,{className:`shrink-0 text-[11px] font-medium text-gray-400`,children:UZ(t.count,n)})]}),(0,H.jsx)(`p`,{className:u(`mt-1 line-clamp-1 text-[11px] leading-relaxed`,o.text),children:HZ(t,i,n)})]})})}function IZ(e){let{scene:t,entries:n,isLoading:r,language:i,localeFallbacks:a,installState:o,onBack:s,onOpen:c,onInstall:l}=e,d=BZ(t.scene),f=d.icon,p=MZ[d.tone];return(0,H.jsxs)(`section`,{className:`flex min-h-full flex-col`,children:[(0,H.jsxs)(`div`,{className:`mb-4 flex min-w-0 items-start gap-2.5`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:s,className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900`,"aria-label":zZ({zh:`返回`,en:`Back`},i),children:(0,H.jsx)(li,{className:`h-4 w-4`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:u(`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border`,p.icon),children:(0,H.jsx)(f,{className:`h-4 w-4`})}),(0,H.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[15px] font-semibold text-gray-950`,children:VZ(t,d,i)}),(0,H.jsx)(`span`,{className:`shrink-0 text-[11px] font-medium text-gray-400`,children:zZ(r?{zh:`加载中`,en:`Loading`}:{zh:`${n.length} 个技能`,en:`${n.length} skills`},i)})]}),(0,H.jsx)(`div`,{className:`mt-1.5 flex min-w-0 items-center gap-2`,children:(0,H.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[12px] leading-relaxed text-gray-500`,children:HZ(t,d,i)})})]})]}),r?(0,H.jsx)(`div`,{"data-testid":`marketplace-scene-skeleton`,className:u(NZ,`min-h-0 flex-1 auto-rows-[166px] content-start`),children:(0,H.jsx)(En,{count:24})}):n.length>0?(0,H.jsx)(`div`,{className:NZ,children:n.map(e=>(0,H.jsx)(wZ,{entry:e,language:i,localeFallbacks:a,installState:o,layout:`grid`,onOpen:c,onInstall:l},e.item.id))}):(0,H.jsx)(`div`,{className:`rounded-lg border border-dashed border-gray-200 py-8 text-center text-[12px] text-gray-500`,children:zZ({zh:`这个模块暂无技能。`,en:`No skills in this module yet.`},i)})]})}function LZ(e){let{icon:t,title:n,description:r,entries:i,language:a,localeFallbacks:o,isLoading:s,installState:c,onOpen:l,onInstall:u}=e;return(0,H.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,H.jsx)(RZ,{icon:t,title:n,description:r}),s?(0,H.jsx)(`div`,{"data-testid":`marketplace-recent-skeleton`,className:`-mx-1 grid auto-rows-[166px] grid-cols-[repeat(4,260px)] gap-2.5 overflow-hidden px-1 pb-1.5`,children:(0,H.jsx)(En,{count:4})}):(0,H.jsx)(`div`,{className:`-mx-1 flex gap-2.5 overflow-x-auto px-1 pb-1.5 custom-scrollbar`,children:i.map(e=>(0,H.jsx)(wZ,{entry:e,language:a,localeFallbacks:o,installState:c,onOpen:l,onInstall:u},e.item.id))})]})}function RZ({icon:e,title:t,description:n}){return(0,H.jsx)(`div`,{className:`flex items-end justify-between gap-4`,children:(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`h3`,{className:`flex items-center gap-2 text-[14px] font-semibold text-gray-950`,children:[(0,H.jsx)(e,{className:`h-4 w-4 text-primary`}),t]}),(0,H.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-relaxed text-gray-500`,children:n})]})})}function zZ(e,t){return t.startsWith(`zh`)?e.zh:e.en}function BZ(e){return AZ.find(t=>t.scene===e)??{scene:e,...jZ}}function VZ(e,t,n){return t.title?zZ(t.title,n):e.title}function HZ(e,t,n){return t.summary?zZ(t.summary,n):e.description??e.scene}function UZ(e,t){return t.startsWith(`zh`)?`${e} 个技能`:`${e} skills`}var WZ=`https://skillhub.cn/`;function GZ(){return(0,H.jsx)(ge,{href:WZ,external:!0,className:`h-7 shrink-0 px-1.5 text-[13px]`,children:b(`marketplaceExternalSkillSourceTitle`)})}function KZ(e){return(e??``).trim().toLowerCase()}function qZ(e,t){let n=KZ(t);return n.length>0?`${e}:${n}`:``}function JZ(e){let t=new Map;for(let n of e){let e=[n.install.spec,n.slug,n.id];for(let r of e){let e=qZ(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function YZ(e){let t=new Map;for(let n of e){let e=[n.spec,n.id,n.label];for(let r of e){let e=qZ(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function XZ(e,t){let n=[e.install.spec,e.slug,e.id];for(let r of n){let n=qZ(e.type,r);if(!n)continue;let i=t.get(n);if(i)return i}}function ZZ(e,t){return t.get(qZ(e.type,e.spec))||t.get(qZ(e.type,e.id))||t.get(qZ(e.type,e.label))}function QZ(e,t,n,r){let i=KZ(n);if(!i)return!0;let a=Tn(t?.summaryI18n,t?.summary,r);return[e.id,e.spec,e.label,t?.name,t?.slug,t?.summary,a,...t?.tags??[]].map(e=>KZ(e)).filter(Boolean).some(e=>e.includes(i))}function $Z(e){let{items:t,recentItems:n,installedRecordLookup:r,scene:i,forcedType:a,typeFilter:o,scope:s,searchText:c,query:l,showListSkeleton:u,hasCatalogError:d}=e,f=cZ(o===`skill`),p=(0,V.useMemo)(()=>f.data?.scenes??[],[f.data?.scenes]),m=lZ(p,o===`skill`),h=(0,V.useMemo)(()=>p.map(e=>({...e,count:typeof e.count==`number`?e.count:m.get(e.scene)})),[m,p]),g=(0,V.useMemo)(()=>t.map(e=>({item:e,record:XZ(e,r)})),[t,r]),_=(0,V.useMemo)(()=>n.map(e=>({item:e,record:XZ(e,r)})),[r,n]),v=(0,V.useMemo)(()=>{let e=i?.trim();if(e)return h.find(t=>t.scene===e)??{scene:e,title:e}},[i,h]),y=o===`skill`&&!!i?.trim(),b=o===`skill`&&s===`all`&&!c.trim()&&!l&&!y,x=u||t.length>=4,S=b&&!d&&x&&h.length===0&&f.isLoading;return{entries:g,recentEntries:_,scenes:h,selectedScene:v,sceneEntries:g,isSceneRoute:y,isScenesLoading:S,showShelves:b&&!d&&x&&(u||h.length>0||S),backPath:a?`/skills`:`/marketplace/skills`,pathPrefix:a?`/skills/scenes`:`/marketplace/skills/scenes`}}function eQ(){let e=dZ(),t=fZ(),{confirm:n,ConfirmDialog:r}=On(),[i,a]=(0,V.useState)(new Set),[o,s]=(0,V.useState)(new Map);return{installState:{installingSpecs:i},manageState:{actionsByTarget:o},handleInstall:async t=>{let n=t.install.spec;if(!i.has(n)){a(e=>new Set(e).add(n));try{await e.mutateAsync({type:t.type,spec:n,kind:t.install.kind,skill:t.slug,installPath:`skills/${t.slug}`})}catch{}finally{a(e=>{let t=new Set(e);return t.delete(n),t})}}},handleManage:async(e,r)=>{let i=e===`update`?r.catalogSlug||r.id||r.spec:r.id||r.spec;if(!(!i||o.has(i))&&!(e===`uninstall`&&!await n({title:`${b(`marketplaceUninstallTitle`)} ${i}?`,description:b(`marketplaceUninstallDescription`),confirmLabel:b(`marketplaceUninstall`),variant:`destructive`}))){s(t=>new Map(t).set(i,e));try{let a={type:r.type,action:e,id:i,spec:r.spec};try{await t.mutateAsync(a)}catch(r){if(e!==`update`||!iZ(r)||!await n({title:b(`marketplaceUpdateConflictTitle`),description:b(`marketplaceUpdateConflictDescription`),confirmLabel:b(`marketplaceUpdateConflictConfirm`),variant:`destructive`}))return;await t.mutateAsync({...a,force:!0})}}finally{s(e=>{let t=new Map(e);return t.delete(i),t})}}},ConfirmDialog:r}}function tQ(e){let t=Oi(),n=(0,V.useRef)({byKey:new Map,seq:0});return{openItemDetail:async(r,i)=>{let a=r?.name??i?.label??i?.id??i?.spec??b(`marketplaceUnknownItem`),o=kn(r?`skill`:`skill-local`,r?.slug??i?.id??i?.spec??a),s=r?`marketplace:${r.type}:${r.slug}`:`marketplace:${i?.type??`unknown`}:${i?.id??i?.spec??a}`,c=b(`marketplaceTypeSkill`);if(!r){wn(t,{id:o,title:a,typeLabel:c,spec:i?.spec??`-`,status:`ready`,summary:b(`marketplaceInstalledLocalSummary`),metadataRaw:JSON.stringify(i??{},null,2),contentRaw:`-`});return}let l=n.current.seq+1;n.current.seq=l,n.current.byKey.set(s,l);let u=Tn(r.summaryI18n,r.summary,e);wn(t,{id:o,title:a,typeLabel:c,spec:r.install.spec,status:`loading`,summary:u,tags:r.tags,author:r.author});try{let e=await rt(r.slug);if(n.current.byKey.get(s)!==l)return;wn(t,{id:o,title:a,typeLabel:c,spec:r.install.spec,status:`ready`,summary:u,metadataRaw:e.metadataRaw,contentRaw:e.bodyRaw||e.raw,sourceUrl:e.sourceUrl,sourceLabel:`Source (${e.source})`,tags:r.tags,author:r.author},{activate:!1})}catch(e){if(n.current.byKey.get(s)!==l)return;wn(t,{id:o,title:a,typeLabel:c,spec:r.install.spec,status:`error`,summary:u,metadataRaw:JSON.stringify({error:e instanceof Error?e.message:String(e)},null,2),contentRaw:b(`marketplaceOperationFailed`)},{activate:!1})}}}}function nQ(e){let{scope:t,typeFilter:n,query:r,localeFallbacks:i,catalogView:a,installedView:o,isCatalogLoading:s,isCatalogFetching:c,isCatalogFetchingNextPage:l,catalogError:u,isInstalledLoading:d,installedError:f}=e,p=(0,V.useMemo)(()=>o?.records??[],[o?.records]),m=(0,V.useMemo)(()=>a?.items??[],[a?.items]),h=(0,V.useMemo)(()=>JZ(m),[m]),g=(0,V.useMemo)(()=>YZ(p),[p]),_=(0,V.useMemo)(()=>p.filter(e=>e.type===n).map(e=>({key:`${e.type}:${e.spec}:${e.id??``}`,record:e,item:ZZ(e,h)})).filter(e=>QZ(e.record,e.item,r,i)).sort((e,t)=>rQ(e.record,t.record)),[p,n,h,r,i]),v=(0,V.useMemo)(()=>t===`installed`?_:m.map(e=>({key:e.id,item:e,record:XZ(e,g)})),[m,_,g,t]),y=t===`all`&&s&&!a||t===`installed`&&d&&!o,x=t===`all`&&!y&&!!a&&c&&!l,S=t===`installed`?d&&!o?b(`loading`):`${_.length} ${b(`marketplaceInstalledSkillsCountSuffix`)}`:a?`${a.total} ${b(`marketplaceSkillsCountSuffix`)}`:b(`loading`),C=t===`all`&&u?u:t===`installed`&&f?f:void 0,w={scope:t,entries:v,header:{title:b(t===`installed`?`marketplaceSectionInstalledSkills`:`marketplaceAllSkills`),summary:S,refreshingLabel:b(`marketplaceRefreshingResults`)},status:{showSkeleton:y,isRefreshing:x,error:C},emptyLabel:b(t===`installed`?`marketplaceNoInstalledSkills`:`marketplaceNoSkills`),errorLabel:b(t===`installed`?`marketplaceErrorLoadingInstalledSkills`:`marketplaceErrorLoadingSkillsData`)};return{allItems:m,installedRecordLookup:g,installedTotal:o?.total??0,itemListView:w,showListSkeleton:y,isRefreshingList:x}}function rQ(e,t){let n=Date.parse(e.installedAt??``),r=Date.parse(t.installedAt??``);return Number.isNaN(n)||Number.isNaN(r)||n===r?e.spec.localeCompare(t.spec):r-n}var iQ=20;function aQ({forcedType:e}={}){let t=ce(),n=le(),{language:r}=jn(),i=`skill`,a=(0,V.useMemo)(()=>In(r),[r]),[o,s]=(0,V.useState)(``),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(`all`),[f,p]=(0,V.useState)(`relevance`),{installState:m,manageState:h,handleInstall:g,handleManage:_,ConfirmDialog:v}=eQ(),{openItemDetail:y}=tQ(a);(0,V.useEffect)(()=>{let e=setTimeout(()=>{l(o.trim())},250);return()=>clearTimeout(e)},[o]);let x=uZ(i),S=i===`skill`?n.scene?.trim():void 0,C=aZ({q:S?void 0:c||void 0,scene:S,type:i,sort:f,pageSize:iQ}),w=oZ(i,u===`all`&&!o.trim()&&!c&&!S),{containerRef:T,sentinelRef:E}=Mn({disabled:u!==`all`||C.isError||!C.hasNextPage||C.isFetchingNextPage,onLoadMore:()=>C.fetchNextPage(),watchValue:`${i}:${u}:${c}:${S??``}:${f}:${C.data?.loadedItems??0}:${C.data?.loadedPages??0}`});(0,V.useEffect)(()=>{let e=T.current;e&&typeof e.scrollTo==`function`&&e.scrollTo({top:0})},[T,c,S,u,f,i]);let D=nQ({scope:u,typeFilter:i,query:c,localeFallbacks:a,catalogView:C.data,installedView:x.data,isCatalogLoading:C.isLoading,isCatalogFetching:C.isFetching,isCatalogFetchingNextPage:C.isFetchingNextPage,catalogError:C.isError?C.error:void 0,isInstalledLoading:x.isLoading,installedError:x.isError?x.error:void 0}),O=$Z({items:D.allItems,recentItems:w.data?.items??[],installedRecordLookup:D.installedRecordLookup,scene:S,forcedType:e,typeFilter:i,scope:u,searchText:o,query:c,showListSkeleton:D.showListSkeleton,hasCatalogError:C.isError});return(0,H.jsxs)(Jt,{className:`flex h-full min-h-0 flex-col pb-0`,children:[!O.isSceneRoute&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`mb-3 flex items-start justify-between gap-3 border-b border-gray-200/60`,children:[(0,H.jsx)(PY,{value:u,onValueChange:e=>d(e),children:(0,H.jsxs)(FY,{className:`mb-0 h-auto flex-1 justify-start gap-6 rounded-none border-b-0 bg-transparent p-0 text-gray-500`,children:[(0,H.jsx)(IY,{value:`all`,className:`rounded-none border-b-2 border-transparent bg-transparent px-0 pb-3 pt-0 shadow-none hover:bg-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-gray-950 data-[state=active]:shadow-none`,children:b(`marketplaceTabMarketplaceSkills`)}),(0,H.jsxs)(IY,{value:`installed`,className:`gap-1.5 rounded-none border-b-2 border-transparent bg-transparent px-0 pb-3 pt-0 shadow-none hover:bg-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-gray-950 data-[state=active]:shadow-none`,children:[b(`marketplaceTabInstalledSkills`),(0,H.jsx)(`span`,{className:`text-[11px] font-medium text-gray-500`,children:D.installedTotal})]})]})}),(0,H.jsx)(GZ,{})]}),(0,H.jsx)(An,{scope:u,searchText:o,isRefreshing:D.isRefreshingList,searchPlaceholder:b(`marketplaceSearchPlaceholderSkills`),sort:f,onSearchTextChange:s,onSortChange:p})]}),(0,H.jsx)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,H.jsxs)(`div`,{ref:T,className:`min-h-0 flex-1 overflow-y-auto custom-scrollbar pr-1`,"aria-busy":D.showListSkeleton||C.isFetchingNextPage,children:[O.isSceneRoute&&O.selectedScene&&(0,H.jsx)(IZ,{scene:O.selectedScene,entries:O.sceneEntries,isLoading:D.showListSkeleton,language:r,localeFallbacks:a,installState:m,onBack:()=>t(O.backPath),onOpen:e=>void y(e.item,e.record),onInstall:g}),O.isSceneRoute&&!D.showListSkeleton&&(0,H.jsx)(Ln,{hasMore:!!C.hasNextPage,loading:C.isFetchingNextPage,sentinelRef:E}),O.showShelves&&(0,H.jsx)(PZ,{recentEntries:O.recentEntries,scenes:O.scenes,isScenesLoading:O.isScenesLoading,isItemsLoading:D.showListSkeleton||w.isLoading,language:r,installState:m,onOpen:e=>void y(e.item,e.record),onInstall:g,onOpenScene:e=>t(`${O.pathPrefix}/${e}`)}),!O.isSceneRoute&&(0,H.jsx)(CZ,{model:D.itemListView,showTitle:O.showShelves||!D.showListSkeleton,operationState:{installState:m,manageState:h},scroll:{hasMore:!!C.hasNextPage,loadingMore:C.isFetchingNextPage,sentinelRef:E},actions:{onOpen:(e,t)=>void y(e,t),onInstall:g,onManage:_}})]})}),(0,H.jsx)(v,{})]})}function oQ({error:e,filter:t,hostTarget:n,installedById:r,isError:i,isFetchingNextPage:a,isLoading:o,isStarting:s,items:c,localeFallbacks:l,onFilterChange:u,onInstall:d,onLoadMore:f,onSearchChange:p,onSelect:m,onUpdate:h,operations:g,hasNextPage:_,search:v,startingSource:y}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(sQ,{filter:t,onFilterChange:u,onSearchChange:p,search:v}),(0,H.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto bg-background px-4 py-4 sm:px-6 sm:py-5`,children:[e?(0,H.jsx)(`div`,{role:`alert`,className:`mb-2 rounded-xl bg-destructive/8 px-3 py-2.5 text-xs leading-5 text-destructive ring-1 ring-destructive/15`,children:e.message||b(`appPackagesActionFailed`)}):null,(0,H.jsx)(cQ,{installedById:r,hostTarget:n,isError:i,isFetchingNextPage:a,isLoading:o,isStarting:s,items:c,localeFallbacks:l,onInstall:d,onLoadMore:f,onSelect:m,onUpdate:h,operations:g,hasNextPage:_,startingSource:y})]})]})}function sQ({filter:e,onFilterChange:t,onSearchChange:n,search:r}){let i=[{value:`all`,label:b(`appPackagesFilterAll`)},{value:`featured`,label:b(`appPackagesMarketplaceFeatured`)},{value:`personal`,label:b(`appPackagesFilterPersonal`)},{value:`local`,label:b(`appPackagesFilterLocal`)}];return(0,H.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 bg-card px-5 pb-3.5 pt-[max(1.25rem,env(safe-area-inset-top))] sm:px-6 sm:pt-5`,children:[(0,H.jsxs)(Lr,{className:`pr-8`,children:[(0,H.jsx)(Br,{className:`text-xl`,children:b(`appPackagesMarketplaceTitle`)}),(0,H.jsx)(Nr,{className:`max-w-xl leading-5`,children:b(`appPackagesMarketplaceDescription`)})]}),(0,H.jsxs)(`div`,{className:`relative mt-4`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,H.jsx)(vt,{autoFocus:!0,className:`h-10 rounded-xl border-transparent bg-muted/65 pl-9 shadow-none focus-visible:ring-1`,value:r,onChange:e=>n(e.target.value),placeholder:b(`appPackagesMarketplaceSearch`),"aria-label":b(`appPackagesMarketplaceSearch`)})]}),(0,H.jsx)(`div`,{className:`mt-3 flex gap-1 overflow-x-auto`,"aria-label":b(`appPackagesFilterLabel`),children:i.map(n=>(0,H.jsx)(`button`,{type:`button`,onClick:()=>t(n.value),className:u(`shrink-0 rounded-full px-3 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e===n.value?`bg-foreground text-background`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-foreground`),children:n.label},n.value))})]})}function cQ({installedById:e,hostTarget:t,isError:n,isFetchingNextPage:r,isLoading:i,isStarting:a,items:o,localeFallbacks:s,onInstall:c,onLoadMore:l,onSelect:u,onUpdate:d,operations:f,hasNextPage:p,startingSource:m}){return i?(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 min-[820px]:grid-cols-3`,"aria-label":b(`appPackagesMarketplaceLoading`),children:[(0,H.jsx)(yi,{className:`aspect-[16/9] w-full rounded-2xl`}),(0,H.jsx)(yi,{className:`aspect-[16/9] w-full rounded-2xl`}),(0,H.jsx)(yi,{className:`hidden aspect-[16/9] w-full rounded-2xl min-[820px]:block`})]}):n?(0,H.jsx)(`div`,{role:`alert`,className:`rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-5 text-sm text-destructive`,children:b(`appPackagesMarketplaceFailed`)}):o.length===0?(0,H.jsxs)(`div`,{className:`flex flex-col items-center px-6 py-14 text-center`,children:[(0,H.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-2xl bg-muted`,children:(0,H.jsx)(ui,{className:`h-5 w-5 text-muted-foreground`})}),(0,H.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:b(`appPackagesMarketplaceEmpty`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:b(`appPackagesMarketplaceEmptyHint`)})]}):(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 min-[820px]:grid-cols-3`,children:o.map(n=>(0,H.jsx)(lQ,{installedPackage:e.get(n.appId),hostTarget:t,isStarting:a&&m===n.install.spec,item:n,localeFallbacks:s,onInstall:c,onSelect:u,onUpdate:d,operation:DX(f,n.appId,n.install.spec)},n.id))}),p?(0,H.jsx)(`div`,{className:`flex justify-center pt-5`,children:(0,H.jsx)(`button`,{type:`button`,disabled:r,onClick:l,className:`rounded-full border border-border bg-card px-4 py-2 text-xs font-medium text-foreground transition hover:bg-[var(--interaction-hover)] disabled:cursor-wait disabled:opacity-60`,children:b(r?`appPackagesMarketplaceLoadingMore`:`appPackagesMarketplaceLoadMore`)})}):null]})}function lQ({installedPackage:e,hostTarget:t,isStarting:n,item:r,localeFallbacks:i,onInstall:a,onSelect:o,onUpdate:s,operation:c}){let l=e?uQ(e.name,e.nameI18n):r.name,u=Tn(r.summaryI18n,r.summary,i),d=c?WX(c.status):!1,f=!!(e&&e.activeVersion!==r.latestVersion),p=JX(r.availability,b(`appPackagesAllPlatforms`)),m=xX(YX(r.availability,t),p),h=!!(m&&(!e||f));return(0,H.jsxs)(`article`,{className:`group relative overflow-hidden rounded-2xl border border-border/60 bg-card shadow-sm transition duration-200 hover:-translate-y-0.5 hover:border-border hover:shadow-lg`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>o(r.slug),className:`block w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:(0,H.jsx)(yX,{accentColor:r.accentColor,coverPreview:r.coverPreview,coverUrl:r.coverUrl,name:l,className:`aspect-[16/9] rounded-none ring-0`})}),(0,H.jsxs)(`div`,{className:`p-3.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(gX,{icon:r.iconUrl??e?.icon,name:l,className:`h-11 w-11 rounded-[13px]`}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>o(r.slug),className:`min-w-0 flex-1 rounded-lg text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:l}),r.featured?(0,H.jsx)(Or,{className:`h-3.5 w-3.5 shrink-0 text-amber-500`,"aria-label":b(`appPackagesMarketplaceFeatured`)}):null]}),(0,H.jsx)(SX,{presentation:m}),(0,H.jsx)(`span`,{className:`mt-1 line-clamp-2 block min-h-10 text-xs leading-5 text-muted-foreground`,children:u}),(0,H.jsxs)(`span`,{className:`mt-2 flex items-center gap-1.5 text-[11px] text-muted-foreground/75`,children:[(0,H.jsx)(`span`,{children:r.publisher.name}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,H.jsxs)(`span`,{children:[`v`,r.latestVersion]}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,H.jsx)(`span`,{children:p}),(0,H.jsx)(sa,{className:`ml-0.5 h-3 w-3 opacity-0 transition-opacity group-hover:opacity-60`})]})]})]}),(0,H.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 border-t border-border/50 pt-3`,children:[(0,H.jsx)(CX,{blocked:h,presentation:m,className:`min-w-0 text-[11px] font-medium text-muted-foreground`}),(0,H.jsx)(wX,{active:d,canUpdate:f,installed:!!e,isStarting:n,onAction:()=>f?s(r.appId):a(r.install.spec,r.install.registry),operation:c,unavailableLabel:h?m?.actionLabel:void 0,unavailableReason:h?m?.reason:void 0})]})]}),c&&!h&&d?(0,H.jsx)(`div`,{className:`px-4 pb-4`,children:(0,H.jsx)(EX,{operation:c})}):null]})}function uQ(e,t){let n=M()===`zh`?`zh-CN`:`en-US`;return t?.[n]??e??``}function dQ({detail:e,error:t,hostTarget:n,installedPackage:r,isLoading:i,isStarting:a,localeFallbacks:o,onInstall:s,onUpdate:c,operation:l}){if(i)return(0,H.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,H.jsx)(yi,{className:`h-24 w-full rounded-2xl`}),(0,H.jsx)(yi,{className:`h-40 w-full rounded-2xl`})]});if(t||!e)return(0,H.jsx)(`div`,{role:`alert`,className:`m-6 rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-5 text-sm text-destructive`,children:t?.message??b(`appPackagesMarketplaceFailed`)});let u=Tn(e.summaryI18n,e.summary,o),d=Tn(e.descriptionI18n,e.description??u,o),f=l?WX(l.status):!1,p=e.manifest.components??[],m=p.filter(e=>e.kind===`panel`).length,h=p.filter(e=>e.kind===`service`).length,g=e.manifest.runtime?.profile??(h>0?`native-process`:`panel-only`),_=!!(r&&r.activeVersion!==e.latestVersion),v=JX(e.availability,b(`appPackagesAllPlatforms`)),y=xX(YX(e.availability,n),v),x=!!(y&&(!r||_));return(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-5 py-5 sm:px-7 sm:py-6`,children:[(0,H.jsxs)(`div`,{className:`grid items-stretch gap-5 sm:grid-cols-[minmax(0,1.18fr)_minmax(240px,0.82fr)]`,children:[(0,H.jsx)(yX,{accentColor:e.accentColor,coverPreview:e.coverPreview,coverUrl:e.coverUrl,name:e.name,className:`aspect-[16/9] rounded-2xl`}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col rounded-2xl border border-border/60 bg-card p-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(gX,{icon:e.iconUrl??r?.icon,name:e.name,className:`h-14 w-14 rounded-2xl`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-foreground`,children:e.name}),(0,H.jsx)(SX,{presentation:y}),(0,H.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(ko,{className:`h-3.5 w-3.5`}),e.publisher.name]}),(0,H.jsxs)(`span`,{children:[`v`,e.latestVersion]})]})]})]}),(0,H.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-muted-foreground`,children:u}),(0,H.jsxs)(`div`,{className:`mt-auto pt-4`,children:[(0,H.jsx)(CX,{blocked:x,presentation:y,className:`mb-2 text-xs font-medium text-muted-foreground`}),(0,H.jsx)(wX,{active:f,canUpdate:_,installed:!!r,isStarting:a,onAction:()=>_?c(e.appId):s(e.install.spec,e.install.registry),operation:l,unavailableLabel:x?y?.actionLabel:void 0,unavailableReason:x?y?.reason:void 0})]})]})]}),l&&!x&&f?(0,H.jsx)(EX,{operation:l}):null,(0,H.jsxs)(`section`,{className:`mt-7`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:b(`appPackagesAboutApp`)}),(0,H.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-muted-foreground`,children:d})]}),(0,H.jsxs)(`div`,{className:`mt-6 grid gap-3 sm:grid-cols-2`,children:[(0,H.jsx)(fQ,{icon:ao,label:b(`appPackagesPlatformsLabel`),value:v}),(0,H.jsx)(fQ,{icon:Cn,label:b(`appPackagesPanelsAdded`),value:m>0?String(m):b(`appPackagesNone`)}),(0,H.jsx)(fQ,{icon:To,label:b(`appPackagesServicesAdded`),value:h>0?String(h):b(`appPackagesNone`)}),e.manifest.engines?.nextclaw?(0,H.jsx)(fQ,{icon:ko,label:b(`appPackagesNextClawRequirement`),value:e.manifest.engines.nextclaw}):null,(0,H.jsx)(fQ,{icon:g===`native-process`?Oo:ko,label:b(`appPackagesIsolationLabel`),value:b(g===`native-process`?`appPackagesIsolationFullUser`:g===`wasi`?`appPackagesIsolationMediated`:`appPackagesIsolationPanel`)})]}),(0,H.jsxs)(`section`,{className:`mt-7 border-t border-border/60 pt-6`,children:[(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:b(`appPackagesAccessTitle`)}),(0,H.jsx)(`div`,{className:`mt-3 space-y-2`,children:pQ(e).map(e=>(0,H.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-xl bg-muted/45 px-3 py-2.5 text-xs leading-5 text-muted-foreground`,children:[(0,H.jsx)(ko,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{children:e})]},e))})]}),(0,H.jsxs)(`a`,{href:e.webUrl,target:`_blank`,rel:`noreferrer`,className:`mt-6 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground underline-offset-4 hover:text-foreground hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[b(`appPackagesOpenPublicDetails`),(0,H.jsx)(fe,{className:`h-3.5 w-3.5`})]})]})}function fQ({icon:e,label:t,value:n}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-border/60 px-3 py-3`,children:[(0,H.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,H.jsx)(e,{className:`h-4 w-4`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:t}),(0,H.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n})]})]})}function pQ(e){let t=[],n=e.permissions.documentAccess??[];n.length>0&&t.push(b(`appPackagesDocumentAccess`).replace(`{count}`,String(n.length)));let r=e.permissions.allowedDomains??[];return r.length>0&&t.push(b(`appPackagesNetworkAccess`).replace(`{count}`,String(r.length))),e.permissions.capabilities?.hostBridge&&t.push(b(`appPackagesHostBridgeAccess`)),e.permissions.capabilities?.nativeProcess&&t.push(b(`appPackagesNativeProcessAccess`)),(e.permissions.storage===!0||typeof e.permissions.storage==`object`&&e.permissions.storage?.namespace)&&t.push(b(`appPackagesLocalStorageAccess`)),t.length>0?t:[b(`appPackagesNoExtraAccess`)]}var mQ=`https://apps-registry.nextclaw.io`,hQ=new Set([404,405,501]),gQ=(void 0)?.replace(/\/$/,``),_Q=void 0,vQ=new Set([`hello-notes`,`personal-organizer`,`starter-card`,`workspace-glance`]);async function yQ(e={},t){let n=await SQ(e,t);return hQ.has(n.status)?await wQ(e,t):await CQ(n)}async function bQ(e,t){let n=await fetch(`${mQ}/api/v1/apps/items/${encodeURIComponent(e)}`,{headers:{accept:`application/json`},signal:t});if(!n.ok)throw Error(`Marketplace detail request failed (${n.status})`);let r=await n.json();if(!kQ(r)||r.ok!==!0||!kQ(r.data))throw Error(`Marketplace returned an invalid app detail`);let{data:i}=r,a=i;if(!EQ(i)||!kQ(a.manifest)||!kQ(a.permissions))throw Error(`Marketplace returned an invalid app detail`);let{manifest:o,permissions:s}=a,c=Array.isArray(o.components)?o.components.filter(e=>kQ(e)&&(e.kind===`panel`||e.kind===`service`)&&typeof e.path==`string`):void 0;return{...xQ(i),description:typeof a.description==`string`?a.description:void 0,descriptionI18n:OQ(a.descriptionI18n)?a.descriptionI18n:void 0,manifest:{schemaVersion:o.schemaVersion===2?2:1,icon:typeof o.icon==`string`?o.icon:void 0,engines:kQ(o.engines)&&typeof o.engines.nextclaw==`string`?{nextclaw:o.engines.nextclaw}:void 0,components:c},permissions:s}}function xQ(e){if(e.coverUrl)return e;let t=TQ(e.slug);return e.publisher.id!==`nextclaw`||!t?e:{...e,coverUrl:t,coverPreview:!0}}async function SQ(e,t){let{cursor:n,featured:r,limit:i,publisher:a,q:o,sort:s,tag:c,tags:l}=e,u=new URLSearchParams;return o&&u.set(`q`,o),c&&u.set(`tag`,c),l?.length&&u.set(`tags`,l.join(`,`)),a&&u.set(`publisher`,a),r!==void 0&&u.set(`featured`,String(r)),s&&u.set(`sort`,s),n&&u.set(`cursor`,n),u.set(`limit`,String(i??24)),await fetch(`${mQ}/api/v2/apps/items?${u}`,{headers:{accept:`application/json`},signal:t})}async function CQ(e){if(!e.ok)throw Error(`Marketplace request failed (${e.status})`);let t=await e.json();if(!kQ(t)||t.ok!==!0||!kQ(t.data))throw Error(`Marketplace returned an invalid response`);return{items:(Array.isArray(t.data.items)?t.data.items.filter(EQ):[]).map(xQ),nextCursor:typeof t.data.nextCursor==`string`?t.data.nextCursor:void 0,hasMore:t.data.hasMore===!0,query:typeof t.data.query==`string`?t.data.query:void 0,tag:typeof t.data.tag==`string`?t.data.tag:void 0,featured:typeof t.data.featured==`boolean`?t.data.featured:void 0,sort:t.data.sort===`updated`||t.data.sort===`featured`?t.data.sort:`relevance`}}async function wQ(e,t){let{featured:n,publisher:r,q:i,sort:a,tag:o,tags:s}=e,c=new URLSearchParams({page:`1`,pageSize:`100`});i&&c.set(`q`,i),o&&c.set(`tag`,o);let l=await fetch(`${mQ}/api/v1/apps/items?${c}`,{headers:{accept:`application/json`},signal:t});if(!l.ok)throw Error(`Marketplace compatibility request failed (${l.status})`);let u=await l.json();if(!kQ(u)||u.ok!==!0||!kQ(u.data))throw Error(`Marketplace returned an invalid compatibility response`);let d=Array.isArray(u.data.items)?u.data.items.filter(EQ):[],f=new Set(s??[]);return{items:d.filter(e=>!r||e.publisher.id===r).filter(e=>n===void 0||e.featured===n).filter(e=>f.size===0||e.tags.some(e=>f.has(e))).map(xQ),hasMore:!1,query:i,tag:o,tags:s,featured:n,sort:a??(i?`relevance`:`featured`)}}function TQ(e){let t=gQ??_Q;if(t&&vQ.has(e))return`${t}/${encodeURIComponent(e)}.webp`}function EQ(e){return!kQ(e)||!kQ(e.install)||!kQ(e.publisher)?!1:typeof e.id==`string`&&typeof e.slug==`string`&&typeof e.appId==`string`&&typeof e.name==`string`&&(e.iconUrl===void 0||typeof e.iconUrl==`string`)&&(e.coverUrl===void 0||typeof e.coverUrl==`string`)&&(e.coverPreview===void 0||typeof e.coverPreview==`boolean`)&&(e.accentColor===void 0||typeof e.accentColor==`string`)&&typeof e.summary==`string`&&OQ(e.summaryI18n)&&Array.isArray(e.tags)&&e.tags.every(e=>typeof e==`string`)&&typeof e.latestVersion==`string`&&typeof e.featured==`boolean`&&(e.availability===void 0||DQ(e.availability))&&typeof e.publisher.id==`string`&&typeof e.publisher.name==`string`&&e.install.kind===`registry`&&typeof e.install.spec==`string`&&typeof e.install.registry==`string`&&typeof e.webUrl==`string`}function DQ(e){return!kQ(e)||e.mode!==`universal`&&e.mode!==`targeted`?!1:Array.isArray(e.targets)&&e.targets.every(e=>typeof e==`string`)&&Array.isArray(e.operatingSystems)&&e.operatingSystems.every(e=>e===`darwin`||e===`linux`||e===`win32`)}function OQ(e){return kQ(e)&&Object.values(e).every(e=>typeof e==`string`)}function kQ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var AQ=[`app-marketplace`,`v3`];function jQ(e,t){let n=Rn({queryKey:[...AQ,e],initialPageParam:void 0,queryFn:async({pageParam:t,signal:n})=>await yQ({...e,cursor:t,limit:24},n),getNextPageParam:e=>e.nextCursor,enabled:t,retry:1,staleTime:300*1e3}),r=(0,V.useMemo)(()=>{if(!n.data)return;let e=new Map;for(let t of n.data.pages)for(let n of t.items)e.set(n.id,n);return{items:[...e.values()],hasMore:n.data.pages.at(-1)?.hasMore??!1}},[n.data]);return{...n,data:r}}function MQ(e,t){return Ot({queryKey:[`app-marketplace-detail`,`v2`,e],queryFn:async({signal:t})=>await bQ(e??``,t),enabled:t&&!!e,retry:1,staleTime:300*1e3})}var NQ=new Set([`nextclaw.starter-card`,`nextclaw.validation-task-board`]);function PQ({error:e,hostTarget:t,installedPackages:n,isStarting:r,onInstall:i,onOpenChange:a,onUpdate:o,open:s,operations:c,startingSource:l}){let[u,d]=(0,V.useState)(`all`),[f,p]=(0,V.useState)(``),[m,h]=(0,V.useState)(``),[g,_]=(0,V.useState)(null);(0,V.useEffect)(()=>{let e=window.setTimeout(()=>h(f.trim()),250);return()=>window.clearTimeout(e)},[f]);let v=jQ((0,V.useMemo)(()=>({q:m||void 0,featured:u===`featured`?!0:void 0,tags:u===`personal`?[`personal`,`productivity`,`notes`,`calendar`]:void 0,tag:u===`local`?`local`:void 0,sort:m?`relevance`:`featured`}),[m,u]),s),y=MQ(g,s),x=(0,V.useMemo)(()=>new Map(n.map(e=>[e.id,e])),[n]),S=In(M()===`zh`?`zh-CN`:`en-US`),C=(0,V.useMemo)(()=>(v.data?.items??[]).filter(e=>!NQ.has(e.appId)).map((e,n)=>({item:e,index:n,rank:XX(YX(e.availability,t))})).sort((e,t)=>e.rank-t.rank||e.index-t.index).map(({item:e})=>e),[t,v.data?.items]);return(0,H.jsx)(Ir,{open:s,onOpenChange:e=>{e||_(null),a(e)},children:(0,H.jsx)($r,{children:(0,H.jsxs)(zr,{className:`flex h-dvh w-screen max-w-none flex-col gap-0 overflow-hidden rounded-none border-0 bg-background/95 p-0 shadow-[0_32px_100px_rgba(0,0,0,0.24)] backdrop-blur-xl [&>button.absolute]:top-[max(1rem,env(safe-area-inset-top))] sm:h-[min(680px,calc(100dvh-4rem))] sm:w-[min(920px,calc(100vw-3rem))] sm:max-w-none sm:rounded-2xl sm:border sm:border-border/55`,children:[g?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(FQ,{onBack:()=>_(null)}),(0,H.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto bg-background`,children:(0,H.jsx)(dQ,{detail:y.data,error:y.error instanceof Error?y.error:null,installedPackage:y.data?x.get(y.data.appId):void 0,hostTarget:t,isLoading:y.isLoading,isStarting:r&&y.data?.install.spec===l,localeFallbacks:S,onInstall:i,onUpdate:o,operation:y.data?DX(c,y.data.appId,y.data.install.spec):void 0})})]}):(0,H.jsx)(oQ,{error:e,filter:u,installedById:x,hostTarget:t,isError:v.isError,isFetchingNextPage:v.isFetchingNextPage,isLoading:v.isLoading,isStarting:r,items:C,localeFallbacks:S,onFilterChange:d,onInstall:i,onLoadMore:()=>void v.fetchNextPage(),onSearchChange:p,onSelect:_,onUpdate:o,operations:c,hasNextPage:v.hasNextPage,search:f,startingSource:l}),(0,H.jsxs)(`div`,{className:`flex items-start gap-2 border-t border-border/60 bg-muted/25 px-5 pb-[max(.75rem,env(safe-area-inset-bottom))] pt-3 text-[11px] leading-4 text-muted-foreground sm:px-6 sm:pb-3`,children:[(0,H.jsx)(ko,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{children:b(`appPackagesMarketplaceTrustHint`)})]})]})})})}function FQ({onBack:e}){return(0,H.jsx)(`div`,{className:`border-b border-border/60 bg-card px-4 pb-3 pt-[max(.75rem,env(safe-area-inset-top))] sm:px-5 sm:pt-3`,children:(0,H.jsxs)(`button`,{type:`button`,onClick:e,className:`inline-flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,H.jsx)(li,{className:`h-4 w-4`}),b(`appPackagesBackToMarketplace`)]})})}function IQ({appPackage:e,isPending:t,operation:n,onDisable:r,onEnable:i,onOpenPanelApp:a,onRollback:o,onUninstall:s,onUpdate:c,panelApps:l,storageUsage:d,storageUsageLoading:f,storageUsageUnavailable:p}){let[m,h]=(0,V.useState)(!1),[g,_]=(0,V.useState)(!1),[v,y]=(0,V.useState)(!1),x=(0,V.useRef)(!1),S=(0,V.useRef)(null),C=e.components.filter(e=>e.kind===`panel`),w=e.components.length-C.length,T=e.installedVersions.filter(t=>t!==e.activeVersion),E=GQ(e.name,e.nameI18n)??e.id,D=GQ(e.description,e.descriptionI18n),O=n?WX(n.status):!1,k=t||O,A=RQ(d,f,p);return(0,H.jsxs)(ys,{surface:`flat`,hover:!1,className:`overflow-hidden border-border/60 shadow-[0_1px_2px_rgba(0,0,0,0.025)]`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3.5 px-4 pb-3.5 pt-4`,children:[(0,H.jsx)(gX,{icon:e.icon,name:E}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`h2`,{className:`truncate text-sm font-semibold text-foreground`,children:E}),(0,H.jsx)(`span`,{className:u(`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium`,e.enabled?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`bg-muted text-muted-foreground`),children:e.enabled?b(`appPackagesEnabled`):b(`appPackagesAvailable`)})]}),D?(0,H.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-muted-foreground`,children:D}):null,(0,H.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground/75`,children:[(0,H.jsxs)(`span`,{children:[`v`,e.activeVersion]}),e.builtIn?(0,H.jsx)(`span`,{children:b(`appPackagesBuiltIn`)}):null,w>0?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(To,{className:`h-3 w-3`}),b(`appPackagesLocalService`)]}):null,(0,H.jsxs)(`span`,{className:u(`inline-flex items-center gap-1`,e.isolation===`full-user`&&`text-amber-700 dark:text-amber-300`),children:[e.isolation===`full-user`?(0,H.jsx)(Oo,{className:`h-3 w-3`}):(0,H.jsx)(ko,{className:`h-3 w-3`}),e.isolation===`full-user`?b(`appPackagesIsolationFullUser`):e.isolation===`host-mediated`?b(`appPackagesIsolationMediated`):b(`appPackagesIsolationPanel`)]})]}),(0,H.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center gap-1.5 rounded-md bg-muted/35 px-2 py-1 text-[10px] text-muted-foreground`,title:e.storage.dataDirectory,children:[(0,H.jsx)(Ja,{className:`h-3 w-3 shrink-0`}),(0,H.jsxs)(`span`,{className:`shrink-0`,children:[b(`appPackagesDataUsage`),` `,A]}),(0,H.jsx)(`code`,{className:`min-w-0 truncate font-mono text-[10px]`,children:e.storage.dataDirectory})]})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,H.jsx)(L,{type:`button`,size:`sm`,variant:e.enabled?`outline`:`default`,disabled:k,onClick:e.enabled?r:i,children:zQ({enabled:e.enabled,isPending:t,operation:n,operationActive:O})}),(0,H.jsxs)(wF,{open:m,onOpenChange:h,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":b(`appPackagesMoreActions`),title:b(`appPackagesMoreActions`),disabled:k,className:`rounded-full p-2 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:opacity-50`,children:(0,H.jsx)(Ea,{className:`h-4 w-4`})})}),(0,H.jsxs)(DF,{align:`end`,className:`w-52 rounded-xl p-1.5`,onCloseAutoFocus:e=>{x.current&&=(e.preventDefault(),!1)},children:[(0,H.jsx)(BQ,{icon:mi,label:b(`appPackagesCheckUpdate`),onClick:()=>{h(!1),c()}}),T.map(e=>(0,H.jsx)(BQ,{icon:Co,label:`${b(`appPackagesRollback`)} v${e}`,onClick:()=>{h(!1),o(e)}},e)),(0,H.jsx)(BQ,{destructive:!0,icon:Vo,label:b(`appPackagesUninstall`),onClick:()=>{x.current=!0,h(!1),y(!1),_(!0)}})]})]})]})]}),n&&(O||n.status===`failed`||n.status===`interrupted`)?(0,H.jsx)(HQ,{operation:n}):null,C.length>0?(0,H.jsx)(`div`,{className:`border-t border-border/60 bg-muted/20 p-2`,children:(0,H.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:C.map(t=>{let n=l.find(e=>e.appId===t.id),r=WQ(t.id),i=GQ(t.title,t.titleI18n)??t.id;return(0,H.jsxs)(`button`,{type:`button`,disabled:!e.enabled||!n||k,onClick:()=>n&&a({...n,title:i,description:GQ(t.description,t.descriptionI18n)}),className:`group flex min-w-0 items-center gap-2 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-default disabled:opacity-55`,title:e.enabled?i:b(`appPackagesEnableToOpen`),children:[(0,H.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-card text-muted-foreground shadow-sm ring-1 ring-border/60`,children:(0,H.jsx)(VQ,{icon:t.icon,fallback:r})}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-foreground`,children:i}),e.enabled?(0,H.jsx)(sa,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5`}):null]},t.id)})})}):null,(0,H.jsx)(Ir,{open:g,onOpenChange:_,children:(0,H.jsxs)(zr,{className:`max-w-md [&>:last-child]:hidden`,onOpenAutoFocus:e=>{e.preventDefault(),S.current?.focus()},children:[(0,H.jsxs)(Lr,{children:[(0,H.jsx)(Br,{children:b(`appPackagesUninstallTitle`)}),(0,H.jsx)(Nr,{children:b(`appPackagesUninstallDescription`)})]}),(0,H.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,H.jsx)(kX,{checked:!v,description:b(`appPackagesKeepDataDescription`),label:b(`appPackagesKeepData`),onClick:()=>y(!1)}),(0,H.jsx)(kX,{checked:v,destructive:!0,description:b(`appPackagesDeleteDataDescription`),label:b(`appPackagesDeleteData`),onClick:()=>y(!0)})]}),(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(LQ,{loading:f,storage:e.storage,usage:d,unavailable:p})}),(0,H.jsxs)(Dr,{className:`mt-5 gap-2 sm:gap-0`,children:[(0,H.jsx)(L,{ref:S,autoFocus:!0,type:`button`,variant:`outline`,onClick:()=>_(!1),children:b(`cancel`)}),(0,H.jsx)(L,{type:`button`,variant:`destructive`,onClick:()=>{s(v),_(!1)},children:b(`appPackagesUninstall`)})]})]})})]})}function LQ({loading:e,storage:t,unavailable:n,usage:r}){return r?(0,H.jsx)(AX,{storage:t,usage:r}):(0,H.jsxs)(`div`,{className:`rounded-xl bg-muted/45 px-3 py-3 text-xs text-muted-foreground`,children:[e?(0,H.jsx)(fi,{className:`mr-1.5 inline h-3.5 w-3.5 animate-spin`}):null,b(e?`appPackagesLoading`:n?`appPackagesDataUsageUnavailable`:`appPackagesNoDataYet`)]})}function RQ(e,t,n){return e?jX(e.totalBytes):b(t?`appPackagesLoading`:n?`appPackagesDataUsageUnavailable`:`appPackagesNoDataYet`)}function zQ({enabled:e,isPending:t,operation:n,operationActive:r}){return r?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(fi,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}),n?UQ(n):b(`appPackagesWorking`)]}):b(t?`appPackagesWorking`:e?`appPackagesDisable`:`appPackagesEnable`)}function BQ({destructive:e=!1,icon:t,label:n,onClick:r}){return(0,H.jsxs)(`button`,{type:`button`,onClick:r,className:u(`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm transition-colors`,e?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`),children:[(0,H.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:n})]})}function VQ({fallback:e,icon:t}){return t&&(t.startsWith(`data:`)||t.startsWith(`/`)||t.startsWith(`http://`)||t.startsWith(`https://`))?(0,H.jsx)(`img`,{src:t,alt:``,className:`h-4 w-4 rounded object-cover`}):t?(0,H.jsx)(`span`,{className:`text-sm leading-none`,children:t}):(0,H.jsx)(e,{className:`h-3.5 w-3.5`})}function HQ({operation:e}){let t=e.status===`failed`||e.status===`interrupted`,n=Math.max(4,Math.round(e.completedSteps/e.totalSteps*100));return(0,H.jsxs)(`div`,{className:`border-t border-border/50 px-4 py-2.5`,role:t?`alert`:`status`,"aria-live":`polite`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px]`,children:[t?(0,H.jsx)(Pr,{className:`h-3.5 w-3.5 text-destructive`}):(0,H.jsx)(fi,{className:`h-3.5 w-3.5 animate-spin text-primary`}),(0,H.jsx)(`span`,{className:t?`text-destructive`:`text-muted-foreground`,children:t?e.error??b(`appPackagesActionFailed`):UQ(e)})]}),(0,H.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-muted`,children:(0,H.jsx)(`div`,{className:u(`h-full rounded-full transition-[width] duration-300`,t?`bg-destructive`:`bg-primary`),style:{width:t?`100%`:`${n}%`}})})]})}function UQ(e){switch(e.status){case`queued`:return b(`appPackagesPreparing`);case`resolving`:return b(`appPackagesResolving`);case`downloading`:return b(`appPackagesDownloading`);case`verifying`:return b(`appPackagesVerifying`);case`installing`:return e.action===`rollback`?`${b(`appPackagesSwitchingVersion`)} ${e.targetVersion?`v${e.targetVersion}`:``}`.trim():e.action===`uninstall`?b(`appPackagesUninstalling`):b(`appPackagesInstalling`);case`finalizing`:return b(`appPackagesFinalizing`);case`succeeded`:return b(`appPackagesCompleted`);case`failed`:case`interrupted`:return b(`appPackagesActionFailed`)}}function WQ(e){return e.endsWith(`-todos`)?No:e.endsWith(`-notes`)?so:e.endsWith(`-favorites`)?Xi:e.endsWith(`-calendar`)?ra:Ur}function GQ(e,t){let n=M()===`zh`?`zh-CN`:`en-US`;return t?.[n]??e}function KQ({focusedPackageId:e,onOpenPanelApp:t}){let n=HX(),r=NX(),i=UX(),a=gY(),o=KX(),s=vY(),c=yY(),l=F9(),u=(0,V.useRef)(null),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(``),[h,g]=(0,V.useState)(!1),_=(0,V.useMemo)(()=>i.data?.entries??[],[i.data?.entries]);(0,V.useEffect)(()=>{if(!e||n.isLoading)return;let t=document.getElementById(`app-package-${e}`);t?.scrollIntoView({block:`nearest`}),t?.focus({preventScroll:!0})},[n.data,n.isLoading,e]),GX({isLoaded:!!i.data,operations:_,refetchPackages:n.refetch,refetchPanels:a.refetch,refetchAppData:r.refetch,settlementManager:l.appPackageOperationSettlementManager});let v=(e,t)=>{o.reset(),o.mutate(e,{onSuccess:t})},y=async e=>{if(e.clientDeclared&&!e.clientGranted){if(!await l.serviceActionAuthorizationManager.requestAuthorization({panelAppId:e.appId,actions:[{actionId:`nextclaw.client`,actionTitle:b(`panelAppsClientGrantTitle`),actionDescription:b(`panelAppsClientGrantDescription`),risk:`dangerous`}]}))return;await c.mutateAsync(e.appId)}try{t(await s.mutateAsync(e.id))}catch{t(e)}},x=e=>{e.preventDefault();let t=p.trim();t&&v({action:`install`,source:t},()=>{f(!1),m(``)})};return(0,H.jsxs)(`div`,{className:`@container flex h-full min-h-0 flex-col bg-card text-card-foreground`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-12 shrink-0 items-center justify-end gap-1 border-b border-border/70 px-4 py-2`,children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>{n.refetch(),i.refetch(),a.refetch(),r.refetch()},className:`rounded-full p-2 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,title:b(`appPackagesRefresh`),"aria-label":b(`appPackagesRefresh`),children:(0,H.jsx)(mi,{className:`h-3.5 w-3.5`})}),(0,H.jsxs)(L,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>{o.reset(),g(!0)},children:[(0,H.jsx)(Ro,{className:`mr-1.5 h-3.5 w-3.5`}),b(`appPackagesBrowse`)]}),(0,H.jsxs)(L,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>{o.reset(),f(!0)},children:[(0,H.jsx)(co,{className:`mr-1.5 h-3.5 w-3.5`}),b(`appPackagesInstall`)]})]}),(0,H.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl p-3 sm:p-5`,children:[(0,H.jsxs)(`div`,{className:`mb-4 px-1`,children:[(0,H.jsx)(`h1`,{ref:u,tabIndex:-1,className:`text-base font-semibold tracking-tight text-foreground`,children:b(`appPackagesLibraryTitle`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:b(`appPackagesLibraryDescription`)})]}),o.isError?(0,H.jsx)(`div`,{role:`alert`,className:`mb-3 rounded-xl bg-destructive/8 px-3 py-2.5 text-xs leading-5 text-destructive ring-1 ring-destructive/15`,children:o.error instanceof Error?o.error.message:b(`appPackagesActionFailed`)}):null,(0,H.jsx)(qQ,{appDataEntries:r.data?.entries??[],appDataLoading:r.isLoading,appDataUnavailable:r.isError,error:XQ(n.error,a.error),focusedPackageId:e,isLoading:n.isLoading||a.isLoading,isPending:o.isPending,mutationAppId:`appId`in(o.variables??{})?o.variables.appId:void 0,packages:n.data?.entries??[],panelApps:a.data?.entries??[],operations:_,onInstall:()=>f(!0),onMutate:v,onOpenPanelApp:e=>void y(e)}),(0,H.jsx)(FX,{diagnostics:r.data?.diagnostics??[],entries:r.data?.entries??[],error:r.error,isLoading:r.isLoading,onDeletionFocusReturn:()=>u.current?.focus()})]})}),(0,H.jsx)(PQ,{error:o.error instanceof Error?o.error:null,hostTarget:n.data?.hostTarget,installedPackages:n.data?.entries??[],startingSource:o.variables?.action===`install`?o.variables.source:void 0,isStarting:o.isPending,operations:_,open:h,onOpenChange:g,onInstall:(e,t)=>v({action:`install`,source:e,registryUrl:t}),onUpdate:e=>v({action:`update`,appId:e})}),(0,H.jsx)(Ir,{open:d,onOpenChange:f,children:(0,H.jsx)(zr,{className:`max-w-md [&>:last-child]:hidden`,children:(0,H.jsxs)(`form`,{onSubmit:x,children:[(0,H.jsxs)(Lr,{children:[(0,H.jsx)(Br,{children:b(`appPackagesInstallTitle`)}),(0,H.jsx)(Nr,{children:b(`appPackagesInstallDescription`)})]}),(0,H.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,H.jsx)(vt,{autoFocus:!0,value:p,onChange:e=>m(e.target.value),placeholder:b(`appPackagesInstallPlaceholder`),"aria-label":b(`appPackagesInstallSource`)}),(0,H.jsxs)(`div`,{className:`flex items-start gap-2 rounded-xl bg-muted/60 px-3 py-2.5 text-xs leading-5 text-muted-foreground`,children:[(0,H.jsx)(ko,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{children:b(`appPackagesInstallTrustHint`)})]}),o.isError?(0,H.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:o.error instanceof Error?o.error.message:b(`appPackagesActionFailed`)}):null]}),(0,H.jsxs)(Dr,{className:`mt-5 gap-2 sm:gap-0`,children:[(0,H.jsx)(L,{type:`button`,variant:`outline`,onClick:()=>f(!1),children:b(`cancel`)}),(0,H.jsx)(L,{type:`submit`,disabled:!p.trim()||o.isPending,children:o.isPending?b(`appPackagesInstalling`):b(`appPackagesInstall`)})]})]})})})]})}function qQ({appDataEntries:e,appDataLoading:t,appDataUnavailable:n,error:r,focusedPackageId:i,isLoading:a,isPending:o,mutationAppId:s,onInstall:c,onMutate:l,onOpenPanelApp:u,packages:d,panelApps:f,operations:p}){if(a)return(0,H.jsxs)(`div`,{className:`space-y-2.5`,"aria-label":b(`appPackagesLoading`),children:[(0,H.jsx)(yi,{className:`h-44 w-full rounded-2xl`}),(0,H.jsx)(yi,{className:`h-32 w-full rounded-2xl`})]});if(r)return(0,H.jsx)(`div`,{className:`rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-4 text-sm text-destructive`,children:r});if(d.length===0){let e=p.filter(e=>e.action===`install`&&WX(e.status));return e.length>0?(0,H.jsx)(`div`,{className:`space-y-2.5`,children:e.map(e=>(0,H.jsx)(JQ,{operation:e},e.id))}):(0,H.jsxs)(`div`,{className:`flex flex-col items-center rounded-2xl border border-dashed border-border px-6 py-10 text-center`,children:[(0,H.jsx)(co,{className:`h-7 w-7 text-muted-foreground`}),(0,H.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-foreground`,children:b(`appPackagesEmptyTitle`)}),(0,H.jsx)(`p`,{className:`mt-1 max-w-sm text-xs leading-5 text-muted-foreground`,children:b(`appPackagesEmptyDescription`)}),(0,H.jsx)(L,{type:`button`,size:`sm`,className:`mt-4`,onClick:c,children:b(`appPackagesInstall`)})]})}return(0,H.jsxs)(`div`,{className:`space-y-2.5`,children:[p.filter(e=>e.action===`install`&&WX(e.status)&&!d.some(t=>t.id===e.appId)).map(e=>(0,H.jsx)(JQ,{operation:e},e.id)),d.map(r=>{let a=p.find(e=>e.appId===r.id),c=a&&(WX(a.status)||a.status===`failed`||a.status===`interrupted`)?a:void 0;return(0,H.jsx)(`section`,{id:`app-package-${r.id}`,"aria-label":r.name,tabIndex:-1,className:i===r.id?`rounded-xl outline-none ring-2 ring-primary/35 ring-offset-2 ring-offset-background`:`rounded-xl outline-none`,children:(0,H.jsx)(IQ,{appPackage:r,storageUsage:e.find(e=>e.source===`package`&&e.lifecycle===`active`&&e.appId===r.id&&e.instanceId===r.instanceId)?.usage??r.storageUsage,storageUsageLoading:t,storageUsageUnavailable:n,panelApps:f.filter(e=>e.packageId===r.id),isPending:o&&s===r.id,operation:c,onEnable:()=>l({action:`enable`,appId:r.id}),onDisable:()=>l({action:`disable`,appId:r.id}),onUpdate:()=>l({action:`update`,appId:r.id}),onRollback:e=>l({action:`rollback`,appId:r.id,version:e}),onUninstall:e=>l({action:`uninstall`,appId:r.id,purgeData:e}),onOpenPanelApp:u})},r.id)})]})}function JQ({operation:e}){let t=e.appId??e.source??b(`appPackagesInstall`),n=Math.max(4,Math.round(e.completedSteps/e.totalSteps*100));return(0,H.jsxs)(`div`,{className:`rounded-xl border border-border/60 bg-card px-4 py-3.5 shadow-[0_1px_2px_rgba(0,0,0,0.025)]`,role:`status`,"aria-live":`polite`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(gX,{name:t}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`p`,{className:`truncate text-sm font-semibold text-foreground`,children:t}),(0,H.jsxs)(`p`,{className:`mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(fi,{className:`h-3.5 w-3.5 animate-spin`}),YQ(e)]})]})]}),(0,H.jsx)(`div`,{className:`ml-14 mt-2 h-1 overflow-hidden rounded-full bg-muted`,children:(0,H.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width] duration-300`,style:{width:`${n}%`}})})]})}function YQ(e){switch(e.status){case`queued`:return b(`appPackagesPreparing`);case`resolving`:return b(`appPackagesResolving`);case`downloading`:return b(`appPackagesDownloading`);case`verifying`:return b(`appPackagesVerifying`);case`installing`:return b(`appPackagesInstalling`);case`finalizing`:return b(`appPackagesFinalizing`);case`succeeded`:return b(`appPackagesCompleted`);case`failed`:case`interrupted`:return e.error??b(`appPackagesActionFailed`)}}function XQ(...e){return e.find(e=>e instanceof Error)?.message||(e.some(Boolean)?b(`appPackagesLoadFailed`):void 0)}function ZQ(){return`service-action-auth-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}var QQ=N((e,t)=>({pending:null,requestAuthorization:async n=>await new Promise(r=>{t().pending?.resolve(!1),e({pending:{id:ZQ(),...n,resolve:r}})}),resolveAuthorization:n=>{let{pending:r}=t();r&&(r.resolve(n),e({pending:null}))}}));function $Q(){let e=QQ(e=>e.pending),t=QQ(e=>e.resolveAuthorization);return(0,H.jsx)(Ir,{open:!!e,onOpenChange:e=>{e||t(!1)},children:(0,H.jsxs)(zr,{className:`[&>:last-child]:hidden`,children:[(0,H.jsxs)(Lr,{children:[(0,H.jsxs)(Br,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Oo,{className:`h-4 w-4 text-amber-600`}),b(`serviceActionAuthorizationTitle`)]}),(0,H.jsx)(Nr,{children:b(`serviceActionAuthorizationDescription`)})]}),e?(0,H.jsxs)(`div`,{className:`space-y-3 rounded-md border border-border bg-muted/60 p-3 text-sm`,children:[(0,H.jsx)(t$,{label:b(`serviceActionAuthorizationSource`),value:e.panelAppId}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:b(`serviceActionAuthorizationActions`)}),(0,H.jsx)(`div`,{className:`max-h-64 space-y-2 overflow-auto`,children:e.actions.map(e=>(0,H.jsx)(e$,{action:e},e.actionId))})]}),e.inputPreview?(0,H.jsx)(t$,{label:b(`serviceActionAuthorizationInput`),value:e.inputPreview}):null]}):null,(0,H.jsxs)(Dr,{className:`gap-2 sm:gap-0`,children:[(0,H.jsx)(L,{type:`button`,variant:`outline`,onClick:()=>t(!1),children:b(`serviceActionAuthorizationReject`)}),(0,H.jsx)(L,{type:`button`,onClick:()=>t(!0),children:b(`serviceActionAuthorizationAllow`)})]})]})})}function e$({action:e}){return(0,H.jsxs)(`div`,{className:`space-y-1 rounded border border-border bg-card px-3 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsx)(`div`,{className:`min-w-0 break-words text-xs font-medium text-foreground`,children:e.actionTitle??e.actionId}),(0,H.jsx)(`div`,{className:`shrink-0 rounded bg-amber-50 px-1.5 py-0.5 text-[11px] font-medium text-amber-700`,children:e.risk??`dangerous`})]}),(0,H.jsx)(`div`,{className:`break-words text-[11px] text-muted-foreground`,children:e.actionId}),e.actionDescription?(0,H.jsx)(`div`,{className:`break-words text-xs text-muted-foreground`,children:e.actionDescription}):null]})}function t$({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`grid grid-cols-[5rem_minmax(0,1fr)] gap-3`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:e}),(0,H.jsx)(`div`,{className:`min-w-0 break-words text-xs text-foreground`,children:t})]})}var n$=class{constructor(){this.requestAuthorization=async e=>await QQ.getState().requestAuthorization(e)}};function r$({appId:e,appTitle:t,dataEntry:n,dataLoading:r,deleteError:i,deletePending:a,open:o,purgeData:s,onDelete:c,onOpenChange:l,onPurgeDataChange:u}){let d=(0,V.useRef)(null);(0,V.useEffect)(()=>{i&&d.current?.focus()},[i]);let f=()=>l(!1);return(0,H.jsx)(Ir,{open:o,onOpenChange:e=>!a&&l(e),children:(0,H.jsxs)(zr,{className:`max-w-md [&>:last-child]:hidden`,onEscapeKeyDown:e=>a&&e.preventDefault(),onInteractOutside:e=>a&&e.preventDefault(),children:[(0,H.jsxs)(Lr,{children:[(0,H.jsx)(Br,{children:b(`serviceAppsDeleteConfirmTitle`)}),(0,H.jsxs)(Nr,{children:[b(`serviceAppsDeleteConfirmDescription`),` `,t]})]}),(0,H.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,H.jsx)(kX,{checked:!s,description:b(`serviceAppsKeepDataDescription`),label:b(`appPackagesKeepData`),onClick:()=>u(!1)}),(0,H.jsx)(kX,{checked:s,destructive:!0,disabled:!n||r,description:b(`serviceAppsDeleteDataDescription`),label:b(`appPackagesDeleteData`),onClick:()=>u(!0)})]}),n?(0,H.jsx)(`div`,{className:`mt-3`,children:(0,H.jsx)(AX,{storage:n.storage,usage:n.usage})}):(0,H.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:b(r?`appPackagesLoading`:`serviceAppsDataUnavailable`)}),i?(0,H.jsx)(`p`,{ref:d,role:`alert`,tabIndex:-1,className:`mt-3 text-xs text-destructive`,children:i instanceof Error?i.message:b(`appPackagesActionFailed`)}):null,(0,H.jsxs)(Dr,{className:`mt-5 gap-2 sm:gap-0`,children:[(0,H.jsx)(L,{autoFocus:!0,type:`button`,variant:`outline`,disabled:a,onClick:f,children:b(`cancel`)}),(0,H.jsxs)(L,{type:`button`,variant:s?`destructive`:`default`,disabled:a||s&&!n,onClick:()=>c(e,s,f),children:[a?(0,H.jsx)(fi,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}):null,b(s?`appDataDeletePermanently`:`serviceAppsDelete`)]})]})]})})}function i$({app:e,actions:t,actionsOpen:n,grants:r,deletePending:i,deleteError:a,dataEntry:o,dataLoading:s,isDiscovering:c,onActionsOpenChange:l,onDiscover:d,onManagePackage:f,onDelete:p,onResetDelete:m,onRestart:h,onRevoke:g}){let[_,v]=(0,V.useState)(!1),[y,x]=(0,V.useState)(!1),[S,C]=(0,V.useState)(!1),[w,T]=(0,V.useState)(!1),E=e.status!==`starting`&&e.status!==`stopped`,D=e.status===`running`||e.status===`failed`,O=e.sourceKind===`package`?e.packageId:void 0,k=c$(e),A=()=>{v(!1),T(!1),m(),x(!0)};return(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(`section`,{className:`group bg-card transition-colors hover:bg-muted/25`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3 px-4 py-3.5`,children:[(0,H.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:(0,H.jsx)(To,{className:`h-4 w-4`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.title}),(0,H.jsx)(a$,{status:e.status})]}),e.description?(0,H.jsx)(`div`,{className:`mt-1 truncate text-xs leading-5 text-muted-foreground`,children:e.description}):null,e.lastError?(0,H.jsx)(`div`,{className:`mt-1.5 truncate text-xs text-rose-600`,title:e.lastError,children:e.lastError}):null]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[E?(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,disabled:c,className:`inline-flex h-7 items-center gap-1.5 rounded-md bg-foreground px-2.5 text-xs font-medium text-background transition-colors hover:bg-foreground/85 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground/40 disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":b(`serviceAppsDiscoverActions`),onClick:()=>d(e.id),children:[c?(0,H.jsx)(fi,{className:`h-3.5 w-3.5 animate-spin`}):(0,H.jsx)(Eee,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:b(`serviceAppsConnect`)})]})}),(0,H.jsx)(qr,{side:`bottom`,className:`max-w-56 text-xs`,children:b(`serviceAppsDiscoverActionsHint`)})]}):null,(0,H.jsxs)(wF,{open:_,onOpenChange:v,children:[(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:opacity-50`,"aria-label":b(`serviceAppsMoreActions`),disabled:i,children:(0,H.jsx)(ci,{className:`h-3.5 w-3.5`})})})}),(0,H.jsx)(qr,{side:`bottom`,className:`text-xs`,children:b(`serviceAppsMoreActions`)})]}),(0,H.jsxs)(DF,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:[(0,H.jsx)(s$,{disabled:!D,icon:Uo,label:b(`serviceAppsDisconnectRuntime`),onClick:()=>{v(!1),h(e.id)}}),O?(0,H.jsx)(s$,{icon:Kr,label:b(`serviceAppsManagePackage`),onClick:()=>{v(!1),f(O)}}):(0,H.jsx)(s$,{destructive:!0,disabled:i,icon:Vo,label:b(`serviceAppsDelete`),onClick:A})]})]})]})]}),(0,H.jsxs)(`div`,{className:`border-t border-border/60`,children:[(0,H.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>l(!n),className:`flex min-w-0 flex-1 items-center justify-between gap-2 px-4 py-2 text-left text-xs text-muted-foreground transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border`,"aria-expanded":n,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{children:b(`serviceAppsActionsSection`)}),(0,H.jsx)(`span`,{className:`tabular-nums text-muted-foreground/70`,children:t.length})]}),(0,H.jsx)($n,{className:u(`h-3.5 w-3.5 shrink-0 text-muted-foreground/70 transition-transform`,n&&`rotate-180`)})]}),k.length>0?(0,H.jsxs)(`button`,{type:`button`,onClick:()=>C(e=>!e),className:`flex shrink-0 items-center gap-1 border-l border-border/60 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border`,"aria-expanded":S,children:[(0,H.jsx)(`span`,{children:b(`serviceAppsDetails`)}),(0,H.jsx)($n,{className:u(`h-3.5 w-3.5 transition-transform`,S&&`rotate-180`)})]}):null]}),n?(0,H.jsx)(`div`,{className:`border-t border-border/60 px-4 py-2.5`,children:t.length===0?(0,H.jsx)(`div`,{className:`py-1 text-xs text-muted-foreground`,children:b(`serviceAppsActionsEmpty`)}):(0,H.jsx)(`div`,{className:`divide-y divide-border/50`,children:t.map(e=>(0,H.jsx)(d$,{action:e,grants:r.filter(t=>t.actionId===e.id),onRevoke:g},e.id))})}):null,S?(0,H.jsx)(l$,{rows:k}):null]}),e.sourceKind===`package`?null:(0,H.jsx)(r$,{appId:e.id,appTitle:e.title,dataEntry:o,dataLoading:s,deleteError:a,deletePending:i,open:y,purgeData:w,onDelete:p,onOpenChange:x,onPurgeDataChange:T})]})})}function a$({status:e}){let t=o$(e),n=t.icon;return(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsxs)(`span`,{className:u(`inline-flex shrink-0 items-center gap-1 text-xs`,t.className),"aria-label":t.label,children:[(0,H.jsx)(n,{className:u(`h-3 w-3`,t.iconClassName)}),(0,H.jsx)(`span`,{children:t.label})]})}),(0,H.jsx)(qr,{side:`bottom`,className:`text-xs`,children:t.tooltip})]})}function o$(e){switch(e){case`running`:return{className:`text-emerald-700`,icon:ua,label:b(`serviceAppsStatus_running`),tooltip:b(`serviceAppsStatusHint_running`)};case`starting`:return{className:`text-blue-700`,icon:fi,iconClassName:`animate-spin`,label:b(`serviceAppsStatus_starting`),tooltip:b(`serviceAppsStatusHint_starting`)};case`failed`:return{className:`text-rose-700`,icon:Ho,label:b(`serviceAppsStatus_failed`),tooltip:b(`serviceAppsStatusHint_failed`)};case`stopped`:return{className:`text-muted-foreground`,icon:pa,label:b(`serviceAppsStatus_stopped`),tooltip:b(`serviceAppsStatusHint_stopped`)};default:return{className:`text-muted-foreground`,icon:da,label:b(`serviceAppsStatus_idle`),tooltip:b(`serviceAppsStatusHint_idle`)}}}function s$({destructive:e=!1,disabled:t=!1,icon:n,label:r,onClick:i}){return(0,H.jsxs)(`button`,{type:`button`,className:u(`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed disabled:opacity-50`,e?`text-destructive hover:bg-destructive/10`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`),disabled:t,onClick:i,children:[(0,H.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:r})]})}function c$(e){let t=[e.command,...e.args??[]].filter(e=>!!e?.trim()).join(` `);return[{label:b(`serviceAppsCommand`),value:t},{label:b(`serviceAppsCwd`),value:e.cwd},{label:b(`serviceAppsManifest`),value:e.manifestPath},{label:b(`serviceAppsLastStarted`),value:e.lastStartedAt},{label:b(`serviceAppsLastReady`),value:e.lastReadyAt},{label:b(`serviceAppsLastFailed`),value:e.lastFailedAt}].filter(e=>e.value)}function l$({rows:e}){return(0,H.jsx)(`div`,{className:`border-t border-border/60 px-4 py-2.5`,children:(0,H.jsx)(`dl`,{className:`grid grid-cols-[4.75rem_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-xs`,children:e.map(e=>(0,H.jsx)(u$,{label:e.label,value:e.value},e.label))})})}function u$({label:e,value:t}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground/70`,children:e}),(0,H.jsx)(`dd`,{className:`min-w-0 truncate font-mono text-muted-foreground`,title:t,children:t})]})}function d$({action:e,grants:t,onRevoke:n}){return(0,H.jsxs)(`div`,{className:`py-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground`,children:(0,H.jsx)(Ko,{className:`h-3.5 w-3.5`})}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`truncate text-xs font-medium text-foreground`,children:e.title??e.name}),e.description?(0,H.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:e.description}):null]})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[e.runtimeState?(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:b(`serviceAppsRuntimeState_${e.runtimeState}`)}):null,(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.risk})]})]}),t.map(e=>(0,H.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-2 pl-8`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,H.jsx)(ko,{className:`h-3 w-3 shrink-0 text-emerald-500`}),(0,H.jsxs)(`span`,{className:`truncate`,children:[b(`serviceAppsGrantedTo`),` `,e.caller.appId]})]}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`rounded-md p-1 text-muted-foreground/70 transition-colors hover:bg-muted hover:text-rose-600 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,title:b(`serviceAppsRevokeGrant`),"aria-label":b(`serviceAppsRevokeGrant`),children:(0,H.jsx)(Vo,{className:`h-3 w-3`})})]},`${e.caller.surface}:${e.caller.appId}:${e.actionId}`))]})}var f$=[`service-apps`],p$=[`service-actions`],m$=[`service-action-grants`],h$=[`app-data`];function g$(){return Ot({queryKey:f$,queryFn:()=>I.serviceApps.listServiceApps()})}function _$(){return Ot({queryKey:p$,queryFn:()=>I.serviceApps.listServiceActions()})}function v$(){return Ot({queryKey:m$,queryFn:()=>I.serviceApps.listServiceActionGrants()})}function y$(){let e=F();return jt({mutationFn:e=>I.serviceApps.restartServiceApp(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:f$}),e.invalidateQueries({queryKey:p$})])}})}function b$(){let e=F();return jt({mutationFn:e=>I.serviceApps.deleteServiceApp(e.appId,e.purgeData),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:f$}),e.invalidateQueries({queryKey:p$}),e.invalidateQueries({queryKey:m$}),e.invalidateQueries({queryKey:h$})])}})}function x$(){let e=F();return jt({mutationFn:e=>I.serviceApps.discoverServiceAppActions(e),onSuccess:async()=>{await e.invalidateQueries({queryKey:f$})}})}function S$(){let e=F();return jt({mutationFn:e=>I.serviceApps.revokeServiceActionGrant(e),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:p$}),e.invalidateQueries({queryKey:m$})])}})}function C$({onManagePackage:e}){let t=g$(),n=NX(),r=_$(),i=v$(),a=b$(),o=y$(),s=x$(),c=S$(),[l,u]=(0,V.useState)({}),[d,f]=(0,V.useState)({}),p=()=>{t.refetch(),r.refetch(),i.refetch(),n.refetch()};if(t.isLoading||r.isLoading||i.isLoading)return(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:b(`serviceAppsLoading`)});if(t.isError||r.isError||i.isError){let e=t.error??r.error??i.error;return(0,H.jsx)(`div`,{className:`p-4 text-sm text-rose-600`,children:e instanceof Error?e.message:b(`serviceAppsLoadFailed`)})}let m=t.data?.entries??[],h=t.data?.diagnostics??[],g=r.data?.actions??[],_=i.data?.grants??[],v=e=>{s.mutateAsync(e).then(t=>{u(n=>({...n,[e]:t.actions})),f(t=>({...t,[e]:!0}))})},y=(n.data?.entries??[]).filter(e=>e.source===`workspace-service`&&e.lifecycle===`active`);return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card text-card-foreground`,children:[(0,H.jsx)(`div`,{className:`flex min-h-12 shrink-0 items-center justify-end border-b border-border/60 px-4 py-2`,children:(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-label":b(`serviceAppsRefresh`),onClick:p,children:(0,H.jsx)(mi,{className:`h-3.5 w-3.5`})})}),(0,H.jsx)(qr,{side:`bottom`,className:`text-xs`,children:b(`serviceAppsRefresh`)})]})})}),h.length>0?(0,H.jsxs)(`div`,{role:`alert`,className:`mx-3 mt-3 rounded-xl border border-destructive/20 bg-destructive/5 px-3 py-2.5 text-xs text-destructive sm:mx-4`,children:[(0,H.jsx)(`div`,{className:`font-medium`,children:b(`serviceAppsLoadFailed`)}),(0,H.jsx)(`ul`,{className:`mt-1 space-y-1`,children:h.map(e=>(0,H.jsxs)(`li`,{className:`break-words`,children:[e.appId,`: `,e.message]},e.stagedPath))})]}):null,m.length===0?(0,H.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 py-8 text-center`,children:(0,H.jsxs)(`div`,{className:`w-full max-w-xs`,children:[(0,H.jsx)(`div`,{className:`mx-auto flex h-10 w-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,H.jsx)(To,{className:`h-5 w-5`})}),(0,H.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-foreground`,children:b(`serviceAppsEmptyTitle`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:b(`serviceAppsEmptyDescription`)})]})}):(0,H.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto p-3 sm:p-4`,children:(0,H.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border/70 bg-card`,children:m.map(t=>(0,H.jsx)(i$,{app:t,actions:l[t.id]??g.filter(e=>e.appId===t.id),actionsOpen:!!d[t.id],grants:_,deletePending:a.isPending,deleteError:a.error,dataEntry:y.find(e=>e.appId===t.id),dataLoading:n.isLoading,isDiscovering:s.isPending,onActionsOpenChange:e=>f(n=>({...n,[t.id]:e})),onDiscover:v,onManagePackage:e,onDelete:(e,t,n)=>void a.mutate({appId:e,purgeData:t},{onSuccess:n}),onResetDelete:a.reset,onRestart:e=>void o.mutate(e),onRevoke:e=>void c.mutate({actionId:e.actionId,caller:e.caller})},t.id))})})]})}function w$({activeTab:e,onActiveTabChange:t,onOpenPanelApp:n}){let[r,i]=(0,V.useState)(),a=e=>{i(void 0),t(e)},o=e=>{i(e),t(`apps`)};return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card text-card-foreground`,children:[(0,H.jsx)(`nav`,{className:`shrink-0 border-b border-border/70 px-4 py-3`,"aria-label":b(`appsTitle`),children:(0,H.jsx)(PY,{value:e,onValueChange:e=>a(e),children:(0,H.jsxs)(FY,{className:`grid h-auto w-full max-w-[390px] grid-cols-3 rounded-lg bg-muted/70 p-0.5`,children:[(0,H.jsxs)(IY,{value:`apps`,className:`min-w-0 gap-1.5 px-2 py-1.5 text-xs`,children:[(0,H.jsx)(Kr,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:b(`appsTitle`)})]}),(0,H.jsxs)(IY,{value:`panel-apps`,className:`min-w-0 gap-1.5 px-2 py-1.5 text-xs`,children:[(0,H.jsx)(Ur,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:b(`panelAppsTitle`)})]}),(0,H.jsxs)(IY,{value:`service-apps`,className:`min-w-0 gap-1.5 px-2 py-1.5 text-xs`,children:[(0,H.jsx)(To,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:b(`serviceAppsTitle`)})]})]})})}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:e===`apps`?(0,H.jsx)(KQ,{focusedPackageId:r,onOpenPanelApp:n}):e===`panel-apps`?(0,H.jsx)(zY,{onOpenPanelApp:n}):(0,H.jsx)(C$,{onManagePackage:o})})]})}var T$=class{constructor(e){this.docBrowserManager=e,this.initialized=!1,this.knownTerminalOperationIds=new Set,this.settle=({isLoaded:e,operations:t,refetchPackages:n,refetchPanels:r,refetchAppData:i})=>{if(!e)return;let a=t.filter(e=>!WX(e.status));if(!this.initialized){a.forEach(e=>this.knownTerminalOperationIds.add(e.id)),this.initialized=!0;return}a.forEach(e=>{this.knownTerminalOperationIds.has(e.id)||(this.knownTerminalOperationIds.add(e.id),this.settleOperation(e,n,r,i))})},this.settleOperation=(e,t,n,r)=>{if(e.status===`succeeded`){R.success(E$(e)),t(),r(),n().then(t=>{e.action!==`rollback`&&e.action!==`update`||this.docBrowserManager.reloadByDedupeKeys(t.data?.entries.filter(t=>t.packageId===e.appId).map(e=>`panel-app:${e.id}`)??[])});return}(e.status===`failed`||e.status===`interrupted`)&&(t(),n(),r(),R.error(e.error??b(`appPackagesActionFailed`)))}}};function E$(e){switch(e.action){case`install`:return b(`appPackagesInstallCompleted`);case`update`:return e.result?.changed===!1?b(`appPackagesAlreadyCurrent`):b(`appPackagesUpdateCompleted`);case`rollback`:return e.result?.changed===!1?b(`appPackagesAlreadyOnVersion`):b(`appPackagesRollbackCompleted`);case`uninstall`:return b(`appPackagesUninstallCompleted`)}}function D$(e){return e.split(`/`).map(e=>e.trim()).filter(e=>e.length>0)}function O$(e){let t=e.trim();try{let e=t.startsWith(`/`),n=e?new URL(t,`http://nextclaw.local`):new URL(t);return{authority:e?``:n.hostname,pathSegments:D$(n.pathname),pathname:n.pathname,raw:t,scheme:e?``:n.protocol.replace(/:$/,``).toLowerCase(),searchParams:n.searchParams}}catch{return{authority:``,pathSegments:D$(t),pathname:t,raw:t,scheme:``,searchParams:new URLSearchParams}}}var k$=class{constructor(e,t){this.routeDefinitions=e,this.options=t,this.resolve=e=>{let t=O$(e);return this.findDefinition(t).resolve(t)},this.normalize=e=>this.options.getNormalizedUri(this.resolve(e)),this.areEquivalent=(e,t)=>this.findDefinition(O$(e)).areEquivalent?.(e,t)??this.normalize(e)===this.normalize(t),this.findDefinition=e=>{let t=this.routeDefinitions.find(t=>t.match(e));if(!t)throw Error(`Unsupported resource URI: ${e.raw}`);return t}}},A$=`home`,j$=`nextclaw://new-tab`,M$=`apps`,N$=`nextclaw://apps`,P$=`${N$}?tab=panel-apps`,F$=`${N$}?tab=service-apps`,I$=`panel-app`,L$=new Set([j$,`about:blank`]);function R$(e){let t=e.resourceUri?.trim()||e.currentUrl.trim(),n=e.currentUrl.trim();return!t||!n||L$.has(t)?null:x({uri:t,resourceKind:e.kind,title:e.title.trim()||t,currentUrl:n,...e.contentParams?{contentParams:structuredClone(e.contentParams)}:{}})}var z$=`apps`;function B$(e){return e===`apps`||e===`panel-apps`||e===`service-apps`}function V$(e=z$){return e===`panel-apps`?P$:e===`service-apps`?F$:N$}function H$(e){try{let t=new URL(e).searchParams.get(`tab`);return B$(t)?t:z$}catch{return z$}}function U$(e){return V$(H$(e))}function W$(e,t){let n=`nextclaw://panel-app/${encodeURIComponent(e)}`,r=t?.trim();return r?`${n}?${new URLSearchParams({path:r}).toString()}`:n}function G$(e,t){let n=`/api/panel-apps/${encodeURIComponent(e)}/content`,r=t?.trim();return r?`${n}?${new URLSearchParams({path:r}).toString()}`:n}function K$(e){let t=e.scheme===`nextclaw`&&e.authority===`panel-app`?e.pathSegments[0]:(()=>{let[t,n,r,i]=e.pathSegments;return t===`api`&&n===`panel-apps`&&i===`content`?r:void 0})();if(!t)return null;try{return decodeURIComponent(t)}catch{return null}}function q$(e){let t=O$(e);return t.searchParams.has(`path`)?null:K$(t)}function J$(e){return(e.resourceUri?q$(e.resourceUri):null)??q$(e.currentUrl)}function Y$(e){return e.startsWith(`data:image/`)||e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)}function X$(e){let t=e.icon?.trim();if(t)return Y$(t)?{type:`url`,url:t}:{type:`text`,value:t}}function Z$(e){return{dedupeKey:`panel-app:${e.appId}`,dockIcon:X$(e),historyPolicy:`managed`,kind:I$,resourceUri:W$(e.appId),title:e.title,url:e.contentPath}}function Q$(e,t){return e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}/`)}function $$(e){let t=e.pathSegments.join(`/`);return Fi(t?`/${t}`:`/`,`docs`)}function e1(e){let t=e.filter(e=>e.trim().length>0).map(e=>encodeURIComponent(decodeURIComponent(e))).join(`/`);return t?`nextclaw://docs/${t}`:`nextclaw://docs`}function t1(e){let t=bi(e),n=t.startsWith(`/`)?t:(()=>{try{return new URL(e).pathname}catch{return``}})();return n?e1(n.split(`/`)):`nextclaw://docs`}function n1(e){return K$(e)!==null}function r1(e){let t=K$(e);if(!t)return`nextclaw://panel-app`;let n=e.searchParams.get(`path`)?.trim();return G$(t,n)}function i1(e){let t=K$(e);if(!t)return`nextclaw://panel-app`;let n=`nextclaw://panel-app/${encodeURIComponent(t)}`,r=e.searchParams.get(`path`)?.trim();return r?`${n}?${new URLSearchParams({path:r}).toString()}`:n}function a1(e,t){let n=O$(e),r=O$(t),i=K$(n),a=K$(r),o=n.searchParams.get(`path`)?.trim()??``,s=r.searchParams.get(`path`)?.trim()??``;return i!==null&&a!==null?i===a&&o===s:e===t}var o1=[{defaultUrl:()=>j$,id:`home`,kind:A$,match:e=>e.raw===j$,resolve:()=>({historyPolicy:`managed`,kind:A$,resourceUri:j$,title:b(`docBrowserHomeTitle`),url:j$}),areEquivalent:(e,t)=>e===t},{defaultUrl:Ai,id:`docs-url`,kind:`docs`,match:e=>wi(e.raw),resolve:e=>{let t=Fi(e.raw,`docs`);return{historyPolicy:`managed`,kind:`docs`,resourceUri:t1(t),title:b(`docBrowserHelp`),url:t}},areEquivalent:(e,t)=>bi(e)===bi(t)},{defaultUrl:Ai,id:`nextclaw-docs`,kind:`docs`,match:e=>e.scheme===`nextclaw`&&e.authority===`docs`,resolve:e=>{let t=$$(e);return{historyPolicy:`managed`,kind:`docs`,resourceUri:e1(e.pathSegments),title:b(`docBrowserHelp`),url:t}},areEquivalent:(e,t)=>bi(e)===bi(t)},{defaultUrl:()=>N$,id:`apps`,kind:M$,match:e=>Q$(e.raw,N$),resolve:e=>{let t=U$(e.raw);return{dedupeKey:`apps`,historyPolicy:`managed`,kind:M$,resourceUri:t,title:b(t===`nextclaw://apps`?`appsTitle`:`serviceAppsTitle`),url:t}},areEquivalent:(e,t)=>U$(e)===U$(t)},{defaultUrl:()=>`nextclaw://panel-app`,id:`panel-app`,kind:I$,match:e=>e.scheme===`nextclaw`&&e.authority===`panel-app`||n1(e),resolve:e=>{let t=r1(e),n=K$(e);return{dedupeKey:n?`panel-app:${e.searchParams.get(`path`)?.trim()||n}`:void 0,historyPolicy:`managed`,kind:I$,resourceUri:i1(e),title:b(`panelAppsTitle`),url:t}},areEquivalent:a1},{defaultUrl:()=>`about:blank`,id:`content`,kind:`content`,match:()=>!0,resolve:e=>({historyPolicy:`managed`,kind:`content`,resourceUri:e.raw||`about:blank`,title:Ti(e.raw,`content`,`Detail`),url:e.raw||`about:blank`}),areEquivalent:(e,t)=>e===t}],s1=o1.map(e=>({areEquivalent:e.areEquivalent,id:e.id,match:e.match,resolve:e.resolve}));function c1(){return[{id:`apps`,label:b(`appsTitle`),target:{type:`right-panel-resource`,uri:N$}},{id:`service-apps`,label:b(`serviceAppsTitle`),target:{type:`right-panel-resource`,uri:F$}},{id:`docs`,label:b(`docBrowserHelp`),target:{options:{newTab:!0},type:`right-panel-resource`,uri:Ai()}},{id:`skill-marketplace`,label:b(`marketplaceSkillsPageTitle`),target:{path:`/marketplace/skills`,type:`app-route`}}]}var l1={apps:{accentClassName:`bg-emerald-50 text-emerald-700`,hoverAccentClassName:`group-hover:bg-emerald-100`,icon:(0,H.jsx)(Kr,{className:`h-5 w-5`})},"service-apps":{accentClassName:`bg-sky-50 text-sky-700`,hoverAccentClassName:`group-hover:bg-sky-100`,icon:(0,H.jsx)(dee,{className:`h-5 w-5`})},docs:{accentClassName:`bg-amber-50 text-amber-700`,hoverAccentClassName:`group-hover:bg-amber-100`,icon:(0,H.jsx)(di,{className:`h-5 w-5`})},"skill-marketplace":{accentClassName:`bg-rose-50 text-rose-700`,hoverAccentClassName:`group-hover:bg-rose-100`,icon:(0,H.jsx)($i,{className:`h-5 w-5`})}};function u1(e){return l1[e.id]??{accentClassName:`bg-gray-50 text-gray-700`,hoverAccentClassName:`group-hover:bg-gray-100`,icon:(0,H.jsx)(Kr,{className:`h-5 w-5`})}}function d1({open:e}){let t=ce(),n=c1(),r=n=>{if(n.type===`app-route`){t(n.path);return}e(n.uri,n.options)};return(0,H.jsx)(`div`,{className:`h-full overflow-auto bg-background px-4 py-5`,children:(0,H.jsx)(`div`,{className:`mx-auto w-full max-w-[520px]`,children:(0,H.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(76px,1fr))] gap-x-2 gap-y-4`,children:n.map(e=>{let t=u1(e);return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.target),className:`group flex min-h-[68px] flex-col items-center gap-1.5 rounded-md px-1.5 py-1.5 text-center focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,H.jsx)(`span`,{className:u(`flex h-10 w-10 shrink-0 items-center justify-center rounded-md transition-colors`,t.accentClassName,t.hoverAccentClassName),children:t.icon}),(0,H.jsx)(`span`,{className:`line-clamp-2 min-w-0 max-w-full text-xs font-medium leading-snug text-gray-700 transition-colors group-hover:text-gray-900`,children:e.label})]},e.id)})})})})}function f1(e){return e&&wi(e)?`docs`:`content`}var p1=class{constructor(){this.resourceUriResolver=new k$(s1,{getNormalizedUri:e=>e.resourceUri??e.url}),this.resolve=e=>this.resourceUriResolver.resolve(e),this.normalize=e=>this.resourceUriResolver.normalize(e),this.areEquivalent=(e,t)=>this.resourceUriResolver.areEquivalent(e,t),this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=this.resolveRouteDefinition(r,n,t),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i.defaultUrl());return i.resolve(O$(a))},this.areUrlsEquivalent=(e,t,n,r)=>n===r?this.resolveRouteDefinition(e,n).areEquivalent?.(e,t)??this.areEquivalent(e,t):!1,this.usesManagedHistory=e=>this.resolveRouteDefinition(e.currentUrl,e.kind).resolve(O$(e.currentUrl)).historyPolicy===`managed`,this.resolveRouteDefinition=(e,t,n)=>{let r=t??(e?void 0:n?.kind),i=r?o1.find(e=>e.kind===r):void 0;if(i)return i;let a=e?O$(e):null,o=a?o1.find(e=>e.match(a)):void 0;if(o)return o;let s=t??n?.kind??f1(e);return o1.find(e=>e.kind===s)??o1[o1.length-1]}}};function m1({appTitle:e,entry:t,onRefresh:n}){let[r,i]=(0,V.useState)(!1);return(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/70 bg-card px-3.5 py-2 shrink-0`,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs font-medium text-muted-foreground`,title:e,children:e}),t?(0,H.jsxs)(wF,{open:r,onOpenChange:i,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(B,{icon:(0,H.jsx)(ci,{className:`h-3.5 w-3.5`}),label:b(`panelAppsMoreActions`),size:`sm`})}),(0,H.jsx)(DF,{align:`end`,className:`w-48 rounded-xl p-1.5`,children:(0,H.jsx)(xY,{entry:t,onSelect:()=>i(!1)})})]}):null,(0,H.jsx)(B,{icon:(0,H.jsx)(mi,{className:`h-3.5 w-3.5`}),label:b(`panelAppsRefreshCurrent`),onClick:n,size:`sm`})]})}function h1({appTitle:e,currentUrl:t,onRefresh:n,resourceUri:r}){let i=gY(),a=J$({currentUrl:t,resourceUri:r}),o=(0,V.useMemo)(()=>i.data?.entries.find(e=>e.appId===a),[a,i.data?.entries]);return(0,H.jsx)(m1,{appTitle:o?.title??e,entry:o,onRefresh:n})}var g1=M$,_1=I$,v1=`apps`;function y1(e){return e===`apps`||e===`panel-apps`||e===`service-apps`}function b1(e=v1){return e===`panel-apps`?P$:e===`service-apps`?F$:N$}function x1(e){try{let t=new URL(e).searchParams.get(`tab`);return y1(t)?t:v1}catch{return v1}}function S1(e){e.open(b1(),{kind:g1,title:b(`appsTitle`),dedupeKey:`apps`})}var C1={[A$]:{getTitle:()=>b(`docBrowserHomeTitle`),renderContent:({open:e})=>(0,H.jsx)(d1,{open:e})},[g1]:{getTitle:()=>b(`appsTitle`),renderIcon:()=>(0,H.jsx)(Kr,{className:`w-4 h-4 text-primary shrink-0`}),renderContent:({currentUrl:e,open:t,openTarget:n})=>(0,H.jsx)(w$,{activeTab:x1(e),onActiveTabChange:e=>t(b1(e),{activate:!1,kind:g1,title:b(`appsTitle`),dedupeKey:`apps`}),onOpenPanelApp:e=>n(Z$(e))})},[_1]:{getIframeSandbox:()=>mX,getTitle:e=>e.title||b(`panelAppsTitle`),onIframeMessage:e=>M9().panelAppBridgeManager.handleIframeMessage(e),onIframePointerOver:e=>hX(e.currentTarget),renderIcon:()=>(0,H.jsx)(Ur,{className:`w-4 h-4 text-primary shrink-0`}),renderToolbar:({refreshIframe:e,tab:t})=>(0,H.jsx)(h1,{appTitle:t.title||b(`panelAppsTitle`),currentUrl:t.currentUrl,onRefresh:e,resourceUri:t.resourceUri}),supportsScrollRestoration:!0}};function w1(){let{appId:e=``}=le(),t=F9(),n=Oi(),r=gY(),i=(0,V.useRef)(null),a=(0,V.useMemo)(()=>r.data?.entries.find(t=>t.appId===e),[e,r.data?.entries]),o=pX(a);return(0,V.useEffect)(()=>{let e=e=>{t.panelAppBridgeManager.handleIframeMessage({event:e,iframe:i.current})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[t]),r.isLoading?(0,H.jsx)(T1,{message:b(`panelAppsLoading`)}):r.isError?(0,H.jsx)(T1,{message:r.error instanceof Error?r.error.message:b(`panelAppsLoadFailed`),actionLabel:b(`panelAppsTryAgain`),onAction:()=>void r.refetch()}):a?o.state===`checking`||o.state===`idle`?(0,H.jsx)(T1,{message:b(`panelAppsCheckingPermission`)}):o.state===`denied`||o.state===`error`?(0,H.jsx)(T1,{message:o.state===`denied`?b(`panelAppsPermissionDenied`):b(`panelAppsPermissionFailed`),actionLabel:b(`panelAppsTryAgain`),onAction:()=>void o.retryClientGrant()}):(0,H.jsx)(`div`,{className:`h-full min-h-0 bg-background`,children:(0,H.jsx)(`iframe`,{ref:i,src:a.contentPath,title:a.title,sandbox:mX,className:`block h-full w-full border-0 bg-background`,onPointerOver:e=>hX(e.currentTarget)},a.appId)}):(0,H.jsx)(T1,{message:b(`panelAppsMainUnavailable`),actionLabel:b(`panelAppsOpenApps`),onAction:()=>S1(n)})}function T1({actionLabel:e,message:t,onAction:n}){return(0,H.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-background px-6 text-center`,children:(0,H.jsxs)(`div`,{className:`max-w-sm`,children:[(0,H.jsx)(`div`,{className:`mx-auto flex h-10 w-10 items-center justify-center rounded-lg bg-muted text-muted-foreground`,children:n?(0,H.jsx)(Co,{className:`h-5 w-5`}):(0,H.jsx)(Kr,{className:`h-5 w-5`})}),(0,H.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-muted-foreground`,children:t}),e&&n?(0,H.jsx)(`button`,{type:`button`,className:`mt-4 rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:n,children:e}):null]})})}var E1=class{constructor(e){this.authorizationManager=e,this.handleIframeMessage=({event:e,iframe:t})=>{this.isBridgeRequest(e.data)&&(!t?.contentWindow||e.source!==t.contentWindow||this.handleBridgeRequest({event:e,iframe:t},e.data))},this.handleBridgeRequest=async(e,t)=>{try{let n=this.getBridgeContext(t),r=await this.dispatchRequest(n,t);this.postResponse(e,{type:`nextclaw:panel-app-service-actions:response`,requestId:t.requestId,ok:!0,data:r})}catch(n){this.postResponse(e,{type:`nextclaw:panel-app-service-actions:response`,requestId:t.requestId,ok:!1,error:this.toBridgeError(n)})}},this.dispatchRequest=async(e,t)=>{switch(t.method){case`list`:return await I.serviceApps.listServiceActions({bridgeSessionToken:e.token});case`requestGrant`:return await this.confirmAndGrant(e,this.requireActionId(t));case`revokeGrant`:return await I.serviceApps.revokeServiceAction(this.requireActionId(t),{bridgeSessionToken:e.token});case`invoke`:return await this.invokeWithAuthorization(e,t);case`agent.send`:return await this.sendAgentMessageWithAuthorization(e,t);case`agent.generateObject`:return await this.generateAgentObjectWithAuthorization(e,t);default:throw Error(`Unsupported panel bridge method: ${String(t.method)}`)}},this.invokeWithAuthorization=async(e,t)=>{let n=this.requireActionId(t);try{return await I.serviceApps.invokeServiceAction(n,this.readOptionalRecord(t.payload?.input),{bridgeSessionToken:e.token})}catch(r){if(!(r instanceof Ct)||r.code!==`AUTHORIZATION_REQUIRED`)throw r;return await this.confirmAndGrant(e,n,this.readOptionalRecord(t.payload?.input)),await I.serviceApps.invokeServiceAction(n,this.readOptionalRecord(t.payload?.input),{bridgeSessionToken:e.token})}},this.sendAgentMessageWithAuthorization=async(e,t)=>{try{return await I.panelApps.sendAgentMessage(this.readAgentSendRequest(t),{bridgeSessionToken:e.token})}catch(n){if(!(n instanceof Ct)||n.code!==`AUTHORIZATION_REQUIRED`)throw n;return await this.confirmAndGrantAgentCapability(e,`agent:send`),await I.panelApps.sendAgentMessage(this.readAgentSendRequest(t),{bridgeSessionToken:e.token})}},this.generateAgentObjectWithAuthorization=async(e,t)=>{try{return await I.panelApps.generateAgentObject(this.readGenerateObjectRequest(t),{bridgeSessionToken:e.token})}catch(n){if(!(n instanceof Ct)||n.code!==`AUTHORIZATION_REQUIRED`)throw n;return await this.confirmAndGrantAgentCapability(e,`agent:generateObject`),await I.panelApps.generateAgentObject(this.readGenerateObjectRequest(t),{bridgeSessionToken:e.token})}},this.confirmAndGrantAgentCapability=async(e,t)=>{if(!await this.authorizationManager.requestAuthorization({panelAppId:e.appId,actions:[{actionId:t,actionTitle:t===`agent:send`?`Send agent message`:`Generate object`,actionDescription:t===`agent:send`?`Send a message to a NextClaw Agent session.`:`Send context to a NextClaw Agent session and receive a structured object.`,risk:`write`}]}))throw new Ct({code:`AUTHORIZATION_REJECTED`,message:`Permission rejected for ${t}.`});return await I.panelApps.grantAgentCapability(t,{bridgeSessionToken:e.token})},this.confirmAndGrant=async(e,t,n)=>{let r=await this.listGrantCandidateActions(e,t);if(!await this.authorizationManager.requestAuthorization({panelAppId:e.appId,actions:r.map(e=>({actionId:e.id,actionTitle:e.title,actionDescription:e.description,risk:e.risk})),inputPreview:this.createInputPreview(n)}))throw new Ct({code:`AUTHORIZATION_REJECTED`,message:`Permission rejected for ${t}.`});let i=await I.serviceApps.grantServiceActions(r.map(e=>e.id),{bridgeSessionToken:e.token}),a=i.grants.find(e=>e.actionId===t)??i.grants[0];if(!a)throw Error(`No permission grant returned for ${t}.`);return a},this.listGrantCandidateActions=async(e,t)=>{let n=await I.serviceApps.listServiceActions({bridgeSessionToken:e.token}),r=n.actions.find(e=>e.id===t);if(r&&r.grantState!==`not-granted`)return[r];let i=n.actions.filter(e=>e.grantState===`not-granted`),a=[...i.filter(e=>e.id===t),...i.filter(e=>e.id!==t)];return a.length>0?a:[{appId:r?.appId??t.split(`.`)[0]??t,description:r?.description,id:t,name:r?.name??t,risk:r?.risk??`dangerous`,title:r?.title}]},this.createInputPreview=e=>{if(!(!e||Object.keys(e).length===0))try{let t=JSON.stringify(e,null,2);return t.length>500?`${t.slice(0,500)}...`:t}catch{return`[unserializable input]`}},this.getBridgeContext=e=>({appId:e.appId,token:e.runtimeToken}),this.requireActionId=e=>{let t=e.payload?.actionId?.trim();if(!t)throw Error(`Panel bridge actionId is required.`);return t},this.readOptionalRecord=e=>{if(e!==void 0)return this.requireRecord(e,`input`)},this.readAgentSendRequest=e=>({payload:this.requireRecord(e.payload?.request,`agent.send request`)}),this.readGenerateObjectRequest=e=>({input:this.requireRecord(e.payload?.input,`generateObject input`)}),this.requireRecord=(e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`${t} is required.`);return e},this.postResponse=(e,t)=>{e.iframe?.contentWindow?.postMessage(t,`*`)},this.toBridgeError=e=>e instanceof Ct?{code:e.code,message:e.message,details:e.details}:{message:e instanceof Error?e.message:String(e)},this.isBridgeRequest=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`nextclaw:panel-app-service-actions:request`&&typeof t.requestId==`string`&&typeof t.runtimeToken==`string`&&typeof t.appId==`string`&&(t.method===`invoke`||t.method===`agent.send`||t.method===`agent.generateObject`||t.method===`list`||t.method===`requestGrant`||t.method===`revokeGrant`)}}};function D1(e,t){let n=t.trim();return[e.id,e.appId,e.fileName,e.title].some(e=>e.trim()===n)}function O1(e,t){let n=t.trim();return n?e.find(e=>D1(e,n))??null:null}function k1(e,t){return G$(e,t)}function A1(e){return`${e}${e.includes(`?`)?`&`:`?`}${new URLSearchParams({[T.displayModeSearchParam]:T.displayMode,[T.placementSearchParam]:T.placement}).toString()}`}function j1(e){if(!e||typeof e!=`object`)return null;let t=e;return t.type===T.contentHeightMessageType&&typeof t.height==`number`&&Number.isFinite(t.height)&&t.height>0?Math.ceil(t.height):null}function M1(e){let{appId:t,params:n,path:r,title:i,url:a}=e;return{contentParams:n,currentUrl:a,dedupeKey:`panel-app:${r??t}`,history:[a],historyIndex:0,id:`inline-panel-app:${r??t}`,kind:I$,navVersion:0,resourceUri:W$(t,r),title:i}}function N1({panelApp:e,showExpandAction:t=!0}){let n=Oi(),r=(0,V.useRef)(null),i=(0,V.useId)(),[a,o]=(0,V.useState)(null),s=gY(),c=(0,V.useMemo)(()=>e.path?void 0:O1(s.data?.entries??[],e.appId),[e.appId,e.path,s.data?.entries]),l=c?Z$(c):null,u=e.title??l?.title??e.appId,d=e.path?k1(e.appId,e.path):s.isLoading?``:l?.url??k1(e.appId),f=(0,V.useMemo)(()=>d?A1(d):``,[d]),p=(0,V.useMemo)(()=>M1({appId:c?.id??e.appId,params:e.params,path:e.path,title:u,url:d}),[c?.id,e.appId,e.params,e.path,u,d]),m=g(e.params),h=`${p.id}:${p.navVersion}:${i}:${m??``}`;return(0,V.useEffect)(()=>{if(!d)return;let e=e=>{if(e.source!==r.current?.contentWindow)return;let t=j1(e.data);if(t!==null){o(t);return}M9().panelAppBridgeManager.handleIframeMessage({event:e,iframe:r.current})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[d]),d?(0,H.jsx)(sY,{actions:t?(0,H.jsx)(B,{size:`sm`,icon:(0,H.jsx)($a,{className:`h-3.5 w-3.5`}),label:b(`chatPanelCardExpand`),tooltipSide:`top`,onClick:()=>{if(l){n.openTarget({...l,contentParams:e.params});return}n.open(d,{dedupeKey:p.dedupeKey,kind:p.kind,contentParams:e.params,title:u})}}):void 0,contentHeight:a,children:(0,H.jsx)(`iframe`,{ref:r,src:f,name:m,title:u,sandbox:mX,tabIndex:0,onPointerOver:()=>hX(r.current),className:`h-full w-full border-0 bg-card`},h)}):(0,H.jsx)(sY,{isLoading:!0,children:(0,H.jsx)(`span`,{className:`sr-only`,children:u})})}function P1({checkpoint:e,inline:t=!1}){let n=!e||e.status===`compressing`,r=e?.status===`failed`,i=e?.status===`cancelled`,a=e?[`${b(`chatContextCompactionCoveredMessages`)}: ${e.coveredSessionMessageCount}`,`${b(`chatContextCompactionOriginalTokens`)}: ${e.originalEstimatedTokens}`,`${b(`chatContextCompactionProjectedTokens`)}: ${e.projectedEstimatedTokens}`].join(`
103
+ `):void 0;return(0,H.jsxs)(`div`,{"data-context-compaction-placement":t?`assistant`:`timeline`,className:t?`my-3 flex items-center gap-3 text-[11px] text-muted-foreground`:`my-4 flex items-center gap-3 text-[11px] text-muted-foreground`,"aria-live":`polite`,title:a,children:[(0,H.jsx)(`div`,{className:`h-px flex-1 bg-border`}),(0,H.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-border bg-muted px-3 py-1`,children:[n?(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-muted-foreground`}):(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-muted-foreground/45`}),(0,H.jsx)(`span`,{children:b(n?`chatContextCompactionCompressing`:i?`chatContextCompactionCancelled`:r?`chatContextCompactionFailed`:`chatContextCompactionCompressed`)})]}),(0,H.jsx)(`div`,{className:`h-px flex-1 bg-border`})]})}function F1({inheritance:e}){return(0,H.jsxs)(`div`,{className:`my-4 flex items-center gap-3 text-[11px] text-emerald-700`,title:[`${b(`chatContextInheritanceSourceSession`)}: ${e.sourceSessionId}`,`${b(`chatContextInheritanceMessages`)}: ${e.inheritedMessageCount}`].join(`
104
+ `),children:[(0,H.jsx)(`div`,{className:`h-px flex-1 bg-emerald-100`}),(0,H.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-emerald-200 bg-emerald-50 px-3 py-1`,children:[(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-400`}),(0,H.jsx)(`span`,{children:b(`chatContextInheritanceInherited`)})]}),(0,H.jsx)(`div`,{className:`h-px flex-1 bg-emerald-100`})]})}var I1=`nextclaw.chat.message-layout`,L1=1,R1=`flat`;function z1(e){if(!e||typeof e!=`object`)return R1;let{layout:t}=e;return t===`flat`||t===`card`?t:R1}var B1=N()(_i(e=>({layout:R1,setLayout:t=>e({layout:t})}),{name:I1,version:L1,storage:vi(()=>window.localStorage),partialize:e=>({layout:e.layout}),merge:(e,t)=>({...t,layout:z1(e)})}));function V1(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function H1(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function U1(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var W1=(e,t)=>Math.abs(e-t)<1.01,G1=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},K1,q1=()=>{if(K1!==void 0)return K1;if(typeof navigator>`u`)return K1=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return K1=!0;let e=navigator.maxTouchPoints;return K1=navigator.platform===`MacIntel`&&e!==void 0&&e>0},J1=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Y1=e=>e,X1=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Z1=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(J1(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(J1(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Q1={passive:!0},$1=typeof window>`u`?!0:`onscrollend`in window,e0=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&$1,o=0,s=a?null:G1(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Q1),a&&r.addEventListener(`scrollend`,u,Q1),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},t0=(e,t)=>e0(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),n0=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},r0=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},i0=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Y1,rangeExtractor:X1,onChange:()=>{},measureElement:n0,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=H1(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!q1()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Q1),e.addEventListener(`touchend`,n,Q1),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(q1()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=H1(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=H1(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=V1(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=H1(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=s0(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=H1(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=H1(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return U1(t[a0(0,t.length-1,r?e=>n[e*2]:e=>U1(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t);this.scrollState={index:null,align:t,behavior:n,startedAt:this.now(),lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e;this.scrollState={index:null,align:`start`,behavior:t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(q1()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&W1(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},a0=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function o0(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function s0(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=o0(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=a0(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var c0=typeof document<`u`?V.useLayoutEffect:V.useEffect;function l0({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=V.useReducer(e=>e+1,0)[1],a=V.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,o=r?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let a=n.start-s,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==a&&(t.lastPositions.set(c,a),i?c.style.transform=r?`translate3d(${a}px, 0, 0)`:`translate3d(0, ${a}px, 0)`:c.style[o]=`${a}px`)}},s={...r,onChange:(t,n)=>{var s;let c=a.current,l=!0;if(c.enabled){o(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,uy.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[c]=V.useState(()=>{let e=new i0(s);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return c.setOptions(s),c0(()=>c._didMount(),[]),c0(()=>c._willUpdate()),c0(()=>{o(c)}),c}function u0(e){return l0({observeElementRect:Z1,observeElementOffset:t0,scrollToFn:r0,...e})}var d0=180;function f0(e){let{activeRowKey:t,focusedRowKey:n,rows:r,scrollRef:i}=e,a=(0,V.useMemo)(()=>r.flatMap((e,r)=>e.key===t||e.key===n?[r]:[]),[t,n,r]),o=(0,V.useCallback)(e=>[...new Set([...X1(e),...a])].sort((e,t)=>e-t),[a]),s=(0,V.useRef)(null),c=u0({anchorTo:`end`,count:r.length,directDomUpdates:!0,estimateSize:()=>d0,getItemKey:e=>r[e]?.key??e,getScrollElement:()=>i.current,initialOffset:()=>r.length*d0,initialRect:{width:0,height:800},overscan:8,rangeExtractor:o,scrollToFn:(e,t,n)=>{let r=s.current;r&&(r.style.height=`${n.getTotalSize()}px`),r0(e,t,n)}});return c.shouldAdjustScrollPositionOnItemSizeChange=e=>e.end<=(c.scrollOffset??0),{containerRef:(0,V.useCallback)(e=>{s.current=e,c.containerRef(e)},[c]),virtualizer:c}}function p0(e,t){if(t.length===0)return e;let n=e[e.length-1];return n?.type===`text`?[...e.slice(0,-1),{...n,text:n.text+t}]:[...e,{type:`text`,text:t}]}function m0(e){return e?.type===`token`&&!!eW(e)}function h0(e){let{index:t,nodes:n,tokenText:r}=e,i=n[t-1],a=n[t+1],o=i?.type===`text`&&/\S$/.test(i.text)||m0(i),s=a?.type===`text`&&/^\S/.test(a.text)||m0(a);return`${o?` `:``}${r}${s?` `:``}`}function g0(e){return Hs(e)}function _0(e){return Gs(e)}function v0(e){return Ks(e,`skill`)}function y0(e){return Ks(e,`file`)}function b0(e,t,n){let r=new Set(t),i=$s(e,e=>e.tokenKind===`skill`&&!r.has(e.tokenKey)),a=Ks(i,`skill`),o=new Map(n.map(e=>[e.ref,e])),s=t.filter(e=>!a.includes(e)).map(e=>zs({tokenKind:`skill`,tokenKey:e,label:o.get(e)?.name||e}));return s.length===0?i:Us([...i,...s])}function x0(e,t){let n=new Set(y0(e));return t.filter(e=>n.has(e.id))}function S0(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[];for(let[t,i]of e.entries()){if(i.type===`text`){r=p0(r,i.text);continue}let a=eW(i);if(a){r=p0(r,h0({index:t,nodes:e,tokenText:a}));continue}if(i.tokenKind!==`file`)continue;let o=n.get(i.tokenKey);o&&r.push({type:`file`,name:o.name,mimeType:o.mimeType,...o.assetUri?{assetUri:o.assetUri}:{},...o.url?{url:o.url}:{},...o.contentBase64?{contentBase64:o.contentBase64}:{},sizeBytes:o.sizeBytes})}return r}function C0(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function w0(e,t){return e?Object.fromEntries(t.map(t=>[t,e])):{}}function T0(e){let t=mI(e.projectRoot),n={...w0(e.model?.trim(),[`model`,`preferred_model`]),...w0(e.thinkingLevel?.trim(),[`thinkingEffort`,`thinking`,`preferred_thinking`]),...w0(e.sessionType?.trim(),[`agentRuntimeId`,`session_type`,`runtime`]),...w0(e.agentId?.trim(),[`agentId`,`agent_id`]),...w0(t??void 0,[`projectRoot`,`project_root`])},r=C0(e.requestedSkills);r.length>0&&(n.requested_skill_refs=r);let i=e.composerNodes?oW(e.composerNodes,e.skillRecords):[];return i.length>0&&(n[_]=DW(i)),e.sessionMaterialization&&(n[m]=e.sessionMaterialization),n}function E0(e){return e.some(e=>e.type===`text`||e.type===`rich-text`||e.type===`reasoning`?e.text.trim().length>0:!0)}function D0({disabled:e,messageId:t,onCancel:n,onChange:r,onSave:i,snapshot:a}){let o=(0,V.useRef)(null),s=(0,V.useRef)([...a.nodes]),c=S0([...a.nodes],a.attachments),l=(0,V.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n())},[n]);return(0,V.useLayoutEffect)(()=>{o.current?.focusComposerAtEnd(s.current)},[t]),(0,H.jsxs)(`div`,{className:`w-full min-w-[min(32rem,76vw)] overflow-hidden rounded-xl border border-border bg-card shadow-sm`,onKeyDownCapture:l,children:[(0,H.jsx)(Ib,{ref:o,actions:{canStopGeneration:!1,isSending:e,onSend:i,onStop:()=>void 0},disabled:e,nodes:[...a.nodes],onNodesChange:e=>{let t=[...e];r({...a,attachments:x0(t,a.attachments),nodes:t,selectedSkills:v0(t),text:_0(t)})},placeholder:b(`chatEditMessagePlaceholder`)},t),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-border/70 px-3 py-2`,children:[(0,H.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,disabled:e,onClick:n,children:b(`chatEditMessageCancel`)}),(0,H.jsx)(`button`,{type:`button`,className:`rounded-lg bg-foreground px-3 py-1.5 text-xs font-medium text-background transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40`,disabled:e||!E0(c),onClick:()=>void i(),children:b(`chatEditMessageSubmit`)})]})]})}function O0(e){let t=ZK(e.messages),n=t.findLast(e=>e.role===`user`),r=t.at(-1);return{continuationAssistantMessageId:e.canContinue&&r?.role===`assistant`?r.id:null,editableUserMessageId:e.isBusy?null:n?.id??null}}function k0(e,t){let n=[],r=0;for(;r<e.length;){let i=t.flatMap(t=>{let n=e.indexOf(t.rawText,r);return n<0?[]:[{index:n,token:t}]}).sort((e,t)=>e.index-t.index||t.token.rawText.length-e.token.rawText.length)[0];if(!i)return n.push(Rs(e.slice(r))),n;i.index>r&&n.push(Rs(e.slice(r,i.index))),n.push(zs({tokenKind:i.token.kind,tokenKey:`ref`in i.token?i.token.ref:i.token.key,label:i.token.label,data:i.token.kind===`system_object`&&`reference`in i.token?{reference:i.token.reference}:void 0})),r=i.index+i.token.rawText.length}return n}function A0(e){let t=e.requested_skill_refs;return C0(Array.isArray(t)?t.filter(e=>typeof e==`string`):void 0)}function j0(e){let{attachmentIdPrefix:t,availableSkills:n,message:r}=e,i=e.metadata??r.metadata??{},a=SW(i),o=[],s=[];r.parts.forEach((e,n)=>{if(e.type===`text`||e.type===`rich-text`||e.type===`reasoning`){o.push(...k0(e.text,xW(e.text,a)));return}if(e.type!==`file`)return;let r=`${t}-${n}`,i={id:r,name:e.name??`attachment`,mimeType:e.mimeType??`application/octet-stream`,sizeBytes:e.sizeBytes??0,assetUri:e.assetUri,url:e.url,contentBase64:e.contentBase64};s.push(i),o.push(zs({tokenKind:`file`,tokenKey:r,label:i.name,previewUrl:i.mimeType.startsWith(`image/`)?i.url:void 0}))});let c=Us(o),l=A0(i),u=new Map(n.map(({ref:e,name:t})=>[e,t]));return{text:_0(c),nodes:c,selectedSkills:l,skillRecords:l.map(e=>({ref:e,name:u.get(e)??e})),attachments:s}}function M0(){return`edited-message-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function N0(e){return e.some(e=>e.type===`text`||e.type===`rich-text`||e.type===`reasoning`?e.text.trim().length>0:!0)}function P0(e,t){let n={...e.metadata};delete n.requested_skill_refs,delete n[_];let r=SW(e.metadata).flatMap(e=>e.kind===`skill`&&`ref`in e&&e.source&&e.path?[{name:e.name,path:e.path,ref:e.ref,source:e.source}]:[]);return Object.assign(n,T0({composerNodes:[...t.nodes],requestedSkills:[...t.selectedSkills],skillRecords:r})),Object.keys(n).length>0?n:void 0}function F0({adaptedMessages:e,canContinue:t,disabled:n,onContinueRun:r,onEditMessage:i,rawMessages:a}){let o=(0,V.useMemo)(()=>O0({canContinue:t,isBusy:n,messages:a}),[t,n,a]),s=(0,V.useMemo)(()=>e.map(e=>{let t=[];return i&&e.id===o.editableUserMessageId&&t.push({disabled:n,icon:`edit`,key:`edit-message`,label:b(`chatEditMessage`)}),r&&e.id===o.continuationAssistantMessageId&&t.push({disabled:n,icon:`continue`,key:`continue-run`,label:b(`chatContinueRun`)}),t.length>0?{...e,actions:t}:e}),[o,e,n,r,i]),[c,l]=(0,V.useState)(null),u=(0,V.useCallback)((e,t)=>{if(t.key===`continue-run`){Promise.resolve(r?.()).catch(()=>void 0);return}if(t.key!==`edit-message`||!i)return;let n=a.find(t=>t.id===e.id);n&&l({message:n,snapshot:j0({attachmentIdPrefix:`edited-attachment-${n.id}`,availableSkills:[],message:n})})},[r,i,a]),d=(0,V.useCallback)(async()=>{if(!c||!i)return;let e=S0([...c.snapshot.nodes],c.snapshot.attachments);N0(e)&&(await i({messageId:c.message.id,message:{...c.message,id:M0(),metadata:P0(c.message,c.snapshot),parts:e,role:`user`,status:`final`,timestamp:new Date().toISOString()}}),l(null))},[c,i]);return{handleMessageAction:u,messages:s,renderMessageContent:(0,V.useCallback)(e=>c?.message.id===e.id?(0,H.jsx)(D0,{disabled:n,messageId:c.message.id,onCancel:()=>l(null),onChange:e=>l(t=>t?{...t,snapshot:e}:null),onSave:d,snapshot:c.snapshot}):void 0,[n,c,d])}}function I0(e){let{selectedSession:t,sessionKey:n}=e,r=tI(),i=F9(),a=t?.projectRoot??t?.workingDir,o=(0,V.useCallback)(e=>{if(e.kind===`ui_resource`&&`key`in e){i.docBrowserManager.open(e.key);return}if(e.kind===`panel_app`&&`key`in e){r.chatUiManager.showContent({target:{type:`panel_app`,payload:{appId:e.key}}});return}if(`key`in e&&(e.kind===`project`||e.kind===`workspace_file`||e.kind===`workspace_directory`)){let t=e.kind===`project`?e.key:mW({projectRoot:a,relativePath:e.key});t&&r.chatThreadManager.openFilePreview({path:t,label:e.label,viewMode:`preview`});return}if(e.kind===`workspace_excerpt`&&`excerpt`in e){let t=mW({projectRoot:a,relativePath:e.path});t&&r.chatThreadManager.openFilePreview({path:t,label:e.label,line:e.startLine??void 0,viewMode:`preview`});return}if(e.kind!==`skill`||!(`ref`in e))return;let o=e.path?.trim();if(o){r.chatThreadManager.openFilePreview({path:o,label:e.label||e.name,viewMode:`preview`,previewViewer:`rendered`});return}if(!n){R.error(b(`chatSkillPreviewUnavailable`));return}je(n,{projectRoot:t?.projectRoot??null}).then(({records:t})=>{let n=t.find(t=>t.ref===e.ref),i=t.filter(t=>t.name===e.name),a=n??(i.length===1?i[0]:null),o=a?.path.trim();if(!a||!o){R.error(b(`chatSkillPreviewUnavailable`));return}r.chatThreadManager.openFilePreview({path:o,label:e.label||a.name,viewMode:`preview`,previewViewer:`rendered`})}).catch(()=>R.error(b(`chatSkillPreviewUnavailable`)))},[i.docBrowserManager,r,a,t?.projectRoot,n]);return{handleAttachmentOpen:(0,V.useCallback)(e=>{let t=e.dataUrl?.trim();if(!t)return;let n=e.label.trim()||`attachment`;r.chatThreadManager.openFilePreview({path:n,label:n,viewMode:`preview`,contentUrl:t,mimeType:e.mimeType})},[r]),handleInlineTokenClick:o}}function L0({event:e}){let{language:t}=jn(),n=VK(e.payload);return(0,H.jsxs)(`details`,{"aria-label":b(`chatObservationEventLabel`,t),"data-testid":`chat-observation-event`,className:`group my-3 min-w-0 text-[11px] text-muted-foreground`,children:[(0,H.jsxs)(`summary`,{"aria-label":`${b(`chatObservationEventLabel`,t)}: ${e.eventType}. ${b(`chatObservationEventShowDetails`,t)}`,className:`flex cursor-pointer list-none items-center gap-3 rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 [&::-webkit-details-marker]:hidden`,children:[(0,H.jsx)(`span`,{className:`h-px min-w-4 flex-1 bg-border/70`}),(0,H.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-[min(80%,32rem)] items-center gap-1.5 px-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 shrink-0 rounded-full bg-muted-foreground/50`}),(0,H.jsx)(`span`,{className:`shrink-0`,children:b(`chatObservationEventLabel`,t)}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground/60`,children:`·`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:e.eventType}),(0,H.jsx)($n,{className:`h-3.5 w-3.5 shrink-0 transition-transform group-open:rotate-180`,"aria-hidden":`true`})]}),(0,H.jsx)(`span`,{className:`h-px min-w-4 flex-1 bg-border/70`})]}),(0,H.jsxs)(`div`,{className:`mx-auto mt-3 max-w-2xl overflow-hidden rounded-xl border border-border/70 bg-card shadow-sm`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 border-b border-border/60 bg-muted/35 px-3 py-2`,children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 shrink-0 rounded-full bg-muted-foreground/55`}),(0,H.jsx)(`span`,{className:`shrink-0 text-xs font-medium text-foreground/85`,children:b(`chatObservationEventDetailsTitle`,t)}),(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground/50`,children:`·`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-[11px] text-muted-foreground`,children:e.eventType})]}),(0,H.jsxs)(`dl`,{className:`grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-2 px-3 py-3 text-xs`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`chatObservationEventExtension`,t)}),(0,H.jsx)(`dd`,{className:`min-w-0 truncate text-foreground/80`,children:e.extensionId}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`chatObservationEventId`,t)}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono text-[11px] text-foreground/75`,children:e.eventId}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`chatObservationEventTime`,t)}),(0,H.jsx)(`dd`,{className:`text-foreground/80`,children:(0,H.jsx)(`time`,{dateTime:e.occurredAt,children:j(e.occurredAt,t)})})]}),(0,H.jsxs)(`div`,{className:`border-t border-border/60 px-3 py-3`,children:[(0,H.jsx)(`div`,{className:`mb-1.5 text-[11px] font-medium text-muted-foreground`,children:b(`chatObservationEventPayloadLabel`,t)}),(0,H.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-muted/55 px-3 py-2.5 text-[11px] leading-5 text-muted-foreground`,children:n||b(`chatObservationEventPayloadEmpty`,t)})]})]})]})}var R0=new class{constructor(){this.cache=new WeakMap,this.adapt=e=>{let{continuationRunning:t,executionLabels:n,language:r,processedLabel:i,rawMessages:a,texts:o}=e;return ZK(a,{continuationRunning:t}).map(e=>{let t=Cq({message:e,processedLabel:i,formatDeferredToolSummary:(e,t)=>{let n=b(`chatProcessSummaryToolCalls`,r).replace(`{count}`,E(e,r));if(t.length===0)return n;let i=r===`zh`?`、`:`, `;return`${n} · ${t.join(i)}`}}),a=t?.label??null,s=Dq({message:e,labels:n}),c=s?.cacheKey??null,l=this.cache.get(e);if(l&&l.language===r&&l.processSummaryLabel===a&&l.executionPresentationKey===c)return l.viewModel;let u=KI(e),d=gq({id:u.id,role:u.role,meta:{timestamp:u.meta?.timestamp,status:u.meta?.status,inlineTokens:SW(e.metadata),processSummary:t,executionSummaryLabel:s?.summaryLabel,moreActions:s?.moreActions},parts:WI(e.parts)},{formatTimestamp:e=>j(e,r),texts:o});return this.cache.set(e,{language:r,processSummaryLabel:a,executionPresentationKey:c,viewModel:d}),d})}}};function z0(e){if(e.target.type===`panel_app`)return(0,H.jsx)(N1,{panelApp:{appId:e.target.payload.appId,params:e.target.payload.params,path:e.target.payload.path,title:e.title}})}var B0=e=>(0,H.jsx)(_z,{agentId:e,className:`h-4 w-4 shrink-0`}),V0=e=>(0,H.jsx)(N1,{panelApp:e}),H0=8e3;function U0(e){let t=e.commonAncestorContainer;return(t instanceof Element?t:t.parentElement)?.closest(`[data-chat-message-selectable="true"]`)??null}function W0(e,t){return e.kind===`typing`||e.key===t}function G0({canContinue:e=!1,messages:t,messageDetailStates:n,isSending:r,messageActionsDisabled:i=!1,onContinueRun:a,onEditMessage:o,onLoadMessageDetails:s,scrollRef:c,sessionKey:l,className:d}){let f=tI(),{language:p}=jn(),m=B1(e=>e.layout),h=yR(l),g=oL(e=>e.snapshot.selectedAgentId),_=eR(e=>e.snapshot.sessionTypesQuery?.data??null),v=EL(h?.sessionType??_?.defaultType),y=v!==`native`||(h?.agentId??g).trim().toLowerCase()!==`main`,x=kL(_?.options??[]).find(e=>e.value===v),S=x?.icon?.src?.trim()?(0,H.jsx)(KL,{icon:{kind:`runtime-image`,src:x.icon.src,alt:x.icon.alt??null,name:x.label},className:`h-[65%] w-[65%]`}):void 0,C=h?.workingDir??h?.projectRoot??null,w=(0,V.useCallback)(e=>{let t=z0(e);if(t)return t;if(e.target.type===`file`)return(0,H.jsx)(cY,{display:e,parentSessionKey:l,sessionProjectRoot:h?.projectRoot??null,sessionWorkingDir:C,onFileOpen:f.chatThreadManager.openFilePreview})},[C,f.chatThreadManager,h?.projectRoot,l]),T=(0,V.useCallback)(e=>on(e.path,C),[C]),E=(0,V.useMemo)(()=>Oq(p),[p]),D=(0,V.useMemo)(()=>Aq(p),[p]),{handleMessageAction:O,messages:k,renderMessageContent:A}=F0({adaptedMessages:(0,V.useMemo)(()=>R0.adapt({continuationRunning:r,executionLabels:D,language:p,processedLabel:b(`chatProcessSummaryProcessed`),rawMessages:t,texts:E}),[D,r,p,t,E]),canContinue:e,disabled:i,onContinueRun:a,onEditMessage:o,rawMessages:t}),ee=k.findLast(e=>e.role===`assistant`&&(e.status===`streaming`||e.status===`pending`)),j=!!ee,M=(0,V.useMemo)(()=>jq(p),[p]),N=(0,V.useCallback)(({range:e})=>!!U0(e),[]),te=(0,V.useCallback)(({range:e,text:t})=>{let n=U0(e),r=n?.dataset.chatMessageId?.trim(),i=n?.dataset.chatMessageRole,a=n?.dataset.chatMessageRoleLabel?.trim();!r||!a||i!==`assistant`&&i!==`user`||f.chatComposerIntentManager.requestConversationExcerptReference({targetSessionKey:l,messageId:r,role:i,label:a,excerpt:t})},[f.chatComposerIntentManager,l]),P=(0,V.useMemo)(()=>eq({rawMessages:t,messages:k}),[k,t]),ne=(0,V.useMemo)(()=>r&&!j?[...P,{kind:`typing`,key:`typing`}]:P,[j,r,P]),[re,ie]=(0,V.useState)(null),ae=ee?`message:${ee.id}`:null,{containerRef:oe,virtualizer:se}=f0({rows:ne,scrollRef:c,activeRowKey:ae,focusedRowKey:re}),{handleAttachmentOpen:ce,handleInlineTokenClick:le}=I0({selectedSession:h,sessionKey:l}),ue=(0,V.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||ie(null)},[]),de=(0,V.useCallback)(e=>{if(LK(e.customType)){let t=BK(e.data);return t?(0,H.jsx)(L0,{event:t}):void 0}if(e.customType!==`nextclaw.context-compaction`)return;let t=e.data;return(0,H.jsx)(P1,{checkpoint:t.checkpoint,inline:!0})},[]);return(0,H.jsx)(vF,{actionLabel:M.addSelectionToChatLabel??b(`chatWorkspaceAddToChat`),isSelectionAllowed:N,maxCharacters:H0,onAddToChat:te,selectionTooLongLabel:M.selectionTooLongLabel??b(`chatWorkspaceExcerptSelectionTooLong`),children:(0,H.jsx)(`div`,{className:u(`relative`,d),ref:oe,children:se.getVirtualItems().map(e=>{let t=ne[e.index];return t?(0,H.jsx)(`div`,{"data-index":e.index,ref:se.measureElement,onBlurCapture:ue,onFocusCapture:()=>ie(t.key),className:`absolute left-0 top-0 w-full`,children:t.kind===`compaction`?(0,H.jsx)(P1,{checkpoint:t.checkpoint}):t.kind===`context-inheritance`?(0,H.jsx)(F1,{inheritance:t.inheritance}):t.kind===`observation-event`?(0,H.jsx)(L0,{event:t.event}):(0,H.jsx)(`div`,{className:t.kind===`message`?`pb-5`:void 0,children:(0,H.jsx)(uF,{assistantAvatarIcon:S,showAssistantHeader:y,layout:m,messages:t.kind===`message`?[t.message]:[],isSending:W0(t,ae),hasAssistantDraft:j,texts:M,onToolAction:f.chatThreadManager.handleToolAction,onFileOpen:f.chatThreadManager.openFilePreview,onAttachmentOpen:ce,onInlineTokenClick:le,onMessageAction:O,resolveMessageToolPayloadState:e=>n?.[e],onMessageToolPayloadRequest:s,resolveFileContentUrl:T,renderCustomPart:de,renderInlineDisplay:w,renderMessageContent:A,renderToolAgent:B0,renderPanelAppCard:V0})})},t.key):null})})})}function K0({children:e,className:t,width:n=`messages`}){let r=B1(e=>e.layout);return(0,H.jsx)(`div`,{"data-chat-conversation-track":r,"data-chat-conversation-track-width":n,className:u(`mx-auto w-full px-4 sm:px-6`,r===`flat`?n===`composer`?`max-w-[min(54rem,100%)]`:`max-w-[min(52rem,100%)]`:`max-w-[min(1120px,100%)]`,t),children:e})}function q0({bottomSlot:e,canContinue:t=!1,isHistoryLoading:n,hasPreviousMessages:r,historyError:i,isLoadingPreviousMessages:a,isContextCompacting:o=!1,isSending:s,messageActionsDisabled:c=!1,messages:l,messageDetailStates:u,sessionKey:d,showWelcome:f,onLoadPreviousMessages:p,onLoadMessageDetails:m,onContinueRun:h,onEditMessage:g,welcomeSlot:_}){let v=(0,V.useRef)(null),y=(0,V.useRef)(null),x=l.length>0||s,{isAtBottom:S,onScroll:C,scrollToBottom:w}=TM({contentRef:y,scrollRef:v,resetKey:d,isLoading:n,hasContent:x,contentVersion:l[l.length-1]??s}),T=l.length>0;return(0,H.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,H.jsx)(`div`,{ref:v,onScroll:(0,V.useCallback)(e=>{C(),e.currentTarget.scrollTop<=320&&r&&!a&&p()},[r,a,p,C]),"data-chat-scroll-container":`true`,className:f?`h-full overflow-y-auto custom-scrollbar`:`h-full overflow-y-auto custom-scrollbar ${FF}`,style:{overflowAnchor:`none`},children:f?_??null:(0,H.jsxs)(`div`,{ref:y,className:`pb-7`,children:[x?(0,H.jsxs)(K0,{className:`relative py-4 sm:py-5`,children:[i?(0,H.jsx)(`div`,{role:`alert`,className:`flex h-8 justify-center`,children:(0,H.jsxs)(`button`,{type:`button`,"aria-label":b(`chatHistoryRetry`),className:`rounded px-1.5 text-xs text-foreground underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>void p(),children:[b(`chatHistoryLoadFailed`),` · `,b(`chatHistoryRetry`)]})}):a?(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-1/2 top-[13px] block h-1.5 w-1.5 -translate-x-1/2 animate-pulse rounded-full bg-muted-foreground/50 sm:top-[17px]`}):null,(0,H.jsx)(G0,{canContinue:t,messages:l,messageDetailStates:u,isSending:s,messageActionsDisabled:c,onContinueRun:h,onEditMessage:g,onLoadMessageDetails:m,scrollRef:v,sessionKey:d}),o?(0,H.jsx)(P1,{}):null]}):null,e?(0,H.jsx)(K0,{className:`pb-4 sm:pb-5`,children:e}):null]})}),T&&!f&&!S?(0,H.jsx)(B,{icon:(0,H.jsx)(Gi,{className:`h-4 w-4`}),label:b(`chatScrollToBottom`),onClick:w,tooltipSide:`top`,className:`absolute bottom-4 left-1/2 z-10 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background/90 text-foreground shadow-lg backdrop-blur hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`}):null]})}function J0(e){let t=e.split(/\r?\n/),n=`message`,r=[];for(let e of t){let t=e.trimEnd();if(!(!t||t.startsWith(`:`))){if(t.startsWith(`event:`)){n=t.slice(6).trim()||`message`;continue}t.startsWith(`data:`)&&r.push(t.slice(5).trimStart())}}return r.length===0?null:{event:n,data:r.join(`
105
+ `)}}async function*Y0(e,t={}){let n=e.getReader(),r=new TextDecoder,i=``;try{for(;;){let{value:e,done:a}=await n.read();if(a)break;t.onActivity?.(),i+=r.decode(e,{stream:!0});let{frames:o,rest:s}=X0(i);i=s;for(let e of o)yield e}i+=r.decode();let{frames:e}=X0(i,!0);for(let t of e)yield t}finally{n.releaseLock()}}function X0(e,t=!1){let n=e.split(/\r?\n\r?\n/),r=n.pop()??``,i=[];for(let e of n){let t=J0(e);t&&i.push(t)}if(t&&r.trim()){let e=J0(r);return e&&i.push(e),{frames:i,rest:``}}return{frames:i,rest:r}}var Z0=`/ncp/agent`,Q0=class extends Error{ncpError;alreadyPublished;constructor(e,t=!1){super(e.message),this.name=`NcpHttpAgentClientError(${e.code})`,this.ncpError=e,this.alreadyPublished=t}};function $0(e){let t=e.trim();if(!t)throw Error(`NcpHttpAgentClient requires a non-empty baseUrl.`);return new URL(t)}function e2(e){if(e)return e;if(typeof globalThis.fetch==`function`)return globalThis.fetch.bind(globalThis);throw Error(`No fetch implementation found. Pass options.fetchImpl explicitly.`)}function t2(e){let t=(e??`/ncp/agent`).trim();if(!t)return Z0;let n=t.startsWith(`/`)?t:`/${t}`;return n.endsWith(`/`)?n.slice(0,-1):n}async function n2(e){try{return(await e.text()).trim()}catch{return``}}function r2(e){if(s2(e))return e.ncpError;if(a2(e))return e;let t=e instanceof Error?e.message:String(e??`Unknown error`);return{code:l2(void 0),message:t,...e instanceof Error&&e.stack?{details:{stack:e.stack}}:{}}}function i2(e,t={}){return new Q0(e,t.alreadyPublished??!1)}function a2(e){return o2(e)&&typeof e.code==`string`&&typeof e.message==`string`}function o2(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function s2(e){return e instanceof Q0}var c2={"config-error":`config-error`,"auth-error":`auth-error`,"runtime-error":`runtime-error`,"timeout-error":`timeout-error`,"abort-error":`abort-error`};function l2(e){if(!e)return`runtime-error`;let t=c2[e];if(t)return t;let n=e.toLowerCase();return n.includes(`timeout`)?`timeout-error`:n.includes(`abort`)||n.includes(`cancel`)?`abort-error`:n.includes(`auth`)?`auth-error`:n.includes(`config`)?`config-error`:`runtime-error`}function u2(e){let t=f2(e);return!t||typeof t.type!=`string`||!t.type.trim()?null:t}function d2(e){let t=f2(e);if(!t)return{code:`runtime-error`,message:e||`Unknown stream error.`};let n=typeof t.code==`string`?t.code:void 0,r=l2(n),i=o2(t.details)?t.details:{};return n&&n!==r&&(i.originalCode=n),{code:r,message:typeof t.message==`string`&&t.message?t.message:`Unknown stream error.`,...Object.keys(i).length>0?{details:i}:{}}}function f2(e){try{let t=JSON.parse(e);return o2(t)?t:null}catch{return null}}var p2=[`text`,`file`,`source`,`step-start`,`reasoning`,`tool-invocation`,`card`,`rich-text`,`action`,`extension`];function m2(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.trunc(e):null}var h2=class{manifest;baseUrl;basePath;fetchImpl;defaultHeaders;streamOpenTimeoutMs;streamIdleTimeoutMs;subscribers=new Set;activeControllers=new Set;started=!1;constructor(e){let{basePath:t,baseUrl:n,endpointId:r,fetchImpl:i,headers:a,streamIdleTimeoutMs:o,streamOpenTimeoutMs:s}=e;this.baseUrl=$0(n),this.basePath=t2(t),this.fetchImpl=e2(i),this.defaultHeaders=a??{},this.streamOpenTimeoutMs=m2(s),this.streamIdleTimeoutMs=m2(o),this.manifest={endpointKind:`custom`,endpointId:r?.trim()||`ncp-http-agent-client`,version:`0.1.0`,supportsStreaming:!0,supportsAbort:!0,supportsProactiveMessages:!1,supportsLiveSessionStream:!0,supportedPartTypes:p2,expectedLatency:`seconds`,metadata:{transport:`http+sse`,scope:`agent`}}}start=async()=>{this.started||(this.started=!0,this.publish(CK({type:SK.EndpointReady})))};stop=async()=>{if(this.started){this.started=!1;for(let e of this.activeControllers)e.abort();this.activeControllers.clear()}};emit=async e=>{switch(e.type){case`message.request`:await this.send(e.payload);return;case`message.stream-request`:await this.stream(e.payload);return;case`message.abort`:await this.abort(e.payload);return;default:this.publish(e);return}};subscribe=e=>(this.subscribers.add(e),()=>{this.subscribers.delete(e)});send=async e=>{await this.ensureStarted();let t=new AbortController;this.activeControllers.add(t);try{let n=await this.fetchImpl(this.resolveUrl(`/send`),{method:`POST`,headers:{...this.defaultHeaders,accept:`application/json`,"content-type":`application/json`},body:JSON.stringify(e),signal:t.signal});if(!n.ok)throw Error(`NCP send command failed with HTTP ${n.status}: ${await n2(n)}`);let r=await n.json();if(!r.ok||!r.data)throw Error(r.error?.message??`NCP send command returned an invalid handle.`);return r.data}catch(e){if(t.signal.aborted)throw Error(`NCP send command was cancelled.`);if(s2(e))throw e;let n=r2(e);throw this.publish(CK({type:SK.EndpointError,payload:n})),i2(n)}finally{this.activeControllers.delete(t)}};stream=async(e,t)=>{await this.ensureStarted();let n=new URLSearchParams({sessionId:e.sessionId});await this.streamRequest({path:`/stream?${n.toString()}`,method:`GET`},t)};abort=async e=>{await this.ensureStarted();let t=new AbortController;this.activeControllers.add(t);try{let n=await this.fetchImpl(this.resolveUrl(`/abort`),{method:`POST`,headers:{...this.defaultHeaders,"content-type":`application/json`,accept:`application/json`},body:JSON.stringify(e),signal:t.signal});if(!n.ok)throw Error(`Abort request failed with HTTP ${n.status}: ${await n2(n)}`)}catch(e){if(t.signal.aborted)return;let n=r2(e);throw this.publish(CK({type:SK.EndpointError,payload:n})),i2(n)}finally{this.activeControllers.delete(t)}};ensureStarted=async()=>{this.started||await this.start()};publish=e=>{for(let t of this.subscribers)t(e)};resolveUrl=e=>new URL(`${this.basePath}${e}`,this.baseUrl);streamRequest=async(e,t)=>{let{body:n,method:r,path:i}=e,a=new AbortController;this.activeControllers.add(a);let o=null,s=null,c=()=>{o&&=(clearTimeout(o),null)},l=(e,t)=>{c(),e&&(o=setTimeout(()=>{s={code:`timeout-error`,message:t},a.abort(s)},e))};try{l(this.streamOpenTimeoutMs,`NCP stream did not open within ${this.streamOpenTimeoutMs}ms.`);let e=await this.fetchImpl(this.resolveUrl(i),{method:r,headers:{...this.defaultHeaders,accept:`text/event-stream`,...n===void 0?{}:{"content-type":`application/json`}},body:n===void 0?void 0:JSON.stringify(n),signal:a.signal});if(!e.ok)throw Error(`NCP stream request failed with HTTP ${e.status}: ${await n2(e)}`);if(!e.body)throw Error(`NCP stream response has no body.`);t?.onOpen?.(),l(this.streamIdleTimeoutMs,`NCP stream received no data for ${this.streamIdleTimeoutMs}ms.`);for await(let t of Y0(e.body,{onActivity:()=>{l(this.streamIdleTimeoutMs,`NCP stream received no data for ${this.streamIdleTimeoutMs}ms.`)}})){if(a.signal.aborted)return;this.handleSseFrame(t)}}catch(e){if(a.signal.aborted&&!s)return;throw s2(e)?e:i2(s??r2(e))}finally{c(),this.activeControllers.delete(a)}};handleSseFrame=e=>{if(e.event===`ncp-event`){let t=u2(e.data);if(!t){this.publish(CK({type:SK.EndpointError,payload:{code:`runtime-error`,message:`Received malformed ncp-event frame.`}}));return}this.publish(t);return}if(e.event===`error`){let t=d2(e.data);throw this.publish(CK({type:SK.EndpointError,payload:t})),i2(t,{alreadyPublished:!0})}}};function g2(e){return{...e,parts:e.parts.map(e=>e.type===`tool-invocation`?{...e,...e.execution?{execution:{...e.execution}}:{}}:e),lifecycle:e.lifecycle?{...e.lifecycle}:void 0,metadata:e.metadata?{...e.metadata}:void 0}}function _2(e){return g2(OK(e))}var v2=class{execution=null;get isEmpty(){return!this.execution}clear=()=>{this.execution=null};observe=e=>{let t=xK(e.metadata);t&&(!e.runId||e.runId===t.runId)&&(this.execution=structuredClone(t))};take=e=>{let t=this.execution;return this.execution=null,!t||e?.trim()&&t.runId!==e?null:t};attach=(e,t)=>t?{...e,metadata:{...e.metadata??{},[gK]:structuredClone(t)}}:e},y2=`__nextclaw_aborted_tool_call__`;function b2(e,t){switch(t.type){case SK.MessageSent:e.handleMessageSent(t.payload);break;case SK.MessageCompleted:e.handleMessageCompleted(t.payload);break;case SK.MessageAbort:e.handleMessageAbort(t.payload,t.occurredAt);break;case SK.MessageFailed:e.handleMessageFailed(t.payload,t.occurredAt);break;case SK.MessageTextStart:e.handleMessageTextStart(t.payload);break;case SK.MessageTextDelta:e.handleMessageTextDelta(t.payload);break;case SK.MessageTextEnd:e.handleMessageTextEnd(t.payload);break;case SK.MessageReasoningStart:e.handleMessageReasoningStart(t.payload);break;case SK.MessageReasoningDelta:e.handleMessageReasoningDelta(t.payload);break;case SK.MessageReasoningEnd:e.handleMessageReasoningEnd(t.payload);break;case SK.MessageToolCallStart:e.handleMessageToolCallStart(t.payload);break;case SK.MessageToolCallArgs:e.handleMessageToolCallArgs(t.payload);break;case SK.MessageToolCallArgsDelta:e.handleMessageToolCallArgsDelta(t.payload);break;case SK.MessageToolCallEnd:e.handleMessageToolCallEnd(t.payload);break;case SK.MessageToolExecutionStarted:e.handleMessageToolExecutionStarted(t.payload,t.occurredAt);break;case SK.MessageToolCallResult:e.handleMessageToolCallResult(t.payload,t.occurredAt);break;case SK.RunStarted:e.handleRunStarted(t.payload,t.occurredAt);break;case SK.RunFinished:e.handleRunFinished(t.payload,t.occurredAt);break;case SK.RunError:e.handleRunError(t.payload,t.occurredAt);break;case SK.RunMetadata:e.handleRunMetadata(t.payload);break;case SK.ContextWindowUpdated:e.handleContextWindowUpdated(t.payload);break;case SK.EndpointError:e.handleEndpointError(t.payload,t.occurredAt);break;default:break}}function x2(e,t){let n=S2(e?.startedAt),r=S2(e?.endedAt??t),i=e?.durationMs,a=typeof i==`number`&&Number.isFinite(i)&&i>=0?i:void 0;if(!(!n&&!r&&a===void 0))return{...n?{startedAt:n}:{},...r?{endedAt:r}:{},...a===void 0?{}:{durationMs:a}}}function S2(e){if(!e)return;let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():void 0}function C2(e,t){if(!e)return t;if(!t)return e;let n=x2(e),r=x2(t),i=n?.startedAt,a=r?.startedAt,o=i&&a?Date.parse(i)<=Date.parse(a)?i:a:i??a,s=n?.durationMs,c=r?.durationMs,l=s??c,u=s===void 0?c===void 0?n?.endedAt??r?.endedAt:r?.endedAt??n?.endedAt:n?.endedAt??r?.endedAt;return{...o?{startedAt:o}:{},...u?{endedAt:u}:{},...l===void 0?{}:{durationMs:l}}}function w2(e){let t=e.error?.trim();return{code:e.interrupted?`run-interrupted`:`runtime-error`,message:t&&t.length>0?t:`Agent run failed.`,details:{sessionId:e.sessionId,messageId:e.messageId,threadId:e.threadId,runId:e.runId}}}function T2(e){if(!(!e.startedAt&&!e.endedAt))return{startedAt:e.startedAt,endedAt:e.endedAt}}function E2(e,t,n){let r=t===`error`||n?.endedAt?P2(e.parts,n?.endedAt).parts:e.parts;return n?{...e,status:t,parts:r,lifecycle:n}:{...e,status:t,parts:r}}function D2(e,t){let n=Date.parse(t.timestamp);if(!Number.isFinite(n))return e.length;let r=e.findIndex(e=>{let t=Date.parse(e.timestamp);return Number.isFinite(t)&&t>n});return r<0?e.length:r}function O2(e,t){let n=[...e];return n.splice(D2(e,t),0,t),n}function k2(e,t,n){let r=new Set(e.map(e=>e.id));t&&r.add(t.id);let i=e;for(let e of n)r.has(e.id)||(r.add(e.id),i=O2(i,_2(e)));return i}function A2(e,t){return t.trim()?e.id.startsWith(`tool-`)?!0:e.parts.some(e=>e.type===`tool-invocation`):!1}function j2(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n];if(r.type===`tool-invocation`&&r.toolCallId===t)return r}return null}function M2(e,t){return j2(e,t)?.toolName??null}function N2(e,t){let n=[...e];for(let e=n.length-1;e>=0;--e){let r=n[e];if(r.type===`tool-invocation`&&r.toolCallId===t.toolCallId)return n[e]={...r,...t,...r.execution||t.execution?{execution:{...r.execution,...t.execution}}:{}},n}return n.push(t),n}function P2(e,t){let n=[],r=t?Date.parse(t):NaN,i=Number.isFinite(r)?new Date(r).toISOString():void 0;return{parts:e.map(e=>e.type!==`tool-invocation`||!e.toolCallId||e.state===`result`||e.state===`cancelled`?e:(n.push(e.toolCallId),{...e,state:`cancelled`,...e.execution?.startedAt&&!e.execution.endedAt?{execution:{...e.execution,...i?{endedAt:i}:{}}}:{}})),toolCallIds:n}}function F2(e){return e.state===`result`||e.state===`cancelled`||!!e.execution?.endedAt||typeof e.execution?.durationMs==`number`}var I2=class{messageIdByCallId=new Map;argsRawByCallId=new Map;constructor(e){this.port=e}isEmpty=()=>this.messageIdByCallId.size===0&&this.argsRawByCallId.size===0;clear=()=>{this.messageIdByCallId.clear(),this.argsRawByCallId.clear()};hydrate=e=>{this.clear(),e.forEach(e=>{e.parts.forEach(t=>{if(t.type!==`tool-invocation`||!t.toolCallId||t.state===`result`||t.state===`cancelled`)return;let n=typeof t.args==`string`?t.args:JSON.stringify(t.args??{});this.messageIdByCallId.set(t.toolCallId,e.id),this.argsRawByCallId.set(t.toolCallId,n)})})};clearByMessageId=e=>{for(let[t,n]of this.messageIdByCallId)n===e&&(this.messageIdByCallId.delete(t),this.argsRawByCallId.delete(t))};markAborted=e=>{e.forEach(e=>this.argsRawByCallId.set(e,y2))};remapMessageId=(e,t)=>{for(let[n,r]of this.messageIdByCallId)r===e&&this.messageIdByCallId.set(n,t)};handleToolCallStart=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId,e.messageId);this.argsRawByCallId.set(e.toolCallId,``),this.port.replaceStreamingMessage({...t,parts:N2(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:e.toolName,state:`partial-call`,args:``}),status:`streaming`})};handleToolCallArgs=e=>{this.argsRawByCallId.get(e.toolCallId)!==`__nextclaw_aborted_tool_call__`&&(this.argsRawByCallId.set(e.toolCallId,e.args),this.applyToolCallArgs(e.sessionId,e.toolCallId,e.args))};handleToolCallArgsDelta=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=`${this.argsRawByCallId.get(e.toolCallId)??``}${e.delta}`;this.argsRawByCallId.set(e.toolCallId,t),this.applyToolCallArgs(e.sessionId,e.toolCallId,t,e.messageId)};handleToolCallEnd=e=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let t=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId),n=this.argsRawByCallId.get(e.toolCallId)??``;this.port.replaceStreamingMessage({...t,parts:N2(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:M2(t.parts,e.toolCallId)??`unknown`,state:`call`,args:n}),status:`streaming`})};handleToolExecutionStarted=(e,t)=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let n=S2(t);if(!n||this.port.updateMessageContainingToolCall(e.toolCallId,(e,t)=>{if(F2(t))return e.parts;let r=S2(t.execution?.startedAt),i=r&&Date.parse(r)<=Date.parse(n)?r:n;return N2(e.parts,{...t,execution:{...t.execution,startedAt:i}})}))return;let r=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId,e.messageId);this.port.replaceStreamingMessage({...r,parts:N2(r.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:`unknown`,state:`call`,execution:{startedAt:n}}),status:`streaming`})};handleToolCallResult=(e,t)=>{if(this.argsRawByCallId.get(e.toolCallId)===`__nextclaw_aborted_tool_call__`)return;let n=e.final!==!1,r=x2(e.execution,n?t:void 0);if(this.port.updateMessageContainingToolCall(e.toolCallId,(t,i)=>i.state===`cancelled`||!n&&F2(i)?t.parts:N2(t.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:i.toolName,state:n?`result`:`call`,args:i.args,result:e.content,...e.contentItems?{resultContentItems:e.contentItems}:{},...r?{execution:C2(i.execution,r)}:{}})))return;let i=this.resolveToolCallTargetMessage(e.sessionId,e.toolCallId);this.port.replaceStreamingMessage({...i,parts:N2(i.parts,{type:`tool-invocation`,toolCallId:e.toolCallId,toolName:`unknown`,state:n?`result`:`call`,result:e.content,...e.contentItems?{resultContentItems:e.contentItems}:{},...r?{execution:r}:{}}),status:`streaming`})};applyToolCallArgs=(e,t,n,r)=>{let i=this.resolveToolCallTargetMessage(e,t,r),a=M2(i.parts,t)??`unknown`;this.port.replaceStreamingMessage({...i,parts:N2(i.parts,{type:`tool-invocation`,toolCallId:t,toolName:a,state:`partial-call`,args:n}),status:`streaming`})};resolveToolCallTargetMessage=(e,t,n)=>{let r=n?.trim()||this.messageIdByCallId.get(t)||this.port.readStreamingMessageId()||`tool-${t}`;return this.messageIdByCallId.set(t,r),this.port.ensureStreamingMessage(e,r,`streaming`)}},L2=`assistant`,R2=class{messages=[];streamingMessage=null;error=null;activeRun=null;contextWindow=null;listeners=new Set;runExecution=new v2;toolCalls;lastSettledRunId=null;snapshotCache=null;snapshotVersion=-1;stateVersion=0;constructor(){this.toolCalls=new I2({ensureStreamingMessage:this.ensureStreamingMessage,readStreamingMessageId:()=>this.streamingMessage?.id??null,replaceStreamingMessage:this.replaceStreamingMessage,updateMessageContainingToolCall:this.updateMessageContainingToolCall})}getSnapshot=()=>{if(this.snapshotCache&&this.snapshotVersion===this.stateVersion)return this.snapshotCache;let e={messages:this.messages,streamingMessage:this.streamingMessage,error:this.error?{...this.error,details:this.error.details?{...this.error.details}:void 0}:null,activeRun:this.activeRun?{...this.activeRun}:null,contextWindow:this.contextWindow?{...this.contextWindow}:null};return this.snapshotCache=e,this.snapshotVersion=this.stateVersion,e};subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));reset=()=>{this.messages.length===0&&!this.streamingMessage&&!this.error&&!this.activeRun&&this.runExecution.isEmpty&&!this.contextWindow&&this.toolCalls.isEmpty()||(this.messages=[],this.streamingMessage=null,this.error=null,this.activeRun=null,this.runExecution.clear(),this.contextWindow=null,this.toolCalls.clear(),this.lastSettledRunId=null,this.stateVersion+=1,this.notifyListeners())};clearError=()=>{let e=this.stateVersion;this.setError(null),this.stateVersion!==e&&this.notifyListeners()};hydrate=e=>{this.messages=[...new Map(e.messages.map(e=>[e.id,_2(e)])).values()],this.streamingMessage=null,this.error=null,this.contextWindow=e.contextWindow?{...e.contextWindow}:null,this.activeRun=e.activeRun?{...e.activeRun,sessionId:e.activeRun.sessionId??e.sessionId,abortDisabledReason:e.activeRun.abortDisabledReason??null}:null,this.runExecution.clear(),this.toolCalls.hydrate(this.messages),this.lastSettledRunId=null,this.stateVersion+=1,this.notifyListeners()};prependHistory=e=>{let t=k2(this.messages,this.streamingMessage,e);t!==this.messages&&(this.messages=t,this.toolCalls.hydrate(this.messages),this.stateVersion+=1,this.notifyListeners())};dispatch=e=>this.dispatchBatch([e]);dispatchBatch=async e=>{if(!e.length)return;let t=this.stateVersion;e.forEach(e=>b2(this,e)),this.stateVersion!==t&&this.notifyListeners()};handleMessageSent=e=>{this.upsertMessage(e.message),this.setError(null)};handleMessageCompleted=e=>{let t=this.runExecution.take(this.activeRun?.runId),n=this.runExecution.attach(_2({...e.message,status:`final`}),t);if(this.streamingMessage?.id===n.id){this.upsertMessage(n),this.toolCalls.clearByMessageId(n.id);return}this.upsertMessage(n)};handleMessageAbort=(e,t)=>{let n=e.messageId?.trim(),r=this.runExecution.take(e.runId??this.activeRun?.runId);if(this.clearActiveRun(),this.setError(null),this.streamingMessage&&(!n||this.streamingMessage.id===n)){let e=this.streamingMessage.id,{parts:i,toolCallIds:a}=P2(this.streamingMessage.parts,t);this.upsertMessage(this.runExecution.attach({...this.streamingMessage,status:`final`,parts:i},r)),this.replaceStreamingMessage(null),this.toolCalls.clearByMessageId(n||e),this.toolCalls.markAborted(a)}};handleMessageFailed=(e,t)=>{this.streamingMessage&&(!e.messageId||this.streamingMessage.id===e.messageId)&&this.settleStreamingMessage(`error`,t?{endedAt:t}:void 0,this.activeRun?.runId),this.clearActiveRun(),this.setError(e.error)};handleMessageTextStart=e=>{let t=this.streamingMessage?.id===e.messageId,n=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),r=n.parts[n.parts.length-1];t&&r?.type===`text`&&r.text.length>0&&this.replaceStreamingMessage({...n,parts:[...n.parts,{type:`text`,text:``}],status:`streaming`}),this.setError(null)};handleMessageTextDelta=e=>{if(!e.delta)return;let t=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),n=[...t.parts],r=n[n.length-1];r?.type===`text`?n[n.length-1]={type:`text`,text:`${r.text}${e.delta}`}:n.push({type:`text`,text:e.delta}),this.replaceStreamingMessage({...t,parts:n,status:`streaming`})};handleMessageTextEnd=e=>{this.streamingMessage?.id===e.messageId&&this.streamingMessage.status===`streaming`&&this.replaceStreamingMessage({...this.streamingMessage,status:`pending`})};handleMessageReasoningStart=e=>{this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`)};handleMessageReasoningDelta=e=>{if(!e.delta)return;let t=this.ensureStreamingMessage(e.sessionId,e.messageId,`streaming`),n=[...t.parts],r=n[n.length-1];r?.type===`reasoning`?n[n.length-1]={type:`reasoning`,text:`${r.text}${e.delta}`}:n.push({type:`reasoning`,text:e.delta}),this.replaceStreamingMessage({...t,parts:n,status:`streaming`})};handleMessageReasoningEnd=e=>{this.streamingMessage?.id,e.messageId};handleMessageToolCallStart=e=>{this.toolCalls.handleToolCallStart(e),this.setError(null)};handleMessageToolCallArgs=e=>{this.toolCalls.handleToolCallArgs(e)};handleMessageToolCallArgsDelta=e=>{this.toolCalls.handleToolCallArgsDelta(e)};handleMessageToolCallEnd=e=>{this.toolCalls.handleToolCallEnd(e)};handleMessageToolExecutionStarted=(e,t)=>{this.toolCalls.handleToolExecutionStarted(e,t)};handleMessageToolCallResult=(e,t)=>{this.toolCalls.handleToolCallResult(e,t)};handleRunStarted=(e,t)=>{this.isSettledRunId(e.runId)||e.runId&&this.activeRun?.runId===e.runId||(this.streamingMessage&&this.activeRun?.runId!==e.runId&&this.handleMessageAbort({sessionId:this.streamingMessage.sessionId,messageId:this.streamingMessage.id},t),this.runExecution.clear(),this.setError(null),this.activeRun={runId:e.runId??null,sessionId:e.sessionId},this.stateVersion+=1)};handleRunFinished=(e,t)=>{this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.settleStreamingMessage(`final`,T2({...e,endedAt:e.endedAt??t}),e.runId??this.activeRun?.runId),this.setError(null),this.clearActiveRun()};handleRunError=(e,t)=>{this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.settleStreamingMessage(`error`,T2({...e,endedAt:e.endedAt??t}),e.runId??this.activeRun?.runId),this.setError(w2(e)),this.clearActiveRun()};handleRunMetadata=e=>{this.runExecution.observe(e);let t=e.metadata;if(t?.kind===`ready`){let e=t;if(this.isSettledRunId(e.runId))return;this.activeRun={runId:e.runId??this.activeRun?.runId??null,sessionId:e.sessionId??this.activeRun?.sessionId,abortDisabledReason:e.supportsAbort===!1?e.abortDisabledReason??`Unsupported`:null},this.stateVersion+=1}else t?.kind===`final`&&(this.markRunAsSettled(e.runId??this.activeRun?.runId??null),this.clearActiveRun())};handleContextWindowUpdated=e=>{this.contextWindow={...e.contextWindow},this.stateVersion+=1};handleEndpointError=(e,t)=>{if(e.code===`abort-error`){this.handleMessageAbort({sessionId:this.activeRun?.sessionId??this.streamingMessage?.sessionId??``,...this.streamingMessage?.id?{messageId:this.streamingMessage.id}:{}},t);return}this.settleStreamingMessage(`error`,t?{endedAt:t}:void 0),this.clearActiveRun(),this.setError(e)};ensureStreamingMessage=(e,t,n)=>{if(this.streamingMessage?.id===t){if(this.streamingMessage.status===n)return this.streamingMessage;let e={...this.streamingMessage,status:n};return this.replaceStreamingMessage(e),e}let r=this.messages.findIndex(e=>e.id===t);if(r>=0){let t=g2(this.messages[r]),i=[...this.messages];i.splice(r,1),this.messages=i,this.stateVersion+=1;let a={...t,sessionId:e,status:n};return this.replaceStreamingMessage(a),a}let i=this.streamingMessage;if(i&&i.id!==t&&i.sessionId===e&&A2(i,t)){let r={...i,id:t,sessionId:e,status:n};return this.toolCalls.remapMessageId(i.id,t),this.replaceStreamingMessage(r),r}let a={id:t,sessionId:e,role:L2,status:n,parts:[],timestamp:new Date().toISOString()};return this.replaceStreamingMessage(a),a};updateMessageContainingToolCall=(e,t)=>{if(this.streamingMessage){let n=j2(this.streamingMessage.parts,e);if(n){let e=t(this.streamingMessage,n);return this.replaceStreamingMessage({...this.streamingMessage,parts:e}),!0}}for(let n=this.messages.length-1;n>=0;--n){let r=this.messages[n],i=j2(r.parts,e);if(!i)continue;let a=[...this.messages];return a[n]={...r,parts:t(r,i)},this.messages=a,this.stateVersion+=1,!0}return!1};upsertMessage=e=>{let t=_2(e);this.streamingMessage?.id===t.id&&(this.streamingMessage=null);let n=this.messages.findIndex(e=>e.id===t.id);if(n<0){this.messages=O2(this.messages,t),this.stateVersion+=1;return}let r=[...this.messages];r[n]=t,this.messages=r,this.stateVersion+=1};replaceStreamingMessage=e=>{!e&&!this.streamingMessage||(this.streamingMessage=e?_2(e):null,this.stateVersion+=1)};setError=e=>{this.error?.code===e?.code&&this.error?.message===e?.message&&this.error?.details===e?.details&&this.error?.cause===e?.cause||(this.error=e?{...e,details:e.details?{...e.details}:void 0}:null,this.stateVersion+=1)};clearActiveRun=()=>{this.activeRun&&(this.activeRun=null,this.stateVersion+=1)};isSettledRunId=e=>!!e?.trim()&&e===this.lastSettledRunId;markRunAsSettled=e=>{this.lastSettledRunId=e?.trim()||null};settleStreamingMessage=(e,t,n)=>{let r=this.runExecution.take(n);if(!this.streamingMessage)return;let i=this.runExecution.attach(E2(this.streamingMessage,e,t),r);this.upsertMessage(i),this.replaceStreamingMessage(null),this.toolCalls.clearByMessageId(i.id)};notifyListeners=()=>{let e=this.getSnapshot();for(let t of this.listeners)t(e)}},z2=16,B2={code:`abort-error`,message:`User stopped the current run.`,details:{source:`chat-ui`}},V2=class{constructor(e){this.dispatchBatch=e,this.queue=[],this.flushTimerId=null,this.isFlushing=!1,this.isDisposed=!1,this.enqueue=e=>{this.isDisposed||(this.queue.push(e),this.scheduleFlush())},this.dispose=()=>{this.isDisposed=!0,this.flushTimerId!==null&&(window.clearTimeout(this.flushTimerId),this.flushTimerId=null),this.queue.length=0},this.scheduleFlush=()=>{this.flushTimerId!==null||this.isFlushing||this.queue.length===0||(this.flushTimerId=window.setTimeout(()=>{this.flushTimerId=null,this.flush()},z2))},this.flush=async()=>{if(!(this.isDisposed||this.isFlushing||this.queue.length===0)){this.isFlushing=!0;try{for(;this.queue.length>0;){let e=this.queue.splice(0);await this.dispatchBatch(e)}}finally{this.isFlushing=!1,this.scheduleFlush()}}}}};function H2(e,t){if(!t)return!0;let n=`payload`in e?e.payload:null;return!n||typeof n!=`object`||!(`sessionId`in n)||typeof n.sessionId!=`string`?!0:n.sessionId===t}function U2(e){return e.parts.some(e=>e.type===`text`||e.type===`rich-text`||e.type===`reasoning`?e.text.trim().length>0:!0)}function W2(e,t){if(typeof e==`string`){let n=e.trim();return n?{...t?{sessionId:t}:{},message:{id:`user-${Date.now().toString(36)}`,...t?{sessionId:t}:{},role:`user`,status:`final`,parts:[{type:`text`,text:n}],timestamp:new Date().toISOString()}}:null}if(!U2(e.message))return null;let n=e.sessionId||e.message.sessionId||t;return{...e,...n?{sessionId:n}:{},message:{...e.message,...n?{sessionId:n}:{}}}}function G2(e,t){return{...e.message,sessionId:t}}function K2(e){let t=(0,V.useRef)();return t.current?e&&t.current.sessionId===null?t.current.sessionId=e:t.current.sessionId!==(e??null)&&(t.current={sessionId:e??null,manager:new R2}):t.current={sessionId:e??null,manager:new R2},t.current.manager}function q2({sessionId:e,client:t,manager:n}){let r=(0,V.useRef)(e),i=(0,V.useSyncExternalStore)(e=>n.subscribe(()=>e()),()=>n.getSnapshot(),()=>n.getSnapshot()),[a,o]=(0,V.useState)(null),[s,c]=(0,V.useState)(null);(0,V.useEffect)(()=>{r.current=e},[e]),(0,V.useEffect)(()=>{let e=new V2(n.dispatchBatch),i=t.subscribe(t=>{H2(t,r.current)&&e.enqueue(t)});return()=>{i(),e.dispose(),t.stop()}},[t,n]);let l=s&&(!e||s.sessionId===e)&&!i.messages.some(e=>e.id===s.id)?O2(i.messages,s):i.messages,u=i.streamingMessage?O2(l,i.streamingMessage):l,d=i.activeRun?.runId??null,f=!!i.activeRun,p=a===e,m=async(e,t)=>{e.runId!==null&&(n.clearError(),await n.dispatchBatch([...t?[{type:SK.MessageSent,payload:{sessionId:e.sessionId,message:t}}]:[],{type:SK.RunStarted,payload:{sessionId:e.sessionId,runId:e.runId}}]))};return{snapshot:i,visibleMessages:u,activeRunId:d,acceptRun:m,isRunning:f,isSending:p,send:async r=>{if(p)return null;let i=W2(r,e);if(!i)return null;n.clearError(),o(e);let a=i.sessionId?G2(i,i.sessionId):null,s=async()=>{c(null),a&&await n.dispatch({type:SK.MessageSent,payload:{sessionId:a.sessionId,message:{...a,status:`error`}}})};c(f?null:a);try{let e=await t.send(i);return e?(e.runId===null||await m(e,G2(i,e.sessionId)),c(null),e):(await s(),null)}catch(e){throw await s(),e}finally{o(t=>t===e?null:t)}},abort:async()=>{e&&await t.abort({sessionId:e,runId:d??void 0,reason:B2})},streamRun:async()=>{e&&(await t.stop(),await t.stream({sessionId:e}))}}}var J2=500,Y2=1e4,X2=3;function Z2(e){return e instanceof Error?e:Error(String(e))}function Q2(e,t){let n=e.getSnapshot();return n.activeRun?.sessionId===t||n.streamingMessage?.sessionId===t||n.messages.some(e=>e.sessionId===t)}function $2(){return new Promise(e=>window.setTimeout(e,J2))}function e4(e,t,n){let r=e.consecutiveFailures+1;return n(!e.hasHydrated||r>=X2?Z2(t):null),{...e,consecutiveFailures:r}}function t4(e,t,n){return t.stable?(n(null),{...e,consecutiveFailures:0}):e4(e,t.error,n)}function n4(e){return[...e.messages,...e.streamingMessage?[e.streamingMessage]:[]]}function r4(e){let{current:t,messages:n,activeRun:r}=e,i=n4(t);return i.length!==n.length||JSON.stringify(t.activeRun)!==JSON.stringify(r)?!1:i.every((e,t)=>e===n[t]||JSON.stringify(e)===JSON.stringify(n[t]))}async function i4(e){let{loadSeed:t,manager:n,reconcileFrom:r,sessionId:i,signal:a}=e,o=await t(i,a);if(a.aborted)return;let s=n.getSnapshot(),c=!!(r&&s!==r),l=c?a4(o,s):o.messages,u=c?s.activeRun:o.status===`running`?{runId:null,sessionId:i,abortDisabledReason:null}:null;r4({current:s,messages:l,activeRun:u})||n.hydrate({sessionId:i,messages:l,activeRun:u})}function a4(e,t){let n=n4(t),r=new Map(n.map(e=>[e.id,e])),i=e.messages.map(e=>{let t=r.get(e.id);if(!t)return e;r.delete(e.id);let n=e.status===`final`||e.status===`error`,i=t.status===`final`||t.status===`error`;return n&&!i?e:t});for(let n of r.values())(n.status===`final`||n.status===`error`||n.role===`user`||e.status===`running`||t.activeRun)&&i.push(n);return i}async function o4(e){let{client:t,onOpen:n,sessionId:r,signal:i}=e,a=Date.now(),o;try{await t.stream({sessionId:r},{onOpen:n}),o=Error(`Live conversation stream disconnected.`)}catch(e){o=e}return i.aborted?null:{error:o,stable:Date.now()-a>=Y2}}async function s4(e,t,n){t.reset(),n(null),await e.stop()}function c4({sessionId:e,client:t,loadSeed:n}){let r=K2(e),i=q2({sessionId:e,client:t,manager:r}),[a,o]=(0,V.useState)({sessionId:null,error:null});(0,V.useEffect)(()=>{let i=new AbortController,{signal:a}=i,s=t=>{o({sessionId:e??null,error:t})};return(async()=>{if(!e){await s4(t,r,s);return}let i=!Q2(r,e),c={consecutiveFailures:0,hasHydrated:!i};for(i?(r.reset(),o({sessionId:null,error:null})):s(null),await t.stop();!a.aborted;){if(i)try{if(await i4({loadSeed:n,manager:r,sessionId:e,signal:a}),a.aborted)return;s(null),c={...c,hasHydrated:!0},i=!1}catch(e){if(a.aborted)return;c=e4(c,e,s),await $2();continue}let o=Promise.resolve(),l=await o4({client:t,sessionId:e,signal:a,onOpen:()=>{o=i4({loadSeed:n,manager:r,reconcileFrom:r.getSnapshot(),sessionId:e,signal:a}).then(()=>{a.aborted||(s(null),c={...c,hasHydrated:!0})}).catch(e=>{a.aborted||(c=e4(c,e,s))})}});if(await o,!l)return;c=t4(c,l,s),i=!0,await $2()}})().catch(e=>{a.aborted||s(Z2(e))}),()=>{i.abort()}},[t,n,r,e]);let s=(0,V.useCallback)(e=>r.prependHistory(e),[r]),c=(0,V.useCallback)(t=>{e&&r.hydrate({sessionId:e,messages:t.messages,activeRun:t.status===`running`?{runId:null,sessionId:e,abortDisabledReason:null}:null})},[r,e]);return{...i,isHydrating:!!(e&&a.sessionId!==e),hydrateError:a.error,prependHistory:s,replaceHistory:c}}var l4=200*1024*1024,u4=`application/octet-stream`;function d4(e){let t=e.type.trim().toLowerCase();return t.length>0?t:u4}function f4(e,t){let n=t.acceptedMimeTypes&&t.acceptedMimeTypes.length>0?new Set(t.acceptedMimeTypes.map(e=>e.trim().toLowerCase())):null,r=t.maxBytes??209715200,i=d4(e);return n&&!n.has(i)?{ok:!1,rejected:{fileName:e.name,mimeType:i,sizeBytes:e.size,reason:`unsupported-type`}}:e.size>r?{ok:!1,rejected:{fileName:e.name,mimeType:i,sizeBytes:e.size,reason:`too-large`}}:{ok:!0,mimeType:i}}function p4(e){let t=e.parts&&e.parts.length>0?e.parts.map(e=>structuredClone(e)):[...e.text?.trim()??``?[{type:`text`,text:e.text.trim()}]:[],...(e.attachments??[]).map(e=>({type:`file`,name:e.name,mimeType:e.mimeType,...e.assetUri?.trim()?{assetUri:e.assetUri.trim()}:{},...e.url?.trim()?{url:e.url.trim()}:{},...e.contentBase64?.trim()?{contentBase64:e.contentBase64.trim()}:{},sizeBytes:e.sizeBytes}))];if(t.length===0)return null;let n=e.timestamp??new Date().toISOString(),r=e.messageId??`user-${Date.now().toString(36)}`;return{...e.sessionId?{sessionId:e.sessionId}:{},message:{id:r,...e.sessionId?{sessionId:e.sessionId}:{},role:`user`,status:`final`,parts:t,timestamp:n,...e.metadata?{metadata:e.metadata}:{}},...e.metadata?{metadata:e.metadata}:{}}}async function m4(e,t){let n=[],r=[];for(let i of e){let e=f4(i,t);if(!e.ok){r.push(e.rejected);continue}n.push(i)}if(n.length===0)return{attachments:[],rejected:r};try{return{attachments:await t.uploadBatch(n),rejected:r}}catch{return r.push(...n.map(e=>({fileName:e.name,mimeType:d4(e),sizeBytes:e.size,reason:`read-failed`}))),{attachments:[],rejected:r}}}function h4(e){return typeof e==`string`?e:e instanceof URL?e.toString():e.url}function g4(e){if(e instanceof Error){let t=e.name?.trim(),n=e.message?.trim();return t&&n?`${t}: ${n}`:n||t||`Unknown Error`}return String(e??`Unknown error`)}function _4(e,t){let n=Error(e);return t!==void 0&&(n.cause=t),n}function v4(){return async(e,t)=>{try{return await fetch(e,{credentials:`include`,...t})}catch(n){throw ct.reportTransportFailure(g4(n)),_4(`NCP fetch failed for ${(t?.method||`GET`).toUpperCase()} ${h4(e)}: ${g4(n)}`,n)}}}function y4(e){return e instanceof Error&&e.message.includes(`ncp session not found:`)}function b4(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}async function x4(e,t){return t.throwIfAborted(),await new Promise((n,r)=>{let i=()=>r(new DOMException(`Aborted`,`AbortError`));t.addEventListener(`abort`,i,{once:!0}),e.then(n,r).finally(()=>{t.removeEventListener(`abort`,i)})})}async function S4(e){let{messageLimit:t,sessionId:n,signal:r}=e,i=window.__NEXTCLAW_INITIAL_SESSION_MESSAGES_PREFETCH__;if(!i||i.consumed||i.sessionId!==n||i.limit!==t)return null;i.consumed=!0;let a=await x4(i.promise,r);if(r.throwIfAborted(),!a?.responseOk||!b4(a.payload))return null;let{payload:o}=a;if(o.ok!==!0||!b4(o.data))return null;let{data:s}=o;return s.sessionId!==n||!Array.isArray(s.messages)||!b4(s.pageInfo)?null:s}async function C4(e,t,n=20,r=`compact`){t.throwIfAborted();try{let i=(r===`compact`?await S4({sessionId:e,messageLimit:n,signal:t}):null)??await Ge(e,{limit:n,toolPayload:`summary`,initialPayload:r===`compact`?`compact`:void 0,signal:t});return t.throwIfAborted(),{messages:i.messages,status:i.status??`idle`,contextWindow:i.contextWindow??null,deferredToolPayloads:i.deferredToolPayloads??{},total:i.total,pageInfo:i.pageInfo}}catch(e){if(t.throwIfAborted(),!y4(e))throw e;return{messages:[],status:`idle`,total:0,deferredToolPayloads:{},pageInfo:{startCursor:null,hasPreviousPage:!1}}}}function w4(e){let{hydrationRetryVersion:t,messageLimit:n,onSeedLoaded:r}=e,i=(0,V.useRef)(new Set);return(0,V.useCallback)(async(e,t)=>{let a=await C4(e,t,n,i.current.has(e)?`standard`:`compact`);return t.aborted||(i.current.add(e),r(e,a)),{messages:a.messages,status:a.status}},[t,n,r])}var T4={sessionId:null,contextWindow:null,total:0,cursor:null,hasPreviousPage:!1,isLoading:!1,error:null,deferredToolPayloads:{},messageDetails:{},messageDetailStates:{}};function E4(e){let{historyStateRef:t,sessionId:n,updateHistoryState:r}=e,i=(0,V.useRef)(new Map);return(0,V.useEffect)(()=>{let e=i.current;for(let t of e.values())t.controller.abort();return e.clear(),()=>{for(let t of e.values())t.controller.abort();e.clear()}},[n]),(0,V.useCallback)(async e=>{if(!n)return;let a=t.current;if(a.sessionId!==n||a.messageDetails[e])return;let o=a.deferredToolPayloads[e]?.cursor;if(!o)return;let s=i.current.get(e);if(s)return await s.promise;let c=new AbortController;r(n,t=>({...t,messageDetailStates:{...t.messageDetailStates,[e]:`loading`}}));let l=(async()=>{try{let t=await He(n,e,o,c.signal);if(c.signal.aborted)return;r(n,n=>({...n,messageDetails:{...n.messageDetails,[e]:t},messageDetailStates:{...n.messageDetailStates,[e]:`ready`}}))}catch{if(c.signal.aborted)return;r(n,t=>({...t,messageDetailStates:{...t.messageDetailStates,[e]:`error`}}))}finally{i.current.get(e)?.controller===c&&i.current.delete(e)}})();i.current.set(e,{controller:c,promise:l}),await l},[t,n,r])}function D4(e){let{hydrationRetryVersion:t,messageLimit:n,sessionId:r}=e,[i,a]=(0,V.useState)(T4),o=(0,V.useRef)(T4),s=(0,V.useRef)(null),c=(0,V.useCallback)((e,t)=>{let n=t(o.current.sessionId===e?o.current:{...T4,sessionId:e});o.current=n,a(n)},[]);(0,V.useEffect)(()=>(s.current?.abort(),s.current=null,()=>{s.current?.abort()}),[r]);let l=E4({historyStateRef:o,sessionId:r,updateHistoryState:c});return{loadSeed:w4({hydrationRetryVersion:t,messageLimit:n,onSeedLoaded:(0,V.useCallback)((e,t)=>{c(e,e=>({...e,contextWindow:t.contextWindow??null,deferredToolPayloads:t.deferredToolPayloads,messageDetails:{},messageDetailStates:Object.fromEntries(Object.keys(t.deferredToolPayloads).map(e=>[e,`summary`])),total:t.total,cursor:t.pageInfo.startCursor,hasPreviousPage:t.pageInfo.hasPreviousPage,error:null}))},[c])}),loadPreviousMessages:(0,V.useCallback)(async e=>{let t=o.current;if(!r||t.sessionId!==r||!t.hasPreviousPage||!t.cursor||s.current)return;let i=new AbortController;s.current=i,c(r,e=>({...e,isLoading:!0,error:null}));try{let a=await Ge(r,{limit:n,cursor:t.cursor,toolPayload:`summary`,signal:i.signal});if(i.signal.aborted||s.current!==i)return;e(a.messages),c(r,e=>({...e,contextWindow:a.contextWindow??e.contextWindow,deferredToolPayloads:{...e.deferredToolPayloads,...a.deferredToolPayloads??{}},messageDetailStates:{...Object.fromEntries(Object.keys(a.deferredToolPayloads??{}).map(e=>[e,`summary`])),...e.messageDetailStates},total:a.total,cursor:a.pageInfo.startCursor,hasPreviousPage:a.pageInfo.hasPreviousPage}))}catch(e){i.signal.aborted||c(r,t=>({...t,error:e instanceof Error?e:Error(String(e))}))}finally{s.current===i&&(s.current=null,c(r,e=>({...e,isLoading:!1})))}},[n,r,c]),loadMessageDetails:l,state:i.sessionId===r?i:T4}}var O4=`ncp agent unavailable during startup`,k4=15e3,A4=7e4;function j4(e){return e?.trim().toLowerCase().includes(O4)??!1}function M4(){return new h2({baseUrl:ye,basePath:`/api/ncp/agent`,fetchImpl:v4(),streamOpenTimeoutMs:k4,streamIdleTimeoutMs:A4})}function N4(e,t){let n=(0,V.useRef)(null),r=(0,V.useCallback)(e=>{if(!e){n.current=null;return}n.current!==e&&(n.current=e,t())},[t]);(0,V.useEffect)(()=>{r(e)},[e,r])}function P4(e,t){return e.map(e=>{let n=t[e.id];return n?!e.metadata&&!n.metadata?n:{...n,metadata:{...e.metadata??{},...n.metadata??{}}}:e})}function F4(e,t={}){let[n]=(0,V.useState)(()=>M4()),r=ot(),[i,a]=(0,V.useState)(0),[o,s]=(0,V.useState)(null),c=(0,V.useRef)(null),{loadSeed:l,loadMessageDetails:u,loadPreviousMessages:d,state:f}=D4({sessionId:e,messageLimit:t.messageLimit??20,hydrationRetryVersion:i}),p=c4({sessionId:e,client:n,loadSeed:l}),{acceptRun:m}=p,h=(0,V.useCallback)(async(e,t)=>{if(c.current)throw Error(`A session command is already in progress.`);c.current=e,s(e);try{let e=await t();return await m(e),e}finally{c.current===e&&(c.current=null),s(t=>t===e?null:t)}},[m]),g=(0,V.useCallback)(async e=>await h(e.sessionId,async()=>{let t={messages:p.visibleMessages,status:p.isRunning?`running`:`idle`},n=p.visibleMessages.findIndex(t=>t.id===e.messageId);if(n<0)throw Error(`The message being edited is no longer in the current session history.`);p.replaceHistory({messages:[...p.visibleMessages.slice(0,n),{...e.message,sessionId:e.sessionId}],status:`idle`});try{return await I.agentRuns.editMessage(e)}catch(n){p.replaceHistory(t);try{let t=new AbortController;p.replaceHistory(await l(e.sessionId,t.signal))}catch{}throw n}}),[p,h,l]),_=(0,V.useCallback)(async e=>await h(e.sessionId,()=>I.agentRuns.continue(e)),[h]),v=(0,V.useCallback)(async()=>await d(p.prependHistory),[p.prependHistory,d]),y=p.hydrateError?.message??p.snapshot.error?.message??null;N4(e&&r.phase===`ready`&&j4(y)?`${e}:${r.lastReadyAt??0}`:null,()=>{a(e=>e+1)});let b=(0,V.useMemo)(()=>P4(p.visibleMessages,f.messageDetails),[p.visibleMessages,f.messageDetails]);return(0,V.useMemo)(()=>({...p,visibleMessages:b,isSending:p.isSending||o===e,editMessage:g,continueRun:_,snapshot:{...p.snapshot,contextWindow:p.snapshot.contextWindow??f.contextWindow},hasPreviousMessages:f.hasPreviousPage,historyError:f.error,isLoadingPreviousMessages:f.isLoading,loadPreviousMessages:v,loadMessageDetails:u,messageDetailStates:f.messageDetailStates,messageTotal:f.total}),[p,_,g,u,v,o,e,f,b])}function I4(e){return e.bootstrapStatus?.ncpAgent.state!==`ready`}function L4(e){return e.activeSystemAction?.message?.trim()||(e.lifecyclePhase===`cold-starting`?b(`chatRuntimeInitializing`):e.lifecyclePhase===`startup-failed`?e.bootstrapStatus?.ncpAgent.error?.trim()||e.bootstrapStatus?.lastError?.trim()||e.lastError?.trim()||b(`chatRuntimeInitializationFailed`):null)}function R4(e){let{message:t,status:n}=e,r=t?.trim();if(!r)return L4(n);let i=n.activeSystemAction?.message?.trim();if(n.phase===`service-transitioning`&&i)return i;let a=Xe(r);return n.phase===`recovering`&&a?b(`runtimeControlRecoveringHelp`):n.phase===`stalled`&&a?null:r}function z4(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function B4(e){if(!e||e.completeInputBudget!==!0||!e.fixedInputTokens||e.totalContextTokens<=0)return null;let t=e.triggerContextTokens??e.totalContextTokens,n=e.usedContextTokens/Math.max(1,t),r=Math.max(0,Math.min(1,n)),i=`${Math.round(r*100)}%`,a=r>=.9?`danger`:r>=.75?`warning`:`neutral`,o=[{label:b(`chatContextWindowUsed`),value:z4(e.usedContextTokens)}];return e.triggerContextTokens!==void 0&&o.push({label:b(`chatContextWindowTrigger`),value:z4(e.triggerContextTokens)}),o.push(e.availableBeforeCompactionTokens===void 0?{label:b(`chatContextWindowAvailable`),value:z4(e.availableContextTokens)}:{label:b(`chatContextWindowAvailableBeforeCompaction`),value:z4(e.availableBeforeCompactionTokens)}),e.fixedInputTokens!==void 0&&o.push({label:b(`chatContextWindowFixed`),value:z4(e.fixedInputTokens),dividerBefore:!0}),e.dynamicInputTokens!==void 0&&o.push({label:b(`chatContextWindowDynamic`),value:z4(e.dynamicInputTokens)}),e.reservedContextTokens!==void 0&&o.push({label:b(`chatContextWindowReserve`),value:z4(e.reservedContextTokens)}),o.push({label:b(`chatContextWindowTotal`),value:z4(e.totalContextTokens)}),e.prunedUsedContextTokens!==e.usedContextTokens&&o.push({label:b(`chatContextWindowPruned`),value:z4(e.prunedUsedContextTokens)}),e.droppedHistoryCount>0&&o.push({label:b(`chatContextWindowDroppedHistory`),value:String(e.droppedHistoryCount)}),e.truncatedToolResultCount>0&&o.push({label:b(`chatContextWindowTruncatedTools`),value:String(e.truncatedToolResultCount)}),{label:b(`chatContextWindow`),percentLabel:i,ratio:r,tone:a,details:o}}var V4=_r(`18rem`);function H4({agents:e,selectedAgent:t,selectedAgentId:n,onSelectAgent:r}){return(0,H.jsxs)(xr,{value:n,onValueChange:r,children:[(0,H.jsxs)(pr,{"aria-label":b(`chatDraftAgentTitle`),className:`h-auto w-auto min-w-0 gap-1 rounded-lg border-0 bg-transparent px-2 py-1.5 text-muted-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus:ring-0`,children:[(0,H.jsx)(`span`,{className:`sr-only`,children:b(`chatDraftAgentTitle`)}),(0,H.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(dz,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-5 w-5 shrink-0`}),(0,H.jsx)(`span`,{className:`max-w-28 truncate text-sm font-medium`,children:t.displayName?.trim()||t.id})]}):null})]}),(0,H.jsx)(gr,{className:`rounded-xl border-border shadow-lg`,style:{maxHeight:V4},children:e.map(e=>(0,H.jsx)(yr,{value:e.id,className:`rounded-lg pr-10`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(dz,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-5 w-5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.displayName?.trim()||e.id})]})},e.id))})]})}var U4=[{labelKey:`chatWelcomeSuggestion1Label`,promptKey:`chatWelcomeSuggestion1Prompt`},{labelKey:`chatWelcomeSuggestion2Label`,promptKey:`chatWelcomeSuggestion2Prompt`},{labelKey:`chatWelcomeSuggestion3Label`,promptKey:`chatWelcomeSuggestion3Prompt`}];function W4({onSelectPrompt:e}){return(0,H.jsx)(`div`,{className:`mt-5 flex flex-wrap justify-center gap-2`,children:U4.map(t=>(0,H.jsx)(`button`,{type:`button`,onClick:()=>e(b(t.promptKey)),className:`rounded-full bg-muted/55 px-3.5 py-2 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,children:b(t.labelKey)},t.labelKey))})}var G4=SF(`20rem`);function K4({isSaving:e,projectOptions:t,projectRoot:n,selectable:r,onOpenProjectDialog:i,onSelectProjectRoot:a}){let[o,s]=(0,V.useState)(!1),c=hI(n)??b(`chatWelcomeProjectPickerPlaceholder`),l=async e=>{s(!1),await a(e)};return(0,H.jsxs)(wF,{open:o,onOpenChange:s,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,title:n??void 0,"aria-label":b(`chatWelcomeProjectPickerLabel`),disabled:!r||e,children:[(0,H.jsx)(Ba,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:c}),(0,H.jsx)($n,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,H.jsxs)(DF,{align:`start`,className:`flex w-[min(20rem,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border border-border bg-popover p-0 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,style:{maxHeight:G4},children:[(0,H.jsx)(`div`,{className:`shrink-0 px-3 pb-2 pt-3 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:b(`chatWelcomeProjectRecentTitle`)}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-1.5 pb-1.5`,children:t.length>0?t.map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-start gap-2 rounded-xl px-2 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)]`,title:e.projectRoot,onClick:()=>{l(e.isDefault?null:e.projectRoot)},children:[(0,H.jsx)(Ba,{className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`truncate text-[13px] font-semibold text-foreground`,children:e.projectName}),e.isDefault?(0,H.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:b(`chatWelcomeProjectDefaultBadge`)}):null]}),(0,H.jsx)(`span`,{className:`block truncate text-[11px] leading-4 text-muted-foreground`,children:e.projectRoot})]}),e.sessionCount>0?(0,H.jsx)(`span`,{className:`mt-0.5 shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground`,children:e.sessionCount}):null]},e.projectRoot)):(0,H.jsx)(`div`,{className:`px-2 py-5 text-center text-xs text-muted-foreground`,children:b(`chatWelcomeProjectNoRecent`)})}),(0,H.jsx)(`div`,{className:`shrink-0 border-t border-border p-1.5`,children:(0,H.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-xl px-2.5 py-2 text-left text-[13px] font-semibold text-foreground transition-colors hover:bg-[var(--interaction-hover)]`,onClick:()=>{s(!1),i()},children:[(0,H.jsx)(Ba,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,H.jsx)(`span`,{children:b(`chatWelcomeProjectOpenFolder`)})]})})]})]})}function q4(e){let{disabled:t=!1,option:n,onSelect:r,selected:i=!1}=e,a=n.ready===!1?n.reasonMessage?.trim()||b(`statusSetup`):null;return(0,H.jsx)(`button`,{type:`button`,"aria-pressed":i,disabled:t,onClick:r,className:u(`w-full rounded-2xl px-3 py-2.5 text-left transition-colors`,i?`bg-gray-50`:`hover:bg-gray-50`,t?`cursor-not-allowed opacity-70`:null),children:(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2.5`,children:[n.icon?.src?(0,H.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center pt-0.5`,children:(0,H.jsx)(KL,{icon:{kind:`runtime-image`,src:n.icon.src,alt:n.icon.alt??null,name:n.label}})}):(0,H.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center pt-0.5 text-muted-foreground`,children:(0,H.jsx)(Zi,{className:`h-4 w-4`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsx)(`div`,{className:`truncate text-[13px] font-semibold text-gray-900`,children:n.label}),(0,H.jsx)(Yo,{status:n.ready===!1?`warning`:`ready`,label:n.ready===!1?b(`statusSetup`):b(`statusReady`),className:`bg-transparent px-0`})]}),a?(0,H.jsx)(`div`,{className:`mt-1 pr-4 text-[11px] leading-4 text-gray-500`,children:a}):null]})]}),i?(0,H.jsx)(wr,{className:`mt-1 h-3.5 w-3.5 shrink-0 text-primary`}):null]})})}var J4=SF(`18rem`);function Y4({options:e,selectedSessionType:t,onSelectSessionType:n}){let[r,i]=(0,V.useState)(!1),a=e.find(e=>e.value===t)??e[0]??null;return a?(0,H.jsxs)(wF,{open:r,onOpenChange:i,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-label":b(`chatWelcomeSessionTypePickerLabel`),children:[a.icon?.src?(0,H.jsx)(KL,{icon:{kind:`runtime-image`,src:a.icon.src,alt:a.icon.alt??null,name:a.label},className:`h-4 w-4`}):(0,H.jsx)(Zi,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:a.label}),(0,H.jsx)($n,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/70`})]})}),(0,H.jsx)(DF,{align:`start`,className:`flex w-[min(16rem,calc(100vw-1rem))] flex-col overflow-hidden rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,style:{maxHeight:J4},children:(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.map(e=>(0,H.jsx)(q4,{option:e,onSelect:()=>{n(e.value),i(!1)}},e.value))})})]}):null}function X4({agents:e,defaultProjectRoot:t,inputSlot:n,projectOptions:r,selectedAgentId:i,selectedProjectRoot:a,selectedSessionType:o,sessionTypeOptions:s,onSelectAgent:c,onSelectPrompt:l,onSelectProjectRoot:u,onSelectSessionType:d}){let f=e.find(e=>e.id===i)??null,[p,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(!1),_=a??t??null,v=async e=>{if(u){g(!0);try{await u(e),m(!1)}finally{g(!1)}}},y=!!u;return(0,H.jsxs)(`div`,{className:`flex min-h-full items-center justify-center px-4 py-10 sm:p-8`,children:[(0,H.jsxs)(`div`,{className:`w-full min-w-0 max-w-[min(680px,100%)]`,children:[(0,H.jsx)(`div`,{className:`text-center`,children:(0,H.jsx)(`h2`,{className:`text-2xl font-semibold leading-tight text-foreground sm:text-[2rem]`,children:b(`chatWelcomeTitle`)})}),n?(0,H.jsx)(`div`,{className:`mt-6`,children:n}):null,(0,H.jsx)(`div`,{className:`mt-2 flex justify-center px-1`,children:(0,H.jsxs)(`div`,{role:`group`,"aria-label":b(`chatWelcomeContextLabel`),className:`flex min-w-0 max-w-full flex-wrap items-center justify-center gap-0.5 rounded-xl bg-muted/40 p-1 text-sm text-muted-foreground`,children:[u?(0,H.jsx)(K4,{isSaving:h,projectOptions:r,projectRoot:_,selectable:y,onOpenProjectDialog:()=>m(!0),onSelectProjectRoot:v}):null,(0,H.jsx)(H4,{agents:e,selectedAgent:f,selectedAgentId:i,onSelectAgent:c}),(0,H.jsx)(Y4,{options:s,selectedSessionType:o,onSelectSessionType:d})]})}),(0,H.jsx)(W4,{onSelectPrompt:l})]}),u?(0,H.jsx)(JF,{open:p,currentProjectRoot:_,defaultWorkspacePath:t,isSaving:h,onOpenChange:m,onSave:v}):null]})}function Z4(e){let{agents:t,fallbackAgentId:n}=e;return(t?.length??0)>0?t??[]:[{id:n}]}function Q4(e){return e.agents.find(t=>t.id===e.agentId)??null}function $4(e,t){if(typeof e!=`string`||e.trim().length===0)return null;let n=EL(e);return t.some(e=>e.value===n)?n:null}function e3(e){let{agentId:t,agents:n,defaultSessionType:r,pendingSessionType:i,selectedSessionType:a,sessionTypeOptions:o}=e;return($4(a,o)??$4(i,o))||((n&&t?$4(DL(Q4({agents:n,agentId:t}),r),o):null)??$4(r,o)??o[0]?.value??EL(r))}function t3(e){return new Date(e.lastMessageAt??e.createdAt).getTime()}function n3(e){let{defaultProjectRoot:t,projects:n=[],sessionSummaries:r}=e,i=new Map;for(let e of n)e.rootPath!==t&&i.set(e.rootPath,{projectRoot:e.rootPath,projectName:e.name,sessionCount:0,isDefault:!1,latestUpdatedAt:new Date(e.updatedAt).getTime()});for(let e of JI([...r])){let n=e.projectRoot?.trim();if(!n||n===t)continue;let r=i.get(n),a=t3(e);if(r){r.sessionCount+=1,r.latestUpdatedAt=Math.max(r.latestUpdatedAt,a);continue}i.set(n,{projectRoot:n,projectName:e.projectName?.trim()||hI(n)||n,sessionCount:1,isDefault:!1,latestUpdatedAt:a})}return t&&i.set(t,{projectRoot:t,projectName:hI(t)||t,sessionCount:0,isDefault:!0,latestUpdatedAt:1/0}),[...i.values()].sort((e,t)=>t.latestUpdatedAt-e.latestUpdatedAt).map(({latestUpdatedAt:e,...t})=>t)}var r3=[];function i3({inputSlot:e,pendingProjectRoot:t,pendingSessionType:n,selectedSessionTypeValue:r,onSelectProjectRoot:i,onSelectPrompt:a,onSelectSessionType:o}){let s=tI(),c=oL(e=>e.snapshot.selectedAgentId),l=$(e=>e.snapshot),u=eR(e=>e.snapshot.configQuery?.data??null),d=eR(e=>e.snapshot.sessionsQuery?.data?.sessions??r3),f=eR(e=>e.snapshot.sessionTypesQuery?.data??null),p=fz(),m=nR(),h=l.agentId??c,g=Z4({agents:p.data?.agents,fallbackAgentId:h}),_=mI(u?.agents.defaults.workspace),v=mI(t),y=kL(f?.options??[]),b=EL(f?.defaultType??`native`),x=e3({defaultSessionType:b,pendingSessionType:n,selectedSessionType:r,sessionTypeOptions:y}),S=n3({defaultProjectRoot:_,projects:m.data?.projects??[],sessionSummaries:d});return(0,H.jsx)(X4,{agents:g,defaultProjectRoot:_,inputSlot:e,projectOptions:S,selectedAgentId:h,selectedProjectRoot:v,selectedSessionType:x,sessionTypeOptions:y,onSelectAgent:e=>{s.chatSessionListManager.setSelectedAgentId(e),o(e3({agents:g,agentId:e,defaultSessionType:b,pendingSessionType:null,selectedSessionType:null,sessionTypeOptions:y}))},onSelectPrompt:a,onSelectProjectRoot:i,onSelectSessionType:o})}function a3(e){return e.modelOptions.length>0}function o3(e){return!e.isProviderStateResolved&&!a3(e)}function s3(e){return e.isProviderStateResolved&&!a3(e)}function c3(e){return!1}function l3(e){let{hasSendableDraft:t,isRuntimeBlocked:n}=e;return n||!t}function u3(e){return{...e.metadata,...e.message.metadata}}function d3(e){let t=SW(u3(e)),n=e.message.parts.flatMap(e=>e.type===`text`||e.type===`rich-text`||e.type===`reasoning`?[e.text]:[]).join(` `);return t.reduce((e,t)=>e.split(t.rawText).join(``),n).replace(/\s+/g,` `).trim()}function f3(e){if(!e.mimeType?.startsWith(`image/`))return;let t=e.url?.trim();if(t)return t;let n=e.contentBase64?.trim();if(n)return`data:${e.mimeType};base64,${n}`;let r=e.assetUri?.trim();return r?Se(r):void 0}function p3(e){return{attachments:e.message.parts.flatMap((e,t)=>{if(e.type!==`file`)return[];let n=e.mimeType??`application/octet-stream`,r=f3(e);return[{mimeType:n,name:e.name?.trim()||`attachment-${t+1}`,...r?{previewUrl:r}:{}}]}),preview:d3(e)}}function m3(e,t){return j0({attachmentIdPrefix:`queued-attachment-${e.id}`,availableSkills:t,message:e.message,metadata:u3(e)})}function h3(e){let t=e.sessionId?.trim();if(!t)return null;let n={id:`submitting-${e.message.id}`,sessionId:t,enqueuedAt:new Date().toISOString(),message:{...e.message,sessionId:t},metadata:structuredClone(e.metadata??{})},r=p3(n);return{attachments:r.attachments,id:n.id,preview:r.preview,sessionId:t,userMessageId:n.message.id}}function g3(e,t){let[n,r]=(0,V.useState)(null),i=(0,V.useCallback)(e=>{let t=h3(e);return t&&r(t),t},[]);return{clearSubmittingInput:(0,V.useCallback)(e=>{r(t=>t?.userMessageId===e.userMessageId?null:t)},[]),queuedInputs:(0,V.useMemo)(()=>{let r=e.map(e=>({...p3(e),id:e.id}));return n?.sessionId===t&&!e.some(e=>e.message.id===n.userMessageId)&&r.push({attachments:n.attachments,id:n.id,isSubmitting:!0,preview:n.preview}),r},[e,t,n]),stageSubmittingInput:i}}function _3(e){let{availableSkills:t,hasComposerContent:n,restoreComposer:r,runQueue:i,setSendError:a}=e,o=(0,V.useCallback)(e=>{if(n){a(b(`chatQueuedEditComposerNotEmpty`));return}i.inputs.some(t=>t.id===e)&&i.removeQueuedInput(e).then(e=>{e&&(r(m3(e,t)),a(null))}).catch(e=>{a(e instanceof Error?e.message:String(e))})},[t,n,r,i,a]);return{deleteQueuedInput:(0,V.useCallback)(e=>{i.removeQueuedInput(e).then(()=>a(null)).catch(e=>{a(e instanceof Error?e.message:String(e))})},[i,a]),editQueuedInput:o,steerQueuedInput:(0,V.useCallback)(e=>{i.steerQueuedInput(e).then(e=>{e&&a(null)}).catch(e=>{a(e instanceof Error?e.message:String(e))})},[i,a])}}function v3({agent:e,sessionKey:t,setSendError:n}){return{continueRun:(0,V.useCallback)(async()=>{if(!(!t||e.isSending||e.isRunning)){n(null);try{await e.continueRun({sessionId:t})}catch(e){throw n(e instanceof Error?e.message:String(e)),e}}},[e,t,n]),editMessage:(0,V.useCallback)(async r=>{if(!(!t||e.isSending||e.isRunning)){n(null);try{await e.editMessage({message:r.message,messageId:r.messageId,sessionId:t})}catch(e){throw n(e instanceof Error?e.message:String(e)),e}}},[e,t,n])}}var y3=e=>e.some(e=>e.type!==`text`||e.text.trim().length>0),b3=e=>e?.trim()||void 0;function x3(e){return{isProviderStateResolved:e.isProviderStateResolved,modelOptions:e.modelOptions,sessionTypeUnavailable:e.sessionTypeState.sessionTypeUnavailable}}function S3(e){let{agentIsSending:t,composerSnapshot:n,inputQuery:r,inputSnapshot:i,isRuntimeBlocked:a,materializationContext:o,selectedAgentId:s,sessionKey:c}=e,l=n??{text:i.text,nodes:[...i.nodes],selectedSkills:[...i.selectedSkills],skillRecords:[...i.skillRecords],attachments:[...i.attachments]},u=S0([...l.nodes],l.attachments);return l3({snapshot:x3(r),hasSendableDraft:y3(u),isRuntimeBlocked:a})||t?null:{composerSnapshot:l,metadata:T0({agentId:o?void 0:r.selectedSession?.agentId?.trim()||s,model:b3(o?i.selectedModel:i.selectedModel??r.fallbackPreferredModel??r.defaultModel),thinkingLevel:o?i.selectedThinkingLevel??void 0:i.selectedThinkingLevel??r.fallbackPreferredThinking??void 0,sessionType:o?void 0:r.sessionTypeState.selectedSessionType,projectRoot:o?i.pendingProjectRoot:c?r.selectedSession?.projectRoot??null:i.pendingProjectRoot,requestedSkills:[...l.selectedSkills],skillRecords:r.skillRecords.filter(e=>l.selectedSkills.includes(e.ref)),composerNodes:[...l.nodes],sessionMaterialization:o?{kind:o.kind,parentSessionId:o.parentSessionKey,inheritContext:o.inheritContext}:null})}}function C3(e,t,n=`queue`){let r=p4({sessionId:t??void 0,text:e.composerSnapshot.text.trim(),attachments:[...e.composerSnapshot.attachments],parts:S0([...e.composerSnapshot.nodes],e.composerSnapshot.attachments),metadata:e.metadata});return r?{...r,delivery:n}:null}function w3(e){let{agent:t,clearSubmittingInput:n,materializationContext:r,onSessionMaterialized:i,resetComposer:a,restoreComposer:o,runQueue:s,sessionKey:c,setSendError:l,stageSubmittingInput:u}=e;return(0,V.useCallback)(async(e,d,f=`queue`)=>{let p=C3(e,c??(r?null:YI()),f);if(!p)return;let m=t.isRunning&&f===`queue`?u(p):null;d===`reset-and-restore`&&a(),l(null);try{let e=await t.send(p);e?.delivery===`steered`?await s.refreshPendingInputs().catch(()=>void 0):e?.delivery===`queued`&&await s.refreshQueuedInputs().catch(()=>void 0),m&&n(m);let r=e?.sessionId?.trim()||t.snapshot.activeRun?.sessionId?.trim()||null;!c&&r&&i?.(r)}catch(t){throw m&&n(m),d===`reset-and-restore`&&o(e.composerSnapshot),l(t instanceof Error?t.message:String(t)),t}},[t,n,r,i,a,o,s,c,l,u])}function T3(e){let{agent:t,inputQuery:n,inputSnapshot:r,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:o,sessionKey:s,submitDraft:c}=e;return(0,V.useCallback)(async()=>{let e=S3({agentIsSending:t.isSending,inputSnapshot:r,inputQuery:n,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:o,sessionKey:s});e&&await c(e,`reset-and-restore`,`prefer-steer`)},[t.isSending,n,r,i,a,o,s,c])}function E3(e){let{agent:t,continueRun:n,inputQuery:r,inputSnapshot:i,isRuntimeBlocked:a,materializationContext:o,primaryAction:s,selectedAgentId:c,sessionKey:l,submitDraft:u}=e;return(0,V.useCallback)(async()=>{if(s===`continue`)return await n();let e=S3({agentIsSending:t.isSending,inputSnapshot:i,inputQuery:r,isRuntimeBlocked:a,materializationContext:o,selectedAgentId:c,sessionKey:l});e&&await u(e,`reset-and-restore`)},[t.isSending,n,r,i,a,o,s,c,l,u])}function D3(e){let{agent:t,inputSnapshot:n,inputQuery:r,isRuntimeBlocked:i,materializationContext:a,runQueue:o,selectedAgentId:s,sessionKey:c,onSessionMaterialized:l,resetComposer:u,restoreComposer:d,setSendError:f}=e,{clearSubmittingInput:p,queuedInputs:m,stageSubmittingInput:h}=g3(o.inputs,c),g=y3((0,V.useMemo)(()=>S0([...n.nodes],n.attachments),[n.attachments,n.nodes])),{deleteQueuedInput:_,editQueuedInput:v,steerQueuedInput:y}=_3({availableSkills:r.skillRecords,hasComposerContent:g,restoreComposer:d,runQueue:o,setSendError:f}),b=t.isSending||t.isRunning,x=r.selectedSession?.activityPreview?.state,S=!!(c&&!b&&!i&&(x===`cancelled`||x===`failed`)),C=S&&!g?`continue`:`send`,w=C===`continue`?!1:l3({snapshot:x3(r),hasSendableDraft:g,isRuntimeBlocked:i})||t.isSending,{continueRun:T,editMessage:E}=v3({agent:t,sessionKey:c,setSendError:f}),D=w3({agent:t,clearSubmittingInput:p,materializationContext:a,onSessionMaterialized:l,resetComposer:u,restoreComposer:d,runQueue:o,sessionKey:c,setSendError:f,stageSubmittingInput:h}),O=E3({agent:t,continueRun:T,inputQuery:r,inputSnapshot:n,isRuntimeBlocked:i,materializationContext:a,primaryAction:C,selectedAgentId:s,sessionKey:c,submitDraft:D}),k=T3({agent:t,inputQuery:r,inputSnapshot:n,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:s,sessionKey:c,submitDraft:D}),A=(0,V.useCallback)(async e=>{let o=e.trim();if(!o)return;let l=S3({agentIsSending:t.isSending,composerSnapshot:{text:o,nodes:g0(o),selectedSkills:[],skillRecords:[],attachments:[]},inputSnapshot:n,inputQuery:r,isRuntimeBlocked:i,materializationContext:a,selectedAgentId:s,sessionKey:c});l&&await D(l,`preserve`)},[t.isSending,r,n,i,a,s,c,D]),ee=(0,V.useCallback)(async()=>{await t.abort()},[t]);return{canContinue:S,canStopGeneration:t.isRunning,continueRun:T,deleteQueuedInput:_,editMessage:E,editQueuedInput:v,canEditQueuedInput:!g,hasSendableDraft:g,isSending:b,queuedInputs:m,send:O,sendSteering:k,sendPresetMessage:A,sendDisabled:w,primaryAction:C,stop:ee,stopDisabled:!t.isRunning,steerQueuedInput:y}}var O3=[`off`,`minimal`,`low`,`medium`,`high`,`adaptive`,`xhigh`],k3=new Set(O3);function A3(e){if(!e||e.length===0)return[];let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function j3(e,t){let n=e.trim(),r=t.trim();if(!n||!r)return n;let i=`${r}/`;return n.startsWith(i)?n.slice(i.length):n}function M3(e,t){let n=e.trim();if(!n)return``;for(let e of t)n=j3(n,e);return n.trim()}function N3(e,t){let n=t.trim(),r=e.trim();return n?r?`${r}/${n}`:n:``}function P3(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();return t&&k3.has(t)?t:null}function F3(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){let e=P3(n);!e||t.includes(e)||t.push(e)}return t}function I3(e){return e.includes(`off`)?[...e]:[`off`,...e]}function L3(e,t){if(!e)return{};let n={};for(let[r,i]of Object.entries(e)){let e=M3(r,t);if(!e)continue;let a={},o=F3(i?.thinking?.supported);if(o.length>0){let e=P3(i?.thinking?.default);a.thinking=e&&o.includes(e)?{supported:o,default:e}:{supported:o}}i?.vision===!0&&(a.vision=!0),(a.thinking||a.vision===!0)&&(n[e]=a)}return n}function R3(e){return Object.fromEntries(Object.entries(e).filter(e=>!!e[1].thinking).map(([e,t])=>[e,t.thinking]))}function z3(e,t,n){let r=M3(t,n);return r?e[r]??null:null}function B3(e,t){let n=e.trim();if(!n)return null;let r=null;for(let e of t)for(let t of e.aliases){let i=t.trim();i&&(n===i||n.startsWith(`${i}/`))&&(!r||i.length>r.score)&&(r={name:e.name,score:i.length})}if(r)return r.name;for(let e of t){let t=M3(n,e.aliases);if(t&&A3(e.models??[]).some(e=>e===t))return e.name}return null}function V3(e){return e?e.enabled!==!1&&(e.apiKeyRequired===!1||e.apiKeySet===!0):!1}function H3(e){let{providersView:t,templatesView:n,config:r,onlyConfigured:i=!1}=e,a=new Map((n?.providerTemplates??[]).map(e=>[e.providerType,e])),o=Object.values(t?.providers??r?.providers??{}).map(e=>{let{providerId:t}=e,n=e.providerType?a.get(e.providerType):void 0,r=t.trim(),i=A3([t,n?.modelPrefix||``,n?.providerType||``]),o=A3((e?.models??[]).map(e=>M3(e,i))),s={...L3(n?.modelConfig,i),...L3(e?.modelConfig,i)},c=R3(s),l=e?.displayName?.trim(),u=V3(e);return{name:t,displayName:l||n?.displayName||t,prefix:r,aliases:i,models:o,modelConfig:s,modelThinking:c,configured:u}});return i?o.filter(e=>e.configured&&e.models.length>0):o}function U3(e,t){return{value:D,modelLabel:e,providerLabel:``,isRuntimeDefault:!0,thinkingCapability:t??null}}function W3(e){let t=new Set;return H3({providersView:e.providersView??void 0,templatesView:e.templatesView??void 0,config:e.config??void 0,onlyConfigured:!0}).flatMap(e=>e.models.map(n=>{let r=N3(e.prefix,n);return!r||t.has(r)?null:(t.add(r),{value:r,modelLabel:n,providerLabel:e.displayName,thinkingCapability:z3(e.modelThinking,n,e.aliases)})})).filter(e=>e!==null).sort((e,t)=>{let n=e.providerLabel.localeCompare(t.providerLabel);return n===0?e.modelLabel.localeCompare(t.modelLabel):n})}function G3(e){let{catalogView:t,config:n,providersView:r,templatesView:i}=e,a=t?.providers??{},o=new Set;return H3({providersView:r??void 0,templatesView:i??void 0,config:n??void 0}).flatMap(e=>{if(!e.configured)return[];let t=new Set(e.models);return(a[e.name]?.models??[]).map(n=>{let r=M3(n,e.aliases),i=N3(e.prefix,r);return!r||!i||t.has(r)||o.has(i)?null:(o.add(i),{value:i,providerId:e.name,providerModel:r,modelLabel:r,providerLabel:e.displayName,thinkingCapability:z3(e.modelThinking,r,e.aliases)})}).filter(e=>e!==null)})}function K3(e){let{modelOptions:t,modelSelectionMode:n,supportedModels:r}=e;if(n===`runtime-default`)return[];if(!r||r.length===0)return t;let i=new Set(r);return t.filter(e=>i.has(e.value))}function q3(e){let{modelOptions:t,modelSelectionMode:n,runtimeDefaultThinkingCapability:r,runtimeDefaultModelLabel:i=`Runtime default`,supportedModels:a}=e,o=U3(i,r);if(n===`runtime-default`)return[o];if(!a||a.length===0)return n===`optional`?[o,...t]:t;let s=new Set(a),c=t.filter(e=>s.has(e.value)),l=c.length>0?c:t;return n===`optional`?[o,...l]:l}function J3(e){return e?.trim().toLowerCase()||`native`}function Y3(e,t){if(typeof t!=`string`)return!1;let n=t.trim();return n?e.some(e=>e.value===n):!1}function X3(e,t){return typeof t==`string`&&e.includes(t)}function Z3(e){return e.length===0?null:e.includes(`off`)?`off`:e[0]??null}function Q3(e){let{currentValue:t,selectedSessionPreferredValue:n,fallbackPreferredValue:r,defaultValue:i,isValueSupported:a,firstAvailableValue:o,preferSessionPreferredValue:s=!1,preserveCurrentValueOnSessionChange:c=!1}=e;return a(t)&&(!s||c)?t:a(n)?n:a(r)?r:a(i)?i:o}function $3(e){let{modelOptions:t,currentSelectedModel:n,selectedSessionPreferredModel:r,fallbackPreferredModel:i,defaultModel:a,preferSessionPreferredModel:o,preserveCurrentSelectedModelOnSessionChange:s}=e;return t.length===0?``:Q3({currentValue:n,selectedSessionPreferredValue:r,fallbackPreferredValue:i,defaultValue:a,isValueSupported:e=>Y3(t,e),firstAvailableValue:t[0]?.value??``,preferSessionPreferredValue:o,preserveCurrentValueOnSessionChange:s})}function e6(e){let{supportedThinkingLevels:t,currentSelectedThinkingLevel:n,selectedSessionPreferredThinking:r,fallbackPreferredThinking:i,defaultThinkingLevel:a,preferSessionPreferredThinking:o,preserveCurrentSelectedThinkingOnSessionChange:s}=e;if(t.length===0)return null;let c=I3(t);return Q3({currentValue:n,selectedSessionPreferredValue:r,fallbackPreferredValue:i,defaultValue:a,isValueSupported:e=>X3(c,e),firstAvailableValue:Z3(c)??`off`,preferSessionPreferredValue:o,preserveCurrentValueOnSessionChange:s})}function t6(e){let{sessions:t,selectedSessionKey:n,sessionType:r,readPreference:i}=e,a=J3(r),o,s=-1/0;for(let e of t){if(e.key===n||J3(e.sessionType)!==a)continue;let t=i(e);if(t==null)continue;let r=Date.parse(e.updatedAt),c=Number.isFinite(r)?r:-1/0;(o===void 0||c>s)&&(o=t,s=c)}return o}function n6(e){let{selectedSession:t,pendingSessionType:n,setPendingSessionType:r,sessionTypesData:i}=e,a=(0,V.useMemo)(()=>kL(i?.options??[]),[i?.options]),o=(0,V.useMemo)(()=>{let e=[...a],n=EL(t?.sessionType);return e.some(e=>e.value===n)||e.push({value:n,label:OL(n),icon:null,ready:!0,reason:null,reasonMessage:null,supportedModels:void 0,recommendedModel:null,modelSelectionMode:`nextclaw`,runtimeDefaultThinking:null,cta:null}),e.sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))},[a,t?.sessionType]),s=(0,V.useMemo)(()=>EL(i?.defaultType??`native`),[i?.defaultType]),c=(0,V.useRef)(null),l=typeof n==`string`&&n.trim().length>0?n:void 0,u=(0,V.useMemo)(()=>EL(t?.sessionType??l??s),[s,l,t?.sessionType]),d=(0,V.useMemo)(()=>o.find(e=>e.value===u)??null,[u,o]);(0,V.useEffect)(()=>{if(t)return;let e=typeof n==`string`?n.trim():``,i=EL(n);(e.length===0||c.current===i||c.current===null&&i===`native`)&&(c.current=s,i!==s&&r(s))},[s,n,t,r]);let f=!t||!!t.sessionTypeMutable,p=(0,V.useMemo)(()=>new Set(a.map(e=>e.value)),[a]),m=(0,V.useMemo)(()=>t&&!p.has(EL(t.sessionType))?!0:d?.ready===!1,[p,t,d?.ready]),h=(0,V.useMemo)(()=>t&&!p.has(EL(t.sessionType))?`${OL(u)} ${b(`chatSessionTypeUnavailableSuffix`)}`:d?.ready===!1?d.reasonMessage?.trim()||`${d.label} setup required`:null,[p,t,u,d]);return(0,V.useMemo)(()=>({sessionTypeOptions:o,selectedSessionTypeOption:d,defaultSessionType:s,selectedSessionType:u,canEditSessionType:f,sessionTypeUnavailable:m,sessionTypeUnavailableMessage:h}),[f,s,u,d,o,m,h])}var r6=`nextclaw.chat.recent-selection.store`;function i6(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function a6(e,t){return Array.isArray(e)?Array.from(new Set(e.map(i6).filter(e=>!!e))).slice(0,t):[]}function o6(e,t){let n=i6(t?.namespace);return n?`${e.storageKey}.${encodeURIComponent(n.toLowerCase())}`:e.storageKey}function s6(e){if(!e||typeof e!=`object`)return{};let t={};for(let[n,r]of Object.entries(e)){let e=i6(n);if(!e)continue;let i=a6(r,1/0);i.length>0&&(t[e]=i)}return t}var c6=N()(_i(e=>({entriesByKey:{},setEntries:(t,n)=>e(e=>({entriesByKey:{...e.entriesByKey,[t]:a6(n,1/0)}}))}),{name:r6,storage:vi(()=>window.localStorage),partialize:e=>({entriesByKey:e.entriesByKey}),merge:(e,t)=>({...t,entriesByKey:s6(e?.entriesByKey)})})),l6=class{constructor(e){this.options=e,this.read=(e={})=>{let t=o6(this.options,e);return a6(c6.getState().entriesByKey[t],this.options.limit)},this.remember=(e,t={})=>{let n=i6(e);if(!n)return this.read(t);let r=o6(this.options,t),i=[n,...this.read(t).filter(e=>e!==n)].slice(0,this.options.limit);return c6.getState().setEntries(r,i),i},this.resolveVisible=e=>{let t=a6(e.availableValues,1/0);if(t.length<=e.minAvailableCount)return[];let n=new Set(t),r=[],i=Math.max(1,e.limit??this.options.limit);for(let t of this.read(e))if(!(!n.has(t)||r.includes(t))&&(r.push(t),r.length>=i))break;return r}}},u6=new l6({storageKey:`nextclaw.chat.recent-models`,limit:3});function d6(){return Ot({queryKey:[`config`],queryFn:Yt,staleTime:3e4,refetchOnWindowFocus:!0})}function f6(){return Ot({queryKey:[`config-meta`],queryFn:an,staleTime:1/0})}function p6(){return Ot({queryKey:[`providers`],queryFn:Qt,staleTime:3e4,refetchOnWindowFocus:!0})}function m6(){return Ot({queryKey:[`provider-templates`],queryFn:Et,staleTime:1/0})}function h6(e={}){return Ot({queryKey:[`provider-model-catalog`],queryFn:St,staleTime:3e4,refetchInterval:t=>e.pollWhileRefreshing&&t.state.data?.refreshing?1e3:!1,refetchOnMount:e.refreshOnMount?`always`:!0,refetchOnWindowFocus:!0})}function g6(){return Ot({queryKey:[`config-schema`],queryFn:yt,staleTime:1/0})}function _6(){let e=F();return jt({mutationFn:yn,onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),R.success(b(`configSaved`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function v6(){let e=F();return jt({mutationFn:({data:e})=>eee(e),onSuccess:t=>{e.setQueryData([`config`],e=>e&&{...e,productAnalytics:t}),R.success(b(`configSavedApplied`))},onError:e=>{R.error(`${b(`configSaveFailed`)}: ${e.message}`)}})}function y6(){let e=F();return jt({mutationFn:({data:e})=>nee(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),R.success(b(`configSavedApplied`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function b6(){let e=F();return jt({mutationFn:({provider:e,data:t})=>Ee(e,t),onSuccess:(t,n)=>{e.setQueryData([`providers`],e=>e&&{providers:{...e.providers,[n.provider]:t}}),e.invalidateQueries({queryKey:[`providers`]}),e.invalidateQueries({queryKey:[`config`]}),n.silentSuccess||R.success(b(`configSaved`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function x6(){let e=F();return jt({mutationFn:({data:e})=>wt(e??{}),onSuccess:()=>{e.invalidateQueries({queryKey:[`providers`]}),e.invalidateQueries({queryKey:[`config`]}),R.success(b(`configSaved`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function S6(){let e=F();return jt({mutationFn:({provider:e})=>Kt(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`providers`]}),e.invalidateQueries({queryKey:[`config`]}),R.success(b(`configSaved`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function C6(){return jt({mutationFn:({provider:e,data:t})=>aee(e,t)})}function w6(){return jt({mutationFn:({provider:e,data:t})=>tn(e,t)})}function T6(){return jt({mutationFn:({provider:e,data:t})=>pn(e,t)})}function E6(){return jt({mutationFn:({provider:e,data:t})=>Mt(e,t)})}function D6(){return jt({mutationFn:({provider:e})=>Ut(e)})}function O6(){let e=F();return jt({mutationFn:({channel:e,data:t})=>gt(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),R.success(b(`configSavedApplying`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function k6(){let e=F();return jt({mutationFn:({data:e})=>gn(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),R.success(b(`configSavedApplied`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function A6(){let e=F();return jt({mutationFn:({data:e})=>Ae(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),R.success(b(`configSavedApplied`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}})}function j6(){return jt({mutationFn:({actionId:e,data:t})=>Ft(e,t),onError:e=>{R.error(b(`error`)+`: `+e.message)}})}var M6=`nextclaw.chat.provider-model-catalog-notices`,N6=1,P6={version:N6,acknowledgedModelsByProvider:{}};function F6(){return typeof window>`u`?null:window.localStorage}function I6(e){let t=new Map;for(let n of e){let e=t.get(n.providerId)??[];e.includes(n.value)||(e.push(n.value),t.set(n.providerId,e))}return t}var L6=new class{constructor(){this.read=()=>{let e=F6();if(!e)return P6;try{let t=JSON.parse(e.getItem(M6)??`null`);return t?.version===N6&&t.acknowledgedModelsByProvider?{version:N6,acknowledgedModelsByProvider:t.acknowledgedModelsByProvider}:P6}catch{return P6}},this.write=e=>{let t=F6();if(!t)return!1;try{return t.setItem(M6,JSON.stringify(e)),!0}catch{return!1}},this.initializeLargeCatalogs=e=>{let t={...this.read().acknowledgedModelsByProvider},n=!1;for(let[r,i]of I6(e))i.length>50&&!Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=i,n=!0);return n&&this.write({version:N6,acknowledgedModelsByProvider:t})},this.filterUnseen=e=>{let t=this.read().acknowledgedModelsByProvider,n=I6(e);return e.filter(e=>{let r=t[e.providerId];return r?!r.includes(e.value):(n.get(e.providerId)?.length??0)<=50})},this.acknowledge=e=>{if(e.length===0)return!1;let t={...this.read().acknowledgedModelsByProvider},n=!1;for(let[r,i]of I6(e)){let e=t[r]??[],a=new Set(e),o=[...e];for(let e of i)a.has(e)||(a.add(e),o.push(e),n=!0);t[r]=o}return n&&this.write({version:N6,acknowledgedModelsByProvider:t})}}},R6=`__nextclaw-preview__`,z6=[{providerId:`opencode`,providerLabel:`OpenCode Zen Free Trial`,models:[`deepseek-v4-flash-free`,`laguna-s-2.1-free`,`longcat-2.0-free`,`mimo-v2.5-free`,`nemotron-3-ultra-free`,`north-mini-code-free`,`trinity-large-preview-free`]},{providerId:`openrouter`,providerLabel:`OpenRouter`,models:[`inclusionai/ling-3.0-tiny:free`,`qwen/qwen3-coder:free`,`deepseek/deepseek-r1:free`,`mistralai/mistral-small:free`,`google/gemma-3-27b-it:free`]},{providerId:`kimi`,providerLabel:`Kimi`,models:[`kimi-k2.5-preview`,`kimi-dev-72b`,`moonshot-v1-128k-preview`]}];function B6(e){return!e.enabled||new URLSearchParams(e.search).get(`preview`)!==`model-discovery`?[]:z6.flatMap(e=>e.models.map(t=>({value:`${R6}${e.providerId}/${t}`,providerId:`${R6}${e.providerId}`,providerModel:t,modelLabel:t,providerLabel:e.providerLabel,thinkingCapability:null})))}function V6(e){return e.providerId.startsWith(R6)}function H6(e){let{config:t,modelSelectionMode:n,providersView:r,supportedModels:i,templatesView:a}=e,o=h6(),{mutateAsync:s}=b6(),[c,l]=(0,V.useState)(0),[u,d]=(0,V.useState)(!1),f=(0,V.useMemo)(()=>B6({enabled:!1,search:typeof window>`u`?``:window.location.search}),[]),p=(0,V.useMemo)(()=>G3({catalogView:o.data??null,config:t,providersView:r,templatesView:a}),[o.data,t,r,a]);(0,V.useEffect)(()=>{L6.initializeLargeCatalogs(p)},[p]);let m=(0,V.useMemo)(()=>f.length>0&&!u?f:K3({modelOptions:L6.filterUnseen(p),modelSelectionMode:n,supportedModels:i}),[p,n,c,u,f,i]);return{addDiscoveredModel:(0,V.useCallback)(async e=>{let t=m.find(t=>t.value===e);if(t&&V6(t))return t;let n=t?r?.providers[t.providerId]:void 0;return!t||!n?null:(await s({provider:t.providerId,data:{models:A3([...n.models??[],t.providerModel])},silentSuccess:!0}),L6.acknowledge([t]),l(e=>e+1),t)},[m,r,s]),dismissDiscoveredModels:(0,V.useCallback)(()=>{if(m.some(V6)){d(!0);return}L6.acknowledge(m)&&l(e=>e+1)},[m]),discoveredModelOptions:m,refreshProviderModelCatalog:o.refetch}}var U6=[],W6=[];function G6(e){let{sessionKey:t,inputSnapshot:n,setPendingSessionType:r}=e,i=t??null,a=vR(),o=eR(e=>e.snapshot),s=o.configQuery?.data??null,c=o.providersQuery?.data??null,l=o.providerTemplatesQuery?.data??null,u=o.sessionsQuery?.data?.sessions??W6,d=lL({sessionId:i?.trim()||`draft-session`,projectRoot:mI(n.pendingProjectRoot)}),f=d.data?.records??U6,p=!!(d.isLoading||d.isFetching),m=(0,V.useMemo)(()=>JI(u),[u]),h=(0,V.useMemo)(()=>m.find(e=>e.key===i)??null,[i,m]),g=n6({selectedSession:h,pendingSessionType:n.pendingSessionType,setPendingSessionType:r,sessionTypesData:o.sessionTypesQuery?.data??null}),_=(0,V.useMemo)(()=>W3({config:s,providersView:c,templatesView:l}),[s,c,l]),v=(0,V.useMemo)(()=>q3({modelOptions:_,modelSelectionMode:g.selectedSessionTypeOption?.modelSelectionMode,runtimeDefaultThinkingCapability:g.selectedSessionTypeOption?.runtimeDefaultThinking??null,runtimeDefaultModelLabel:b(`chatRuntimeDefaultModel`),supportedModels:g.selectedSessionTypeOption?.supportedModels}),[_,g.selectedSessionTypeOption?.modelSelectionMode,g.selectedSessionTypeOption?.runtimeDefaultThinking,g.selectedSessionTypeOption?.supportedModels]),{addDiscoveredModel:y,dismissDiscoveredModels:x,discoveredModelOptions:S,refreshProviderModelCatalog:C}=H6({config:s,providersView:c,templatesView:l,modelSelectionMode:g.selectedSessionTypeOption?.modelSelectionMode,supportedModels:g.selectedSessionTypeOption?.supportedModels}),w=(0,V.useMemo)(()=>new Set(v.map(e=>e.value)),[v]),T=u6.read({namespace:g.selectedSessionType}).find(e=>w.has(e)),E=(0,V.useMemo)(()=>T??t6({sessions:m,selectedSessionKey:i,sessionType:g.selectedSessionType,readPreference:e=>e.preferredModel?.trim()||void 0}),[T,i,g.selectedSessionType,m]),D=(0,V.useMemo)(()=>t6({sessions:m,selectedSessionKey:i,sessionType:g.selectedSessionType,readPreference:e=>e.preferredThinking??void 0}),[i,g.selectedSessionType,m]),O=mI(s?.agents.defaults.workspace);return(0,V.useMemo)(()=>({addDiscoveredModel:y,defaultModel:g.selectedSessionTypeOption?.recommendedModel??s?.agents.defaults.model,defaultProjectRoot:O,dismissDiscoveredModels:x,discoveredModelOptions:S,fallbackPreferredModel:E,fallbackPreferredThinking:D,isProviderStateResolved:a,isSkillsLoading:p,modelOptions:v,providersView:c,refreshProviderModelCatalog:C,selectedSession:h,selectedSessionKey:i,sessionTypeState:g,skillRecords:f}),[s?.agents.defaults.model,O,E,D,a,p,v,y,x,S,C,c,h,i,g,f])}var K6=`new-session`,q6=`nextclaw.chat.composer-drafts`,J6=1;function Y6(e){let t=e?.trim();return t?`session:${t}`:K6}var X6=N()(_i(e=>({drafts:{},ensureDraft:(t,n)=>{e(e=>e.drafts[t]?e:{drafts:{...e.drafts,[t]:n}})},updateDraft:(t,n,r)=>{e(e=>({drafts:{...e.drafts,[t]:r(e.drafts[t]??n)}}))}}),{name:q6,version:J6,storage:vi(()=>window.localStorage),partialize:e=>({drafts:Object.fromEntries(Object.entries(e.drafts).map(([e,t])=>[e,{...t,composerFocusRequestId:0,sendError:null}]))})})),Z6=({preferenceOwnerKey:e,selectedModel:t,selectedThinkingLevel:n,updatePreferences:r})=>{let i=(0,V.useRef)(void 0),a=(0,V.useRef)(null),o=(0,V.useCallback)(t=>{a.current={ownerKey:e,value:t},r({selectedThinkingLevel:t})},[e,r]),s=(0,V.useCallback)(({defaultModel:o,fallbackPreferredModel:s,fallbackPreferredThinking:c,modelOptions:l,selectedSessionExists:u,selectedSessionKey:d,selectedSessionType:f,selectedSessionPreferredModel:p,selectedSessionPreferredThinking:m})=>{let h=d??null,g=JSON.stringify([f,h]),_=i.current!==g,v=_&&!!h&&!u,y=a.current,b=y?.ownerKey===e&&u&&m===y.value;b&&(a.current=null);let x=y?.ownerKey===e&&!b,S=$3({currentSelectedModel:t??void 0,modelOptions:l,selectedSessionPreferredModel:p,fallbackPreferredModel:s,defaultModel:o,preferSessionPreferredModel:_,preserveCurrentSelectedModelOnSessionChange:v}),C=l.find(e=>e.value===S),w=e6({currentSelectedThinkingLevel:n,supportedThinkingLevels:C?.thinkingCapability?.supported??[],selectedSessionPreferredThinking:m,fallbackPreferredThinking:c,defaultThinkingLevel:C?.thinkingCapability?.default??null,preferSessionPreferredThinking:_,preserveCurrentSelectedThinkingOnSessionChange:v||x});(t!==S||n!==w)&&r({selectedModel:S,selectedThinkingLevel:w}),(!h||u)&&(i.current=g)},[t,n,e,r]);return(0,V.useMemo)(()=>({setSelectedThinkingLevel:o,syncSessionPreferences:s}),[o,s])},Q6={text:``,nodes:[],selectedSkills:[],skillRecords:[]},$6=e=>{let t=e?.trim()??``;return{...t?{...Q6,text:t,nodes:g0(t)}:Q6,attachments:[],selectedModel:void 0,selectedThinkingLevel:null,pendingSessionType:TL,selectedSessionType:TL,composerFocusRequestId:t?1:0,sendError:null}},e8=e=>e?.trim()||TL,t8=e=>[e.assetUri??``,e.url??``,e.name,e.mimeType,String(e.sizeBytes),e.contentBase64??``].join(`:`),n8=(e,t)=>{let n=new Set(e.map(t8)),r=[...e];return t.forEach(e=>{let t=t8(e);n.has(t)||(n.add(t),r.push(e))}),r};function r8(e){let{attachments:t,update:n}=e,r=(0,V.useCallback)(e=>{n({attachments:e})},[n]);return{addAttachments:(0,V.useCallback)(e=>{if(e.length===0)return[];let r=new Set(t.map(t8)),i=n8(t,e),a=i.filter(e=>!r.has(t8(e)));return a.length>0&&n({attachments:i}),a},[t,n]),removeAttachment:(0,V.useCallback)(e=>{n(t=>({attachments:t.attachments.filter(t=>t.id!==e)}))},[n]),setAttachments:r}}function i8(e,t){let n=Y6(t),r=(0,V.useMemo)(()=>$6(e),[e]),i=X6(e=>e.drafts[n]??r);return(0,V.useEffect)(()=>{X6.getState().ensureDraft(n,r)},[n,r]),{draftKey:n,snapshot:i,update:(0,V.useCallback)(e=>{X6.getState().updateDraft(n,r,t=>{let n=typeof e==`function`?e({...t,pendingProjectRoot:$.getState().snapshot.draftProjectRoot}):e;return{...t,...n}})},[n,r])}}var a8=(e,t=null)=>{let n=$(e=>e.snapshot.draftProjectRoot),{draftKey:r,snapshot:i,update:a}=i8(e,t),o=(0,V.useCallback)(e=>{a({text:e.text,nodes:e.nodes,selectedSkills:e.selectedSkills,skillRecords:e.skillRecords,sendError:null})},[a]),s=(0,V.useCallback)(()=>{a({...Q6,attachments:[],sendError:null})},[a]),c=(0,V.useCallback)(e=>{a({...e})},[a]),l=(0,V.useCallback)(e=>{a({text:e,nodes:g0(e),selectedSkills:[],skillRecords:[],sendError:null,composerFocusRequestId:Date.now()})},[a]),u=(0,V.useCallback)(()=>{a(e=>({composerFocusRequestId:e.composerFocusRequestId+1}))},[a]),d=(0,V.useCallback)(()=>{a({composerFocusRequestId:0})},[a]),{addAttachments:f,removeAttachment:p,setAttachments:m}=r8({attachments:i.attachments,update:a}),h=Z6({preferenceOwnerKey:r,selectedModel:i.selectedModel,selectedThinkingLevel:i.selectedThinkingLevel,updatePreferences:a}),g=(0,V.useCallback)(e=>{a(t=>{let n=e8(typeof e==`function`?e(t.pendingSessionType):e);return{pendingSessionType:n,selectedSessionType:n}})},[a]),_=(0,V.useCallback)(e=>{$.getState().setSnapshot({draftProjectRoot:e})},[]),v=(0,V.useCallback)((e,t)=>{a({selectedSkills:e,skillRecords:t,sendError:null})},[a]),y=(0,V.useCallback)(e=>{a({sendError:e})},[a]),b=(0,V.useMemo)(()=>({update:a,syncComposer:o,resetComposer:s,restoreComposer:c,applyPromptSuggestion:l,requestComposerFocusAtEnd:u,consumeComposerFocusRequest:d,setAttachments:m,addAttachments:f,removeAttachment:p,...h,setPendingSessionType:g,setPendingProjectRoot:_,setSelectedSkills:v,setSendError:y}),[a,o,s,c,l,u,d,m,f,p,h,g,_,v,y]);return{inputSnapshot:{...i,pendingProjectRoot:n},inputActions:b}},o8=`ncp-session-run-queue`;function s8(e){let t=F(),n=e?.trim()||null,{data:r,isLoading:i,refetch:a}=Ot({queryKey:[o8,n],queryFn:()=>I.sessions.listPendingInputs(n),enabled:!!n,retry:!1,staleTime:5e3});(0,V.useEffect)(()=>{if(n)return I.eventBus.on(c.sessionRunQueueUpdated,async({sessionKey:e})=>{if(e!==n)return;let r=[o8,n];await t.cancelQueries({queryKey:r,exact:!0}),await t.invalidateQueries({queryKey:r,exact:!0})})},[n,t]);let o=(0,V.useCallback)(async e=>n?await I.sessions.deleteQueuedInput(n,e):null,[n]),s=(0,V.useCallback)(async()=>n?(await a()).data?.inputs??[]:[],[n,a]),l=(0,V.useCallback)(async()=>(await s()).filter(({placement:e})=>e===`queued`),[s]),u=(0,V.useCallback)(async e=>n?await I.sessions.steerQueuedInput(n,e):null,[n]),d=r?.inputs??[];return{inputs:d.filter(({placement:e})=>e===`queued`),pendingInputs:d,isLoading:i,refreshPendingInputs:s,refreshQueuedInputs:l,removeQueuedInput:o,steerQueuedInput:u}}function c8(){return(0,V.useEffect)(()=>ks.attach(),[]),{isMobile:Os(e=>e.mode)===`mobile`}}var l8={exactId:1200,exactLabel:1150,prefixId:1e3,prefixLabel:950,prefixToken:900,containsId:800,containsLabel:760,containsDescription:500,subsequence:300,fallback:1};function u8(e){return(e??``).trim().toLowerCase()}function d8(e,t){if(!e||!t)return!1;let n=0;for(let r of t)if(r===e[n]&&(n+=1,n>=e.length))return!0;return!1}function f8(e,t){let n=u8(t);if(!n)return l8.fallback;let r=u8(e.id),i=u8(e.label||e.id),a=u8(e.description),o=(e.aliases??[]).map(u8).filter(Boolean),s=i.split(/[\s/_-]+/).filter(Boolean),c=[r,...o];return c.some(e=>e===n)?l8.exactId:i===n?l8.exactLabel:c.some(e=>e.startsWith(n))?l8.prefixId:i.startsWith(n)?l8.prefixLabel:s.some(e=>e.startsWith(n))?l8.prefixToken:c.some(e=>e.includes(n))?l8.containsId:i.includes(n)?l8.containsLabel:a.includes(n)?l8.containsDescription:d8(n,i)||c.some(e=>d8(n,e))?l8.subsequence:0}function p8(e){return e>=l8.exactLabel?4:e>=l8.prefixToken?3:e>=l8.containsLabel?2:e>0?1:0}var m8=`context-reference:navigate:files`,h8=`context-reference:navigate:folders`,g8=`context-reference:navigate:projects`,_8=`context-reference:navigate:root`,v8=`context-reference:navigate:system-object-group:`,y8=`context-reference:system-object:`,b8=`workspace-files`,x8=`workspace-folders`,S8=`projects`;function C8(e,t){return e.translations?.[t]??e.default}function w8(e){return e.groups.map(t=>({key:`${v8}${t.objectType}`,icon:t.icon,title:C8(t.label,e.language),subtitle:e.texts.systemObjectSectionLabel,description:C8(t.description,e.language),detailLines:[],hintLabel:e.texts.systemObjectGroupHintLabel,sectionKey:`system-object-groups`,sectionLabel:e.texts.systemObjectSectionLabel,selectionBehavior:`navigate`,value:t.objectType}))}function T8(e){return e.groups.flatMap(t=>{let n=C8(t.label,e.language);return t.items.map(e=>({key:`${y8}${e.uri}`,icon:t.icon,title:e.label,subtitle:n,description:e.description??e.objectId,detailLines:[e.uri],sectionKey:`system-objects:${t.objectType}`,sectionLabel:n,selectionBehavior:`action`,value:e.uri}))})}function E8(e){return e.split(/[\\/]+/).filter(Boolean).at(-1)??e}function D8(e){let{kind:t,projectRoot:n,relativePath:r}=e,i=r.split(`/`).filter(Boolean);return{rootLabel:E8(n),segments:i.map((e,n)=>({label:e,kind:n===i.length-1?t:`directory`}))}}function O8(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.projects.map((t,n)=>({order:n,project:t,score:f8({id:t.rootPath,label:t.name,description:t.rootPath,aliases:t.template?[t.template]:[]},e.query)})).filter(({score:e})=>e>0).sort((e,n)=>{let r=p8(e.score),i=p8(n.score);return i===r?n.score===e.score?t.compare(e.project.name,n.project.name)||e.order-n.order:n.score-e.score:i-r}).map(({project:t})=>({key:`context-reference:project:${t.rootPath}`,icon:`project`,title:t.name,subtitle:e.texts.projectSubtitle,description:e.texts.projectDescription,detailLines:[`${e.texts.projectPathLabel}: ${t.rootPath}`],sectionKey:S8,sectionLabel:e.texts.projectSectionLabel,value:t.rootPath,tokenKind:s,tokenKey:t.rootPath}))}function k8(e){let t=E8(e.projectRoot);return e.entries.map(n=>{let i=e.navigateDirectories&&n.kind===`directory`;return{key:`workspace:${n.kind}:${n.relativePath}`,icon:n.kind===`directory`?`folder`:`file`,title:n.name,subtitle:n.parentRelativePath||t,description:n.kind===`directory`?e.texts.directoryDescription:e.texts.fileDescription,detailLines:[`${e.texts.projectRootLabel}: ${e.projectRoot}`,n.relativePath],sectionKey:e.sectionKey,sectionLabel:e.sectionLabel,value:n.relativePath,tokenKind:i?void 0:n.kind===`directory`?p:r,tokenKey:i?void 0:n.relativePath,selectionBehavior:i?`navigate`:void 0,pathPreview:D8({kind:n.kind,projectRoot:e.projectRoot,relativePath:n.relativePath})}})}function A8(e){let{projectRoot:t,referencePath:n,texts:r}=e,i=n.split(`/`).filter(Boolean).join(`/`),a=i||`.`,o=i.split(`/`).filter(Boolean).at(-1)??E8(t);return{key:`context-reference:current-directory:${a}`,icon:`folder`,title:r.currentDirectoryLabel,subtitle:o,description:r.directoryDescription,detailLines:[`${r.projectRootLabel}: ${t}`,a],sectionKey:x8,sectionLabel:r.foldersLabel,value:a,tokenKind:p,tokenKey:a,pathPreview:D8({kind:`directory`,projectRoot:t,relativePath:i})}}function j8(e){return{key:m8,icon:`files`,title:e.filesLabel,subtitle:e.filesSubtitle,description:e.filesDescription,detailLines:[],hintLabel:e.filesHintLabel,selectionBehavior:`navigate`}}function M8(e){return{key:h8,icon:`folder`,title:e.foldersLabel,subtitle:e.foldersSubtitle,description:e.foldersDescription,detailLines:[],hintLabel:e.foldersHintLabel,selectionBehavior:`navigate`}}function N8(e){return{key:g8,icon:`project`,title:e.projectsLabel,subtitle:e.projectsSubtitle,description:e.projectsDescription,detailLines:[],hintLabel:e.projectsHintLabel,selectionBehavior:`navigate`}}function P8(e){let t=e.split(`/`).filter(Boolean);return t.length===0?null:t.slice(0,-1).join(`/`)}function F8(e){let{location:t,texts:n}=e,r=t.view===`files`||t.view===`folders`,i=r?t.path:``,a=!r||!i;return{key:_8,icon:`back`,title:a?n.backLabel:n.parentLabel,subtitle:``,description:a?n.backDescription:n.parentDescription,detailLines:[],hintLabel:a?n.backHintLabel:n.parentHintLabel,value:P8(i)??``,selectionBehavior:`navigate`}}var I8=`panel-apps`;function L8(e){return Date.parse(e.lastOpenedAt??e.updatedAt)||0}function R8(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.entries.map((t,n)=>({entry:t,order:n,score:f8({id:t.appId,label:t.title||t.appId,description:t.description,aliases:[t.id,t.fileName]},e.query)})).filter(e=>e.score>0).sort((e,n)=>{let r=p8(e.score),i=p8(n.score);if(i!==r)return i-r;if(e.entry.favorite!==n.entry.favorite)return e.entry.favorite?-1:1;let a=L8(n.entry),o=L8(e.entry);return a===o?n.score===e.score?t.compare(e.entry.title||e.entry.appId,n.entry.title||n.entry.appId)||e.order-n.order:n.score-e.score:a-o}).map(({entry:e})=>e)}function z8(e){let t=e.keyPrefix??`panel-app`;return R8({entries:e.entries,query:e.query}).map(n=>({entry:n,item:{key:`${t}:${n.appId}`,icon:`panel-app`,title:n.title||n.appId,subtitle:e.texts.subtitle,description:(n.description??``).trim()||e.texts.noDescriptionLabel,detailLines:[`${e.texts.appIdLabel}: ${n.appId}`,`${e.texts.fileLabel}: ${n.fileName}`]}}))}function B8(e){return z8(e).map(({item:e})=>e)}function V8(e){return z8(e).map(({entry:t,item:n})=>({...n,sectionKey:I8,sectionLabel:e.sectionLabel,tokenKind:`panel_app`,tokenKey:t.appId,value:t.appId}))}var H8={key:`context-reference`,marker:`@`};function U8(e){let{entries:t,isBrowsing:n,isFoldersMode:r,projectRoot:i,texts:a}=e,o=(e,t,n)=>k8({entries:e,navigateDirectories:n,projectRoot:i,sectionKey:t===`folders`?x8:b8,sectionLabel:t===`folders`?a.foldersLabel:a.filesLabel,texts:a});return{browsedItems:o(t,r?`folders`:`files`,n),fileItems:o(t.filter(({kind:e})=>e===`file`),`files`,!1),folderItems:o(t.filter(({kind:e})=>e===`directory`),`folders`,!1)}}function W8(e){let{isFoldersMode:t,isWorkspaceMode:n,item:r,onNavigate:i,onSelectSystemObject:a,referencePath:o}=e;r.key===`context-reference:navigate:files`?i({view:`files`,path:``}):r.key===`context-reference:navigate:folders`?i({view:`folders`,path:``}):r.key===`context-reference:navigate:projects`?i({view:`projects`}):r.key===`context-reference:navigate:root`?i(n&&o?{view:t?`folders`:`files`,path:r.value??``}:{view:`root`}):r.key.startsWith(`context-reference:navigate:system-object-group:`)&&r.value?i({view:`system-objects`,objectType:r.value}):r.selectionBehavior===`navigate`&&r.value?i({view:t?`folders`:`files`,path:r.value}):r.key.startsWith(`context-reference:system-object:`)&&r.value&&a(r.value)}function G8(e){return yF({key:`context-reference`,trigger:H8,resolvePanel:({data:t,trigger:n})=>{let r=t.referenceLocation.view===`files`,i=t.referenceLocation.view===`folders`,a=t.referenceLocation.view===`projects`,o=t.referenceLocation.view===`system-objects`,s=r||i,c=!!n.query.trim(),l=s&&!c,u=t.referenceLocation.view===`files`||t.referenceLocation.view===`folders`?t.referenceLocation.path:``,{browsedItems:d,fileItems:f,folderItems:p}=U8({entries:t.serverPathEntries,isBrowsing:l,isFoldersMode:i,projectRoot:t.projectRoot,texts:e.itemTexts.context}),m=O8({projects:t.projects,query:n.query,texts:e.itemTexts.context}),h=i&&l?A8({projectRoot:t.projectRoot,referencePath:u,texts:e.itemTexts.context}):null,g=t.systemObjectGroups??[],_=T8({groups:g,language:e.language,texts:e.itemTexts.context}),v=r?[F8({location:t.referenceLocation,texts:e.itemTexts.context}),...l?d:f]:i?[F8({location:t.referenceLocation,texts:e.itemTexts.context}),...h?[h]:[],...l?d:p]:a?[F8({location:t.referenceLocation,texts:e.itemTexts.context}),...m]:o?[F8({location:t.referenceLocation,texts:e.itemTexts.context}),..._]:[j8(e.itemTexts.context),M8(e.itemTexts.context),N8(e.itemTexts.context),...c?f:[],...c?p:[],...c?m:[],...c?_:w8({groups:g,language:e.language,texts:e.itemTexts.context}),...V8({entries:t.panelApps,query:n.query,sectionLabel:e.itemTexts.context.panelAppSectionLabel,texts:e.itemTexts.panelApp})],y=s?t.isServerPathSearchLoading:a?t.isProjectsLoading:o?!!t.isSystemObjectsLoading:t.isPanelAppsLoading||!!t.isSystemObjectsLoading||c&&(t.isProjectsLoading||t.isServerPathSearchLoading),b=!s&&!a&&!o,x=null;return a&&t.projectsError?x=`${e.itemTexts.context.projectsLoadFailedLabel}: ${t.projectsError}`:(o||b)&&t.systemObjectsError?x=`${e.itemTexts.context.searchFailedLabel}: ${t.systemObjectsError}`:(s||b)&&t.serverPathSearchError&&(x=`${e.itemTexts.context.searchFailedLabel}: ${t.serverPathSearchError}`),{isLoading:a?y:y&&v.length===0,items:v,notice:x?{message:x,tone:`error`}:void 0,onSelectItem:t=>W8({isFoldersMode:i,isWorkspaceMode:s,item:t,onNavigate:e.onNavigate,onSelectSystemObject:e.onSelectSystemObject,referencePath:u}),texts:e.menuTexts}}})}function K8(e){let t=e.modelLabel.trim(),n=e.providerLabel.trim();return n?`${n}/${t}`:t}function q8(e){let t=new Map;for(let n of e){let e=n.value.indexOf(`/`),r=e>0?n.value.slice(0,e):n.providerLabel,i=t.get(r)??{key:r,label:n.providerLabel,options:[]};i.options.push({value:n.value,label:n.modelLabel}),t.set(r,i)}return[...t.values()]}function J8(e){return e.map(e=>({value:e.value,modelLabel:e.modelLabel,providerLabel:e.providerLabel,thinkingCapability:e.thinkingCapability?{supported:e.thinkingCapability.supported,default:e.thinkingCapability.default??null}:null}))}function Y8(e){let{isModelOptionsEmpty:t,onGoToProviders:n,texts:r}=e;return t?{tone:`warning`,text:r.noModelOptionsLabel,actionLabel:r.configureProviderLabel,onAction:n}:null}function X8(e){let{onDismiss:t,onSelect:n,options:r,texts:i}=e;if(!(!t||!n||r.length===0))return{summaryLabel:i.discoveredModelsSummaryLabel.replace(`{count}`,String(r.length)),viewLabel:i.discoveredModelsViewLabel,groupLabel:i.discoveredModelsGroupLabel,allGroupLabel:i.allModelsLabel,actionLabel:i.discoveredModelAddLabel,addedLabel:i.discoveredModelAddedLabel,dismissLabel:i.discoveredModelsDismissLabel,doneLabel:i.discoveredModelsDoneLabel,closeLabel:i.discoveredModelsCloseLabel,searchPlaceholder:i.modelSearchPlaceholder,searchEmptyLabel:i.modelSearchEmptyLabel,groups:q8(r),onDismiss:t,onSelect:n}}function Z8({modelOptions:e,discoveredModelOptions:t,favoriteModelValues:n,recentModelValues:r,selectedModel:i,isModelOptionsLoading:a,hasModelOptions:o,onFavoriteToggle:s,onDiscoveredModelSelect:c,onDiscoveredModelsDismiss:l,onOpen:u,onValueChange:d,texts:f}){let p=e.find(e=>e.value===i)??e[0],m=o?p?.value:void 0,h=new Map(e.map(e=>[e.value,e])),g=(n??[]).map(e=>h.get(e)).filter(e=>!!e),_=new Set(g.map(e=>e.value)),v=(r??[]).map(e=>h.get(e)).filter(e=>e!==void 0&&!_.has(e.value)),y=new Set(v.map(e=>e.value)),b=e.filter(e=>!_.has(e.value)&&!y.has(e.value)),x=g.length>0||v.length>0?[{key:`favorite-models`,label:f.favoriteModelsLabel,options:g.map(e=>({value:e.value,label:K8(e)}))},{key:`recent-models`,label:f.recentModelsLabel,options:v.map(e=>({value:e.value,label:K8(e)}))},{key:`all-models`,label:f.allModelsLabel,options:b.map(e=>({value:e.value,label:K8(e)}))}].filter(e=>e.options.length>0):void 0,S=t??[];return{key:`model`,value:m,placeholder:f.modelSelectPlaceholder,selectedLabel:p?K8(p):void 0,icon:`sparkles`,options:e.map(e=>({value:e.value,label:K8(e)})),groups:x,disabled:!o&&S.length===0,loading:a,emptyLabel:f.modelNoOptionsLabel,search:{placeholder:f.modelSearchPlaceholder,emptyLabel:f.modelSearchEmptyLabel},optionAction:s?{kind:`favorite`,activeValues:g.map(e=>e.value),activeLabel:f.unfavoriteModelLabel,inactiveLabel:f.favoriteModelLabel,onToggle:s}:void 0,discovery:X8({options:S,onDismiss:l,onSelect:c,texts:f}),manageLabel:f.manageModelsLabel,manageHref:`/providers`,onOpen:u,onValueChange:d}}function Q8(e){let{defaultThinkingLevel:t,onValueChange:n,selectedThinkingLevel:r,supportedLevels:i,texts:a}=e;if(i.length===0)return null;let o=I3(i),s=o.includes(`off`)?`off`:o[0],c=r&&o.includes(r)&&r||t&&o.includes(t)&&t||s;return{key:`thinking`,value:c,placeholder:a.thinkingLabels[c],selectedLabel:a.thinkingLabels[c],icon:`brain`,options:o.map(e=>({value:e,label:a.thinkingLabels[e]})),onValueChange:e=>n(e)}}var $8={exactSpec:1200,exactLabel:1150,prefixSpec:1e3,prefixLabel:950,prefixToken:900,containsSpec:800,containsLabel:760,containsDescription:500,subsequence:300,fallback:1};function e5(e){return(e??``).trim().toLowerCase()}function t5(e,t){if(!e||!t)return!1;let n=0;for(let r of t)if(r===e[n]&&(n+=1,n>=e.length))return!0;return!1}function n5(e,t){let n=e5(t);if(!n)return $8.fallback;let r=e5(e.key),i=e5(e.label||e.key),a=e5(`${e.descriptionZh??``} ${e.description??``}`),o=i.split(/[\s/_-]+/).filter(Boolean);return r===n?$8.exactSpec:i===n?$8.exactLabel:r.startsWith(n)?$8.prefixSpec:i.startsWith(n)?$8.prefixLabel:o.some(e=>e.startsWith(n))?$8.prefixToken:r.includes(n)?$8.containsSpec:i.includes(n)?$8.containsLabel:a.includes(n)?$8.containsDescription:t5(n,i)||t5(n,r)?$8.subsequence:0}function r5(e){return e>=$8.exactLabel?4:e>=$8.prefixToken?3:e>=$8.containsLabel?2:e>0?1:0}function i5(e){return new Map(e.map((e,t)=>[e,t]))}function a5(e,t){let n=i5(t),r=[],i=[];for(let t of e){if(n.has(t.key)){r.push(t);continue}i.push(t)}return r.sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0)),[...r,...i]}function o5(e,t,n,r=[]){let i=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0}),a=i5(r),o=new Map;for(let t of e){let e=t.groupKey?.trim();e&&!o.has(e)&&o.set(e,o.size)}return e.map((e,n)=>({record:e,order:n,score:n5(e,t)})).filter(e=>e.score>0).sort((e,t)=>{let n=o.get(e.record.groupKey?.trim()??``)??1/0,r=o.get(t.record.groupKey?.trim()??``)??1/0;if(n!==r)return n-r;let s=r5(e.score),c=r5(t.score);if(c!==s)return c-s;let l=a.get(e.record.key)??1/0,u=a.get(t.record.key)??1/0;if(l!==u)return l-u;if(t.score!==e.score)return t.score-e.score;let d=(e.record.label||e.record.key).trim(),f=(t.record.label||t.record.key).trim(),p=i.compare(d,f);return p===0?e.order-t.order:p}).map(({record:e})=>({key:`skill:${e.key}`,title:e.label||e.key,subtitle:n.slashSkillSubtitle,description:(e.descriptionZh??e.description??``).trim()||n.noSkillDescription,detailLines:[`${n.slashSkillSpecLabel}: ${e.key}`,...e.scopeLabel?[`${n.slashSkillScopeLabel}: ${e.scopeLabel}`]:[]],sectionKey:e.groupKey,sectionLabel:e.groupLabel,tokenKind:`skill`,tokenKey:e.key,value:e.key}))}function s5(e){return e.map(e=>({key:e.key,label:e.label,description:e.descriptionZh||e.description||``,badgeLabel:e.badgeLabel}))}function c5(e){let{allSkillsLabel:t,recentKeySet:n,recentSkillsLabel:r,skillRecords:i}=e,a=i.filter(e=>n.has(e.key)),o=new Map;for(let e of i){if(n.has(e.key))continue;let r=e.groupKey?.trim()||`all-skills`,i=e.groupLabel?.trim()||t,a=o.get(r)??{label:i,records:[]};a.records.push(e),o.set(r,a)}let s=[...o].map(([e,t])=>({key:e,label:t.label,options:s5(t.records)})),c=s.some(e=>e.key!==`all-skills`);if(!(a.length===0&&!c))return[...a.length>0?[{key:`recent-skills`,label:r,options:s5(a)}]:[],...s].filter(e=>e.options.length>0)}function l5(e){let{groupedRecentSkillValues:t,isLoading:n,onSelectedKeysChange:r,recentSkillValues:i,selectedSkills:a,skillRecords:o,texts:s}=e,c=a5(o,i??[]),l=new Set(t??[]);return{title:s.title,searchPlaceholder:s.searchPlaceholder,emptyLabel:s.emptyLabel,loadingLabel:s.loadingLabel,isLoading:n,manageLabel:s.manageLabel,manageHref:`/marketplace/skills`,options:s5(c),groups:c5({skillRecords:c,recentKeySet:l,recentSkillsLabel:s.recentSkillsLabel,allSkillsLabel:s.allSkillsLabel}),selectedKeys:a,onSelectedKeysChange:r}}var u5=`commands`,d5=`panel-app-action`,f5=`panel-apps`,p5=`skills`;function m5(e){let t=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0});return e.commands.map((t,n)=>({command:t,order:n,score:f8({id:t.key,label:t.title,description:t.description,aliases:t.keywords},e.query)})).filter(e=>e.score>0).sort((e,n)=>{let r=p8(e.score),i=p8(n.score);return i===r?n.score===e.score?t.compare(e.command.title,n.command.title)||e.order-n.order:n.score-e.score:i-r}).map(({command:t})=>({key:`command:${t.key}`,icon:t.icon,title:t.title,subtitle:e.texts.commandSubtitle,description:t.description,detailLines:[...t.detailLines??[]],hintLabel:e.texts.commandHintLabel,sectionKey:u5,sectionLabel:e.texts.commandSectionLabel}))}function h5(e){let{data:t,itemTexts:n,query:r,skillHintLabel:i,skillSectionLabel:a}=e;return o5([...t.skillRecords],r,n,[...t.recentSkillValues]).map(e=>({...e,icon:`skill`,hintLabel:i,sectionKey:e.sectionKey?`${p5}:${e.sectionKey}`:p5,sectionLabel:e.sectionLabel||a}))}function g5(e){return B8({entries:e.data.panelApps,keyPrefix:d5,query:e.query,texts:e.itemTexts}).map(t=>({...t,icon:`panel-app`,hintLabel:e.panelAppHintLabel,sectionKey:f5,sectionLabel:e.panelAppSectionLabel}))}function _5(e){let t=`${d5}:`;return e.key.startsWith(t)?e.key.slice(t.length):null}function v5(e){return yF({key:`slash-command`,trigger:Is,resolvePanel:t=>{let{data:n,trigger:r}=t,i=h5({data:n,itemTexts:e.itemTexts.skillTexts,query:r.query,skillHintLabel:e.labels.skillHintLabel,skillSectionLabel:e.labels.skillSectionLabel}),a=[...new Set(i.flatMap(e=>e.sectionKey?[e.sectionKey]:[]))];return{filterOptions:[{key:`all`,label:e.labels.filterAllLabel},{key:u5,label:e.labels.filterCommandsLabel,sectionKeys:[u5]},{key:p5,label:e.labels.filterSkillsLabel,sectionKeys:a.length>0?a:[p5]},{key:f5,label:e.labels.filterPanelAppsLabel,sectionKeys:[f5]}],isLoading:n.isPanelAppsLoading||n.isSkillsLoading,items:[...m5({commands:e.commands,query:r.query,texts:{commandHintLabel:e.labels.commandHintLabel,commandSectionLabel:e.labels.commandSectionLabel,commandSubtitle:e.labels.commandSubtitle}}),...i,...g5({data:n,itemTexts:e.itemTexts.panelAppTexts,panelAppHintLabel:e.labels.panelAppHintLabel,panelAppSectionLabel:e.labels.panelAppSectionLabel,query:r.query})],onSelectItem:t=>{if(t.key.startsWith(`command:`)){e.commands.find(e=>t.key===`command:${e.key}`)?.onSelect();return}let n=_5(t);if(n){e.onSelectPanelApp(n);return}let r=t.tokenKey??t.value;r&&e.onSelectSkill?.(r)},texts:e.menuTexts}}})}function y5(e){let{commands:t,language:n,onNavigate:r,onSelectPanelApp:i,onSelectSkill:a,onSelectSystemObject:o,slashTexts:s}=e,c={appIdLabel:b(`chatPanelAppReferenceAppId`,n),fileLabel:b(`chatPanelAppReferenceFile`,n),noDescriptionLabel:b(`chatPanelAppReferenceNoDescription`,n),subtitle:b(`chatPanelAppReferenceType`,n)};return[v5({commands:t,itemTexts:{panelAppTexts:c,skillTexts:s},menuTexts:{loadingLabel:b(`chatSlashLoading`,n),sectionLabel:b(`chatSlashSection`,n),emptyLabel:b(`chatSlashNoResult`,n),hintLabel:b(`chatSlashHint`,n),itemHintLabel:b(`chatSlashSkillHint`,n)},labels:{commandHintLabel:b(`chatSlashCommandHint`,n),commandSectionLabel:b(`chatSlashSectionCommands`,n),commandSubtitle:b(`chatSlashTypeCommand`,n),filterAllLabel:b(`chatSlashFilterAll`,n),filterCommandsLabel:b(`chatSlashFilterCommands`,n),filterPanelAppsLabel:b(`chatSlashFilterPanelApps`,n),filterSkillsLabel:b(`chatSlashFilterSkills`,n),panelAppHintLabel:b(`chatSlashPanelAppHint`,n),panelAppSectionLabel:b(`chatPanelAppReferenceSection`,n),skillHintLabel:b(`chatSlashSkillHint`,n),skillSectionLabel:b(`chatSlashSectionSkills`,n)},onSelectPanelApp:i,onSelectSkill:a}),G8({itemTexts:{context:{backLabel:b(`chatContextReferenceBack`,n),backDescription:b(`chatContextReferenceBackDescription`,n),backHintLabel:b(`chatContextReferenceBackHint`,n),currentDirectoryLabel:b(`chatContextReferenceCurrentDirectory`,n),directoryDescription:b(`chatContextReferenceDirectoryDescription`,n),fileDescription:b(`chatContextReferenceFileDescription`,n),filesDescription:b(`chatContextReferenceFilesDescription`,n),filesHintLabel:b(`chatContextReferenceFilesHint`,n),filesLabel:b(`chatContextReferenceFilesLabel`,n),filesSubtitle:b(`chatContextReferenceFilesType`,n),foldersDescription:b(`chatContextReferenceFoldersDescription`,n),foldersHintLabel:b(`chatContextReferenceFoldersHint`,n),foldersLabel:b(`chatContextReferenceFoldersLabel`,n),foldersSubtitle:b(`chatContextReferenceFoldersType`,n),panelAppSectionLabel:b(`chatPanelAppReferenceSection`,n),parentLabel:b(`chatContextReferenceParent`,n),parentDescription:b(`chatContextReferenceParentDescription`,n),parentHintLabel:b(`chatContextReferenceParentHint`,n),projectDescription:b(`chatContextReferenceProjectDescription`,n),projectPathLabel:b(`chatContextReferenceProjectPath`,n),projectSectionLabel:b(`chatContextReferenceProjectSection`,n),projectSubtitle:b(`chatContextReferenceProjectType`,n),projectsDescription:b(`chatContextReferenceProjectsDescription`,n),projectsHintLabel:b(`chatContextReferenceProjectsHint`,n),projectsLabel:b(`chatContextReferenceProjectsLabel`,n),projectsLoadFailedLabel:b(`chatContextReferenceProjectsLoadFailed`,n),projectsSubtitle:b(`chatContextReferenceProjectsType`,n),projectRootLabel:b(`chatContextReferenceProjectRoot`,n),searchFailedLabel:b(`chatContextReferenceSearchFailed`,n),systemObjectGroupHintLabel:b(`chatSystemObjectGroupHint`,n),systemObjectSectionLabel:b(`chatSystemObjectSection`,n)},panelApp:c},menuTexts:{loadingLabel:b(`chatContextReferenceLoading`,n),sectionLabel:b(`chatContextReferenceSection`,n),emptyLabel:b(`chatContextReferenceNoResult`,n),hintLabel:b(`chatContextReferenceHint`,n),itemHintLabel:b(`chatContextReferenceItemHint`,n)},language:n,onNavigate:r,onSelectSystemObject:o})]}function b5(e){return[`server-path-search`,e.basePath.trim(),e.query?.trim()??``,e.limit??null]}function x5(e){let{enabled:t,limit:n}=e,r=e.basePath.trim(),i=e.query?.trim()??``;return Ot({queryKey:b5({basePath:r,query:i,limit:n}),queryFn:()=>nn({basePath:r,query:i,limit:n}),enabled:(t??!0)&&!!r,staleTime:5e3})}function S5(e){let{enabled:t,limit:n,objectType:r}=e,i=e.query.trim();return Ot({queryKey:[`system-object-references`,r??null,i,n??null],queryFn:()=>I.systemObjectReferences.list({query:i||void 0,limit:n,objectType:r}),enabled:t,staleTime:1e4})}function C5(e){let t=e.parentRelativePath.split(`/`).filter(Boolean).join(`/`);return e.entries.map(e=>({name:e.name,path:e.path,relativePath:[t,e.name].filter(Boolean).join(`/`),parentRelativePath:t,kind:e.kind,hidden:e.hidden}))}function Mne(e){let{inputSurfaceTrigger:t,isContextReferenceTrigger:n,query:r,referenceLocation:i}=e,a=gY({enabled:n&&i.view===`root`||t?.key===Is.key}),o=nR({enabled:!!(n&&(i.view===`root`||i.view===`projects`))}),s=i.view===`system-objects`?i.objectType:void 0;return{panelApps:a,projects:o,systemObjects:S5({enabled:!!(n&&(i.view===`root`||i.view===`system-objects`)),query:r,limit:s?20:6,objectType:s})}}function Nne(e){let{isSkillsLoading:t,itemTexts:n,language:r,onSelectPanelApp:i,onSelectSkill:a,onSelectSystemObject:o,projectRoot:s,recentSkillValues:c,skillRecords:l,commands:u}=e,[d,f]=(0,V.useState)({view:`root`}),[p,m]=(0,V.useState)(null),h=(0,V.useRef)(`null`),g=(0,V.useCallback)(e=>{let t=JSON.stringify(e?[e.key,e.marker,e.query,e.start,e.end]:null);h.current!==t&&(h.current=t,e||f({view:`root`}),m(e))},[]),_=p?.key===H8.key,v=d.view===`files`||d.view===`folders`,y=v?d.path:``,b=(0,V.useDeferredValue)(_?p.query:``),x=!!(_&&s&&v&&!b.trim()),S=!!(_&&s&&(d.view===`root`||v)&&b.trim()),C=NF({path:y||`.`,basePath:s,includeFiles:d.view===`files`,enabled:x}),w=x5({basePath:s,query:b,enabled:S}),T=x?C:w,E=(0,V.useMemo)(()=>x?C5({entries:C.data?.entries??[],parentRelativePath:y}):w.data?.entries??[],[x,y,C.data?.entries,w.data?.entries]),{panelApps:D,projects:O,systemObjects:k}=Mne({inputSurfaceTrigger:p,isContextReferenceTrigger:_,query:b,referenceLocation:d}),A=(0,V.useMemo)(()=>y5({commands:u,language:r,onNavigate:f,onSelectPanelApp:i,onSelectSkill:a,onSelectSystemObject:o,slashTexts:n.slashTexts}),[u,n.slashTexts,r,i,a,o]);return{inputSurfaceState:(0,V.useMemo)(()=>bF({data:{isPanelAppsLoading:D.isLoading||D.isFetching,isProjectsLoading:O.isLoading||O.isFetching,isServerPathSearchLoading:T.isLoading||T.isFetching,isSkillsLoading:t,isSystemObjectsLoading:k.isLoading||k.isFetching,panelApps:D.data?.entries??[],projectRoot:s,projects:O.data?.projects??[],projectsError:O.error instanceof Error?O.error.message:null,recentSkillValues:c,referenceLocation:d,serverPathEntries:E,serverPathSearchError:T.error instanceof Error?T.error.message:null,skillRecords:l,systemObjectGroups:k.data?.groups??[],systemObjectsError:k.error instanceof Error?k.error.message:null},plugins:A,trigger:p}),[A,p,D.data?.entries,D.isFetching,D.isLoading,s,O.data?.projects,O.error,O.isFetching,O.isLoading,T.error,T.isFetching,T.isLoading,d,E,t,c,l,k.data?.groups,k.error,k.isFetching,k.isLoading]),setInputSurfaceTrigger:g}}var w5=mn.chat.modelFavorites,T5=[`preference`,w5];function Pne(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();e&&!t.includes(e)&&t.push(e)}return t}function Fne(e){let t=F(),n=(0,V.useMemo)(()=>new Set(e),[e]),r=Ot({queryKey:T5,queryFn:()=>nt(w5),staleTime:3e4}),i=(0,V.useMemo)(()=>Pne(r.data?.value),[r.data?.value]),a=(0,V.useMemo)(()=>i.filter(e=>n.has(e)),[n,i]),o=jt({mutationFn:async e=>await Oe(w5,e),onMutate:async e=>{await t.cancelQueries({queryKey:T5});let n=t.getQueryData(T5);return t.setQueryData(T5,{key:w5,value:e,updatedAt:new Date().toISOString()}),{previous:n}},onError:(e,n,r)=>{r?.previous&&t.setQueryData(T5,r.previous)},onSuccess:e=>{t.setQueryData(T5,e)}}),s=(0,V.useCallback)((e,t)=>{let n=e.trim();if(!n)return;let r=t?[n,...i.filter(e=>e!==n)]:i.filter(e=>e!==n);o.mutate(r)},[i,o]);return{favoriteModelValues:a,isLoading:r.isLoading,setModelFavorite:s}}var E5=new l6({storageKey:`nextclaw.chat.recent-skills`,limit:5});function Ine(e){let{addAttachments:t,attachmentSupported:n,inputBarRef:r}=e,i=(0,V.useCallback)(e=>{if(e===`unsupported-type`){R.error(b(`chatInputAttachmentUnsupported`));return}if(e===`too-large`){R.error(b(`chatInputAttachmentTooLarge`).replace(`{maxMb}`,String(l4/(1024*1024))));return}R.error(b(`chatInputAttachmentReadFailed`))},[]),a=(0,V.useCallback)(async e=>{if(!n||e.length===0)return;let a=await m4(e,{uploadBatch:ree});if(a.attachments.length>0){let e=t(a.attachments);e.length>0&&r.current?.insertFileTokens(e.map(e=>({tokenKey:e.id,label:e.name,previewUrl:e.mimeType.startsWith(`image/`)?e.url:void 0})))}a.rejected.length>0&&i(a.rejected[0].reason)},[t,n,r,i]);return{handleFilesAdd:a,handleFileInputChange:(0,V.useCallback)(async e=>{let t=Array.from(e.target.files??[]);e.currentTarget.value=``,await a(t)},[a])}}function Lne(e){let{inputBarRef:t,intentManager:n,selectedSessionKey:r}=e;(0,V.useEffect)(()=>{let e=r?.trim()||null,i=e=>{let r=t.current;r&&(r.insertToken({tokenKind:e.kind,tokenKey:e.tokenKey,label:e.label,data:e.kind===`workspace_excerpt`?{path:e.path,excerpt:e.excerpt,startLine:e.startLine,endLine:e.endLine}:e.kind===`conversation_excerpt`?{messageId:e.messageId,role:e.role,excerpt:e.excerpt}:e.kind===`ui_resource`?{reference:e.reference}:void 0}),n.markConsumed(e.id))},a=n.subscribe(e,i),o=n.consumePending(e);return o&&i(o),a},[t,n,r])}function Rne(e){return(0,V.useCallback)(t=>{let n=[...t];e.update(e=>({nodes:n,attachments:x0(n,e.attachments),text:_0(n),selectedSkills:v0(n),sendError:null}))},[e])}function D5(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zne(e){let{inputActions:t,selectedSessionKey:n}=e,r=Ms(),i=(0,V.useRef)(0),a=(0,V.useRef)(new Map),o=(0,V.useRef)(Promise.resolve());return(0,V.useCallback)((e,s,c)=>{let l=n?.trim();if(!l)return;let u=++i.current,d=`${l}:model`,f=`${l}:thinking`;D5(e,`preferredModel`)&&a.current.set(d,u),D5(e,`preferredThinking`)&&a.current.set(f,u);let p=o.current.then(()=>r({invalidateSessionSkills:!1,sessionKey:l,patch:e,successMessage:null}));o.current=p.catch(()=>void 0),p.catch(()=>{t.update(t=>{let n={};return D5(e,`preferredModel`)&&a.current.get(d)===u&&t.selectedModel===s.selectedModel&&D5(c,`selectedModel`)&&(n.selectedModel=c.selectedModel),D5(e,`preferredThinking`)&&a.current.get(f)===u&&t.selectedThinkingLevel===s.selectedThinkingLevel&&D5(c,`selectedThinkingLevel`)&&(n.selectedThinkingLevel=c.selectedThinkingLevel),n})})},[t,n,r])}function Bne(e){let{language:t,onContextCompactingChange:n,onSendPresetMessage:r,selectedSessionKey:i}=e,a=tI(),o=(0,V.useRef)(new Set),s=(0,V.useCallback)(async e=>{if(!o.current.has(e)){o.current.add(e),n?.(e,!0);try{await be(e),R.success(b(`chatSlashCommandCompactContextSuccess`,t))}catch(e){let n=e instanceof Error?e.message:String(e);R.error(`${b(`chatSlashCommandCompactContextFailed`,t)}: ${n}`)}finally{o.current.delete(e),n?.(e,!1)}}},[t,n]);return(0,V.useMemo)(()=>{let e=i?.trim();return e?[{key:`side-chat`,icon:`message-square-plus`,title:b(`chatSlashCommandSideChatTitle`,t),description:b(`chatSlashCommandSideChatDescription`,t),detailLines:[b(`chatSlashCommandSideChatDetail`,t)],keywords:[`side`,`chat`,`child`,`branch`,`new`],onSelect:()=>a.chatThreadManager.openSideChatDraft(e)},{key:`update-session-title`,icon:`command`,title:b(`chatSlashCommandUpdateSessionTitleTitle`,t),description:b(`chatSlashCommandUpdateSessionTitleDescription`,t),detailLines:[b(`chatSlashCommandUpdateSessionTitleDetail`,t)],keywords:[`update`,`rename`,`title`,`session`,`更新`,`重命名`,`标题`,`会话`],onSelect:()=>void r(b(`chatSlashCommandUpdateSessionTitlePrompt`,t))},{key:`compact-context`,icon:`list-collapse`,title:b(`chatSlashCommandCompactContextTitle`,t),description:b(`chatSlashCommandCompactContextDescription`,t),detailLines:[b(`chatSlashCommandCompactContextDetail`,t)],keywords:[`compact`,`compress`,`context`,`summary`,`压缩`,`上下文`],onSelect:()=>void s(e)}]:[]},[s,t,r,a.chatThreadManager,i])}function Vne(e){return(0,V.useCallback)(t=>{I.systemObjectReferences.resolve(t).then(t=>{e.current?.insertInputSurfaceToken({tokenKind:o,tokenKey:t.uri,label:t.label,data:{reference:t}})}).catch(e=>{let t=e instanceof Error?e.message:b(`error`);R.error(`${b(`chatSystemObjectResolveFailed`)}: ${t}`)})},[e])}function Hne(){return{off:b(`chatThinkingLevelOff`),minimal:b(`chatThinkingLevelMinimal`),low:b(`chatThinkingLevelLow`),medium:b(`chatThinkingLevelMedium`),high:b(`chatThinkingLevelHigh`),adaptive:b(`chatThinkingLevelAdaptive`),xhigh:b(`chatThinkingLevelXhigh`)}}function Une(e){let{allModelsLabel:t,favoriteModelLabel:n,favoriteModelValues:r,favoriteModelsLabel:i,hasModelOptions:a,isModelOptionsLoading:o,modelRecords:s,discoveredModelRecords:c,modelSearchEmptyLabel:l,modelSearchPlaceholder:u,onFavoriteModelToggle:d,onDiscoveredModelSelect:f,onDiscoveredModelsDismiss:p,onModelSelectOpen:m,onModelChange:h,onThinkingChange:g,recentModelValues:_,recentModelsLabel:v,selectedModel:y,selectedThinkingLevel:x,thinkingDefaultLevel:S,thinkingSupportedLevels:C,unfavoriteModelLabel:w}=e;return[Z8({modelOptions:s,discoveredModelOptions:c,favoriteModelValues:r,recentModelValues:_,selectedModel:y,isModelOptionsLoading:o,hasModelOptions:a,onFavoriteToggle:d,onDiscoveredModelSelect:f,onDiscoveredModelsDismiss:p,onOpen:m,onValueChange:h,texts:{modelSelectPlaceholder:b(`chatSelectModel`),modelNoOptionsLabel:b(`chatModelNoOptions`),modelSearchPlaceholder:u,modelSearchEmptyLabel:l,favoriteModelsLabel:i,favoriteModelLabel:n,unfavoriteModelLabel:w,manageModelsLabel:b(`chatManageModels`),discoveredModelsSummaryLabel:b(`chatDiscoveredModelsSummary`),discoveredModelsViewLabel:b(`chatDiscoveredModelsView`),discoveredModelsGroupLabel:b(`chatDiscoveredModelsGroup`),discoveredModelAddLabel:b(`chatDiscoveredModelAdd`),discoveredModelAddedLabel:b(`chatDiscoveredModelAddedShort`),discoveredModelsDismissLabel:b(`chatDiscoveredModelsDismiss`),discoveredModelsDoneLabel:b(`chatDiscoveredModelsDone`),discoveredModelsCloseLabel:b(`chatDiscoveredModelsClose`),recentModelsLabel:v,allModelsLabel:t}}),Q8({supportedLevels:C,selectedThinkingLevel:x,defaultThinkingLevel:S,onValueChange:g,texts:{thinkingLabels:Hne()}})].filter(e=>e!==null)}function Wne(e){let{allSkillsLabel:t,isSkillsLoading:n,onSelectedKeysChange:r,recentSkillGroupValues:i,recentSkillValues:a,recentSkillsLabel:o,selectedSkills:s,skillRecords:c}=e;return l5({skillRecords:c,recentSkillValues:a,groupedRecentSkillValues:i,selectedSkills:[...s],isLoading:n,onSelectedKeysChange:r,texts:{title:b(`chatSkillsPickerTitle`),searchPlaceholder:b(`chatSkillsPickerSearchPlaceholder`),emptyLabel:b(`chatSkillsPickerEmpty`),loadingLabel:b(`sessionsLoading`),manageLabel:b(`chatSkillsPickerManage`),recentSkillsLabel:o,allSkillsLabel:t}})}function Gne(e,t){let n=e?.thinkingCapability;return!n||n.supported.length===0?null:t===`off`?`off`:t&&n.supported.includes(t)?t:n.default&&n.supported.includes(n.default)?n.default:`off`}function Kne({item:e}){let t=e.attachments??[],n=t.slice(0,3);return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[n.map((e,t)=>e.previewUrl?(0,H.jsx)(`img`,{alt:e.name,loading:`lazy`,src:e.previewUrl,title:e.name,className:`h-9 w-9 shrink-0 rounded-md border border-border/70 object-cover`},`${e.name}-${t}`):(0,H.jsxs)(`span`,{title:e.name,className:`inline-flex min-w-0 max-w-36 shrink items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground`,children:[(0,H.jsx)(go,{className:`h-3 w-3 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.name})]},`${e.name}-${t}`)),t.length>n.length?(0,H.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[`+`,t.length-n.length]}):null,e.preview||t.length===0?(0,H.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-foreground/80`,children:e.preview||b(`chatQueuedBannerAttachmentFallback`)}):null]})}function O5({children:e,disabled:t=!1,label:n,onClick:r}){return(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`span`,{className:`inline-flex`,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":n,disabled:t,onClick:r,className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-not-allowed disabled:text-muted-foreground/50`,children:e})})}),(0,H.jsx)(qr,{side:`top`,children:n})]})}function qne({controller:e}){return e.queuedInputs.length===0?null:(0,H.jsx)($r,{delayDuration:120,children:(0,H.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:e.queuedInputs.map(t=>(0,H.jsxs)(`div`,{className:`flex min-h-8 min-w-0 items-center gap-2 text-sm`,children:[(0,H.jsx)(Sa,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,H.jsx)(Kne,{item:t}),t.isSubmitting?(0,H.jsxs)(`span`,{"aria-label":b(`chatQueuedSubmitting`),className:`inline-flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(fi,{className:`h-3.5 w-3.5 animate-spin`}),b(`chatQueuedSubmitting`)]}):(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,H.jsx)(O5,{disabled:!e.canEditQueuedInput,label:e.canEditQueuedInput?b(`chatQueuedEdit`):b(`chatQueuedEditComposerNotEmpty`),onClick:()=>e.editQueuedInput(t.id),children:(0,H.jsx)(yo,{className:`h-4 w-4`})}),(0,H.jsx)(O5,{label:b(`chatQueuedSteer`),onClick:()=>e.steerQueuedInput(t.id),children:(0,H.jsx)(lee,{className:`h-4 w-4`})}),(0,H.jsx)(O5,{label:b(`chatQueuedDelete`),onClick:()=>e.deleteQueuedInput(t.id),children:(0,H.jsx)(Vo,{className:`h-4 w-4`})})]})]},t.id))})})}function Jne(e,t,n){return e.map(e=>({key:e.ref,label:e.name,scopeLabel:t[e.source],groupKey:e.source,groupLabel:n[e.source],description:e.description,descriptionZh:e.descriptionZh,badgeLabel:t[e.source]}))}function Yne(e){let{skillGroupLabels:t,skillScopeLabels:n}=(0,V.useMemo)(()=>({skillScopeLabels:{builtin:b(`chatSkillScopeBuiltin`),global:b(`chatSkillScopeGlobal`),project:b(`chatSkillScopeProject`),workspace:b(`chatSkillScopeWorkspace`)},skillGroupLabels:{builtin:b(`chatSkillGroupBuiltin`),global:b(`chatSkillGroupGlobal`),project:b(`chatSkillGroupProject`),workspace:b(`chatSkillGroupWorkspace`)}}),[e]);return{skillScopeLabels:n,skillGroupLabels:t,slashTexts:(0,V.useMemo)(()=>({slashSkillSubtitle:b(`chatSlashTypeSkill`),slashSkillSpecLabel:b(`chatSlashSkillSpec`),slashSkillScopeLabel:b(`chatSlashSkillScope`),noSkillDescription:b(`chatSkillsPickerNoDescription`)}),[e]),recentModelsLabel:b(`chatPickerRecentModels`),allModelsLabel:b(`chatPickerAllModels`),favoriteModelsLabel:b(`chatPickerFavoriteModels`),modelSearchPlaceholder:b(`chatModelSearchPlaceholder`),modelSearchEmptyLabel:b(`chatModelSearchEmpty`),favoriteModelLabel:b(`chatFavoriteModel`),unfavoriteModelLabel:b(`chatUnfavoriteModel`),recentSkillsLabel:b(`chatPickerRecent`),allSkillsLabel:b(`chatPickerAllSkills`)}}function Xne(e){let{modelOptions:t,skillGroupLabels:n,skillRecords:r,skillScopeLabels:i}=e,a=(0,V.useMemo)(()=>Jne(r,i,n),[n,i,r]),o=(0,V.useMemo)(()=>J8(t),[t]);return{skillRecords:a,modelRecords:o,recentModelValues:u6.resolveVisible({availableValues:o.map(e=>e.value),minAvailableCount:5}),recentSkillValues:E5.resolveVisible({availableValues:a.map(e=>e.key),minAvailableCount:0}),recentSkillGroupValues:E5.resolveVisible({availableValues:a.map(e=>e.key),minAvailableCount:4})}}var Zne=(0,V.memo)(function(e){let{contextWindow:t,controller:n,inputActions:r,inputQuery:i,inputSnapshot:a,onContextCompactingChange:o,placeholder:s,surface:c=`default`}=e,l=tI(),{language:u}=jn(),f=B1(e=>e.layout),{isMobile:p}=c8(),m=(0,V.useRef)(null),h=(0,V.useRef)(null),g=Yne(u),{skillRecords:_,modelRecords:v,recentModelValues:y,recentSkillValues:x,recentSkillGroupValues:S}=Xne({modelOptions:i.modelOptions,skillRecords:i.skillRecords,skillGroupLabels:g.skillGroupLabels,skillScopeLabels:g.skillScopeLabels}),C=(0,V.useMemo)(()=>J8(i.discoveredModelOptions),[i.discoveredModelOptions]),w=Bne({language:u,onContextCompactingChange:o,onSendPresetMessage:n.sendPresetMessage,selectedSessionKey:i.selectedSessionKey}),T=(0,V.useCallback)(e=>void l.chatUiManager.showContent({target:{type:`panel_app`,payload:{appId:e}}}),[l.chatUiManager]),E=i.selectedSessionKey?i.selectedSession?.projectRoot??i.defaultProjectRoot??``:a.pendingProjectRoot??i.defaultProjectRoot??``,D=Vne(m),{inputSurfaceState:O,setInputSurfaceTrigger:k}=Nne({commands:w,isSkillsLoading:i.isSkillsLoading,itemTexts:{slashTexts:g.slashTexts},language:u,onSelectPanelApp:T,onSelectSkill:E5.remember,onSelectSystemObject:D,projectRoot:E,recentSkillValues:x,skillRecords:_}),{favoriteModelValues:A,setModelFavorite:ee}=Fne((0,V.useMemo)(()=>v.map(e=>e.value),[v])),j=a.selectedModel??``,M=a.selectedThinkingLevel,N={isProviderStateResolved:i.isProviderStateResolved,modelOptions:i.modelOptions,sessionTypeUnavailable:i.sessionTypeState.sessionTypeUnavailable},te=a3(N),P=o3(N),ne=s3(N),re=c3(N),ie=ne?b(`chatModelNoOptions`):s??b(p?`chatInputPlaceholderCompact`:`chatInputPlaceholder`),ae=v.find(e=>e.value===j),oe=ae?.thinkingCapability?.supported??[],{handleFilesAdd:se,handleFileInputChange:ce}=Ine({attachmentSupported:!0,inputBarRef:m,addAttachments:r.addAttachments}),le=zne({inputActions:r,selectedSessionKey:i.selectedSessionKey}),ue=Rne(r);Lne({inputBarRef:m,intentManager:l.chatComposerIntentManager,selectedSessionKey:i.selectedSessionKey});let de=(0,V.useCallback)(e=>{let t=Gne(v.find(t=>t.value===e)??C.find(t=>t.value===e),M);r.update({selectedModel:e,selectedThinkingLevel:t,sendError:null}),u6.remember(e,{namespace:i.sessionTypeState.selectedSessionType}),d(e)||u6.remember(e),le({preferredModel:d(e)?null:e,preferredThinking:t},{selectedModel:e,selectedThinkingLevel:t},{selectedModel:j,selectedThinkingLevel:M})},[r,C,i.sessionTypeState.selectedSessionType,v,M,le,j]),fe=(0,V.useCallback)(async e=>{let t=await i.addDiscoveredModel(e);if(!t)throw R.error(b(`chatDiscoveredModelUnavailable`)),Error(`Discovered provider model is no longer available.`);R.success(b(`chatDiscoveredModelAdded`).replace(`{model}`,t.modelLabel))},[i]),pe=(0,V.useCallback)(e=>{r.setSelectedThinkingLevel(e),le({preferredThinking:e},{selectedThinkingLevel:e},{selectedThinkingLevel:M})},[r,le,M]),me=(0,V.useCallback)(e=>{let t=a.selectedSkills;e.filter(e=>!t.includes(e)).forEach(e=>E5.remember(e)),ue(b0([...a.nodes],e,i.skillRecords.map(e=>({ref:e.ref,name:e.name}))))},[ue,i.skillRecords,a.nodes,a.selectedSkills]);(0,V.useEffect)(()=>{a.composerFocusRequestId&&(m.current?.focusComposerAtEnd([...a.nodes]),r.consumeComposerFocusRequest())},[r,a.composerFocusRequestId,a.nodes]);let he=Une({allModelsLabel:g.allModelsLabel,favoriteModelLabel:g.favoriteModelLabel,favoriteModelValues:A,favoriteModelsLabel:g.favoriteModelsLabel,hasModelOptions:te,isModelOptionsLoading:P,discoveredModelRecords:C,modelRecords:v,modelSearchEmptyLabel:g.modelSearchEmptyLabel,modelSearchPlaceholder:g.modelSearchPlaceholder,onFavoriteModelToggle:ee,onDiscoveredModelSelect:fe,onDiscoveredModelsDismiss:i.dismissDiscoveredModels,onModelSelectOpen:()=>{i.refreshProviderModelCatalog()},onModelChange:de,onThinkingChange:pe,recentModelValues:y,recentModelsLabel:g.recentModelsLabel,selectedModel:j,selectedThinkingLevel:M,thinkingSupportedLevels:oe,thinkingDefaultLevel:ae?.thinkingCapability?.default??null,unfavoriteModelLabel:g.unfavoriteModelLabel}),ge=Wne({allSkillsLabel:g.allSkillsLabel,onSelectedKeysChange:me,recentSkillGroupValues:S,recentSkillValues:x,recentSkillsLabel:g.recentSkillsLabel,isSkillsLoading:i.isSkillsLoading,skillRecords:_,selectedSkills:a.selectedSkills}),_e=(0,V.useMemo)(()=>[...a.nodes],[a.nodes]),ve=c===`default`&&f===`flat`,ye=(0,H.jsx)(Vb,{ref:m,surface:ve?`embedded`:c,topSlot:n.queuedInputs.length>0?(0,H.jsx)(qne,{controller:n}):null,composer:{nodes:_e,placeholder:ie,excerptCharacterCountTemplate:b(`chatWorkspaceExcerptCharacterCount`),removeTokenLabel:b(`chatInputRemoveReference`),disabled:re,onNodesChange:ue,onFilesAdd:se,inputSurfaceTriggerSpecs:O.triggerSpecs,onInputSurfaceTriggerChange:k},inputSurface:O.panel??void 0,hint:Y8({isModelOptionsEmpty:ne,onGoToProviders:l.chatUiManager.goToProviders,texts:{noModelOptionsLabel:b(`chatModelNoOptions`),configureProviderLabel:b(`chatGoConfigureProvider`)}}),toolbar:{addMenuLabel:b(`chatInputAdd`),selects:[],trailingSelects:he,accessories:[{key:`attach`,label:b(`chatInputAttach`),icon:`paperclip`,disabled:re,onClick:()=>h.current?.click()}],skillPicker:ge,actions:{isSending:n.isSending,canStopGeneration:n.canStopGeneration,sendDisabled:n.sendDisabled,stopDisabled:n.stopDisabled,stopHint:b(`chatStopUnavailable`),sendButtonLabel:n.primaryAction===`continue`?b(`chatContinueRun`):b(`chatSend`),sendIcon:n.primaryAction,stopButtonLabel:b(`chatStop`),contextWindow:t,onSend:n.send,onAlternateSend:n.sendSteering,onStop:n.stop}}});return(0,H.jsxs)(H.Fragment,{children:[ve?(0,H.jsx)(K0,{className:`pb-4 pt-2`,width:`composer`,children:ye}):ye,(0,H.jsx)(`input`,{ref:h,type:`file`,multiple:!0,className:`hidden`,onChange:ce})]})});function Qne(e){let{applyPromptSuggestion:t,applySystemObjectReference:n,consumeDraftIntent:r}=e,i=F9(),a=tI();(0,V.useEffect)(()=>{if(!r)return;let e=e=>{a.chatSessionListManager.createSession(),a.chatSessionListManager.setSelectedAgentId(`main`),e.kind===`prompt`?t(e.prompt):n(e.reference),i.chatDraftIntentManager.markConsumed(e.id)},o=i.chatDraftIntentManager.subscribe(e),s=i.chatDraftIntentManager.consumePending();return s&&e(s),o},[i,t,n,r,a])}function k5(e){if(!e||typeof e!=`object`)return null;let t=e.chatDraft;return!t||typeof t!=`object`?null:t}function $ne(e){let{applyPromptSuggestion:t,sessionKey:n,setPendingProjectRoot:r,setPendingSessionType:i}=e,a=_e(),o=(0,V.useRef)(null);(0,V.useEffect)(()=>{if(n)return;let e=k5(a.state);if(!e)return;let s=[a.key,typeof e.sessionType==`string`?e.sessionType:``,typeof e.projectRoot==`string`?e.projectRoot:``,typeof e.prompt==`string`?e.prompt:``].join(`:`);o.current!==s&&(o.current=s,typeof e.sessionType==`string`&&e.sessionType.trim()&&i(e.sessionType),typeof e.prompt==`string`&&e.prompt.trim()&&t(e.prompt),r(typeof e.projectRoot==`string`&&e.projectRoot.trim()?e.projectRoot:null))},[t,a.key,a.state,n,r,i])}function ere({inputQuery:e}){let t=tI(),n=e.isProviderStateResolved&&e.modelOptions.length===0,r=e.sessionTypeState.sessionTypeUnavailableMessage?.trim()||null;return(0,H.jsxs)(H.Fragment,{children:[n?(0,H.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-amber-200/70 bg-amber-50/70 flex items-center justify-between gap-3 shrink-0 sm:px-5`,children:[(0,H.jsx)(`span`,{className:`text-xs text-amber-800`,children:b(`chatModelNoOptions`)}),(0,H.jsx)(`button`,{type:`button`,onClick:t.chatUiManager.goToProviders,className:`text-xs font-semibold text-amber-900 underline-offset-2 hover:underline`,children:b(`chatGoConfigureProvider`)})]}):null,e.sessionTypeState.sessionTypeUnavailable&&r?(0,H.jsx)(`div`,{className:`px-4 py-2.5 border-b border-amber-200/70 bg-amber-50/70 shrink-0 sm:px-5`,children:(0,H.jsx)(`span`,{className:`text-xs text-amber-800`,children:r})}):null]})}function A5(e){let{consumeDraftIntent:t=!1,materializationContext:n=null,onSessionMaterialized:r,sessionKey:i,showWelcomeForDraft:a=!0}=e,o=_e(),s=i?null:k5(o.state),c=typeof s?.prompt==`string`?s.prompt:null,l=ot(),u=oL(e=>e.snapshot.selectedAgentId),d=F4(i??void 0),f=s8(i),{inputActions:p,inputSnapshot:m}=a8(c,i),h=(0,V.useCallback)(e=>{p.update(t=>{let n=WU(t.nodes,e);return{nodes:n,text:_0(n),composerFocusRequestId:Date.now(),sendError:null}})},[p]),g=G6({sessionKey:i,inputSnapshot:m,setPendingSessionType:p.setPendingSessionType}),[_,v]=(0,V.useState)(()=>new Set),y=(0,V.useCallback)((e,t)=>{v(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,V.useEffect)(()=>{p.syncSessionPreferences({defaultModel:g.defaultModel,fallbackPreferredModel:g.fallbackPreferredModel,fallbackPreferredThinking:g.fallbackPreferredThinking,modelOptions:g.modelOptions,selectedSessionExists:!!g.selectedSession,selectedSessionKey:g.selectedSessionKey,selectedSessionType:g.sessionTypeState.selectedSessionType,selectedSessionPreferredModel:g.selectedSession?.preferredModel??void 0,selectedSessionPreferredThinking:g.selectedSession?.preferredThinking??null})},[p,g.defaultModel,g.fallbackPreferredModel,g.fallbackPreferredThinking,g.modelOptions,g.selectedSession,g.selectedSessionKey,g.sessionTypeState.selectedSessionType]),$ne({applyPromptSuggestion:p.applyPromptSuggestion,sessionKey:i,setPendingProjectRoot:p.setPendingProjectRoot,setPendingSessionType:p.setPendingSessionType});let x=I4(l),S=d.isRunning||g.selectedSession?.status===`running`,C=d.snapshot.error,w=d.hydrateError?.message??(C?.code===`run-interrupted`?null:C?.message)??null,T=l.phase===`ready`&&j4(w)?null:w,E=x?null:l.phase===`ready`?T:R4({message:T,status:l}),D=D3({agent:(0,V.useMemo)(()=>({...d,isRunning:S,isSending:d.isSending}),[d,S]),inputSnapshot:m,inputQuery:g,isRuntimeBlocked:x,materializationContext:n,runQueue:f,selectedAgentId:u,sessionKey:i,onSessionMaterialized:r,resetComposer:p.resetComposer,restoreComposer:p.restoreComposer,setSendError:p.setSendError}),O=(0,V.useMemo)(()=>{let e=new Set(d.visibleMessages.map(({id:e})=>e)),t=f.pendingInputs.flatMap(t=>t.placement===`steering`&&!e.has(t.message.id)?[{...t.message,status:`pending`}]:[]);return[...d.visibleMessages,...t]},[d.visibleMessages,f.pendingInputs]),k=(0,V.useRef)(D);(0,V.useEffect)(()=>{k.current=D},[D]);let A=(0,V.useMemo)(()=>({canEditQueuedInput:D.canEditQueuedInput,canStopGeneration:D.canStopGeneration,deleteQueuedInput:e=>k.current.deleteQueuedInput(e),editQueuedInput:e=>k.current.editQueuedInput(e),isSending:D.isSending,primaryAction:D.primaryAction,queuedInputs:D.queuedInputs,send:()=>k.current.send(),sendSteering:()=>k.current.sendSteering(),sendPresetMessage:e=>k.current.sendPresetMessage(e).catch(()=>void 0),sendDisabled:D.sendDisabled,stop:()=>k.current.stop(),stopDisabled:D.stopDisabled,steerQueuedInput:e=>k.current.steerQueuedInput(e)}),[D.canStopGeneration,D.canEditQueuedInput,D.isSending,D.primaryAction,D.queuedInputs,D.sendDisabled,D.stopDisabled]),ee=(0,V.useMemo)(()=>B4(MK(d.snapshot.contextWindow)),[d.snapshot.contextWindow]),{selectedSession:j}=g,M=m.sendError?.trim()||E?.trim()||(j?.activityPreview?.state===`failed`&&j.activityPreview.statusKind!==`run-interrupted`?j.activityPreview.statusText?.trim():null)||null,N=M?(0,H.jsx)(`div`,{className:`rounded-lg border-l-2 border-destructive/40 bg-muted/45 px-3 py-2.5`,role:`status`,children:(0,H.jsx)(`pre`,{className:`max-h-32 select-text overflow-auto whitespace-pre-wrap break-words font-mono text-[11px] leading-5 text-muted-foreground`,children:M})}):null;Qne({consumeDraftIntent:t,applyPromptSuggestion:p.applyPromptSuggestion,applySystemObjectReference:h});let te=(0,V.useCallback)((e,t)=>(0,H.jsx)(Zne,{contextWindow:ee,controller:A,inputActions:p,inputQuery:g,inputSnapshot:m,onContextCompactingChange:y,placeholder:t,surface:e}),[ee,A,p,g,m,y]),P=a&&!i&&O.length===0&&!d.isHydrating&&!D.isSending;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ere,{inputQuery:g}),(0,H.jsx)(q0,{hasPreviousMessages:d.hasPreviousMessages,historyError:d.historyError,isHistoryLoading:d.isHydrating,isLoadingPreviousMessages:d.isLoadingPreviousMessages,isSending:D.isSending,canContinue:D.canContinue,messageActionsDisabled:D.isSending||x,isContextCompacting:!!(i&&_.has(i)),bottomSlot:P?null:N,messages:O,messageDetailStates:d.messageDetailStates,sessionKey:i,showWelcome:P,onLoadPreviousMessages:d.loadPreviousMessages,onLoadMessageDetails:d.loadMessageDetails,onContinueRun:()=>k.current.continueRun(),onEditMessage:e=>k.current.editMessage(e),welcomeSlot:(0,H.jsx)(i3,{inputSlot:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[te(`embedded`,b(`chatWelcomeInputPlaceholder`)),N]}),pendingProjectRoot:m.pendingProjectRoot,pendingSessionType:m.pendingSessionType,selectedSessionTypeValue:m.selectedSessionType,onSelectProjectRoot:p.setPendingProjectRoot,onSelectPrompt:p.applyPromptSuggestion,onSelectSessionType:p.setPendingSessionType})}),P?null:te(`default`)]})}var tre=Mr,nre=Fr,j5=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Rr,{ref:n,className:u(`fixed inset-0 z-[var(--z-modal-backdrop,10000)] bg-black/35 backdrop-blur-[1px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));j5.displayName=Rr.displayName;var rre=xt(`fixed z-[var(--z-modal,10050)] bg-background shadow-2xl transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),M5=V.forwardRef(({children:e,className:t,closeLabel:n=`Close`,side:r,...i},a)=>(0,H.jsxs)(nre,{children:[(0,H.jsx)(j5,{}),(0,H.jsxs)(kr,{ref:a,className:u(rre({side:r}),t),...i,children:[e,(0,H.jsxs)(Hr,{className:`absolute right-4 top-4 rounded-lg p-1.5 text-muted-foreground opacity-75 transition-colors hover:bg-muted hover:text-foreground hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:pointer-events-none`,children:[(0,H.jsx)(hi,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`sr-only`,children:n})]})]})]}));M5.displayName=kr.displayName;function N5({className:e,...t}){return(0,H.jsx)(`div`,{className:u(`flex flex-col space-y-2 text-left`,e),...t})}N5.displayName=`SheetHeader`;function P5({className:e,...t}){return(0,H.jsx)(`div`,{className:u(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}P5.displayName=`SheetFooter`;var F5=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(jr,{ref:n,className:u(`text-lg font-semibold tracking-tight text-foreground`,e),...t}));F5.displayName=jr.displayName;var I5=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(Ar,{ref:n,className:u(`text-sm leading-relaxed text-muted-foreground`,e),...t}));I5.displayName=Ar.displayName;function L5(e){return j(e??void 0)}function ire(e){if(!e)return`-`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`-`;let n=Date.now(),r=t.getTime()-n,i=M(),a=Math.abs(r);if(a<6e4)return i===`zh`?`刚刚`:`just now`;if(a<36e5){let e=Math.round(a/6e4);return r>0?i===`zh`?`${e}分钟后`:`in ${e}m`:i===`zh`?`${e}分钟前`:`${e}m ago`}if(a<864e5){let e=Math.round(a/36e5);return r>0?i===`zh`?`${e}小时后`:`in ${e}h`:i===`zh`?`${e}小时前`:`${e}h ago`}let o=Math.round(a/864e5);return r>0?i===`zh`?`${o}天后`:`in ${o}d`:i===`zh`?`${o}天前`:`${o}d ago`}function are(e){return typeof e!=`number`||!Number.isFinite(e)?`-`:j(new Date(e))}function ore(e){if(typeof e!=`number`||!Number.isFinite(e))return`-`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.round(t/60);if(n<60)return`${n}m`;let r=Math.round(n/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}var sre=[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`],cre=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function R5(e){return e.padStart(2,`0`)}function lre(e,t){let n=e.trim().split(/\s+/);if(n.length!==5)return null;let[r,i,a,o,s]=n,c=t===`zh`;if(r===`*`&&i===`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每分钟`:`every minute`;if(r.startsWith(`*/`)&&i===`*`&&a===`*`&&o===`*`&&s===`*`){let e=parseInt(r.slice(2),10);if(Number.isFinite(e)&&e>0)return c?`每 ${e} 分钟`:`every ${e}m`}if(r===`0`&&i===`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每小时`:`every hour`;let l=`${R5(i)}:${R5(r)}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&s===`*`)return c?`每天 ${l}`:`daily ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&s===`1-5`)return c?`工作日 ${l}`:`weekdays ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&(s===`0,6`||s===`6,0`))return c?`周末 ${l}`:`weekends ${l}`;if(r!==`*`&&i!==`*`&&a===`*`&&o===`*`&&/^\d$/.test(s)){let e=parseInt(s,10),t=c?sre[e]:cre[e];return t?`${t} ${l}`:null}return r!==`*`&&i!==`*`&&a!==`*`&&o===`*`&&s===`*`?c?`每月 ${a} 日 ${l}`:`monthly ${a} ${l}`:null}function z5(e){let t=M(),n=t===`zh`,{schedule:r}=e;if(r.kind===`cron`)return r.expr?lre(r.expr,t)??`cron ${r.expr}`:`cron`;if(r.kind===`every`){let e=ore(r.everyMs);return n?`每 ${e}`:`every ${e}`}return r.kind===`at`?`${n?`定时`:`at`} ${are(r.atMs)}`:`-`}function B5(e){return e.payload.sessionId?.trim()||`cron:${e.id}`}function V5(e){return!!(e.payload.sessionId?.trim()||e.state.lastRunAt)}function ure(e,t){let n=t?.trim();return!!(n&&e.payload.sessionId?.trim()===n)}function H5({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border/50 py-3 last:border-b-0`,children:[(0,H.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,H.jsx)(`span`,{className:`max-w-[65%] break-words text-right text-xs font-medium text-foreground`,children:t})]})}function dre({job:e,open:t,onDelete:n,onOpenChange:r,onRun:i,onToggle:a}){if(!e)return null;let o=B5(e),s=!!e.payload.sessionId?.trim(),c=V5(e)?e9(o):null,l=e.state.lastStatus?b(`cronLastStatus${e.state.lastStatus[0].toUpperCase()}${e.state.lastStatus.slice(1)}`):b(`cronNeverRun`);return(0,H.jsx)(tre,{open:t,onOpenChange:r,children:(0,H.jsxs)(M5,{side:`right`,closeLabel:b(`cronCloseDetails`),className:`flex w-full flex-col overflow-hidden p-0 sm:max-w-[510px]`,children:[(0,H.jsxs)(N5,{className:`shrink-0 border-b border-border/60 px-5 pb-5 pt-6 pr-14 sm:px-7 sm:pt-7`,children:[(0,H.jsxs)(`div`,{className:`mb-1 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{children:z5(e)}),(0,H.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,H.jsx)(`span`,{children:b(s?`cronBoundSession`:`cronDedicatedSession`)})]}),(0,H.jsx)(F5,{children:e.name||e.id}),(0,H.jsx)(I5,{children:b(`cronDetailDescription`)})]}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-5 py-6 sm:px-7`,children:[(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:b(`cronTaskPrompt`)}),(0,H.jsx)(`div`,{className:`rounded-2xl bg-muted/55 px-4 py-3 text-sm leading-6 text-foreground`,children:e.payload.message})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsx)(`h3`,{className:`mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:b(`cronTaskDetails`)}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(H5,{label:b(`cronScheduleLabel`),value:z5(e)}),(0,H.jsx)(H5,{label:b(`cronNextRun`),value:L5(e.state.nextRunAt)}),(0,H.jsx)(H5,{label:b(`cronAgentLabel`),value:e.payload.agentId?.trim()||`main`}),(0,H.jsx)(H5,{label:b(`cronSessionLabel`),value:c?(0,H.jsx)(ge,{href:c,size:`xs`,className:`text-[hsl(var(--link-foreground))] underline decoration-[1.2px] underline-offset-2 hover:text-[hsl(var(--link-foreground-hover))]`,children:o}):o}),(0,H.jsx)(H5,{label:b(`cronCreatedAt`),value:L5(e.createdAt)})]})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-4`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:b(`cronLatestRun`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:b(`cronLatestRunHint`)})]}),(0,H.jsx)(`span`,{className:u(`rounded-full px-2.5 py-1 text-xs font-medium`,e.state.lastStatus===`error`?`bg-red-50 text-red-700`:e.state.lastStatus===`ok`?`bg-emerald-50 text-emerald-700`:`bg-muted text-muted-foreground`),children:l})]}),(0,H.jsxs)(`div`,{className:`rounded-2xl border border-border/60 px-4 py-1`,children:[(0,H.jsx)(H5,{label:b(`cronLastRun`),value:L5(e.state.lastRunAt)}),e.state.lastError?(0,H.jsx)(H5,{label:b(`cronLastError`),value:e.state.lastError}):null]})]}),(0,H.jsxs)(`section`,{className:`flex items-center justify-between rounded-2xl border border-border/60 px-4 py-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.enabled?b(`cronEnabledState`):b(`cronPaused`)}),(0,H.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:b(`cronToggleHint`)})]}),(0,H.jsx)(Sn,{checked:e.enabled,onCheckedChange:t=>a(e,t),"aria-label":e.enabled?b(`cronDisable`):b(`cronEnable`)})]}),c?null:(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b(`cronSessionAvailableAfterRun`)})]}),(0,H.jsxs)(P5,{className:`shrink-0 border-t border-border/60 bg-background px-5 py-4 sm:px-7`,children:[(0,H.jsxs)(L,{variant:`ghost`,className:`text-red-600 hover:bg-red-50 hover:text-red-700`,onClick:()=>n(e),children:[(0,H.jsx)(Vo,{className:`mr-2 h-4 w-4`}),b(`delete`)]}),c?(0,H.jsx)(ge,{href:c,className:u(ln({variant:`outline`}),`hover:no-underline`),children:b(`cronOpenSession`)}):(0,H.jsx)(L,{variant:`outline`,disabled:!0,children:b(`cronOpenSession`)}),(0,H.jsxs)(L,{onClick:()=>i(e),children:[(0,H.jsx)(bo,{className:`mr-2 h-4 w-4`}),b(`cronRunNow`)]})]})]})})}function fre({job:e}){let t=e.state.lastStatus===`error`,n=t?b(`cronNeedsAttention`):e.enabled?b(`cronRunningNormally`):b(`cronPaused`);return(0,H.jsxs)(`span`,{className:u(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium`,t?`bg-red-50 text-red-700`:e.enabled?`bg-emerald-50 text-emerald-700`:`bg-muted text-muted-foreground`),children:[(0,H.jsx)(`span`,{className:u(`h-1.5 w-1.5 rounded-full`,t?`bg-red-500`:e.enabled?`bg-emerald-500`:`bg-muted-foreground/50`)}),n]})}function pre({expanded:e,job:t,onDelete:n,onEdit:r,onRun:i,onToggleExpanded:a,onToggle:o}){let[s,c]=(0,V.useState)(!1),l=!!t.payload.sessionId?.trim(),d=t.state.lastStatus===`error`,f=d?Ho:wr,p=t.name||t.id,m=`cron-job-preview-${t.id}`,h=B5(t),g=V5(t)?e9(h):null;return(0,H.jsxs)(`div`,{className:u(`group relative rounded-xl border-b border-border/55 transition-colors duration-150 last:border-b-0 hover:bg-muted/35 focus-within:bg-muted/35`,e&&`bg-muted/35`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3 px-1 py-3.5`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`grid min-w-0 flex-1 grid-cols-[36px_minmax(0,1fr)] items-center gap-3 rounded-lg pr-16 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,"aria-controls":m,"aria-expanded":e,"aria-label":`${b(e?`cronCollapseTask`:`cronExpandTask`)} ${p}`,onClick:()=>a(t),children:[(0,H.jsx)(`span`,{className:u(`flex h-9 w-9 items-center justify-center rounded-xl`,d?`bg-amber-50 text-amber-600`:`bg-emerald-50 text-emerald-600`),children:(0,H.jsx)(f,{className:`h-4 w-4`,"aria-hidden":`true`})}),(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`strong`,{className:`truncate text-[13px] font-semibold text-foreground`,children:p}),(0,H.jsx)(fre,{job:t}),(0,H.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground`,children:b(l?`cronBoundSession`:`cronDedicatedSession`)}),t.deleteAfterRun?(0,H.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground`,children:b(`cronOneShot`)}):null]}),(0,H.jsxs)(`span`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(na,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),z5(t)]}),t.state.nextRunAt?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(ga,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),b(`cronNextRun`),` `,ire(t.state.nextRunAt)]}):null]})]})]}),(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(`div`,{className:`relative flex shrink-0 items-center`,children:[(0,H.jsxs)(`div`,{className:`absolute right-11 top-1/2 flex -translate-y-1/2 items-center gap-0.5 opacity-100 transition-opacity duration-150 [@media(hover:hover)]:pointer-events-none [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-focus-within:pointer-events-auto [@media(hover:hover)]:group-focus-within:opacity-100 [@media(hover:hover)]:group-hover:pointer-events-auto [@media(hover:hover)]:group-hover:opacity-100`,children:[(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(L,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>r(t),"aria-label":`${b(`edit`)} ${p}`,children:(0,H.jsx)(yo,{className:`h-3.5 w-3.5`})})}),(0,H.jsx)(qr,{children:b(`cronEditDetails`)})]}),(0,H.jsxs)(wF,{open:s,onOpenChange:c,children:[(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(L,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":`${b(`cronMoreActions`)} ${p}`,children:(0,H.jsx)(ci,{className:`h-4 w-4`})})})}),(0,H.jsx)(qr,{children:b(`cronMoreActions`)})]}),(0,H.jsxs)(DF,{align:`end`,sideOffset:4,className:`w-40 p-1`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{c(!1),i(t)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-foreground transition-colors hover:bg-muted`,children:[(0,H.jsx)(bo,{className:`h-3.5 w-3.5 text-muted-foreground`}),b(`cronRunNow`)]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{c(!1),n(t)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-red-600 transition-colors hover:bg-red-50`,children:[(0,H.jsx)(Vo,{className:`h-3.5 w-3.5`}),b(`delete`)]})]})]})]}),(0,H.jsx)(Sn,{checked:t.enabled,onCheckedChange:e=>o(t,e),"aria-label":t.enabled?b(`cronDisable`):b(`cronEnable`)})]})})]}),(0,H.jsx)(`div`,{id:m,"aria-hidden":!e,className:u(`grid transition-[grid-template-rows,opacity] duration-200 ease-out`,e?`grid-rows-[1fr] opacity-100`:`grid-rows-[0fr] opacity-0`),children:(0,H.jsx)(`div`,{className:`overflow-hidden`,children:(0,H.jsxs)(`div`,{className:`mb-3 ml-12 mr-1 rounded-xl bg-background/70 px-4 py-3`,children:[(0,H.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground`,children:b(`cronTaskPrompt`)}),(0,H.jsx)(`p`,{className:`mt-1.5 line-clamp-4 text-xs leading-5 text-foreground`,children:t.payload.message}),(0,H.jsxs)(`dl`,{className:`mt-3 grid gap-x-5 gap-y-2 border-t border-border/50 pt-3 text-[11px] sm:grid-cols-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`cronAgentLabel`)}),(0,H.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-foreground`,children:t.payload.agentId?.trim()||`main`})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`cronSessionLabel`)}),(0,H.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-foreground`,children:g?(0,H.jsx)(ge,{href:g,size:`xs`,className:`max-w-full truncate text-[11px] text-[hsl(var(--link-foreground))] underline decoration-[1.2px] underline-offset-2 hover:text-[hsl(var(--link-foreground-hover))]`,children:h}):h})]}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:b(`cronLastRun`)}),(0,H.jsx)(`dd`,{className:`mt-0.5 truncate font-medium text-foreground`,children:L5(t.state.lastRunAt)})]})]}),t.state.lastError?(0,H.jsx)(`p`,{className:`mt-3 line-clamp-2 border-t border-red-100 pt-3 text-[11px] leading-5 text-red-700`,children:t.state.lastError}):null]})})})]})}var U5=[{titleKey:`cronTemplateAiNewsTitle`,descriptionKey:`cronTemplateAiNewsDescription`,promptKey:`cronTemplateAiNewsPrompt`,icon:oo},{titleKey:`cronTemplateWeeklyReviewTitle`,descriptionKey:`cronTemplateWeeklyReviewDescription`,promptKey:`cronTemplateWeeklyReviewPrompt`,icon:ia},{titleKey:`cronTemplateMeetingPrepTitle`,descriptionKey:`cronTemplateMeetingPrepDescription`,promptKey:`cronTemplateMeetingPrepPrompt`,icon:ra},{titleKey:`cronTemplateLearningTitle`,descriptionKey:`cronTemplateLearningDescription`,promptKey:`cronTemplateLearningPrompt`,icon:di},{titleKey:`cronTemplateCompetitorTitle`,descriptionKey:`cronTemplateCompetitorDescription`,promptKey:`cronTemplateCompetitorPrompt`,icon:vee},{titleKey:`cronTemplateFamilyTitle`,descriptionKey:`cronTemplateFamilyDescription`,promptKey:`cronTemplateFamilyPrompt`,icon:fee}],W5=(0,V.forwardRef)(function({prominent:e=!1,value:t,onChange:n,onSubmit:r},i){return(0,H.jsxs)(`form`,{className:u(`relative w-full`,e&&`mx-auto max-w-3xl`),onSubmit:e=>{e.preventDefault(),r()},children:[(0,H.jsx)(Or,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`,"aria-hidden":`true`}),(0,H.jsx)(vt,{ref:i,value:t,onChange:e=>n(e.target.value),className:`pl-9 pr-11`,placeholder:b(`cronComposerPlaceholder`),"aria-label":b(`cronComposerLabel`)}),(0,H.jsx)(L,{type:`submit`,size:`icon`,className:`absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full shadow-none`,disabled:!t.trim(),"aria-label":b(`cronComposerSubmit`),children:(0,H.jsx)(qi,{className:`h-4 w-4`})})]})});function G5({compact:e=!1,onSelect:t}){return(0,H.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(min(100%,17.5rem),1fr))] gap-3`,children:(e?U5.slice(0,4):U5).map(e=>{let n=e.icon;return(0,H.jsxs)(`button`,{type:`button`,onClick:()=>t(b(e.promptKey)),className:`group grid min-h-24 grid-cols-[38px_minmax(0,1fr)] items-center gap-3 rounded-2xl border border-border/60 bg-card px-4 py-4 text-left transition-all hover:-translate-y-0.5 hover:border-primary/20 hover:shadow-[0_12px_30px_rgba(30,45,52,0.08)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,H.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground transition-colors group-hover:bg-primary/10 group-hover:text-primary`,children:(0,H.jsx)(n,{className:`h-4 w-4`,"aria-hidden":`true`})}),(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsx)(`strong`,{className:`block text-sm font-medium text-foreground`,children:b(e.titleKey)}),(0,H.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-muted-foreground`,children:b(e.descriptionKey)})]})]},e.titleKey)})})}function K5(e={all:!0}){return Ot({queryKey:[`cron`,e],queryFn:()=>Vt(e),placeholderData:e=>e,staleTime:1e4})}function q5(){let e=F();return{onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),R.success(b(`configSavedApplied`))},onError:e=>{R.error(b(`configSaveFailed`)+`: `+e.message)}}}function J5(){return jt({mutationFn:({id:e})=>sn(e),...q5()})}function mre(){return jt({mutationFn:({id:e,enabled:t})=>ut(e,{enabled:t}),...q5()})}function hre(){return jt({mutationFn:({id:e,force:t})=>kt(e,{force:t}),...q5()})}var Y5=10;function gre({summary:e}){let{attention:t,disabled:n,enabled:r,total:i}=e,a=[{label:b(`cronSummaryTotal`),value:i},{label:b(`cronSummaryEnabled`),value:r},{label:b(`cronSummaryPaused`),value:n}],o=t>0?Pr:ua;return(0,H.jsxs)(`section`,{"aria-label":b(`cronSummaryLabel`),className:`grid grid-cols-3 overflow-hidden rounded-2xl bg-border/60 sm:grid-cols-[minmax(220px,1.35fr)_repeat(3,minmax(100px,0.55fr))] sm:gap-px`,children:[(0,H.jsxs)(`div`,{className:`col-span-3 flex items-center gap-3 bg-muted/40 px-4 py-3.5 sm:col-span-1`,children:[(0,H.jsx)(`span`,{className:u(`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl`,t>0?`bg-amber-50 text-amber-600`:`bg-emerald-50 text-emerald-600`),children:(0,H.jsx)(o,{className:`h-4 w-4`,"aria-hidden":`true`})}),(0,H.jsxs)(`span`,{className:`min-w-0`,children:[(0,H.jsx)(`strong`,{className:`block truncate text-xs font-semibold text-foreground`,children:t>0?`${t} ${b(`cronAttentionSummary`)}`:b(`cronAllHealthy`)}),(0,H.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:b(t>0?`cronAttentionSummaryHint`:`cronAllHealthyHint`)})]})]}),a.map(e=>(0,H.jsxs)(`div`,{className:`bg-muted/40 px-4 py-3.5 sm:px-5`,children:[(0,H.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-foreground`,children:e.value}),(0,H.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.label})]},e.label))]})}function _re({page:e,total:t,disabled:n,onPageChange:r}){let i=Math.ceil(t/Y5);if(i<=1)return null;let a=e*Y5+1,o=Math.min(t,a+Y5-1);return(0,H.jsxs)(`nav`,{"aria-label":b(`cronPaginationLabel`),className:`flex items-center justify-between gap-3 border-b border-border/60 py-3 text-xs text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`tabular-nums`,children:[a,`–`,o,` / `,t]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8`,disabled:n||e===0,onClick:()=>r(e-1),"aria-label":b(`cronPreviousPage`),children:(0,H.jsx)(oa,{className:`h-4 w-4`})}),(0,H.jsxs)(`span`,{className:`min-w-14 text-center tabular-nums text-foreground`,children:[e+1,` / `,i]}),(0,H.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8`,disabled:n||e>=i-1,onClick:()=>r(e+1),"aria-label":b(`cronNextPage`),children:(0,H.jsx)(sa,{className:`h-4 w-4`})})]})]})}function vre(){let[e,t]=(0,V.useState)(``),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(`all`),[o,s]=(0,V.useState)(0),[c,l]=(0,V.useState)(null),[d,f]=(0,V.useState)(null),p=(0,V.useDeferredValue)(n.trim()),m=(0,V.useRef)(null),h=tI(),g=K5({all:!0,limit:Y5,offset:o*Y5,query:p,status:i}),_=J5(),v=mre(),y=hre(),{confirm:x,ConfirmDialog:S}=On(),C=g.data?.jobs??[],w=g.data?.total??0,T=g.data?.summary,E=C.find(e=>e.id===d)??null,D=()=>{let t=e.trim();if(!t){m.current?.focus();return}h.chatSessionListManager.createSession({prompt:t})},O=e=>{t(e),m.current?.focus()},k=async e=>{await x({title:`${b(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:`destructive`,confirmLabel:b(`delete`)})&&(l(null),f(null),C.length===1&&o>0&&s(o-1),_.mutate({id:e.id}))},A=(e,t)=>{(i===`enabled`&&!t||i===`disabled`&&t)&&C.length===1&&o>0&&s(o-1),v.mutate({id:e.id,enabled:t})},ee=async e=>{let t=!e.enabled;t&&!await x({title:`${b(`cronRunForceConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:b(`cronRunNow`)})||y.mutate({id:e.id,force:t})},j=e=>{l(null),s(e)},M=e=>{l(t=>t===e.id?null:e.id)},N=(T?.total??0)>0;return(0,H.jsxs)(Jt,{className:`space-y-6`,children:[(0,H.jsx)(ft,{headingLevel:1,title:b(`cronPageTitle`),description:b(`cronPageDescription`),actions:(0,H.jsx)(B,{size:`lg`,label:b(`refresh`),icon:(0,H.jsx)(mi,{className:u(`h-4 w-4`,g.isFetching&&`animate-spin`)}),onClick:()=>{o===0?(l(null),g.refetch()):j(0)}})}),N?(0,H.jsx)(W5,{ref:m,value:e,onChange:t,onSubmit:D}):null,g.isLoading?(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-muted-foreground`,children:[(0,H.jsx)(mi,{className:`mb-3 h-5 w-5 animate-spin`}),(0,H.jsx)(`span`,{className:`text-sm`,children:b(`cronLoading`)})]}):N?(0,H.jsxs)(H.Fragment,{children:[T?(0,H.jsx)(gre,{summary:T}):null,(0,H.jsxs)(`section`,{className:`pt-1`,children:[(0,H.jsx)(`div`,{className:`mb-3 flex items-end justify-between gap-4`,children:(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:b(`cronMyTasks`)}),(0,H.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[w,` `,b(`cronTaskCountUnit`)]})]})}),(0,H.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2.5`,children:[(0,H.jsxs)(`div`,{className:`relative min-w-[220px] flex-1`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,H.jsx)(vt,{value:n,onChange:e=>{r(e.target.value),j(0)},placeholder:b(`cronSearchPlaceholder`),className:`pl-9`})]}),(0,H.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,"aria-label":b(`cronStatusLabel`),children:[[`all`,`cronStatusAll`],[`enabled`,`cronStatusEnabled`],[`disabled`,`cronStatusDisabled`],[`attention`,`cronStatusAttention`]].map(([e,t])=>(0,H.jsx)(`button`,{type:`button`,"aria-pressed":i===e,onClick:()=>{a(e),j(0)},className:u(`rounded-lg px-2.5 py-2 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,i===e&&`bg-muted text-foreground`),children:b(t)},e))})]}),C.length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{"aria-busy":g.isFetching,className:u(`border-y border-border/60 transition-opacity`,g.isFetching&&`opacity-60`),children:C.map(e=>(0,H.jsx)(pre,{expanded:c===e.id,job:e,onDelete:k,onEdit:e=>f(e.id),onRun:ee,onToggleExpanded:M,onToggle:A},e.id))}),(0,H.jsx)(_re,{page:o,total:w,disabled:g.isFetching,onPageChange:j})]}):(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-center text-muted-foreground`,children:[(0,H.jsx)(ui,{className:`mb-3 h-5 w-5`}),(0,H.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:b(`cronNoMatchingTasks`)}),(0,H.jsx)(`span`,{className:`mt-1 text-xs`,children:b(`cronNoMatchingTasksHint`)})]})]}),(0,H.jsxs)(`section`,{className:`pt-2`,children:[(0,H.jsxs)(`div`,{className:`mb-3`,children:[(0,H.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:b(`cronNeedInspiration`)}),(0,H.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:b(`cronTemplateSelectionHint`)})]}),(0,H.jsx)(G5,{compact:!0,onSelect:O})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`section`,{className:`flex min-h-[270px] flex-col items-center justify-center rounded-3xl bg-muted/25 px-4 py-10 text-center sm:px-8`,children:[(0,H.jsx)(`span`,{className:`mb-4 flex h-11 w-11 items-center justify-center rounded-2xl bg-card shadow-sm`,children:(0,H.jsx)(xee,{className:`h-5 w-5 text-primary`})}),(0,H.jsx)(`h2`,{className:`text-xl font-semibold text-foreground`,children:b(`cronEmptyHeroTitle`)}),(0,H.jsx)(`p`,{className:`mb-6 mt-2 max-w-2xl text-sm leading-6 text-muted-foreground`,children:b(`cronEmptyHeroDescription`)}),(0,H.jsx)(W5,{ref:m,prominent:!0,value:e,onChange:t,onSubmit:D}),(0,H.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:b(`cronComposerHint`)})]}),(0,H.jsxs)(`section`,{children:[(0,H.jsxs)(`div`,{className:`mb-3`,children:[(0,H.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:b(`cronStartFromResult`)}),(0,H.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:b(`cronTemplateSelectionHint`)})]}),(0,H.jsx)(G5,{onSelect:O})]})]}),(0,H.jsx)(dre,{job:E,open:!!E,onOpenChange:e=>{e||f(null)},onDelete:k,onRun:ee,onToggle:A}),(0,H.jsx)(S,{})]})}function yre({jobs:e}){let t=J5(),{confirm:n,ConfirmDialog:r}=On(),i=async e=>{await n({title:`${b(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:b(`delete`)})&&t.mutate({id:e.id})};return(0,H.jsxs)(`div`,{className:`h-full overflow-y-auto custom-scrollbar px-4 py-4`,children:[(0,H.jsxs)(`div`,{className:`mb-4`,children:[(0,H.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:b(`chatWorkspaceSessionCronJobs`)}),(0,H.jsxs)(`div`,{className:`mt-1 text-xs text-gray-500`,children:[b(`cronTotalLabel`),`: `,e.length]})]}),e.length===0?(0,H.jsx)(`div`,{className:`py-8 text-center text-sm text-gray-500`,children:b(`chatWorkspaceCronJobEmpty`)}):(0,H.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,H.jsxs)(`div`,{className:`rounded-lg border border-gray-200 bg-white px-3 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.name||e.id}),(0,H.jsx)(`div`,{className:`mt-1 text-[11px] text-gray-400`,children:e.id})]}),(0,H.jsxs)(L,{type:`button`,variant:`subtle`,size:`sm`,className:`h-7 gap-1 rounded-lg px-2`,onClick:()=>void i(e),disabled:t.isPending,children:[(0,H.jsx)(Vo,{className:`h-3.5 w-3.5`}),b(`delete`)]})]}),(0,H.jsxs)(`div`,{className:`mt-3 space-y-1.5 text-xs text-gray-500`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronScheduleLabel`),`:`]}),` `,z5(e)]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronNextRun`),`:`]}),` `,L5(e.state.nextRunAt)]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronLastRun`),`:`]}),` `,L5(e.state.lastRunAt)]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronLastStatus`),`:`]}),` `,e.state.lastStatus??`-`]}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[b(`cronSessionLabel`),`:`]}),` `,B5(e)]})]}),(0,H.jsx)(`div`,{className:`mt-3 whitespace-pre-wrap break-words text-sm text-gray-700`,children:e.payload.message})]},e.id))}),(0,H.jsx)(r,{})]})}function bre({childSessionTabs:e,sessionKey:t}){let n=tI();return(0,H.jsx)(`div`,{className:`h-full overflow-auto bg-gray-50/45 px-4 py-5 custom-scrollbar`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-xl`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`h2`,{className:`truncate text-base font-semibold text-gray-900`,children:b(`chatWorkspaceChildSessions`)}),(0,H.jsx)(`span`,{className:`rounded-full bg-gray-100 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-gray-500`,children:e.length})]}),(0,H.jsxs)(`button`,{type:`button`,className:`inline-flex shrink-0 items-center gap-1.5 rounded-md bg-primary px-2.5 py-1.5 text-xs font-semibold text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25 disabled:cursor-not-allowed disabled:opacity-50`,disabled:!t,onClick:()=>n.chatThreadManager.openSideChatDraft(t),children:[(0,H.jsx)(to,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:b(`chatWorkspaceCreateChildSession`)})]})]}),e.length===0?(0,H.jsx)(`div`,{className:`py-10 text-center text-sm text-gray-500`,children:b(`chatWorkspaceChildSessionsEmpty`)}):(0,H.jsx)(`div`,{className:`mt-4 space-y-2`,children:e.map(e=>(0,H.jsxs)(`div`,{className:`group relative flex w-full items-center rounded-lg border border-gray-200/80 bg-white transition-colors hover:border-gray-300 hover:bg-gray-50`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-3 px-3 py-3 pr-12 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/25`,onClick:()=>n.chatThreadManager.selectChildSessionDetail(e.sessionKey),children:[(0,H.jsx)(`span`,{className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600`,children:(0,H.jsx)(Ka,{className:`h-4 w-4`})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`block truncate text-sm font-medium text-gray-900`,children:e.title}),e.projectName||e.sessionTypeLabel?(0,H.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-gray-500`,children:[e.sessionTypeLabel,e.projectName].filter(Boolean).join(` · `)}):null]}),(0,H.jsx)(sa,{className:`h-4 w-4 shrink-0 text-gray-300 transition-transform group-hover:translate-x-0.5 group-hover:text-gray-500`})]}),(0,H.jsx)(kF,{sessionKey:e.sessionKey,triggerSize:`sm`,triggerTone:`strong`,className:`absolute right-2 top-1/2 -translate-y-1/2 bg-white opacity-100 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`})]},e.sessionKey))})]})})}function X5(e){return e===null?`—`:new Intl.NumberFormat().format(e)}function Z5(e){return e===null?`—`:new Intl.NumberFormat(void 0,{style:`percent`,maximumFractionDigits:1}).format(e)}function Q5({status:e}){return(0,H.jsx)(`span`,{className:u(`inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[10px] font-semibold`,e===`reported`?`bg-emerald-50 text-emerald-700`:e===`partial`?`bg-amber-50 text-amber-700`:`bg-gray-100 text-gray-500`),children:b(e===`reported`?`chatWorkspaceTokenUsageReported`:e===`partial`?`chatWorkspaceTokenUsagePartial`:`chatWorkspaceTokenUsageUnavailable`)})}function $5({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`min-w-0 rounded-md bg-gray-50 px-2.5 py-2`,children:[(0,H.jsx)(`div`,{className:`truncate text-[10px] font-medium text-gray-500`,children:e}),(0,H.jsx)(`div`,{className:`mt-0.5 truncate text-sm font-semibold tabular-nums text-gray-900`,children:t})]})}function xre({sessionKey:e}){let t=uL(e),n=t.data;return(0,H.jsxs)(`section`,{"aria-labelledby":`chat-workspace-token-usage-title`,className:`mt-4 rounded-lg border border-gray-200/80 bg-white p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`span`,{className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600`,children:(0,H.jsx)(aa,{className:`h-4 w-4`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`h3`,{id:`chat-workspace-token-usage-title`,className:`text-sm font-semibold text-gray-900`,children:b(`chatWorkspaceTokenUsage`)}),n?(0,H.jsx)(Q5,{status:n.status}):null]}),(0,H.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-gray-500`,children:b(`chatWorkspaceTokenUsageDescription`)})]})]}),t.isLoading?(0,H.jsx)(`p`,{className:`py-5 text-center text-xs text-gray-500`,"aria-live":`polite`,children:b(`chatWorkspaceTokenUsageLoading`)}):t.isError?(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-4 text-xs text-rose-600`,role:`alert`,children:[(0,H.jsx)(`span`,{children:b(`chatWorkspaceTokenUsageLoadFailed`)}),(0,H.jsx)(`button`,{type:`button`,className:`shrink-0 rounded px-1.5 py-1 font-semibold text-gray-700 hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`,onClick:()=>void t.refetch(),children:b(`chatWorkspaceTokenUsageRetry`)})]}):n&&n.runCount>0?(0,H.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[(0,H.jsx)($5,{label:b(`chatWorkspaceTokenUsageTotal`),value:X5(n.totals.totalTokens)}),(0,H.jsx)($5,{label:b(`chatWorkspaceTokenUsageInput`),value:X5(n.totals.inputTokens)}),(0,H.jsx)($5,{label:b(`chatWorkspaceTokenUsageOutput`),value:X5(n.totals.outputTokens)}),(0,H.jsx)($5,{label:b(`chatWorkspaceTokenUsageCachedInput`),value:X5(n.totals.cachedInputTokens)}),(0,H.jsx)($5,{label:b(`chatWorkspaceTokenUsageCacheHitRate`),value:Z5(n.totals.cacheHitRate)}),(0,H.jsx)($5,{label:b(`chatWorkspaceTokenUsageRuns`),value:String(n.runCount)})]}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`mb-1.5 text-[11px] font-medium text-gray-700`,children:b(`chatWorkspaceTokenUsageByModel`)}),(0,H.jsx)(`div`,{className:`space-y-1.5`,children:n.models.map(e=>(0,H.jsxs)(`div`,{className:`rounded-md border border-gray-200/70 px-2.5 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate text-xs font-semibold text-gray-900`,title:e.model,children:e.model}),(0,H.jsx)(Q5,{status:e.status})]}),(0,H.jsxs)(`div`,{className:`mt-1 text-[10px] text-gray-500`,children:[b(`chatWorkspaceTokenUsageModelRunCount`).replace(`{count}`,String(e.runCount)),` · `,b(`chatWorkspaceTokenUsageModelCacheHitRate`).replace(`{rate}`,Z5(e.cacheHitRate))]}),(0,H.jsx)(`dl`,{className:`mt-2 grid grid-cols-2 gap-x-3 gap-y-1 text-[10px] sm:grid-cols-4`,children:[[b(`chatWorkspaceTokenUsageInput`),e.inputTokens],[b(`chatWorkspaceTokenUsageOutput`),e.outputTokens],[b(`chatWorkspaceTokenUsageCachedInput`),e.cachedInputTokens],[b(`chatWorkspaceTokenUsageTotal`),e.totalTokens]].map(([e,t])=>(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-1 sm:block`,children:[(0,H.jsx)(`dt`,{className:`truncate text-gray-500`,children:e}),(0,H.jsx)(`dd`,{className:`shrink-0 font-semibold tabular-nums text-gray-800 sm:mt-0.5`,children:X5(t)})]},String(e)))})]},e.model))})]})]}):(0,H.jsx)(`p`,{className:`py-5 text-center text-xs leading-5 text-gray-500`,children:b(`chatWorkspaceTokenUsageEmpty`)})]})}var Sre={active:`border-emerald-200 bg-emerald-50 text-emerald-700`,paused:`border-amber-200 bg-amber-50 text-amber-700`,degraded:`border-orange-200 bg-orange-50 text-orange-700`,expired:`border-gray-200 bg-gray-100 text-gray-600`,broken:`border-rose-200 bg-rose-50 text-rose-700`};function e7(e,t){return e.replace(`{count}`,String(t))}function Cre(e){return b(`chatWorkspaceContinuousAttentionStatus${e[0].toUpperCase()}${e.slice(1)}`)}function t7(e){return b(e===`context`?`chatWorkspaceContinuousAttentionState`:`chatWorkspaceContinuousAttentionEvents`)}function wre({item:e,isPending:t,onAction:n}){let r=e.status===`active`||e.status===`paused`,i=e.status===`active`?`pause`:`resume`,a=b(i===`pause`?`chatWorkspaceContinuousAttentionPause`:`chatWorkspaceContinuousAttentionResume`);return(0,H.jsxs)(`article`,{className:`rounded-xl border border-gray-200/80 bg-white p-3 shadow-sm`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,H.jsx)(`span`,{className:`mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-500`,children:e.kind===`context`?(0,H.jsx)(Oa,{className:`h-4 w-4`}):(0,H.jsx)(Xa,{className:`h-4 w-4`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`h3`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.title}),(0,H.jsx)(`span`,{className:u(`rounded-full border px-1.5 py-0.5 text-[10px] font-medium`,Sre[e.status]),children:Cre(e.status)})]}),(0,H.jsxs)(`p`,{className:`mt-0.5 truncate text-[11px] text-gray-400`,children:[e.extensionId,` · `,t7(e.kind)]}),e.description?(0,H.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-gray-600`,children:e.description}):null,e.statusReason?(0,H.jsxs)(`p`,{className:`mt-2 flex gap-1.5 text-xs leading-5 text-orange-700`,children:[(0,H.jsx)(Ho,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{children:e.statusReason})]}):null,e.safeConfigPreview?(0,H.jsx)(`p`,{className:`mt-2 rounded-md bg-gray-50 px-2 py-1.5 text-[11px] leading-5 text-gray-500`,children:e.safeConfigPreview}):null,(0,H.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-gray-400`,children:[(0,H.jsxs)(`span`,{children:[b(`chatWorkspaceContinuousAttentionCreated`),`: `,j(e.createdAt)]}),e.expiresAt?(0,H.jsxs)(`span`,{children:[b(`chatWorkspaceContinuousAttentionExpires`),`: `,j(e.expiresAt)]}):null,e.lastReadAt?(0,H.jsxs)(`span`,{children:[b(`chatWorkspaceContinuousAttentionLastRead`),`: `,j(e.lastReadAt)]}):null,e.kind===`events`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{children:e7(b(`chatWorkspaceContinuousAttentionPending`),e.pendingCount??0)}),e.suppressedCount?(0,H.jsx)(`span`,{children:e7(b(`chatWorkspaceContinuousAttentionSuppressed`),e.suppressedCount)}):null,e.deliveryFailureCount?(0,H.jsx)(`span`,{className:`text-rose-600`,children:e7(b(`chatWorkspaceContinuousAttentionFailures`),e.deliveryFailureCount)}):null]}):null]})]})]}),(0,H.jsxs)(`div`,{className:`mt-3 flex items-center justify-end gap-2 border-t border-gray-100 pt-2`,children:[r?(0,H.jsxs)(`button`,{type:`button`,"data-testid":`observation-${e.id}-${i}`,disabled:t,className:`inline-flex items-center gap-1.5 rounded-md border border-gray-200 px-2.5 py-1.5 text-xs font-medium text-gray-700 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50`,onClick:()=>n(i),children:[i===`pause`?(0,H.jsx)(_o,{className:`h-3.5 w-3.5`}):(0,H.jsx)(bo,{className:`h-3.5 w-3.5`}),t?b(`chatWorkspaceContinuousAttentionUpdating`):a]}):null,(0,H.jsxs)(`button`,{type:`button`,"data-testid":`observation-${e.id}-remove`,disabled:t,className:`inline-flex items-center gap-1.5 rounded-md border border-rose-200 px-2.5 py-1.5 text-xs font-medium text-rose-700 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-50`,onClick:()=>n(`remove`),children:[(0,H.jsx)(Vo,{className:`h-3.5 w-3.5`}),b(`chatWorkspaceContinuousAttentionRemove`)]})]})]})}function Tre({sessionKey:e}){let[t,n]=(0,V.useState)(`context`),[r,i]=(0,V.useState)(!1),a=fL(e),o=pL(e),{confirm:s,ConfirmDialog:c}=On();if(!e)return null;let l=a.data,d=t===`context`?l?.bindings??[]:l?.subscriptions??[],f=async(e,t)=>{if(!(t===`remove`&&!await s({title:b(`chatWorkspaceContinuousAttentionRemoveTitle`),description:b(`chatWorkspaceContinuousAttentionRemoveDescription`),confirmLabel:b(`chatWorkspaceContinuousAttentionRemove`),variant:`destructive`}))){i(!1);try{await o.mutateAsync({kind:e.kind,id:e.id,action:t})}catch{i(!0)}}};return(0,H.jsx)(`div`,{className:`h-full overflow-auto bg-gray-50/45 px-4 py-5 custom-scrollbar`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-xl`,children:[(0,H.jsx)(c,{}),(0,H.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,H.jsx)(`span`,{className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,H.jsx)(Oa,{className:`h-4 w-4`})}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:b(`chatWorkspaceContinuousAttention`)}),(0,H.jsxs)(`p`,{className:`mt-1 break-all text-xs leading-5 text-gray-500`,children:[b(`chatWorkspaceContinuousAttentionDescription`),` · `,e]})]})]}),l?(0,H.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,H.jsx)(n7,{label:b(`chatWorkspaceContinuousAttentionTotal`),value:l.counts.total}),(0,H.jsx)(n7,{label:b(`chatWorkspaceContinuousAttentionState`),value:l.counts.context}),(0,H.jsx)(n7,{label:b(`chatWorkspaceContinuousAttentionEvents`),value:l.counts.events}),(0,H.jsx)(n7,{label:b(`chatWorkspaceContinuousAttentionNeedsAttention`),value:l.counts.needsAttention})]}):null,(0,H.jsx)(`div`,{className:`mt-4 flex rounded-lg border border-gray-200 bg-white p-1`,role:`tablist`,children:[`context`,`events`].map(e=>{let r=e===`context`?l?.counts.context??0:l?.counts.events??0;return(0,H.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===e,className:u(`flex-1 rounded-md px-3 py-2 text-xs font-medium transition-colors`,t===e?`bg-gray-100 text-gray-900`:`text-gray-500 hover:text-gray-700`),onClick:()=>n(e),children:[t7(e),` `,(0,H.jsx)(`span`,{className:`ml-1 tabular-nums text-gray-400`,children:r})]},e)})}),r?(0,H.jsx)(`p`,{className:`mt-2 text-xs text-rose-600`,children:b(`chatWorkspaceContinuousAttentionActionFailed`)}):null,a.isPending?(0,H.jsx)(`div`,{className:`mt-3 space-y-2`,"aria-label":b(`chatWorkspaceContinuousAttentionLoading`),children:[0,1].map(e=>(0,H.jsx)(`div`,{className:`h-28 animate-pulse rounded-xl border border-gray-200 bg-white`},e))}):a.isError?(0,H.jsxs)(`div`,{className:`mt-4 rounded-xl border border-rose-200 bg-rose-50 px-4 py-5 text-center`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium text-rose-800`,children:b(`chatWorkspaceContinuousAttentionLoadFailed`)}),(0,H.jsxs)(`button`,{type:`button`,className:`mt-3 inline-flex items-center gap-1.5 rounded-md border border-rose-200 bg-white px-3 py-1.5 text-xs font-medium text-rose-700`,onClick:()=>void a.refetch(),children:[(0,H.jsx)(mi,{className:`h-3.5 w-3.5`}),b(`chatWorkspaceContinuousAttentionRetry`)]})]}):d.length===0?(0,H.jsxs)(`div`,{className:`mt-4 rounded-xl border border-dashed border-gray-300 bg-white px-4 py-8 text-center`,children:[(0,H.jsx)(ha,{className:`mx-auto h-5 w-5 text-gray-300`}),(0,H.jsx)(`p`,{className:`mt-2 text-sm font-medium text-gray-700`,children:b(`chatWorkspaceContinuousAttentionEmpty`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:b(`chatWorkspaceContinuousAttentionEmptyDescription`)})]}):(0,H.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,H.jsx)(wre,{item:e,isPending:o.isPending&&o.variables?.id===e.id,onAction:t=>void f(e,t)},`${e.kind}:${e.id}`))})]})})}function n7({label:e,value:t}){return(0,H.jsxs)(`div`,{className:`rounded-lg border border-gray-200/80 bg-white px-3 py-2`,children:[(0,H.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-gray-400`,children:e}),(0,H.jsx)(`div`,{className:`mt-1 text-lg font-semibold tabular-nums text-gray-900`,children:t})]})}function Ere({fileActive:e,projectFilesActive:t}){let n=tI(),r=(0,V.useRef)(null),i=(0,V.useRef)(null),a=$(e=>e.snapshot.workspaceExplorerOpen),o=$(e=>e.snapshot.workspaceExplorerWidth),s=$(e=>e.setSnapshot),[c,l]=(0,V.useState)(!1),[u,d]=(0,V.useState)(null),f=u??o,p=(0,V.useCallback)(e=>s({workspaceExplorerOpen:e}),[s]);return(0,V.useEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=()=>l(e.getBoundingClientRect().width<560);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,V.useEffect)(()=>{if(!e||!c||!a)return;let t=e=>{e.key===`Escape`&&p(!1)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[c,a,e,p]),{compact:c,containerRef:r,explorerOpen:a,explorerOverlay:e&&c&&a,explorerWidth:f,onResizeStart:t=>{if(c||!e)return;t.preventDefault(),t.currentTarget.setPointerCapture?.(t.pointerId),i.current={startX:t.clientX,startWidth:f,width:f};let r=e=>{let t=i.current;if(!t)return;let n=AR(t.startWidth+e.clientX-t.startX);t.width=n,d(n)},a=()=>{let e=i.current?.width;typeof e==`number`&&n.chatThreadManager.setWorkspaceExplorerWidth(e),d(null),i.current=null,window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)},setExplorerOpen:p,showExplorer:t||e&&a}}function r7({count:e,description:t,icon:n,onClick:r,title:i}){return(0,H.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-3 rounded-lg border border-gray-200/80 bg-white px-3 py-3 text-left transition-colors hover:border-gray-300 hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/25`,onClick:r,children:[(0,H.jsx)(`span`,{className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600`,children:n}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:i}),typeof e==`number`?(0,H.jsx)(`span`,{className:`rounded-full bg-gray-100 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-gray-500`,children:e}):null]}),(0,H.jsx)(`span`,{className:`mt-0.5 block text-xs leading-5 text-gray-500`,children:t})]}),(0,H.jsx)(sa,{className:`h-4 w-4 shrink-0 text-gray-300 transition-transform group-hover:translate-x-0.5 group-hover:text-gray-500`})]})}function Dre({childSessionTabs:e,sessionCronJobs:t,sessionKey:n}){let r=tI(),i=fL(n);return(0,H.jsx)(`div`,{className:`h-full overflow-auto bg-gray-50/45 px-4 py-5 custom-scrollbar`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-xl`,children:[(0,H.jsx)(`h2`,{className:`text-base font-semibold text-gray-900`,children:b(`chatWorkspaceOverview`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:b(`chatWorkspaceOverviewDescription`)}),(0,H.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,H.jsx)(r7,{count:i.data?.counts.total??0,description:b(`chatWorkspaceContinuousAttentionDescription`),icon:(0,H.jsx)(Oa,{className:`h-4 w-4`}),title:b(`chatWorkspaceContinuousAttention`),onClick:()=>{n&&r.chatThreadManager.openContinuousAttention(n)}}),(0,H.jsx)(r7,{count:e.length,description:b(`chatWorkspaceChildSessionsDescription`),icon:(0,H.jsx)(Ka,{className:`h-4 w-4`}),title:b(`chatWorkspaceChildSessions`),onClick:()=>{n&&r.chatThreadManager.openChildSessions(n)}}),(0,H.jsx)(r7,{count:t.length,description:b(`chatWorkspaceSessionCronJobsDescription`),icon:(0,H.jsx)(Ui,{className:`h-4 w-4`}),title:b(`chatWorkspaceSessionCronJobs`),onClick:()=>{n&&r.chatThreadManager.openSessionCronPanel(n)}}),(0,H.jsx)(r7,{description:b(`chatWorkspaceProjectFilesDescription`),icon:(0,H.jsx)(Ha,{className:`h-4 w-4`}),title:b(`chatWorkspaceProjectFiles`),onClick:()=>{n&&r.chatThreadManager.openProjectFiles(n)}})]}),(0,H.jsx)(xre,{sessionKey:n})]})})}function Ore({activePath:e,onFileOpen:t,projectRoot:n,sessionKey:r,workingDir:i}){let a=tI(),o=n??i,s=NF({path:o,includeFiles:!0,enabled:!!o});return o?(0,H.jsx)(TJ,{activeRelativePath:e?SI({path:e,sessionProjectRoot:o}):null,browseQuery:s,onFileOpen:t??a.chatThreadManager.openFilePreview,sessionKey:r,renderStatus:({text:e,tone:t=`muted`})=>(0,H.jsx)(`div`,{className:u(`flex h-full items-center justify-center px-6 text-center text-sm`,t===`error`?`text-rose-600`:`text-gray-500`),children:e}),showRoot:!0},o):(0,H.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-center text-sm text-gray-500`,children:b(`chatWorkspaceProjectFilesUnavailable`)})}function kre({value:e}){return(0,H.jsx)(`span`,{className:`inline-flex max-w-full shrink-0 items-center rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-[10px] font-medium text-gray-600`,children:(0,H.jsx)(`span`,{className:`truncate`,children:e})})}function Are({tab:e}){let t=[e.sessionTypeLabel,e.preferredModel,e.projectName].filter(e=>!!e?.trim());return t.length===0&&!e.projectRoot?null:(0,H.jsxs)(`div`,{className:`flex min-h-9 min-w-0 items-center gap-1.5 border-b border-gray-200/70 px-3 py-1.5 text-[11px] text-gray-500`,children:[t.map(e=>(0,H.jsx)(kre,{value:e},e)),e.projectRoot?(0,H.jsx)(`span`,{title:e.projectRoot,className:`min-w-0 flex-1 truncate rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 font-mono text-[10px] text-gray-500`,children:e.projectRoot}):null]})}function jre(){return(0,H.jsxs)(`div`,{className:`border-b border-gray-200/70 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-semibold text-gray-900`,children:[(0,H.jsx)(to,{className:`h-4 w-4 shrink-0 text-primary`}),(0,H.jsx)(`span`,{className:`truncate`,children:b(`chatWorkspaceSideChatDraftTitle`)})]}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-gray-500`,children:b(`chatWorkspaceSideChatDraftSubtitle`)})]})}function Mre({activeSelection:e,childSessionTabs:t,filePreviewRefreshVersion:n,sessionKey:r,sessionCronJobs:i,sessionProjectRoot:a,sessionWorkingDir:o,explorerControl:s}){let c=tI();return e.kind===`overview`?(0,H.jsx)(Dre,{childSessionTabs:t,sessionCronJobs:i,sessionKey:r}):e.kind===`child-sessions`?(0,H.jsx)(bre,{childSessionTabs:t,sessionKey:r}):e.kind===`continuous-attention`?(0,H.jsx)(Tre,{sessionKey:r}):e.kind===`side-chat-draft`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(jre,{}),(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(A5,{materializationContext:{kind:`child`,parentSessionKey:e.draft.parentSessionKey,inheritContext:!0},sessionKey:null,showWelcomeForDraft:!1,onSessionMaterialized:t=>c.chatThreadManager.materializeSideChatDraft({draftKey:e.draft.draftKey,sessionKey:t})})})]}):e.kind===`child-session`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Are,{tab:e.tab}),(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(A5,{sessionKey:e.tab.sessionKey})})]}):e.kind===`file`?(0,H.jsx)(aY,{breadcrumbLeading:(0,H.jsx)(B,{"data-testid":`workspace-explorer-toggle`,icon:s?.open?(0,H.jsx)(uo,{className:`h-4 w-4`}):(0,H.jsx)(po,{className:`h-4 w-4`}),label:b(s?.open?`chatWorkspaceHideProjectFiles`:`chatWorkspaceShowProjectFiles`),size:`sm`,tooltipSide:`bottom`,onClick:s?.onToggle}),file:e.file,refreshVersion:n,sessionProjectRoot:a,sessionWorkingDir:o,onFileOpen:c.chatThreadManager.openFilePreview,onTextExcerptAdd:e=>{c.chatComposerIntentManager.requestExcerptReference({targetSessionKey:r,...e})}}):(0,H.jsx)(yre,{jobs:i})}function Nre({activeSelection:e,sessionKey:t,sessionProjectRoot:n,sessionWorkingDir:r,...i}){let a=e.kind===`project-files`,o=e.kind===`file`,s=tI(),{compact:c,containerRef:l,explorerOpen:d,explorerOverlay:f,explorerWidth:p,onResizeStart:m,setExplorerOpen:h,showExplorer:g}=Ere({fileActive:o,projectFilesActive:a});return(0,H.jsxs)(`div`,{ref:l,"data-testid":`workspace-shared-explorer-layout`,className:`relative flex h-full min-h-0 flex-1 overflow-hidden`,children:[f?(0,H.jsx)(`button`,{"data-testid":`workspace-explorer-scrim`,type:`button`,"aria-label":b(`chatWorkspaceHideProjectFiles`),className:`absolute inset-0 z-10 bg-black/15`,onClick:()=>h(!1)}):null,(0,H.jsxs)(`div`,{"data-testid":`workspace-shared-explorer`,"data-mode":a?`full`:f?`overlay`:`side`,className:u(`relative min-h-0 shrink-0 flex-col border-r border-gray-200/80 bg-white`,g?`flex`:`hidden`,a?`flex-1 border-r-0`:null,f?`absolute inset-y-0 left-0 z-20 w-[min(320px,86%)] shadow-xl`:null),style:!a&&!f?{width:p}:void 0,"aria-hidden":!g,children:[(0,H.jsx)(Ore,{activePath:o?e.file.path:null,onFileOpen:e=>{c&&h(!1),s.chatThreadManager.openFilePreview(e)},projectRoot:n,sessionKey:t,workingDir:r}),o&&!c?(0,H.jsx)(`div`,{"data-testid":`workspace-explorer-resize-handle`,"aria-label":b(`chatWorkspaceResizeProjectFiles`),"aria-orientation":`vertical`,"aria-valuemax":400,"aria-valuemin":192,"aria-valuenow":p,role:`separator`,className:`absolute inset-y-0 right-[-4px] z-20 w-2 cursor-ew-resize hover:bg-primary/10`,onPointerDown:m}):null]}),a?null:(0,H.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,H.jsx)(Mre,{...i,activeSelection:e,explorerControl:o?{open:d,onToggle:()=>h(!d)}:void 0,sessionKey:t,sessionProjectRoot:n,sessionWorkingDir:r})})]})}function Pre({sessionKey:e,childSessionTabs:t,activeChildSessionKey:n,activeSideChatDraft:r,workspaceFileTabs:i,activeWorkspaceFileKey:a,closedWorkspaceTabEntries:o,workspaceNavigationHistory:s=[],workspaceNavigationHistoryIndex:c=0,activePanelKind:l,sessionCronJobs:d=[],sessionProjectRoot:f,sessionWorkingDir:p,workspacePanelWidth:m=480,displayMode:h=`docked`}){let g=tI(),_=F(),[v,y]=(0,V.useState)(!1),[b,x]=(0,V.useState)(0),S=xz(t),C=oL(e=>e.optimisticReadAtBySessionKey),w=Cz({activeChildSessionKey:n,activeSideChatDraft:r,activeWorkspaceFileKey:a,activePanelKind:l,childSessionTabs:S,workspaceFileTabs:i}),T={entries:s,index:c};(0,V.useEffect)(()=>{g.chatThreadManager.syncVisibleWorkspaceSelection(w)},[w,g]);let E=(0,V.useMemo)(()=>Tz({hasSession:!!e,resolvedChildTabs:S,activeSideChatDraft:r,closedWorkspaceTabEntries:o,workspaceFileTabs:i,activeSelection:w,optimisticReadAtBySessionKey:C,sessionProjectRoot:f??p,onAddFileToChat:({label:t,tokenKey:n})=>{g.chatComposerIntentManager.requestFileReference({targetSessionKey:e,tokenKey:n,label:t})},onSelectSession:g.chatThreadManager.selectChildSessionDetail,onSelectFile:g.chatThreadManager.selectWorkspaceFile,onOpenFileViewer:g.chatThreadManager.openWorkspaceFileViewer,onCloseTab:g.chatThreadManager.closeWorkspaceTab,onSelectOverview:()=>{e&&g.chatThreadManager.openWorkspaceOverview(e)},onSelectChildSessions:()=>{e&&g.chatThreadManager.openChildSessions(e)},onSelectProjectFiles:()=>{g.chatThreadManager.openProjectFiles(e)},onSelectCronJobs:()=>{e&&g.chatThreadManager.openSessionCronPanel(e)},onSelectContinuousAttention:()=>{e&&g.chatThreadManager.openContinuousAttention(e)}}),[w,r,o,C,g.chatThreadManager,g.chatComposerIntentManager,S,e,f,p,i]);if(!w)return null;let D=h===`docked`&&v,O=h===`overlay`||D,k=w.kind===`file`&&w.file.viewMode===`preview`?w.file:null,A=k?()=>{_.invalidateQueries({queryKey:JJ({path:k.path,basePath:p})}),_.invalidateQueries({queryKey:MF({path:k.path,basePath:p,includeFiles:!0})}),x(e=>e+1)}:void 0;return(0,H.jsxs)(ti,{"data-testid":`chat-session-workspace-panel`,className:u(O?`bg-white`:`hidden border-gray-200/70 bg-white/95 backdrop-blur-sm md:flex`,D?`shadow-xl`:null),defaultWidth:m,width:m,minWidth:360,maxWidth:860,onWidthCommit:g.chatThreadManager.setWorkspacePanelWidth,overlay:O,overlayScope:D?`container`:`viewport`,children:[(0,H.jsx)(jU,{tabs:E,canGoBack:jR(T),canGoForward:MR(T),isMaximized:D,onGoBack:g.chatThreadManager.goBackWorkspacePanel,onGoForward:g.chatThreadManager.goForwardWorkspacePanel,onRefreshFile:A,onToggleMaximize:h===`docked`?()=>y(e=>!e):void 0,onClose:g.chatThreadManager.closeWorkspacePanel}),(0,H.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-white`,children:(0,H.jsx)(Nre,{activeSelection:w,childSessionTabs:S,filePreviewRefreshVersion:b,sessionKey:e,sessionCronJobs:d,sessionProjectRoot:f,sessionWorkingDir:p})})]})}var Fre=[];function Ire(e,t){let n=eR(e=>e.snapshot.sessionsQuery?.data?.sessions??Fre),r=(0,V.useMemo)(()=>{let r=e.childSessionTabs.filter(e=>e.parentSessionKey===t),i=new Set(r.map(e=>e.sessionKey));return[...r,...JI(n).filter(e=>e.parentSessionId===t&&!i.has(e.key)).map(e=>({sessionKey:e.key,parentSessionKey:t}))]},[t,n,e.childSessionTabs]),i=(0,V.useMemo)(()=>e.workspaceFileTabs.filter(e=>e.parentSessionKey===t),[t,e.workspaceFileTabs]),a=e.activeSideChatDraft?.parentSessionKey===t?e.activeSideChatDraft:null,o=K5({all:!0});return{childSessionTabs:r,activeSideChatDraft:a,workspaceFileTabs:i,sessionCronJobs:(0,V.useMemo)(()=>(o.data?.jobs??[]).filter(e=>ure(e,t)),[o.data?.jobs,t]),showWorkspacePanel:e.workspacePanelParentKey===t&&e.activeWorkspacePanelKind!=null}}function Lre({layoutMode:e,sessionKey:t}){let n=$(e=>e.snapshot),r=eR(e=>mI(e.snapshot.configQuery?.data?.agents.defaults.workspace)),i=yR(t),a=t?null:n.draftProjectRoot??r,{childSessionTabs:o,activeSideChatDraft:s,workspaceFileTabs:c,sessionCronJobs:l,showWorkspacePanel:u}=Ire(n,t);return u?(0,H.jsx)(Pre,{sessionKey:t,childSessionTabs:t?o:[],activeChildSessionKey:n.activeChildSessionKey??null,activeSideChatDraft:s,workspaceFileTabs:c,activeWorkspaceFileKey:n.activeWorkspaceFileKey??null,closedWorkspaceTabEntries:n.closedWorkspaceTabEntries,workspaceNavigationHistory:n.workspaceNavigationHistory,workspaceNavigationHistoryIndex:n.workspaceNavigationHistoryIndex,activePanelKind:n.activeWorkspacePanelKind??null,sessionCronJobs:t?l:[],sessionProjectRoot:i?.projectRoot??a,sessionWorkingDir:i?.workingDir??i?.projectRoot??a,workspacePanelWidth:n.workspacePanelWidth,displayMode:e===`mobile`?`overlay`:`docked`}):null}function i7({layoutMode:e=`desktop`,onBackToList:t}){let n=tI(),r=oL(e=>e.snapshot.selectedSessionKey);return(0,H.jsxs)(`section`,{className:`relative flex-1 min-h-0 flex overflow-hidden bg-background`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,H.jsx)(yz,{}),(0,H.jsx)(vz,{layoutMode:e,onBackToList:t}),(0,H.jsx)(A5,{consumeDraftIntent:!0,sessionKey:r,onSessionMaterialized:n.chatThreadManager.materializeRootDraftSession})]}),(0,H.jsx)(Lre,{layoutMode:e,sessionKey:r})]})}function Rre(){let e=Ns(),[t,n]=(0,V.useState)(null),[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(null),s=e=>{n(e.key),i(e.label?.trim()??``)},c=()=>{n(null),i(``),o(null)};return{editingSessionKey:t,draftLabel:r,savingSessionKey:a,setDraftLabel:i,startEditingSessionLabel:s,cancelEditingSessionLabel:c,saveSessionLabel:async t=>{let n=r.trim();if(n===(t.label?.trim()??``)){c();return}o(t.key);try{await e({sessionKey:t.key,label:n||null}),c()}catch{o(null)}}}}var a7=`nextclaw.ui.theme`,o7=`work`,s7=[{value:`work`,labelKey:`themeWork`,appearance:`light`},{value:`night`,labelKey:`themeNight`,appearance:`dark`},{value:`charcoal`,labelKey:`themeCharcoal`,appearance:`dark`},{value:`natural`,labelKey:`themeNatural`,appearance:`light`},{value:`minimal`,labelKey:`themeMinimal`,appearance:`light`},{value:`warm`,labelKey:`themeWarm`,appearance:`light`},{value:`cool`,labelKey:`themeCool`,appearance:`light`},{value:`dawn`,labelKey:`themeDawn`,appearance:`light`},{value:`graphite`,labelKey:`themeGraphite`,appearance:`light`},{value:`probe`,labelKey:`themeProbe`,appearance:`light`}],zre=s7.map(({value:e})=>e),c7=s7.map(({value:e,labelKey:t})=>({value:e,labelKey:t}));function l7(e){return typeof e==`string`?zre.includes(e)?e:e===`leaf`?`warm`:null:null}function u7(e){return s7.find(t=>t.value===e)?.appearance??`light`}var d7=new class{constructor(){this.activeTheme=o7,this.initialized=!1,this.listeners=new Set,this.resolveInitialTheme=()=>{if(typeof window>`u`)return o7;try{let e=l7(window.localStorage.getItem(a7));if(e)return e}catch{}return o7},this.initializeTheme=()=>(this.initialized||=(this.activeTheme=this.resolveInitialTheme(),this.applyThemeAttribute(this.activeTheme),!0),this.activeTheme),this.getTheme=()=>this.initialized?this.activeTheme:this.initializeTheme(),this.setTheme=e=>{this.initializeTheme(),e!==this.activeTheme&&(this.activeTheme=e,this.applyThemeAttribute(this.activeTheme),this.saveTheme(this.activeTheme),this.listeners.forEach(e=>e(this.activeTheme)))},this.subscribeThemeChange=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.applyThemeAttribute=e=>{if(typeof document>`u`)return;let t=u7(e);document.documentElement.setAttribute(`data-theme`,e),document.documentElement.setAttribute(`data-theme-appearance`,t),document.documentElement.style.colorScheme=t},this.saveTheme=e=>{if(!(typeof window>`u`))try{window.localStorage.setItem(a7,e)}catch{}}}};function Bre(){return d7.initializeTheme()}function Vre(){return d7.getTheme()}function Hre(e){d7.setTheme(e)}function Ure(e){return d7.subscribeThemeChange(e)}var f7=`nextclaw-pwa-install-banner-dismissed`,p7=`nextclaw-pwa-install-banner-dismissed-until`;function m7(){let e=g7();return e?e.getItem(`nextclaw-pwa-install-banner-dismissed`)===`1`?!0:Gre(e):!1}function Wre(){let e=g7();e?.setItem(f7,`1`),e?.removeItem(p7)}function h7(){let e=g7();e?.removeItem(f7),e?.removeItem(p7)}function g7(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Gre(e){let t=e.getItem(p7);if(!t)return!1;let n=Number.parseInt(t,10);return e.removeItem(p7),!Number.isFinite(n)||n<=Date.now()?!1:(e.setItem(f7,`1`),!0)}function _7(){return{initialized:!1,installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`,dismissedInstallPrompt:m7()}}var v7=N(()=>_7()),y7=new class{constructor(){this.started=!1,this.deferredPrompt=null,this.displayModeMediaQuery=null,this.start=()=>{this.started||typeof window>`u`||(this.started=!0,window.addEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.addEventListener(`appinstalled`,this.handleAppInstalled),typeof window.matchMedia==`function`&&(this.displayModeMediaQuery=window.matchMedia(`(display-mode: standalone)`),this.bindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged)),this.refreshState())},this.stop=()=>{!this.started||typeof window>`u`||(window.removeEventListener(`beforeinstallprompt`,this.handleBeforeInstallPrompt),window.removeEventListener(`appinstalled`,this.handleAppInstalled),this.displayModeMediaQuery&&=(this.unbindDisplayModeListener(this.displayModeMediaQuery,this.handleDisplayModeChanged),null),this.deferredPrompt=null,this.started=!1)},this.resetForTests=()=>{this.stop(),v7.setState(_7())},this.refreshState=()=>{let e=this.resolveInstallability();v7.setState(t=>({...t,initialized:!0,installability:e.installability,installMethod:e.installMethod,blockedReason:e.blockedReason,dismissedInstallPrompt:m7()}))},this.dismissInstallPrompt=()=>{Wre(),v7.setState({dismissedInstallPrompt:!0})},this.promptInstall=async()=>{let e=this.resolveInstallability();if(e.installability!==`available`)return`unavailable`;if(e.installMethod===`manual`||!this.deferredPrompt)return`manual`;this.deferredPrompt.prompt();let t=await this.deferredPrompt.userChoice;return this.deferredPrompt=null,t.outcome===`accepted`?(h7(),this.refreshState(),R.success(b(`pwaInstallAccepted`)),`accepted`):(this.dismissInstallPrompt(),this.refreshState(),`dismissed`)},this.handleBeforeInstallPrompt=e=>{e.preventDefault(),this.deferredPrompt=e,this.refreshState()},this.handleAppInstalled=()=>{this.deferredPrompt=null,h7(),v7.setState({dismissedInstallPrompt:!0}),R.success(b(`pwaInstalledToast`)),this.refreshState()},this.handleDisplayModeChanged=()=>{this.refreshState()},this.resolveInstallability=()=>this.isDevelopmentServer()?{installability:`unsupported`,installMethod:`none`,blockedReason:`dev-server`}:this.hasDesktopHost()?{installability:`suppressed`,installMethod:`none`,blockedReason:`desktop-host`}:this.isStandalone()?{installability:`installed`,installMethod:`none`,blockedReason:null}:this.hasInstallSurfaceSupport()?this.isEligibleInstallContext()?{installability:`available`,installMethod:this.deferredPrompt?`prompt`:`manual`,blockedReason:null}:{installability:`unsupported`,installMethod:`none`,blockedReason:`insecure-context`}:{installability:`unsupported`,installMethod:`none`,blockedReason:`missing-browser-support`},this.hasDesktopHost=()=>typeof window<`u`&&!!window.nextclawDesktop,this.hasInstallSurfaceSupport=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&`serviceWorker`in navigator,this.isEligibleInstallContext=()=>typeof window>`u`?!1:window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>typeof window<`u`&&!1,this.isStandalone=()=>{if(typeof window>`u`)return!1;let e=window.navigator;return typeof window.matchMedia==`function`&&window.matchMedia(`(display-mode: standalone)`).matches||e.standalone===!0},this.bindDisplayModeListener=(e,t)=>{if(`addEventListener`in e){e.addEventListener(`change`,t);return}e.addListener?.(t)},this.unbindDisplayModeListener=(e,t)=>{if(`removeEventListener`in e){e.removeEventListener(`change`,t);return}e.removeListener?.(t)}}};function Kre(){let e=v7(e=>e.installability);return(0,H.jsx)(`span`,{className:u(`inline-flex items-center rounded-full border px-3 py-1 text-xs font-medium`,e===`installed`?`bg-emerald-50 text-emerald-700 border-emerald-200`:e===`available`?`bg-amber-50 text-amber-700 border-amber-200`:`bg-gray-100 text-gray-600 border-gray-200`),children:qre(e)})}function qre(e){return b(e===`available`?`pwaInstallStatusAvailable`:e===`installed`?`pwaInstallStatusInstalled`:e===`suppressed`?`pwaInstallStatusDesktopHost`:`pwaInstallStatusUnavailable`)}function Jre(e,t,n){return b(e===`installed`?`pwaInstallCardInstalled`:e===`suppressed`?`pwaInstallCardSuppressed`:e===`available`&&t===`prompt`?`pwaInstallCardPrompt`:e===`available`?`pwaInstallCardManual`:n===`insecure-context`?`pwaInstallCardInsecureContext`:n===`dev-server`?`pwaInstallCardDevServer`:`pwaInstallCardUnsupported`)}function Yre(){let e=v7(e=>e.installability),t=v7(e=>e.installMethod),n=v7(e=>e.blockedReason);return(0,H.jsx)(en,{title:b(`pwaInstallTitle`),description:b(`pwaInstallDescription`),actions:(0,H.jsx)(Kre,{}),children:(0,H.jsx)(Gt,{children:(0,H.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,H.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:Jre(e,t,n)}),e===`available`&&t===`prompt`?(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,H.jsxs)(L,{type:`button`,className:`gap-2`,onClick:()=>void y7.promptInstall(),children:[(0,H.jsx)(wa,{className:`h-4 w-4`}),b(`pwaInstallAction`)]}),(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:b(`pwaInstallPromptHint`)})]}):null,e===`available`&&t===`manual`?(0,H.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl bg-background/65 p-4`,children:[(0,H.jsx)(jo,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,H.jsx)(`p`,{className:`text-sm leading-6 text-muted-foreground`,children:b(`pwaInstallManualHint`)})]}):null]})})})}function Xre(){let e=v7(e=>e.installability),t=v7(e=>e.installMethod),n=v7(e=>e.dismissedInstallPrompt);return e!==`available`||t!==`prompt`||n?null:(0,H.jsxs)(`div`,{className:`fixed bottom-5 right-5 z-50 w-[min(420px,calc(100vw-2rem))] rounded-[26px] border border-gray-200 bg-white/95 p-5 shadow-2xl backdrop-blur-xl`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:b(`pwaInstallBannerTitle`)}),(0,H.jsx)(`p`,{className:`text-sm leading-6 text-gray-600`,children:b(`pwaInstallBannerDescription`)})]}),(0,H.jsx)(`button`,{type:`button`,"aria-label":b(`pwaInstallDismiss`),className:`rounded-full p-1 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>{y7.dismissInstallPrompt()},children:(0,H.jsx)(hi,{className:`h-4 w-4`})})]}),(0,H.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[(0,H.jsxs)(L,{type:`button`,size:`sm`,className:`gap-2`,onClick:()=>{y7.promptInstall()},children:[(0,H.jsx)(wa,{className:`h-4 w-4`}),b(`pwaInstallAction`)]}),(0,H.jsx)(L,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{y7.dismissInstallPrompt()},children:b(`pwaInstallDismiss`)})]})]})}var Zre=new class{constructor(){this.started=!1,this.registration=null,this.start=async()=>{if(!(this.started||typeof window>`u`)&&(this.started=!0,!(!(`serviceWorker`in navigator)||!this.isEligibleInstallContext()))){if(this.isDevelopmentServer()){await this.cleanupDevelopmentRegistrations();return}try{this.registration=await navigator.serviceWorker.register(`/sw.js`)}catch{return}}},this.stop=()=>{!this.started||typeof window>`u`||!(`serviceWorker`in navigator)||(this.started=!1,this.registration=null)},this.isEligibleInstallContext=()=>window.isSecureContext||this.isTrustedLocalhost(window.location.hostname),this.isTrustedLocalhost=e=>e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`,this.isDevelopmentServer=()=>!1,this.cleanupDevelopmentRegistrations=async()=>{if(typeof navigator.serviceWorker.getRegistrations!=`function`)return;let e=(await navigator.serviceWorker.getRegistrations()).filter(e=>[e.active?.scriptURL,e.installing?.scriptURL,e.waiting?.scriptURL].filter(e=>!!e).some(e=>e.endsWith(`/sw.js`)));await Promise.all(e.map(async e=>await e.unregister())),e.length>0&&await this.clearNextClawCaches()},this.clearNextClawCaches=async()=>{if(typeof window>`u`||!(`caches`in window)||typeof caches.keys!=`function`)return;let e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith(`nextclaw-ui-`)).map(async e=>await caches.delete(e)))}}},b7=!1;function Qre(){b7||typeof window>`u`||(b7=!0,y7.start(),Zre.start())}var $re={natural:`#FAF9F7`,work:`#FFFFFF`,minimal:`#FFFFFF`,warm:`#FAF8F4`,cool:`#F8FAFC`,dawn:`#FAF7F4`,graphite:`#F8F8F7`,night:`#101318`,charcoal:`#1C1C1C`,probe:`#FEFCF6`},eie=new class{constructor(){this.syncTheme=e=>{if(typeof document>`u`)return;let t=$re[e];this.updateThemeMeta(t),this.updateSurfaceBackgrounds(t),document.documentElement.style.colorScheme=u7(e)},this.syncCurrentTheme=()=>{if(typeof document>`u`)return;let e=document.documentElement.getAttribute(`data-theme`);this.syncTheme(l7(e)??`work`)},this.updateThemeMeta=e=>{let t=document.querySelector(`meta[name="theme-color"]`);t instanceof HTMLMetaElement&&(t.content=e)},this.updateSurfaceBackgrounds=e=>{document.documentElement.style.backgroundColor=e,document.body.style.backgroundColor=e;let t=document.getElementById(`root`);t&&(t.style.backgroundColor=e)}}},x7=(0,V.createContext)(null);function tie({children:e}){let[t,n]=(0,V.useState)(()=>Bre());(0,V.useEffect)(()=>{eie.syncTheme(t)},[t]),(0,V.useEffect)(()=>Ure(e=>{n(e)}),[]);let r=(0,V.useCallback)(e=>{Hre(e),n(Vre())},[]),i=(0,V.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,H.jsx)(x7.Provider,{value:i,children:e})}function S7(){let e=(0,V.useContext)(x7);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function nie({sessionKey:e,draftLabel:t,isSaving:n,onDraftLabelChange:r,onSave:i,onCancel:a}){return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(vt,{value:t,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),i()):e.key===`Escape`&&(e.preventDefault(),a())},placeholder:b(`sessionsLabelPlaceholder`),className:`h-8 rounded-lg border-border bg-background text-xs`,autoFocus:!0,disabled:n}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`div`,{className:`min-w-0 truncate text-[11px] text-muted-foreground/65`,children:e}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(B,{icon:(0,H.jsx)(wr,{className:`h-3.5 w-3.5`}),label:b(`save`),tooltip:!1,onClick:()=>void i(),disabled:n}),(0,H.jsx)(B,{icon:(0,H.jsx)(hi,{className:`h-3.5 w-3.5`}),label:b(`cancel`),tooltip:!1,onClick:a,disabled:n})]})]})]})}function rie({sessionKey:e,active:t,showUnreadDot:n,runStatus:r,context:i,isPinned:a,title:o,previewText:s,trailingText:c,agentId:l,agentLabel:d,agentAvatarUrl:f,childSessionCount:p=0,onSelect:m,onOpenChildSessions:h,onStartEditing:g,onTogglePinned:_}){return(0,H.jsxs)(`div`,{className:`group/session relative`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:m,className:`w-full text-left`,children:[(0,H.jsx)(`div`,{className:u(`flex min-h-6 min-w-0 items-center`,p>0&&h?`pr-32`:`pr-20`),children:(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[l?.trim()&&l.trim().toLowerCase()!==`main`?(0,H.jsx)(dz,{agentId:l,displayName:d,avatarUrl:f,className:`h-5 w-5 shrink-0`}):null,(0,H.jsx)(`span`,{className:`truncate leading-6 font-medium`,children:o}),i.label?(0,H.jsx)(`span`,{className:u(`shrink-0 rounded-full border px-1.5 py-0.5 text-[10px] font-semibold leading-none`,t?`border-border/70 bg-background/80 text-foreground/75`:`border-transparent bg-muted/70 text-muted-foreground`),children:i.label}):null,i.icon?(0,H.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,H.jsx)(KL,{icon:i.icon,className:u(`h-[13px] w-[13px]`,t?`text-foreground/75`:`text-muted-foreground`)})}):null]})}),(0,H.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground/65`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),n?(0,H.jsx)(`span`,{"aria-label":b(`chatSessionUnread`),className:`ml-auto h-2 w-2 shrink-0 rounded-full bg-primary`}):(0,H.jsx)(`span`,{className:`ml-auto shrink-0`,children:c})]})]}),p>0&&h?(0,H.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),h()},className:`pointer-events-none absolute right-12 top-0 inline-flex h-6 items-center gap-1 rounded-md px-1.5 text-[10px] font-medium text-muted-foreground opacity-0 transition-colors hover:bg-background/80 hover:text-foreground group-hover/session:pointer-events-auto group-hover/session:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,"aria-label":b(`chatSessionOpenChildSessions`),title:b(`chatSessionOpenChildSessions`),children:[(0,H.jsx)(Ka,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:p})]}):null,r?(0,H.jsx)(`span`,{className:`absolute right-0 top-0 inline-flex h-6 w-6 items-center justify-center transition-opacity group-hover/session:opacity-0`,children:(0,H.jsx)(JL,{status:r})}):null,(0,H.jsxs)(`div`,{className:`pointer-events-none absolute right-0 top-0 flex h-6 items-center gap-0.5 opacity-0 transition-opacity group-hover/session:pointer-events-auto group-hover/session:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100`,children:[(0,H.jsx)(B,{size:`sm`,tone:`strong`,icon:(0,H.jsx)(Xr,{className:u(`h-3.5 w-3.5`,a&&`fill-current text-foreground`)}),label:b(a?`chatSidebarUnpinSession`:`chatSidebarPinSession`),tooltipSide:`right`,onClick:e=>{e.stopPropagation(),_()}}),(0,H.jsx)(B,{size:`sm`,tone:`strong`,icon:(0,H.jsx)(yo,{className:`h-3.5 w-3.5`}),label:b(`edit`),tooltipSide:`right`,onClick:e=>{e.stopPropagation(),g()}}),(0,H.jsx)(kF,{sessionKey:e,triggerSize:`sm`,triggerTone:`strong`})]})]})}function iie({sessionKey:e,active:t,showUnreadDot:n,runStatus:r,context:i,isPinned:a,title:o,previewText:s,trailingText:c,agentId:l,agentLabel:d,agentAvatarUrl:f,childSessionCount:p,isEditing:m,draftLabel:h,isSaving:g,onSelect:_,onOpenChildSessions:v,onStartEditing:y,onDraftLabelChange:b,onSave:x,onCancel:S,onTogglePinned:C}){return(0,H.jsx)(`div`,{className:u(`w-full rounded-lg px-2.5 py-2 text-left text-[13px] transition-colors`,t?`bg-background/90 font-medium text-foreground`:`text-foreground/80 hover:bg-background/65 hover:text-foreground`),children:m?(0,H.jsx)(nie,{sessionKey:e,draftLabel:h,isSaving:g,onDraftLabelChange:b,onSave:x,onCancel:S}):(0,H.jsx)(rie,{sessionKey:e,active:t,showUnreadDot:n,runStatus:r,context:i,isPinned:a,title:o,previewText:s,trailingText:c,agentId:l,agentLabel:d,agentAvatarUrl:f,onSelect:_,childSessionCount:p,onOpenChildSessions:v,onStartEditing:y,onTogglePinned:C})})}function aie(e){let{item:t,selectedSessionKey:n,optimisticReadAtBySessionKey:r,agentsById:i,childSessionsByParentKey:a,editingSessionKey:o,draftLabel:s,savingSessionKey:c,sessionTypeOptions:l,isPinned:u,sessionTitle:d,onSelectSession:f,onOpenChildSessions:p,onStartEditingSessionLabel:m,onDraftLabelChange:h,onSaveSessionLabel:g,onCancelEditingSessionLabel:_,onTogglePinned:v}=e,{session:y,runStatus:b}=t,x=n===y.key,S=r[y.key],C=S&&y.readAt?S.localeCompare(y.readAt)>0?S:y.readAt:S??y.readAt,w=a.get(y.key)??[],T=y.agentId?i.get(y.agentId)?.displayName??y.agentId:null,E=aI(y)??`${T?.trim()?`${T} · `:``}${y.messageCount}`;return(0,H.jsx)(iie,{sessionKey:y.key,active:x,showUnreadDot:nL({active:x,lastMessageAt:y.lastMessageAt,readAt:C,runStatus:b}),runStatus:b,context:VL(y,l),isPinned:u,title:d(y),previewText:E,trailingText:lI(y.lastMessageAt??y.createdAt),agentId:y.agentId??null,agentLabel:T,agentAvatarUrl:y.agentId?i.get(y.agentId)?.avatarUrl??null:null,childSessionCount:w.length,isEditing:o===y.key,draftLabel:s,isSaving:c===y.key,onSelect:()=>f(y.key),onOpenChildSessions:()=>p(y.key,w[0]?.session.key??null),onStartEditing:()=>m(y),onDraftLabelChange:h,onSave:()=>g(y),onCancel:_,onTogglePinned:v})}var oie={maxHeight:SF(`18rem`)};function C7({className:e,onSelect:t,options:n,selectedSessionType:r,title:i=b(`chatSessionTypeLabel`),titleClassName:a}){return(0,H.jsxs)(`div`,{className:u(`space-y-1 overflow-y-auto overscroll-contain`,e),style:oie,children:[(0,H.jsx)(`div`,{className:u(`px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.18em] text-gray-400`,a),children:i}),n.map(e=>(0,H.jsx)(q4,{disabled:e.ready===!1,option:e,selected:e.value===r,onSelect:()=>t(e.value)},e.value))]})}function w7({option:e}){return e?.icon?.src?(0,H.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:(0,H.jsx)(KL,{icon:{kind:`runtime-image`,src:e.icon.src,alt:e.icon.alt??null,name:e.label},className:`h-4 w-4`})}):(0,H.jsx)(Zi,{className:`h-4 w-4 shrink-0`})}function sie(e){let{query:t,selectedNewSessionType:n,selectedNewSessionTypeOption:r,sessionTypeOptions:i,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:s,onSelectNewSessionType:c,onQueryChange:l,collapsed:d=!1}=e,f=i.length>1;return d?(0,H.jsx)(`div`,{className:`px-2 pb-2`,children:(0,H.jsxs)(`div`,{className:u(`flex flex-col items-center`,qY),children:[(0,H.jsx)(B,{icon:(0,H.jsx)(pi,{className:GY}),label:b(`chatSidebarNewTask`),className:u(WY,JY),onClick:()=>{o(!1),s(n)}}),f?(0,H.jsxs)(wF,{open:a,onOpenChange:o,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(B,{icon:(0,H.jsx)(w7,{option:r}),label:b(`chatSessionTypeLabel`),className:u(WY,JY)})}),(0,H.jsx)(DF,{align:`start`,side:`right`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,H.jsx)(C7,{options:i,selectedSessionType:n,onSelect:e=>{c(e),o(!1)}})})]}):null]})}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{className:`px-4 pb-2`,children:(0,H.jsxs)(`div`,{className:`flex overflow-hidden rounded-lg bg-primary/10 text-primary ring-1 ring-primary/10`,children:[(0,H.jsxs)(L,{variant:`ghost`,className:u(`min-w-0 rounded-none bg-transparent px-3 text-primary shadow-none hover:bg-primary/10 hover:text-primary-700 active:bg-primary/15`,f?`flex-1`:`w-full`),onClick:()=>{o(!1),s(n)},children:[(0,H.jsx)(pi,{className:`mr-1.5 h-4 w-4`}),b(`chatSidebarNewTask`)]}),f?(0,H.jsxs)(wF,{open:a,onOpenChange:o,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(B,{icon:(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(w7,{option:r}),(0,H.jsx)($n,{className:`h-3 w-3 opacity-50`})]}),label:b(`chatSessionTypeLabel`),tooltip:b(`chatSessionTypeLabel`),className:`h-9 w-12 shrink-0 rounded-none border-l border-primary/10 bg-transparent text-primary shadow-none hover:bg-primary/10 hover:text-primary-700 active:bg-primary/15`})}),(0,H.jsx)(DF,{align:`end`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,H.jsx)(C7,{options:i,selectedSessionType:n,onSelect:e=>{c(e),o(!1)}})})]}):null]})}),(0,H.jsx)(`div`,{className:`px-4 pb-2`,children:(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60`}),(0,H.jsx)(vt,{value:t,onChange:e=>l(e.target.value),placeholder:b(`chatSidebarSearchPlaceholder`),className:`h-8 rounded-lg border-0 bg-background/55 pl-8 text-xs shadow-none hover:bg-background/75`})]})})]})}function cie(e){let{query:t,defaultSessionType:n,sessionTypeOptions:r,isCreateMenuOpen:i,onCreateMenuOpenChange:a,onCreateSession:o,onQueryChange:s}=e,c=r.length>1;return(0,H.jsx)(`div`,{className:`px-4 pb-2 pt-1`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,H.jsx)(ui,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground/70`}),(0,H.jsx)(vt,{value:t,onChange:e=>s(e.target.value),placeholder:b(`chatSidebarSearchPlaceholder`),className:`h-9 rounded-full border-0 bg-muted pl-9 pr-3 text-[13px] shadow-none`})]}),c?(0,H.jsxs)(wF,{open:i,onOpenChange:a,children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(B,{icon:(0,H.jsx)(pi,{className:`h-4 w-4`}),label:b(`chatSidebarNewTask`),tooltip:!1,className:`h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`})}),(0,H.jsx)(DF,{align:`end`,className:`w-60 rounded-3xl border border-border bg-popover p-2 text-popover-foreground shadow-[0_24px_70px_-30px_rgba(15,23,42,0.45)]`,children:(0,H.jsx)(C7,{options:r,selectedSessionType:n,title:b(`chatSidebarNewTask`),titleClassName:`pb-1.5 text-[11px] font-medium normal-case tracking-normal`,onSelect:e=>{o(e),a(!1)}})})]}):(0,H.jsx)(B,{icon:(0,H.jsx)(pi,{className:`h-4 w-4`}),label:b(`chatSidebarNewTask`),className:`h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground`,onClick:()=>o(n)})]})})}function lie(){return Ot({queryKey:[`app-meta`],queryFn:pt,staleTime:1/0})}var uie={healthy:`bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]`,attention:`bg-amber-400 shadow-[0_0_0_3px_rgba(251,191,36,0.16)]`,inactive:`bg-muted-foreground/45 shadow-[0_0_0_3px_rgba(156,163,175,0.12)]`};function die(){let e=Re(),t=e.actionLabel===b(`runtimeStatusRestartAction`),n=()=>{e.tone!==`healthy`&&ct.requestRuntimeBootstrapProbeNow()},r=async()=>{if(t)try{let e=await ct.runRuntimeControlAction(`restart-service`);R.success(e.message)}catch(e){let t=e instanceof Error?e.message:b(`runtimeControlActionFailed`);R.error(`${b(`runtimeControlActionFailed`)}: ${t}`)}};return(0,H.jsxs)(wF,{children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,className:`inline-flex items-center justify-center rounded-full p-0.5 transition-transform hover:scale-105`,"aria-label":e.title,title:e.title,"data-testid":`runtime-status-entry`,onClick:n,children:(0,H.jsx)(`span`,{className:u(`h-2.5 w-2.5 rounded-full`,uie[e.tone])})})}),(0,H.jsxs)(DF,{align:`start`,sideOffset:10,className:`w-[290px] space-y-3 rounded-2xl border border-border bg-popover p-4 text-popover-foreground`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.title}),(0,H.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:e.description})]}),e.reasonLines.length>0?(0,H.jsx)(`div`,{className:`space-y-2`,children:e.reasonLines.map(e=>(0,H.jsx)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-xs leading-5 text-amber-900`,children:e},e))}):null,e.actionLabel?(0,H.jsxs)(`div`,{className:`flex items-center justify-between border-t border-border/70 pt-1`,children:[(0,H.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:b(`runtimeStatusActionHint`)}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:e.isBusy,className:`text-sm font-semibold text-primary transition-colors hover:text-primary-hover disabled:text-muted-foreground/45`,children:e.isBusy?b(`runtimeStatusRestartingAction`):e.actionLabel})]}):null]})]})}function T7({className:e,density:t=`sidebar`,suffix:n}){let{data:r}=lie(),{supported:i,busyAction:a,snapshot:o}=ze(),s=r?.name??`NextClaw`,c=r?.productVersion?.trim(),l=c?`v${c}`:null,d=Ce(c),f=n??(0,H.jsx)(die,{}),p=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`,m=t===`chrome`;return(0,H.jsxs)(`div`,{className:u(e??`flex min-w-0 items-center gap-2`,p&&`pl-[58px]`),children:[(0,H.jsx)(`div`,{className:u(`flex shrink-0 items-center justify-center overflow-hidden`,`h-6 w-6 rounded-md`),children:(0,H.jsx)(`img`,{src:`/logo.svg`,alt:s,className:`h-full w-full object-contain`})}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,H.jsx)(`span`,{className:u(`shrink-0 font-semibold text-gray-800`,m?`text-[15px]`:`text-[14px]`),children:s}),l?(0,H.jsx)(fie,{versionLabel:l,density:t,releaseNotesLink:d}):null]}),(0,H.jsx)(pie,{supported:i,busyAction:a,snapshot:o}),f?(0,H.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:f}):null]})]})}function fie({versionLabel:e,density:t,releaseNotesLink:n}){let r=u(`block min-w-0 flex-1 truncate font-medium text-gray-500 outline-none`,`text-[12px]`,n&&`cursor-pointer rounded-sm transition-colors hover:text-gray-700 hover:underline focus-visible:ring-2 focus-visible:ring-gray-300`),i=n?[b(`desktopUpdatesVersionTooltipCurrent`).replace(`{version}`,e),b(`desktopUpdatesVersionTooltipReleaseNotes`).replace(`{version}`,n.versionLabel)].join(`
106
+ `):e;return(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:n?(0,H.jsx)(ge,{href:n.url,external:!0,icon:null,"aria-label":b(`desktopUpdatesVersionReleaseNotesLabel`).replace(`{currentVersion}`,e).replace(`{releaseVersion}`,n.versionLabel),className:u(r,`p-0 text-left`),children:e}):(0,H.jsx)(`span`,{tabIndex:0,"aria-label":e,className:r,children:e})}),(0,H.jsx)(qr,{side:`bottom`,className:`max-w-72 whitespace-pre-line text-xs leading-relaxed`,children:i})]})})}function pie({supported:e,busyAction:t,snapshot:n}){if(!e||!n)return null;let r=iee(n);return n.status===`downloading`?(0,H.jsx)(D7,{snapshot:n,releaseNotesLink:r}):n.status===`blocked`||n.status===`failed`?(0,H.jsx)(D7,{snapshot:n}):n.status===`downloaded`?(0,H.jsx)(E7,{link:r,children:(0,H.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-emerald-50 px-2 text-[11px] font-semibold leading-none text-emerald-700 ring-1 ring-emerald-100 transition-colors hover:bg-emerald-100 disabled:opacity-70`,disabled:t===`applying`,onClick:()=>void Ne.applyDownloadedUpdate(),children:b(t===`applying`?`desktopUpdatesInlineApplying`:`desktopUpdatesInlineReady`)})}):n.status===`update-available`?(0,H.jsx)(E7,{link:r,children:(0,H.jsx)(`button`,{type:`button`,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 transition-colors hover:bg-amber-100 disabled:opacity-70`,disabled:t===`downloading`,onClick:()=>void Ne.downloadUpdate(),children:b(t===`downloading`?`desktopUpdatesInlineDownloading`:`desktopUpdatesInlineDownload`)})}):null}function E7({children:e,link:t}){if(!t)return e;let n=b(`desktopUpdatesUpdateReleaseNotesLabel`).replace(`{version}`,t.versionLabel);return(0,H.jsxs)(`span`,{className:`group/update-release-notes relative inline-flex shrink-0`,children:[e,(0,H.jsx)(`span`,{"data-update-release-notes-hover":`true`,className:`invisible pointer-events-none absolute left-1/2 top-full z-[var(--z-tooltip,10150)] -translate-x-1/2 pt-1 opacity-0 transition-opacity group-hover/update-release-notes:visible group-hover/update-release-notes:pointer-events-auto group-hover/update-release-notes:opacity-100 group-focus-within/update-release-notes:visible group-focus-within/update-release-notes:pointer-events-auto group-focus-within/update-release-notes:opacity-100`,children:(0,H.jsx)(ge,{href:t.url,external:!0,icon:null,"aria-label":n,className:`whitespace-nowrap rounded-md border bg-popover px-3 py-1.5 text-left text-xs font-medium text-popover-foreground shadow-md outline-none transition-colors hover:bg-gray-100 focus-visible:ring-2 focus-visible:ring-gray-300`,children:n})})]})}function D7({snapshot:e,releaseNotesLink:t}){if(e.status===`blocked`||e.status===`failed`)return(0,H.jsx)(mie,{snapshot:e});let n=e.status===`downloading`?gie(e):null;return n?(0,H.jsx)(E7,{link:t??null,children:(0,H.jsx)(`span`,{tabIndex:t?0:void 0,className:`inline-flex h-5 shrink-0 items-center rounded-full bg-amber-50 px-2 text-[11px] font-semibold leading-none text-amber-700 ring-1 ring-amber-100 outline-none transition-colors hover:bg-amber-100 focus-visible:ring-2 focus-visible:ring-amber-300`,children:n})}):null}function mie({snapshot:e}){let t=hie(e),n=e.recoveryCommand?.trim()||null,r=e.diagnosticCommand?.trim()?b(`desktopUpdatesDiagnosticCommand`).replace(`{command}`,e.diagnosticCommand.trim()):null,i=e.errorMessage?.trim()||e.blockReason?.trim()||null,a=[t,e.status===`blocked`&&e.blockReason?b(`desktopUpdatesBlockedRootCause.${e.blockReason}`):null,i,n,r].filter(Boolean).join(`
107
+ `);return(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`span`,{role:`img`,"aria-label":t,tabIndex:0,className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-50 text-[13px] font-bold leading-none text-amber-700 ring-1 ring-amber-100 outline-none focus-visible:ring-2 focus-visible:ring-amber-300`,children:`!`})}),(0,H.jsx)(qr,{side:`bottom`,className:`max-w-80 whitespace-pre-line break-words text-xs leading-relaxed`,children:a})]})})}function hie(e){return e.status===`blocked`?b(`desktopUpdatesStatusBlocked`):b(e.failureStage?`desktopUpdatesFailureStage.${e.failureStage}`:`desktopUpdatesStatusFailed`)}function gie(e){let t=e.progress?.percent;return t==null?b(`desktopUpdatesInlineDownloading`):b(`desktopUpdatesInlineDownloadingPercent`).replace(`{percent}`,String(t))}var _ie={connected:{dotClass:`bg-emerald-500`},disconnected:{dotClass:`h-2.5 w-2.5 rounded-full border border-gray-400 bg-transparent`},connecting:{dotClass:`text-amber-600`}};function vie({status:e,className:t}){let n=_ie[e],r=b(e===`connected`?`connected`:e===`disconnected`?`disconnected`:`connecting`);return(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`span`,{role:`status`,"aria-label":r,className:u(`inline-flex h-5 w-5 items-center justify-center`,t),children:e===`connecting`?(0,H.jsx)(fi,{className:u(`h-3 w-3 animate-spin`,n.dotClass)}):(0,H.jsx)(`span`,{className:u(e===`connected`?`h-2 w-2 rounded-full`:``,n.dotClass)})})}),(0,H.jsx)(qr,{side:`bottom`,className:`text-xs`,children:r})]})})}var yie=[`default-src 'none'`,`base-uri 'none'`,`connect-src 'none'`,`font-src data:`,`form-action 'none'`,`frame-src 'none'`,`img-src data: blob:`,`media-src data: blob:`,`object-src 'none'`,`script-src 'none'`,`style-src 'unsafe-inline'`].join(`; `);function bie(e){let t=new DOMParser().parseFromString(e,`text/html`);t.querySelectorAll(`base, script`).forEach(e=>e.remove()),t.querySelectorAll(`meta[http-equiv]`).forEach(e=>{let t=e.getAttribute(`http-equiv`)?.toLowerCase();(t===`content-security-policy`||t===`refresh`)&&e.remove()}),t.querySelectorAll(`*`).forEach(e=>{e.getAttributeNames().filter(e=>e.toLowerCase().startsWith(`on`)).forEach(t=>e.removeAttribute(t))}),t.querySelectorAll(`a[href]`).forEach(e=>{let t=e.getAttribute(`href`)?.trim()??``;if(t.toLowerCase().startsWith(`javascript:`)){e.removeAttribute(`href`);return}e.setAttribute(`target`,t.startsWith(`#`)?`_self`:`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)});let n=t.createElement(`meta`);n.setAttribute(`http-equiv`,`Content-Security-Policy`),n.setAttribute(`content`,yie),t.head.prepend(n);let r=t.createElement(`style`);return r.dataset.nextclawInboxDefaults=``,r.textContent=[`:root { color-scheme: light dark; }`,`*, *::before, *::after { box-sizing: border-box; }`,`body { margin: 0; padding: 24px; color: CanvasText; background: Canvas; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif; line-height: 1.6; overflow-wrap: anywhere; }`,`img, svg, video { max-width: 100%; height: auto; }`,`pre { max-width: 100%; overflow: auto; }`].join(`
108
+ `),n.after(r),`<!doctype html>${t.documentElement.outerHTML}`}function xie({content:e,fillHeight:t,title:n}){let r=(0,V.useMemo)(()=>bie(e),[e]);return(0,H.jsx)(`iframe`,{className:u(`w-full rounded-xl bg-background`,t?`h-full min-h-0 border-0`:`h-[min(60vh,680px)] min-h-[360px] border border-border/70`),sandbox:`allow-popups allow-popups-to-escape-sandbox`,srcDoc:r,title:n})}function O7({className:e,content:t,contentType:n,fillHeight:r=!1,title:i}){return(0,H.jsx)(`div`,{className:u(`inbox-delivery-content`,e),children:n===`html`?(0,H.jsx)(xie,{content:t,fillHeight:r,title:i}):(0,H.jsx)(Wj,{text:t,role:`assistant`,texts:{copyCodeLabel:b(`chatCodeCopy`),copiedCodeLabel:b(`chatCodeCopied`)}})})}var Sie={readerOpen:!1,activeDeliveryId:null},k7=N(e=>({snapshot:Sie,setSnapshot:t=>e(e=>({snapshot:{...e.snapshot,...t}}))})),A7=[`inbox-deliveries`];function j7(e){return{deliveries:e,total:e.length,unreadCount:e.filter(e=>!e.readAt&&!e.archivedAt).length,unpresentedCount:e.filter(e=>!e.presentedAt&&!e.readAt&&!e.archivedAt).length}}var Cie=class{constructor(e=Tt){this.queryClient=e,this.cleanups=[],this.offerPromise=null,this.started=!1,this.start=()=>{this.started||(this.started=!0,this.cleanups.push(I.eventBus.on(c.inboxDeliveryChanged,this.handleDeliveryChanged)),typeof document<`u`&&(document.addEventListener(`visibilitychange`,this.handleVisibilityChange),this.cleanups.push(()=>document.removeEventListener(`visibilitychange`,this.handleVisibilityChange))),this.offerPendingDelivery())},this.stop=()=>{if(this.started)for(this.started=!1;this.cleanups.length>0;)this.cleanups.pop()?.()},this.closeReader=()=>{k7.getState().setSnapshot({readerOpen:!1})},this.selectInReader=async e=>{let t=await this.updateState(e,`present`);return k7.getState().setSnapshot({activeDeliveryId:t.id,readerOpen:!0}),t},this.markRead=async e=>await this.updateState(e,`read`),this.markUnread=async e=>await this.updateState(e,`mark_unread`),this.archive=async e=>await this.updateState(e,`archive`),this.restore=async e=>await this.updateState(e,`restore`),this.delete=async e=>{let t=await I.inboxDeliveries.delete(e);if(t){this.queryClient.setQueryData(A7,t=>t&&j7(t.deliveries.filter(({id:t})=>t!==e)));let{snapshot:t}=k7.getState();t.activeDeliveryId===e&&k7.getState().setSnapshot({activeDeliveryId:null,readerOpen:!1})}return t},this.prepareChatReference=async e=>{let t=await I.systemObjectReferences.resolve(y(w,e)),n=await this.updateState(e,`read`);return this.closeReader(),{delivery:n,reference:t}},this.updateState=async(e,t)=>{let n=await I.inboxDeliveries.updateState(e,t);return this.replaceCachedDelivery(n),n},this.replaceCachedDelivery=e=>{this.queryClient.setQueryData(A7,t=>t&&j7(t.deliveries.some(({id:t})=>t===e.id)?t.deliveries.map(t=>t.id===e.id?e:t):[e,...t.deliveries]))},this.handleDeliveryChanged=()=>{this.queryClient.invalidateQueries({queryKey:A7}),this.offerPendingDelivery()},this.handleVisibilityChange=()=>{document.visibilityState===`visible`&&this.offerPendingDelivery()},this.offerPendingDelivery=()=>{this.offerPromise||!this.isVisible()||k7.getState().snapshot.readerOpen||(this.offerPromise=this.openOldestPendingDelivery().catch(()=>void 0).finally(()=>{this.offerPromise=null}))},this.openOldestPendingDelivery=async()=>{let e=(await this.queryClient.fetchQuery({queryKey:A7,queryFn:()=>I.inboxDeliveries.list(),staleTime:0})).deliveries.filter(e=>!e.presentedAt&&!e.readAt&&!e.archivedAt),t=e[e.length-1];!t||!this.isVisible()||k7.getState().snapshot.readerOpen||await this.selectInReader(t.id)},this.isVisible=()=>typeof document>`u`||document.visibilityState===`visible`}};function M7(){return Ot({queryKey:A7,queryFn:()=>I.inboxDeliveries.list()})}function N7(){return M7().data?.unreadCount??0}function wie(e,t){return b(`inboxReaderPosition`).replace(`{current}`,String(e)).replace(`{total}`,String(t))}function Tie(){let e=(0,V.useRef)(null),t=ce(),{chatDraftIntentManager:n,inboxManager:r}=F9(),{data:i}=M7(),{activeDeliveryId:a,readerOpen:o}=k7(e=>e.snapshot),[s,c]=(0,V.useState)(null),[l,d]=(0,V.useState)(null),f=(i?.deliveries??[]).filter(e=>!e.readAt&&!e.archivedAt),p=f.findIndex(({id:e})=>e===a),m=p>=0?f[p]:null,h=m?.contentType===`html`,g=async(e,t)=>{c(e),d(null);try{await t()}catch{d(b(`inboxActionError`))}finally{c(null)}},_=e=>{let t=f[e];t&&g(`select`,async()=>{await r.selectInReader(t.id)})},v=()=>{m&&g(`open`,async()=>{await r.markRead(m.id),r.closeReader(),t(`/inbox/${encodeURIComponent(m.id)}`)})},y=()=>{m&&g(`continue`,async()=>{let{reference:e}=await r.prepareChatReference(m.id);n.requestSystemObjectReference(e),t(Q7)})},x=()=>{m&&g(`read`,async()=>{await r.markRead(m.id),r.closeReader()})},S=f.length>1?(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 pr-1`,children:[(0,H.jsx)(`span`,{className:`mr-1 text-[11px] tabular-nums text-muted-foreground`,children:wie(p+1,f.length)}),(0,H.jsx)(B,{icon:(0,H.jsx)(oa,{className:`h-4 w-4`}),label:b(`inboxPrevious`),disabled:p<=0||s===`select`,onClick:()=>_(p-1)}),(0,H.jsx)(B,{icon:(0,H.jsx)(sa,{className:`h-4 w-4`}),label:b(`inboxNext`),disabled:p>=f.length-1||s===`select`,onClick:()=>_(p+1)})]}):null;return(0,H.jsx)(Ir,{open:o&&!!m,onOpenChange:e=>{e||r.closeReader()},children:(0,H.jsx)(zr,{className:`flex h-[min(82vh,760px)] w-[calc(100vw-2rem)] max-w-[820px] flex-col gap-0 overflow-hidden rounded-[24px] border-border/70 bg-background p-0 shadow-[0_20px_55px_-22px_rgba(15,23,42,0.32)] max-sm:h-[100dvh] max-sm:max-h-none max-sm:w-screen max-sm:rounded-none max-sm:border-0`,onOpenAutoFocus:t=>{t.preventDefault(),e.current?.focus()},children:m?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`header`,{className:`shrink-0 border-b border-border/50 px-5 py-3 pr-14 sm:px-6`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-muted/70 text-muted-foreground`,children:(0,H.jsx)(Xa,{className:`h-3.5 w-3.5`})}),(0,H.jsx)(Br,{ref:e,tabIndex:-1,title:m.title,className:`min-w-0 truncate text-sm font-medium text-foreground outline-none`,children:m.title}),(0,H.jsx)(`span`,{className:`hidden shrink-0 text-muted-foreground sm:inline`,"aria-hidden":`true`,children:`·`}),(0,H.jsx)(`time`,{className:`hidden shrink-0 text-[11px] tabular-nums text-muted-foreground sm:block`,dateTime:m.createdAt,children:j(m.createdAt)})]}),S]}),(0,H.jsx)(Nr,{className:`sr-only`,children:m.summary??b(`inboxNoSummary`)})]}),(0,H.jsx)(`div`,{className:u(`min-h-0 flex-1`,h?`p-3 sm:p-4`:`custom-scrollbar overflow-y-auto px-6 py-5 sm:px-8 sm:py-6`),children:(0,H.jsx)(O7,{className:h?`h-full`:void 0,content:m.content,contentType:m.contentType,fillHeight:h,title:m.title})}),(0,H.jsxs)(`footer`,{className:`shrink-0 border-t border-border/50 bg-background px-5 py-3 sm:px-6`,children:[l?(0,H.jsx)(`p`,{role:`alert`,className:`mb-3 text-sm text-destructive`,children:l}):null,(0,H.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col-reverse gap-1 sm:flex-row sm:flex-wrap`,children:[(0,H.jsx)(L,{size:`sm`,variant:`ghost`,onClick:r.closeReader,children:b(`inboxReadLater`)}),(0,H.jsx)(L,{size:`sm`,variant:`outline`,disabled:s!==null,onClick:x,children:b(`inboxMarkRead`)}),(0,H.jsx)(L,{size:`sm`,variant:`ghost`,disabled:s!==null,onClick:v,children:b(`inboxOpenInbox`)})]}),(0,H.jsx)(L,{size:`sm`,disabled:s!==null,onClick:y,children:b(`inboxContinueChat`)})]})]})]}):null})})}function Eie(){let{inboxManager:e}=F9();return(0,V.useEffect)(()=>(e.start(),()=>e.stop()),[e]),(0,H.jsx)(Tie,{})}function Die(e,t){return t||(e.some(e=>!e.readAt&&!e.archivedAt)?`unread`:`all`)}function P7(e,t){return t===`unread`?e.filter(e=>!e.readAt&&!e.archivedAt):t===`archived`?e.filter(e=>!!e.archivedAt):e.filter(e=>!e.archivedAt)}function F7({selection:e=!1}){return(0,H.jsxs)(`div`,{className:`flex h-full min-h-56 flex-col items-center justify-center px-8 text-center`,children:[(0,H.jsx)(`span`,{className:`mb-4 flex h-12 w-12 items-center justify-center rounded-2xl bg-muted text-muted-foreground`,children:(0,H.jsx)(Xa,{className:`h-5 w-5`})}),(0,H.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:b(e?`inboxSelectTitle`:`inboxEmptyTitle`)}),(0,H.jsx)(`p`,{className:`mt-2 max-w-sm text-sm leading-6 text-muted-foreground`,children:b(e?`inboxSelectDescription`:`inboxEmptyDescription`)})]})}function Oie({activeDeliveryId:e,deliveries:t,filter:n,onFilterChange:r}){let i=[{id:`unread`,label:b(`inboxUnread`),count:P7(t,`unread`).length},{id:`all`,label:b(`inboxAll`),count:P7(t,`all`).length},{id:`archived`,label:b(`inboxArchived`),count:P7(t,`archived`).length}],a=P7(t,n);return(0,H.jsxs)(`aside`,{className:`flex min-h-0 flex-col border-border/60 bg-muted/20 md:border-r`,children:[(0,H.jsx)(`div`,{className:`flex shrink-0 gap-1 border-b border-border/50 px-3 py-2`,children:i.map(e=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(e.id),className:u(`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,n===e.id?`bg-[var(--interaction-selection)] text-foreground`:`text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-foreground`),children:[e.label,(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`text-[10px] font-normal tabular-nums opacity-60`,children:e.count})]},e.id))}),(0,H.jsx)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto p-2`,children:a.length>0?(0,H.jsx)(`ul`,{className:`space-y-0.5`,children:a.map(t=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(ue,{to:`/inbox/${encodeURIComponent(t.id)}`,className:u(`block rounded-lg px-2.5 py-2 text-[13px] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e===t.id?`bg-[var(--interaction-selection)] text-foreground`:`text-foreground/80 hover:bg-[var(--interaction-hover)] hover:text-foreground`),children:[(0,H.jsx)(`h2`,{className:u(`truncate font-medium leading-5`,!t.readAt&&`font-semibold text-foreground`),children:t.title}),(0,H.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[11px] leading-4 text-muted-foreground/65`,children:[(0,H.jsx)(`p`,{className:`min-w-0 flex-1 truncate`,children:t.summary??b(`inboxNoSummary`)}),t.readAt?(0,H.jsx)(`time`,{className:`shrink-0 tabular-nums`,dateTime:t.createdAt,children:k(t.createdAt)}):(0,H.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-primary`,"aria-label":b(`inboxUnread`)})]})]})},t.id))}):(0,H.jsx)(F7,{})})]})}function kie({delivery:e,error:t,isMobile:n,pending:r,onArchiveToggle:i,onBack:a,onContinue:o,onDelete:s,onReadToggle:c}){if(!e)return(0,H.jsx)(`main`,{className:`flex min-h-0 flex-col`,children:(0,H.jsx)(F7,{selection:!0})});let l=e.contentType===`html`;return(0,H.jsxs)(`main`,{className:`flex min-h-0 flex-col`,children:[(0,H.jsxs)(`div`,{className:`shrink-0 border-b border-border/50 px-5 py-3 sm:px-6`,children:[n?(0,H.jsxs)(`button`,{type:`button`,onClick:a,className:`mb-3 inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,H.jsx)(li,{className:`h-4 w-4`}),b(`inboxTitle`)]}):null,(0,H.jsxs)(`div`,{className:`flex min-h-7 min-w-0 items-center gap-2`,children:[(0,H.jsx)(`h2`,{title:e.title,className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.title}),(0,H.jsx)(`span`,{className:`hidden shrink-0 text-muted-foreground sm:inline`,"aria-hidden":`true`,children:`·`}),(0,H.jsx)(`time`,{className:`hidden shrink-0 text-[11px] tabular-nums text-muted-foreground sm:block`,dateTime:e.createdAt,children:j(e.createdAt)})]})]}),(0,H.jsx)(`div`,{className:u(`min-h-0 flex-1`,l?`p-3 sm:p-4`:`custom-scrollbar overflow-y-auto px-5 py-5 sm:px-6 sm:py-6`),children:(0,H.jsx)(`div`,{className:u(`mx-auto max-w-5xl`,l&&`h-full`),children:(0,H.jsx)(O7,{className:l?`h-full`:void 0,content:e.content,contentType:e.contentType,fillHeight:l,title:e.title})})}),(0,H.jsxs)(`div`,{className:`shrink-0 border-t border-border/50 px-5 py-3 sm:px-6`,children:[t?(0,H.jsx)(`p`,{role:`alert`,className:`mb-2 text-sm text-destructive`,children:t}):null,(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,H.jsx)(L,{size:`sm`,variant:`outline`,disabled:r,onClick:c,children:e.readAt?b(`inboxMarkUnread`):b(`inboxMarkRead`)}),(0,H.jsxs)(L,{size:`sm`,variant:`ghost`,disabled:r,onClick:i,children:[e.archivedAt?(0,H.jsx)(Co,{className:`mr-2 h-4 w-4`}):(0,H.jsx)(Wi,{className:`mr-2 h-4 w-4`}),e.archivedAt?b(`inboxRestore`):b(`inboxArchive`)]}),(0,H.jsxs)(L,{size:`sm`,variant:`ghost`,disabled:r,onClick:s,children:[(0,H.jsx)(Vo,{className:`mr-2 h-4 w-4`}),b(`inboxDelete`)]})]}),(0,H.jsxs)(L,{size:`sm`,disabled:r,onClick:o,children:[(0,H.jsx)(eo,{className:`mr-2 h-4 w-4`}),b(`inboxContinueChat`)]})]})]})]})}function Aie(){let e=ce(),{deliveryId:t}=le(),{isMobile:n}=c8(),{chatDraftIntentManager:r,inboxManager:i}=F9(),a=M7(),{confirm:o,ConfirmDialog:s}=On(),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null),[f,p]=(0,V.useState)(null),m=(0,V.useMemo)(()=>a.data?.deliveries??[],[a.data?.deliveries]),h=(0,V.useMemo)(()=>t?m.find(({id:e})=>e===t)??null:null,[m,t]),g=Die(m,c);(0,V.useEffect)(()=>{h&&!h.readAt&&i.markRead(h.id).catch(()=>p(b(`inboxActionError`)))},[h,i]);let _=async(e,t)=>{d(e),p(null);try{await t()}catch{p(b(`inboxActionError`))}finally{d(null)}},v=()=>{h&&_(`continue`,async()=>{let{reference:t}=await i.prepareChatReference(h.id);r.requestSystemObjectReference(t),e(Q7)})},y=async()=>{!h||!await o({title:b(`inboxDeleteTitle`),description:b(`inboxDeleteDescription`),confirmLabel:b(`inboxDeleteConfirm`),variant:`destructive`})||_(`delete`,async()=>{await i.delete(h.id),e(`/inbox`,{replace:!0})})},x=()=>{h&&_(`read`,async()=>{if(h.readAt){await i.markUnread(h.id),e(`/inbox`,{replace:!0});return}await i.markRead(h.id)})},S=()=>{h&&_(`archive`,async()=>{if(h.archivedAt){await i.restore(h.id);return}await i.archive(h.id),e(`/inbox`,{replace:!0})})},C=!n||!h,w=!n||!!h;return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-6`,children:[(0,H.jsx)(ft,{headingLevel:1,title:b(`inboxTitle`),className:`px-4 sm:px-0`}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden border-y border-border/60 bg-background sm:rounded-2xl sm:border`,children:a.isError?(0,H.jsx)(`div`,{role:`alert`,className:`p-6 text-sm text-destructive`,children:b(`inboxLoadError`)}):(0,H.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-1 md:grid-cols-[300px_minmax(0,1fr)]`,children:[C?(0,H.jsx)(Oie,{activeDeliveryId:h?.id??null,deliveries:m,filter:g,onFilterChange:l}):null,w?(0,H.jsx)(kie,{delivery:h,error:f,isMobile:n,pending:u!==null,onArchiveToggle:S,onBack:()=>e(`/inbox`),onContinue:v,onDelete:()=>void y(),onReadToggle:x}):null]})}),(0,H.jsx)(s,{})]})}function jie(e,t){return t.some(t=>t.value===e)?e:t[0]?.value??e}function Mie(e){let{groups:t,defaultSessionType:n,sessionTypeOptions:r,renderSessionItem:i}=e,a=tI(),o=oL(e=>e.snapshot.collapsedProjectRoots),[s,c]=(0,V.useState)(null),l=(0,V.useMemo)(()=>jie(n,r),[n,r]),u=r.length>1;return(0,H.jsx)(`div`,{className:`space-y-0.5`,children:t.map(e=>{let t=`${b(`chatSidebarNewTask`)} · ${e.projectName}`,n=o.includes(e.projectRoot),d=b(e.isPinned?`chatSidebarUnpinProject`:`chatSidebarPinProject`);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`group/project relative h-8 rounded-lg px-2 text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,H.jsxs)(`button`,{type:`button`,"aria-expanded":!n,"aria-label":b(n?`chatSidebarExpandProject`:`chatSidebarCollapseProject`),className:`flex h-full w-full min-w-0 items-center gap-1.5 pr-14 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,onClick:()=>a.chatSessionListManager.toggleProjectCollapsed(e.projectRoot),children:[(0,H.jsx)(Ga,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`truncate text-[11px] font-medium uppercase tracking-wider`,title:e.projectRoot,children:e.projectName}),n?(0,H.jsx)(sa,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):(0,H.jsx)($n,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/70`,children:e.items.length})]}),(0,H.jsxs)(`div`,{className:`pointer-events-none absolute right-2 top-1/2 flex -translate-y-1/2 items-center opacity-0 transition-opacity group-hover/project:pointer-events-auto group-hover/project:opacity-100 focus-within:pointer-events-auto focus-within:opacity-100`,children:[u?(0,H.jsxs)(wF,{open:s===e.projectRoot,onOpenChange:t=>{c(t?e.projectRoot:null)},children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(B,{icon:(0,H.jsx)(pi,{className:`h-3.5 w-3.5`}),label:t})}),(0,H.jsx)(DF,{align:`end`,className:`w-56 rounded-2xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_24px_60px_-28px_rgba(15,23,42,0.38)]`,children:(0,H.jsx)(C7,{options:r,selectedSessionType:l,onSelect:t=>{a.chatSessionListManager.createSession({projectRoot:e.projectRoot,sessionType:t}),c(null)}})})]}):(0,H.jsx)(B,{icon:(0,H.jsx)(pi,{className:`h-3.5 w-3.5`}),label:t,onClick:()=>a.chatSessionListManager.createSession({projectRoot:e.projectRoot,sessionType:l})}),(0,H.jsx)(B,{icon:(0,H.jsx)(Xr,{className:e.isPinned?`h-3.5 w-3.5 fill-current text-foreground`:`h-3.5 w-3.5`}),label:d,tooltipSide:`right`,onClick:()=>a.chatSessionListManager.toggleProjectPinned(e.projectRoot)})]})]}),n?null:(0,H.jsx)(`div`,{className:`mt-0.5 space-y-0.5 pl-2`,children:e.items.map(i)})]},e.projectRoot)})})}function I7({label:e}){return(0,H.jsxs)(`div`,{className:`p-4 text-center`,children:[(0,H.jsx)(no,{className:`mx-auto mb-2 h-6 w-6 text-muted-foreground/45`}),(0,H.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e})]})}function Nie({defaultSessionType:e,groups:t,isLoading:n,isProjectFirstView:r,projectGroups:i,renderSessionItem:a,sessionTypeOptions:o}){return n?(0,H.jsx)(`div`,{className:`p-3 text-xs text-muted-foreground`,children:b(`sessionsLoading`)}):r?i.length===0?(0,H.jsx)(I7,{label:b(`chatSidebarProjectViewEmpty`)}):(0,H.jsx)(Mie,{groups:i,defaultSessionType:e,sessionTypeOptions:o,renderSessionItem:a}):t.length===0?(0,H.jsx)(I7,{label:b(`sessionsEmpty`)}):(0,H.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`px-2 pb-1 pt-0.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/65`,children:e.label}),(0,H.jsx)(`div`,{className:`space-y-0.5`,children:e.items.map(a)})]},e.label))})}function Pie({isOpen:e,onOpenChange:t,currentTheme:n,currentThemeLabel:r,themeOptions:i,onSelectTheme:a,currentLanguage:o,currentLanguageLabel:s,languageOptions:c,onSelectLanguage:l,onOpenDocs:d,onOpenApps:f,collapsed:p=!1}){return(0,H.jsxs)(wF,{open:e,onOpenChange:t,children:[p?(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":b(`settingsMenu`),className:u(`flex items-center justify-center`,WY,JY),children:(0,H.jsx)(Do,{className:u(GY,`shrink-0 text-muted-foreground`)})})})}),(0,H.jsx)(qr,{side:`right`,className:`text-xs`,children:b(`settingsMenu`)})]})}):(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsxs)(`button`,{type:`button`,"aria-label":b(`settingsMenu`),className:`flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] font-medium text-muted-foreground transition-colors duration-base hover:bg-background/70 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,H.jsx)(Do,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,H.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:b(`settings`)})]})}),(0,H.jsxs)(DF,{side:p?`right`:`top`,align:p?`end`:`start`,className:`w-64 p-2`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(pe,{to:`/settings`,onClick:()=>t(!1),className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,H.jsx)(Do,{className:`h-4 w-4 text-muted-foreground/70`}),(0,H.jsx)(`span`,{className:`flex-1 text-left`,children:b(`settings`)})]}),[{key:`docs`,icon:di,label:b(`docBrowserHelp`),action:d},{key:`apps`,icon:Kr,label:b(`appsTitle`),action:f}].map(({key:e,icon:n,label:r,action:i})=>(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{i(),t(!1)},className:`flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] font-medium text-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,H.jsx)(n,{className:`h-4 w-4 text-muted-foreground/70`}),(0,H.jsx)(`span`,{className:`flex-1 text-left`,children:r})]},e))]}),(0,H.jsx)(`div`,{className:`my-2 h-px bg-border`}),(0,H.jsx)(L7,{icon:lo,label:b(`theme`),options:i,value:n,valueLabel:r,onSelect:a,onCloseMenu:()=>t(!1)}),(0,H.jsx)(L7,{icon:mee,label:b(`language`),options:c,value:o,valueLabel:s,onSelect:l,onCloseMenu:()=>t(!1)})]})]})}function L7({icon:e,label:t,options:n,value:r,valueLabel:i,onSelect:a,onCloseMenu:o}){return(0,H.jsxs)(xr,{value:r,onOpenChange:e=>{e||o()},onValueChange:e=>a(e),children:[(0,H.jsxs)(pr,{"aria-label":t,className:`h-auto w-full rounded-lg border-0 bg-transparent px-3 py-2 text-[13px] font-medium text-foreground shadow-none hover:bg-gray-200/60 hover:text-gray-900 focus:ring-0`,indicator:(0,H.jsx)(sa,{className:`h-4 w-4 text-muted-foreground/70`}),children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,H.jsx)(e,{className:`h-4 w-4 shrink-0 text-muted-foreground/70`}),(0,H.jsx)(`span`,{className:`text-left`,children:t})]}),(0,H.jsx)(`span`,{className:`ml-auto max-w-[96px] truncate text-[13px] text-muted-foreground`,children:i})]}),(0,H.jsx)(gr,{side:`right`,align:`center`,sideOffset:6,className:`z-[var(--z-tooltip)] min-w-[7rem] rounded-lg`,viewportClassName:`h-auto min-w-[7rem] w-auto`,children:n.map(e=>(0,H.jsx)(yr,{value:e.value,className:`text-[13px]`,children:e.label},e.value))})]})}var R7=N(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null})),Fie=new class{constructor(){this.start=async()=>{let e=this.getDesktopApi();if(!e){this.markUnsupported();return}R7.setState({supported:!0,initialized:!1,busyAction:`loading`});try{let t=await e.getPresenceState();R7.setState({supported:!0,initialized:!0,busyAction:null,snapshot:t})}catch(e){R7.setState({supported:!0,initialized:!0,busyAction:null}),R.error(`${b(`runtimePresenceLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.markUnsupported=()=>{R7.setState({supported:!1,initialized:!0,busyAction:null,snapshot:null})},this.updatePreferences=async e=>{let t=this.getDesktopApi();if(!t)throw Error(b(`runtimePresenceLaunchAtLoginUnavailable`));R7.setState({busyAction:`saving-preferences`});try{let n=await t.updatePresencePreferences(e);return R7.setState({supported:!0,initialized:!0,snapshot:n}),R.success(b(`runtimePresenceSaved`)),n}catch(e){throw R.error(`${b(`runtimePresenceSaveFailed`)}: ${this.getErrorMessage(e)}`),e}finally{R7.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:b(`error`)}},z7=N(()=>({supported:!1,initialized:!1,busyAction:null,snapshot:null}));new class{constructor(){this.unsubscribe=null,this.subscriptionCount=0,this.start=async()=>{this.subscriptionCount+=1;let e=this.getDesktopApi();if(!e){z7.setState({supported:!1,initialized:!0,snapshot:null});return}this.unsubscribe||=e.onUpdateStateChanged(e=>{z7.setState({supported:!0,initialized:!0,snapshot:e})}),z7.setState({supported:!0,initialized:!1});try{let t=await e.getUpdateState();z7.setState({supported:!0,initialized:!0,snapshot:t})}catch(e){z7.setState({supported:!0,initialized:!0}),R.error(`${b(`desktopUpdatesLoadFailed`)}: ${this.getErrorMessage(e)}`)}},this.stop=()=>{this.subscriptionCount=Math.max(0,this.subscriptionCount-1),!(this.subscriptionCount>0)&&(this.unsubscribe?.(),this.unsubscribe=null)},this.checkForUpdates=async()=>{let e;try{e=await this.runSnapshotCommand(`checking`,b(`desktopUpdatesCheckFailed`),async e=>await e.checkForUpdates())}catch{return}if(e.status===`up-to-date`){R.success(b(`desktopUpdatesAlreadyLatest`));return}if(e.status===`update-available`){R.success(b(`desktopUpdatesAvailable`).replace(`{version}`,e.availableVersion??b(`desktopUpdatesUnknownVersion`)));return}if(e.status===`downloaded`){R.success(b(`desktopUpdatesReadyToApply`));return}e.status===`failed`&&e.errorMessage&&R.error(e.errorMessage)},this.downloadUpdate=async()=>{let e;try{e=await this.runSnapshotCommand(`downloading`,b(`desktopUpdatesDownloadFailed`),async e=>await e.downloadUpdate())}catch{return}e.status===`downloaded`&&R.success(b(`desktopUpdatesReadyToApply`))},this.applyDownloadedUpdate=async()=>{try{await this.runSnapshotCommand(`applying`,b(`desktopUpdatesApplyFailed`),async e=>await e.applyDownloadedUpdate())}catch{return}},this.updateChannel=async e=>{if(z7.getState().snapshot?.channel===e)return;let t;try{t=await this.runSnapshotCommand(`switching-channel`,b(`desktopUpdatesChannelChangeFailed`),async t=>await t.updateChannel(e))}catch{return}if(t.status===`update-available`&&t.availableVersion){R.success(b(`desktopUpdatesChannelChangedWithUpdate`).replace(`{channel}`,this.getChannelLabel(e)).replace(`{version}`,t.availableVersion));return}R.success(b(`desktopUpdatesChannelChanged`).replace(`{channel}`,this.getChannelLabel(e)))},this.runSnapshotCommand=async(e,t,n)=>{let r=this.getDesktopApi();if(!r)throw Error(b(`desktopUpdatesDesktopOnlyDescription`));z7.setState({busyAction:e});try{let e=await n(r);return z7.setState({snapshot:e}),e}catch(e){throw R.error(`${t}: ${this.getErrorMessage(e)}`),e}finally{z7.setState({busyAction:null})}},this.getDesktopApi=()=>typeof window>`u`?null:window.nextclawDesktop??null,this.getErrorMessage=e=>e instanceof Error?e.message:b(`error`),this.getChannelLabel=e=>b(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}};function B7(e,t){let n=e.toLowerCase(),r=t.toLowerCase();return n===r||n.startsWith(`${r}/`)}function V7(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/inbox`||t.startsWith(`/inbox/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)||t===`/agents`||t.startsWith(`/agents/`)||t.startsWith(`/apps/panel/`)}function H7(e){let t=e.toLowerCase();return t.startsWith(`/chat/`)&&t!==`/chat`}function Iie(e){return[{target:`/chat`,label:e(`chat`),icon:eo},{target:`/inbox`,label:e(`inboxTitle`),icon:Xa},{target:`/skills`,label:e(`marketplaceFilterSkills`),icon:$i},{target:`/agents`,label:e(`agentsPageTitle`),icon:Zi},{target:`/settings`,label:e(`settings`),icon:Do}]}function U7(e){return[{target:`/model`,label:e(`model`),icon:Ca},{target:`/providers`,label:e(`providers`),icon:Or},{target:`/channels`,label:e(`channels`),icon:ro},{target:`/extensions`,label:e(`extensions`),icon:xo},{target:`/appearance`,label:e(`appearance`),icon:lo},{target:`/security`,label:e(`security`),icon:Ao},{target:`/privacy`,label:e(`privacy`),icon:Hi},{target:`/search`,label:e(`searchChannels`),icon:ui},{target:`/updates`,label:e(`updates`),icon:wa},{target:`/remote`,label:e(`remote`),icon:Oee},{target:`/runtime`,label:e(`runtime`),icon:Ca},{target:`/secrets`,label:e(`secrets`),icon:Za},{target:`/marketplace/mcp`,label:e(`marketplaceFilterMcp`),icon:Ko}]}function Lie(e){let t=U7(e);return[{label:e(`settingsGroupBasic`),items:t.slice(0,3)},{label:e(`settingsGroupAdvanced`),items:t.slice(3)}]}function Rie(e){let t=e.toLowerCase();return t===`/settings`?!0:U7(e=>e).some(e=>B7(t,e.target))}function zie(e,t){let n=e.toLowerCase(),r=U7(t);if(H7(n))return{title:t(`chat`),backTarget:`/chat`,backLabel:t(`chat`)};if(n===`/chat`)return{title:t(`chat`),backTarget:null,backLabel:null};if(n===`/inbox`||n.startsWith(`/inbox/`))return{title:t(`inboxTitle`),backTarget:n===`/inbox`?null:`/inbox`,backLabel:t(`inboxTitle`)};if(n===`/skills`||n.startsWith(`/skills/`))return{title:t(`marketplaceFilterSkills`),backTarget:null,backLabel:null};if(n===`/agents`||n.startsWith(`/agents/`))return{title:t(`agentsPageTitle`),backTarget:null,backLabel:null};if(n.startsWith(`/apps/panel/`))return{title:t(`panelAppsTitle`),backTarget:`/chat`,backLabel:t(`chat`)};if(n===`/settings`)return{title:t(`settings`),backTarget:null,backLabel:null};for(let e of r)if(B7(n,e.target))return{title:e.label,backTarget:`/settings`,backLabel:t(`settings`)};return{title:t(`settings`),backTarget:null,backLabel:null}}function W7({isCollapsed:e,onToggle:t}){let n=b(e?`sidebarExpand`:`sidebarCollapse`);return(0,H.jsx)(B,{icon:(0,H.jsx)(e?po:uo,{className:GY}),label:n,className:u(JY,e&&`h-9 w-9 rounded-xl`),onClick:t})}function Bie({isCollapsed:e,onToggle:t}){return(0,H.jsx)(`div`,{className:u(`shrink-0`,e?`px-0 py-1.5`:`px-2 py-2`),children:(0,H.jsxs)(`div`,{className:u(`flex items-center py-1`,e?u(`flex-col px-0`,qY):`gap-2 px-1`),"data-testid":`settings-sidebar-header`,children:[e?(0,H.jsx)(W7,{isCollapsed:e,onToggle:t}):null,(0,H.jsxs)(pe,{to:`/chat`,"aria-label":b(`backToMain`),className:u(`group inline-flex min-w-0 items-center rounded-lg text-[12px] font-medium text-muted-foreground transition-colors hover:bg-gray-200/60 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?u(WY,JY,`justify-center p-0`):`gap-1.5 px-1 py-1`),children:[(0,H.jsx)(li,{className:u(e?GY:`h-3.5 w-3.5`,`shrink-0 text-muted-foreground/75 group-hover:text-gray-700`)}),(0,H.jsx)(`span`,{className:e?`sr-only`:`truncate`,children:b(`backToMain`)})]}),e?null:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-border`,"aria-hidden":`true`}),(0,H.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-foreground`,children:b(`settings`)}),(0,H.jsx)(`div`,{className:`ml-auto`,children:(0,H.jsx)(W7,{isCollapsed:e,onToggle:t})})]})]})})}function Vie({isCollapsed:e,sections:t}){return(0,H.jsx)(`nav`,{className:u(`custom-scrollbar min-h-0 flex-1 overflow-y-auto`,e?`pr-0`:`pr-1`,FF),children:e?(0,H.jsx)(rX,{isCollapsed:e,items:t.flatMap(e=>e.items),density:`compact`,className:u(KY,`pb-3`)}):(0,H.jsx)(`div`,{className:`space-y-3 pb-3`,children:t.map(t=>(0,H.jsxs)(`section`,{"aria-label":t.label,className:`space-y-1`,children:[(0,H.jsx)(`h2`,{className:`px-3 text-[11px] font-semibold text-muted-foreground/70`,children:t.label}),(0,H.jsx)(rX,{isCollapsed:e,items:t.items,density:`compact`})]},t.label))})})}function Hie(){let e=F9(),t=Oi(),n=Xo(),r=Os(e=>e.isSidebarCollapsed),i=ks.toggleSidebarCollapsed,a=n.data?.account.email?.trim(),o=!!n.data?.account.loggedIn,s=Lie(b),c=r?KY:QY(`compact`);return(0,H.jsxs)(`aside`,{className:u(`shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary pb-6 transition-[width] duration-200 ease-out`,r?u(HY,UY):`w-[240px] px-4`),"data-sidebar-collapsed":r?`true`:`false`,children:[(0,H.jsx)(Bie,{isCollapsed:r,onToggle:i}),(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsx)(Vie,{isCollapsed:r,sections:s}),(0,H.jsxs)(`div`,{className:u(`shrink-0 bg-secondary`,r?`mt-2 flex flex-col items-center pt-2`:`mt-2 pt-3`,c),children:[(0,H.jsx)(iX,{onClick:()=>t.open(void 0,{kind:`docs`,title:b(`docBrowserHelp`)}),icon:di,label:b(`docBrowserHelp`),density:`compact`,collapsed:r}),(0,H.jsx)(iX,{onClick:()=>e.accountManager.openAccountPanel(),icon:Za,label:b(`remoteAccountEntryManage`),density:`compact`,trailing:o?a||b(`remoteAccountEntryConnected`):b(`remoteAccountEntryDisconnected`),trailingClassName:`max-w-[92px] truncate text-right`,testId:`settings-sidebar-account-entry`,trailingTestId:`settings-sidebar-account-status`,collapsed:r})]})]})]})}var G7=[{action:`minimize`,label:`Minimize`,icon:io},{action:`close`,label:`Close`,icon:hi,variant:`danger`}];function Uie({sidebarCollapsed:e=!1}){let t=Gie()?{action:`toggle-maximize`,label:`Restore`,icon:xa}:{action:`toggle-maximize`,label:`Maximize`,icon:Io};return(0,H.jsxs)(`header`,{className:`desktop-window-drag relative flex h-[var(--desktop-titlebar-height)] shrink-0 bg-secondary after:absolute after:bottom-0 after:left-[var(--desktop-sidebar-width)] after:right-0 after:border-b after:border-border/80`,"data-testid":`desktop-window-chrome`,children:[(0,H.jsx)(`div`,{className:`desktop-window-no-drag absolute left-0 right-0 top-0 h-1`,"data-testid":`desktop-window-chrome-resize-strip`}),(0,H.jsx)(`div`,{className:u(`desktop-window-drag relative z-10 flex h-full w-[var(--desktop-sidebar-width)] shrink-0 items-center bg-secondary text-secondary-foreground`,e?`justify-center px-0`:`pl-4 pr-3`),"data-testid":`desktop-window-chrome-sidebar`,children:e?(0,H.jsx)(`img`,{src:`/logo.svg`,alt:`NextClaw`,className:`h-6 w-6 shrink-0 object-contain`}):(0,H.jsx)(T7,{className:`flex min-w-0 shrink-0 items-center gap-2.5`,density:`chrome`})}),(0,H.jsx)(`div`,{className:`desktop-window-no-drag absolute right-0 top-0 z-20 flex h-full w-[var(--desktop-caption-safe-right)] items-start justify-end`,"data-testid":`desktop-window-controls`,children:[G7[0],t,G7[1]].map(e=>(0,H.jsx)(Wie,{control:e},e.action))})]})}function Wie({control:e}){let t=e.icon;return(0,H.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,className:e.variant===`danger`?`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-red-500 hover:text-white`:`desktop-window-no-drag flex h-10 w-[46px] items-center justify-center text-gray-700 transition-colors hover:bg-black/10`,onClick:()=>{window.nextclawDesktop?.controlWindow?.(e.action)},children:(0,H.jsx)(t,{className:`h-3.5 w-3.5`})})}function Gie(){let[e,t]=(0,V.useState)(!1);return(0,V.useEffect)(()=>{let e=!0,n=window.nextclawDesktop;n?.getWindowState?.().then(n=>{e&&t(n.isMaximized)});let r=n?.onWindowStateChanged?.(e=>{t(e.isMaximized)});return()=>{e=!1,r?.()}},[]),e}function K7(){return typeof window>`u`?null:Kie()??window.nextclawDesktop?.platform??null}function q7(){return K7()===`win32`}function Kie(){return null}function J7(){let{pathname:e}=_e(),t=Oi(),n=N7();return(0,H.jsx)(`nav`,{"data-testid":`mobile-bottom-nav`,"aria-label":b(`settings`),className:`shrink-0 border-t border-gray-200/80 bg-white/95 backdrop-blur-sm`,style:{paddingBottom:`calc(env(safe-area-inset-bottom, 0px) + 0.25rem)`},children:(0,H.jsxs)(`ul`,{className:`grid grid-cols-6 gap-1 px-2 pt-1`,children:[Iie(b).map(t=>{let r=t.target===`/settings`?Rie(e):B7(e,t.target);return(0,H.jsx)(`li`,{children:(0,H.jsxs)(ue,{to:t.target,"aria-current":r?`page`:void 0,"data-testid":r?`mobile-nav-active-indicator`:void 0,className:u(`group flex min-h-[2.875rem] flex-col items-center justify-center gap-0.5 rounded-xl px-2 py-1 text-[10px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,r?`bg-gray-100 text-gray-900`:`text-gray-500 hover:bg-gray-50 hover:text-gray-800`),children:[(0,H.jsxs)(`span`,{className:`relative`,children:[(0,H.jsx)(t.icon,{className:u(`h-3.5 w-3.5`,r?`text-gray-900`:`text-gray-400`)}),t.target===`/inbox`&&n>0?(0,H.jsx)(`span`,{className:`absolute -right-1 -top-1 h-1.5 w-1.5 rounded-full bg-primary ring-1 ring-white`}):null]}),(0,H.jsx)(`span`,{className:`max-w-full truncate`,children:t.label})]})},t.target)}),(0,H.jsx)(`li`,{children:(0,H.jsxs)(`button`,{type:`button`,onClick:()=>S1(t),className:`group flex min-h-[2.875rem] w-full flex-col items-center justify-center gap-0.5 rounded-xl px-2 py-1 text-[10px] font-medium text-gray-500 transition-colors hover:bg-gray-50 hover:text-gray-800 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:[(0,H.jsx)(Kr,{className:`h-3.5 w-3.5 text-gray-400`}),(0,H.jsx)(`span`,{className:`max-w-full truncate`,children:b(`appsTitle`)})]})})]})})}function qie({leadingInset:e}){let t=ce(),{pathname:n}=_e(),r=zie(n,b);return(0,H.jsx)(`header`,{"data-testid":`mobile-topbar`,className:`shrink-0 border-b border-gray-200/80 bg-white/95 backdrop-blur-sm`,style:{paddingTop:`calc(env(safe-area-inset-top, 0px) + 0.25rem)`},children:(0,H.jsxs)(`div`,{className:`flex min-h-[2.75rem] items-center gap-2 py-1.5 pl-3 pr-3`,style:{paddingLeft:e?`calc(${e} + 0.75rem)`:void 0},children:[r.backTarget?(0,H.jsx)(`button`,{type:`button`,onClick:()=>t(r.backTarget),className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-gray-200 text-gray-600 transition-colors hover:bg-gray-50 hover:text-gray-900`,"aria-label":r.backLabel??b(`backToMain`),children:(0,H.jsx)(li,{className:`h-4 w-4`})}):null,(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,H.jsx)(`h1`,{className:`truncate text-center text-[15px] font-semibold text-gray-900`,children:r.title})}),r.backTarget?(0,H.jsx)(`div`,{className:`h-8 w-8 shrink-0`,"aria-hidden":`true`}):null]})})}var Jie=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{DocBrowser:e}=await import(`./doc-browser-Dto54tCf.js`);return{DocBrowser:e}},__vite__mapDeps([25,26,4,27,28,29,30,31,32,33,1,34,35,36,37,38,39]))).DocBrowser}));function Yie({pathname:e,isDocBrowserOpen:t,docBrowserDockControls:n,docBrowserRenderers:r={},docBrowserTabMenuGroups:i,topbarLeadingInset:a,children:o}){let s=V7(e),c=!H7(e),l=!H7(e);return(0,H.jsxs)(`div`,{className:`flex h-[100svh] flex-col bg-background font-sans text-foreground supports-[height:100dvh]:h-[100dvh]`,children:[c?(0,H.jsx)(qie,{leadingInset:a}):null,(0,H.jsx)(`div`,{className:`relative flex-1 min-h-0 overflow-hidden`,children:s?(0,H.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:o}):(0,H.jsx)(`main`,{className:`h-full overflow-auto px-4 py-4 custom-scrollbar`,children:(0,H.jsx)(`div`,{className:`mx-auto max-w-3xl animate-fade-in`,children:o})})}),l?(0,H.jsx)(J7,{}):null,t?(0,H.jsx)(V.Suspense,{fallback:null,children:(0,H.jsx)(Jie,{customTabRenderers:r,displayMode:`fullscreen`,dockControls:n,getTabMenuGroups:i})}):null]})}function Xie(){let e=U7(b);return(0,H.jsx)(`div`,{"data-testid":`mobile-settings-shell`,className:`space-y-3 pb-4`,children:e.map(e=>(0,H.jsxs)(pe,{to:e.target,className:({isActive:e})=>u(`flex items-center gap-3 rounded-2xl border border-gray-200/80 bg-white px-4 py-4 shadow-card transition-colors`,e?`border-gray-300 bg-gray-50`:`hover:border-gray-300 hover:bg-gray-50/70`),children:[(0,H.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl bg-gray-100 text-gray-600`,children:(0,H.jsx)(e.icon,{className:`h-4 w-4`})}),(0,H.jsx)(`div`,{className:`min-w-0`,children:(0,H.jsx)(`p`,{className:`truncate text-sm font-semibold text-gray-900`,children:e.label})})]},e.target))})}function Zie(){let{pathname:e}=_e(),t=ce();return H7(e)?(0,H.jsx)(i7,{layoutMode:`mobile`,onBackToList:()=>t(`/chat`)}):(0,H.jsx)(X7,{variant:`mobile`})}var Y7=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{DocBrowser:e}=await import(`./doc-browser-Dto54tCf.js`);return{DocBrowser:e}},__vite__mapDeps([25,26,4,27,28,29,30,31,32,33,1,34,35,36,37,38,39]))).DocBrowser}));function Qie({pathname:e,isMobileLayout:t=!1,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:i,docBrowserRenderers:a={},docBrowserTabMenuGroups:o,sideDock:s,children:c}){let l=V7(e),d=Os(e=>e.isSidebarCollapsed),f=t&&!H7(e),p=q7(),m=d?`56px`:l?`280px`:`240px`;return(0,H.jsxs)(`div`,{className:u(`h-screen flex flex-col overflow-hidden bg-background font-sans text-foreground`,p?`rounded-[10px]`:null),style:p?{"--desktop-titlebar-height":`40px`,"--desktop-caption-safe-right":`140px`,"--desktop-sidebar-width":m}:void 0,children:[p?(0,H.jsx)(Uie,{sidebarCollapsed:d}):null,(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[!l&&(0,H.jsx)(Hie,{}),(0,H.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,H.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:l?(0,H.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:c}):(0,H.jsx)(`main`,{className:`flex-1 overflow-auto p-8 pb-16 custom-scrollbar`,children:(0,H.jsx)(`div`,{className:`mx-auto h-full max-w-6xl animate-fade-in`,children:c})})}),n&&r===`docked`?(0,H.jsx)(V.Suspense,{fallback:null,children:(0,H.jsx)(Y7,{customTabRenderers:a,dockControls:i,getTabMenuGroups:o})}):null,s]})]}),f?(0,H.jsx)(J7,{}):null,n&&r===`floating`?(0,H.jsx)(V.Suspense,{fallback:null,children:(0,H.jsx)(Y7,{customTabRenderers:a,dockControls:i,getTabMenuGroups:o})}):null]})}var $ie=[{target:`/inbox`,label:()=>b(`inboxTitle`),icon:Xa},{target:`/cron`,label:()=>b(`chatSidebarScheduledTasks`),icon:Ui},{target:`/skills`,label:()=>b(`chatSidebarSkills`),icon:$i},{target:`/agents`,label:()=>b(`agentsPageTitle`),icon:Zi}];function eae({isCollapsed:e}){let t=b(e?`sidebarExpand`:`sidebarCollapse`);return(0,H.jsx)(B,{icon:(0,H.jsx)(e?po:uo,{className:GY}),label:t,className:u(JY,e&&`h-9 w-9 rounded-xl`),onClick:ks.toggleSidebarCollapsed})}function tae({connectionStatus:e,isCollapsed:t}){let n=q7(),r=typeof window<`u`&&window.nextclawDesktop?.platform===`darwin`;return(0,H.jsxs)(`div`,{className:u(`flex items-center`,t?`justify-center px-2 py-1.5`:n?`justify-end px-3 py-1.5`:`gap-2 px-4 py-2`,t&&r?`pt-8`:null),children:[t||n?null:(0,H.jsx)(T7,{className:`flex min-w-0 flex-1 items-center gap-2`,suffix:(0,H.jsx)(vie,{status:e})}),(0,H.jsx)(eae,{isCollapsed:t})]})}function nae({isCollapsed:e}){let t=N7();return(0,H.jsxs)(`div`,{className:`pb-1`,children:[(0,H.jsx)(`div`,{className:e?`px-0`:`px-3`,children:(0,H.jsx)(`ul`,{className:e?KY:`space-y-0.5`,children:$ie.map(n=>(0,H.jsx)(`li`,{className:e?`flex justify-center`:void 0,children:(0,H.jsx)(nX,{to:n.target,label:n.label(),icon:n.icon,density:`compact`,collapsed:e,indicator:n.target===`/inbox`&&t>0,trailing:n.target===`/inbox`&&t>0?t>99?`99+`:t:void 0,className:e?void 0:`rounded-lg px-2.5 py-1.5`})},n.target))})}),(0,H.jsx)(sX,{isCollapsed:e})]})}function rae({defaultSessionType:e,groups:t,isCollapsed:n,isLoading:r,isProjectFirstView:i,onAddProject:a,onSelectMode:o,projectGroups:s,renderSessionItem:c,sessionTypeOptions:l}){return n?(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,"aria-hidden":`true`}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex h-8 items-center justify-end gap-1 px-3`,children:[i?(0,H.jsx)(B,{icon:(0,H.jsx)(Va,{className:`h-3.5 w-3.5`}),label:b(`chatProjectAdd`),tone:`surface`,onClick:a}):null,(0,H.jsx)(wL,{isProjectFirstView:i,onSelectMode:o})]}),(0,H.jsx)(`div`,{className:u(`custom-scrollbar min-h-0 flex-1 overflow-y-auto px-3 pb-4 pt-1`,FF),children:(0,H.jsx)(Nie,{isLoading:r,isProjectFirstView:i,groups:t,projectGroups:s,defaultSessionType:e,sessionTypeOptions:l,renderSessionItem:c})})]})}function iae({currentLanguage:e,currentLanguageLabel:t,currentTheme:n,currentThemeLabel:r,isCollapsed:i,isOpen:a,languageOptions:o,onOpenApps:s,onOpenChange:c,onOpenDocs:l,onSelectLanguage:d,onSelectTheme:f,themeOptions:p}){return(0,H.jsx)(`div`,{className:u(`py-2`,i?u(`flex justify-center`,UY):`px-3`),children:(0,H.jsx)(Pie,{isOpen:a,onOpenChange:c,currentTheme:n,currentThemeLabel:r,themeOptions:p,onSelectTheme:f,currentLanguage:e,currentLanguageLabel:t,languageOptions:o,onSelectLanguage:d,onOpenDocs:l,onOpenApps:s,collapsed:i})})}function aae(e){return b(e===`knowledge-base`?`chatProjectTemplateKnowledgeBase`:`chatProjectTemplateEmpty`)}function oae({open:e,defaultWorkspacePath:t,templates:n,isCreating:r,isAddingExisting:i,createErrorMessage:a,addExistingErrorMessage:o,onOpenChange:s,onCreate:c,onAddExisting:l}){let[u,d]=(0,V.useState)(`create`),[f,p]=(0,V.useState)(``),[m,h]=(0,V.useState)(``),[g,_]=(0,V.useState)(``),[v,y]=(0,V.useState)(!1),[x,S]=(0,V.useState)(`empty`),C=n.length>0?n.map(e=>e.id):[`empty`],w=f.trim(),T=m.trim(),E=g.trim(),D=r||i,O=D||(u===`create`?!w:!E),k=u===`create`?a:o,A=()=>{d(`create`),p(``),h(``),_(``),S(`empty`),y(!1)},ee=()=>{D||(A(),s(!1))};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Ir,{open:e,onOpenChange:e=>{if(e){s(!0);return}ee()},children:(0,H.jsxs)(zr,{className:`sm:max-w-lg`,children:[(0,H.jsxs)(Lr,{children:[(0,H.jsx)(Br,{children:b(`chatProjectAddTitle`)}),(0,H.jsx)(Nr,{children:b(`chatProjectAddDescription`)})]}),(0,H.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),!O&&(u===`create`?c({name:w,template:x,rootPath:T||void 0}):l({rootPath:E})).then(A).catch(()=>void 0)},children:[(0,H.jsxs)(PY,{value:u,onValueChange:e=>{D||d(e===`existing`?`existing`:`create`)},children:[(0,H.jsxs)(FY,{className:`grid w-full grid-cols-2`,children:[(0,H.jsx)(IY,{value:`create`,children:b(`chatProjectCreateMode`)}),(0,H.jsx)(IY,{value:`existing`,children:b(`chatProjectExistingMode`)})]}),(0,H.jsxs)(LY,{value:`create`,className:`mt-4 space-y-4`,children:[(0,H.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:b(`chatProjectCreateModeDescription`)}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(rn,{htmlFor:`chat-project-name`,children:b(`chatProjectNameLabel`)}),(0,H.jsx)(vt,{id:`chat-project-name`,value:f,onChange:e=>p(e.target.value),placeholder:b(`chatProjectNamePlaceholder`),autoFocus:!0,disabled:D})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(rn,{htmlFor:`chat-project-template`,children:b(`chatProjectTemplateLabel`)}),(0,H.jsxs)(xr,{value:x,onValueChange:e=>S(e),disabled:D,children:[(0,H.jsx)(pr,{id:`chat-project-template`,children:(0,H.jsx)(or,{})}),(0,H.jsx)(gr,{children:C.map(e=>(0,H.jsx)(yr,{value:e,children:aae(e)},e))})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(rn,{htmlFor:`chat-project-create-root-path`,children:b(`chatProjectCreatePathLabel`)}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(vt,{id:`chat-project-create-root-path`,value:m,onChange:e=>h(e.target.value),placeholder:b(`chatProjectCreatePathPlaceholder`),disabled:D}),(0,H.jsxs)(L,{type:`button`,variant:`outline`,onClick:()=>y(!0),disabled:D,children:[(0,H.jsx)(Ba,{className:`mr-2 h-4 w-4`}),b(`browse`)]})]}),(0,H.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:b(`chatProjectCreatePathHint`)})]})]}),(0,H.jsxs)(LY,{value:`existing`,className:`mt-4 space-y-4`,children:[(0,H.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:b(`chatProjectExistingModeDescription`)}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(rn,{htmlFor:`chat-project-existing-root-path`,children:b(`chatProjectExistingPathLabel`)}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(vt,{id:`chat-project-existing-root-path`,value:g,onChange:e=>_(e.target.value),placeholder:b(`chatProjectExistingPathPlaceholder`),autoFocus:!0,disabled:D}),(0,H.jsxs)(L,{type:`button`,variant:`outline`,onClick:()=>y(!0),disabled:D,children:[(0,H.jsx)(Ba,{className:`mr-2 h-4 w-4`}),b(`browse`)]})]}),(0,H.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:b(`chatProjectExistingPathHint`)})]})]})]}),k?(0,H.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:k}):null,(0,H.jsxs)(Dr,{children:[(0,H.jsx)(L,{type:`button`,variant:`outline`,onClick:ee,disabled:D,children:b(`cancel`)}),(0,H.jsx)(L,{type:`submit`,disabled:O,children:b(D?`saving`:u===`create`?`chatProjectCreateAction`:`chatProjectExistingAction`)})]})]})]})}),(0,H.jsx)(KF,{open:v,allowCreateDirectory:u===`create`,currentPath:u===`create`?m:g,defaultWorkspacePath:t,isSaving:!1,onOpenChange:y,onConfirm:e=>{u===`create`?h(e):_(e),y(!1)},title:b(u===`create`?`chatProjectCreatePathPickerTitle`:`chatProjectExistingPathPickerTitle`),description:b(u===`create`?`chatProjectCreatePathPickerDescription`:`chatProjectExistingPathPickerDescription`),pathLabel:b(u===`create`?`chatProjectCreatePathLabel`:`chatProjectExistingPathLabel`),pathPlaceholder:b(u===`create`?`chatProjectCreatePathPlaceholder`:`chatProjectExistingPathPlaceholder`),confirmLabel:b(`selectCurrentDirectory`),hint:b(u===`create`?`chatProjectCreatePathHint`:`chatProjectExistingPathHint`)})]})}function sae(e,t,n){let r=oL(e=>e.optimisticReadAtBySessionKey);return(0,V.useEffect)(()=>{(()=>{if(!t)return;let r=e.find(({session:e})=>e.key===t);if(!r||r.runStatus===`running`)return;let{session:i}=r;n(i.key,i.lastMessageAt,i.readAt)})()},[e,n,t]),r}function X7({variant:e=`desktop`}){let t=e===`mobile`,n=tI(),r=Oi(),i=Os(e=>e.isSidebarCollapsed),[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1),[l,d]=(0,V.useState)(!1),f=oL(e=>e.snapshot),p=eR(e=>e.snapshot.sessionTypesQuery?.data??null),m=eR(e=>e.snapshot.configQuery?.data??null),h=ot(),g=fz(),_=nR(),v=rR(),y=iR(),{isLoading:x,items:S}=gL(),{language:C,setLanguage:w}=jn(),{theme:T,setTheme:E}=S7(),D=b(c7.find(e=>e.value===T)?.labelKey??`themeWork`),O=A.find(e=>e.value===C)?.label??C,k=(0,V.useMemo)(()=>c7.map(e=>({value:e.value,label:b(e.labelKey)})),[]),ee=(0,V.useMemo)(()=>A.map(e=>({value:e.value,label:e.label})),[]),j=(0,V.useMemo)(()=>new Map((g.data?.agents??[]).map(e=>[e.id,e])),[g.data?.agents]),M=(0,V.useMemo)(()=>new Set(f.pinnedSessionKeys),[f.pinnedSessionKeys]),N=(0,V.useMemo)(()=>new Set(f.pinnedProjectRoots),[f.pinnedProjectRoots]),te=(0,V.useMemo)(()=>vL(S),[S]),P=(0,V.useMemo)(()=>SL(S),[S]),ne=(0,V.useMemo)(()=>bL(te,M),[M,te]),re=(0,V.useMemo)(()=>xL(te,M,N,_.data?.projects??[]),[N,M,_.data?.projects,te]),ie=(0,V.useMemo)(()=>kL(p?.options??[]),[p?.options]),ae=(0,V.useMemo)(()=>EL(p?.defaultType??`native`),[p?.defaultType]),oe=gR({defaultSessionType:ae,sessionTypeOptions:ie}),se=f.listMode===`project-first`,ce=!t&&i,le=sae(S,f.selectedSessionKey,n.chatSessionListManager.markSessionRead),{editingSessionKey:ue,draftLabel:de,savingSessionKey:fe,setDraftLabel:pe,startEditingSessionLabel:me,cancelEditingSessionLabel:he,saveSessionLabel:ge}=Rre(),_e=e=>{C!==e&&(w(e),window.location.reload())},ve=e=>(0,H.jsx)(aie,{item:e,selectedSessionKey:f.selectedSessionKey,optimisticReadAtBySessionKey:le,agentsById:j,childSessionsByParentKey:P,editingSessionKey:ue,draftLabel:de,savingSessionKey:fe,sessionTypeOptions:ie,isPinned:M.has(e.session.key),sessionTitle:CL,onSelectSession:n.chatSessionListManager.selectSession,onOpenChildSessions:(e,t)=>n.chatThreadManager.openChildSessionPanel({parentSessionKey:e,activeChildSessionKey:t}),onStartEditingSessionLabel:me,onDraftLabelChange:pe,onSaveSessionLabel:ge,onCancelEditingSessionLabel:he,onTogglePinned:()=>n.chatSessionListManager.toggleSessionPinned(e.session.key)},e.session.key),ye=(e,t)=>{n.chatSessionListManager.createSession({projectRoot:typeof t==`string`?t:void 0,sessionType:e})},be=()=>{v.reset(),y.reset(),c(!0)},xe=async e=>{await v.mutateAsync(e),c(!1)},Se=async e=>{await y.mutateAsync(e),c(!1)};return(0,H.jsxs)(`aside`,{className:u(`flex h-full min-h-0 flex-col bg-secondary transition-[width] duration-200 ease-out`,t?`flex-1 overflow-hidden`:ce?u(HY,`shrink-0`):`w-[280px] shrink-0`),"data-sidebar-collapsed":ce?`true`:`false`,children:[t?null:(0,H.jsx)(tae,{connectionStatus:h.connectionStatus,isCollapsed:ce}),t?(0,H.jsx)(cie,{query:f.query,defaultSessionType:oe.selectedSessionType,sessionTypeOptions:ie,selectedNewSessionType:oe.selectedSessionType,selectedNewSessionTypeOption:oe.selectedSessionTypeOption,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:ye,onSelectNewSessionType:oe.setSelectedSessionType,onQueryChange:n.chatSessionListManager.setQuery}):(0,H.jsx)(sie,{query:f.query,defaultSessionType:ae,sessionTypeOptions:ie,selectedNewSessionType:oe.selectedSessionType,selectedNewSessionTypeOption:oe.selectedSessionTypeOption,isCreateMenuOpen:a,onCreateMenuOpenChange:o,onCreateSession:ye,onSelectNewSessionType:oe.setSelectedSessionType,onQueryChange:n.chatSessionListManager.setQuery,collapsed:ce}),t?null:(0,H.jsx)(nae,{isCollapsed:ce}),(0,H.jsx)(rae,{defaultSessionType:oe.selectedSessionType,groups:ne,isCollapsed:ce,isLoading:x,isProjectFirstView:se,onAddProject:be,onSelectMode:n.chatSessionListManager.setListMode,projectGroups:re,renderSessionItem:ve,sessionTypeOptions:ie}),t?null:(0,H.jsx)(iae,{currentLanguage:C,currentLanguageLabel:O,currentTheme:T,currentThemeLabel:D,isCollapsed:ce,isOpen:l,languageOptions:ee,onOpenApps:()=>S1(r),onOpenChange:d,onOpenDocs:()=>r.open(void 0,{kind:`docs`,title:b(`docBrowserHelp`)}),onSelectLanguage:_e,onSelectTheme:E,themeOptions:k}),(0,H.jsx)(oae,{open:s,defaultWorkspacePath:mI(m?.agents.defaults.workspace),templates:_.data?.templates??[],isCreating:v.isPending,isAddingExisting:y.isPending,createErrorMessage:v.error?.message,addExistingErrorMessage:y.error?.message,onOpenChange:c,onCreate:xe,onAddExisting:Se})]})}var Z7=`sid_`,Q7=`/chat/draft`,cae=Q7.slice(6);function lae(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCharCode(e);return`${Z7}${btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/g,``)}`}function uae(e){if(!e.startsWith(Z7))return null;let t=e.slice(4).replace(/-/g,`+`).replace(/_/g,`/`),n=`=`.repeat((4-t.length%4)%4);try{let e=atob(t+n),r=Uint8Array.from(e,e=>e.charCodeAt(0));return new TextDecoder().decode(r)}catch{return null}}function $7(e){if(!e||e===cae)return null;let t=uae(e);if(t)return t;try{return decodeURIComponent(e)}catch{return e}}function e9(e){return`/chat/${lae(e)}`}function t9(e,t){let n=t.trim();return n?e.includes(n)?e.filter(e=>e!==n):[n,...e]:e}var dae=class{constructor(e){this.uiManager=e,this.syncDraftThreadState=e=>{let t=$.getState().snapshot.workspaceFileTabs.filter(e=>e.parentSessionKey!==null);$.getState().setSnapshot({sessionKey:null,sessionDisplayName:void 0,draftProjectRoot:e,canDeleteSession:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null,workspaceFileTabs:t,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.resolveUpdateValue=(e,t)=>typeof t==`function`?t(e):t,this.shouldPersistReadAt=(e,t,n)=>{let r=oL.getState().optimisticReadAtBySessionKey[e],i=r&&n?r.localeCompare(n)>0?r:n:r??n??void 0;return i?t.localeCompare(i)>0:!0},this.setSelectedAgentId=e=>{let t=oL.getState().snapshot.selectedAgentId,n=this.resolveUpdateValue(t,e);n!==t&&oL.getState().setSnapshot({selectedAgentId:n})},this.syncSelectedSessionAgent=()=>{let e=$.getState().snapshot.agentId?.trim();e&&this.setSelectedAgentId(e)},this.setSelectedSessionKey=e=>{e!==oL.getState().snapshot.selectedSessionKey&&oL.getState().setSnapshot({selectedSessionKey:e})},this.syncRouteSessionSelection=e=>{this.setSelectedSessionKey(e),e&&$.getState().setSnapshot({draftProjectRoot:null})},this.setListMode=e=>{let t=oL.getState().snapshot.listMode,n=this.resolveUpdateValue(t,e);n!==t&&oL.getState().setSnapshot({listMode:n})},this.toggleSessionPinned=e=>{let{pinnedSessionKeys:t}=oL.getState().snapshot;oL.getState().setSnapshot({pinnedSessionKeys:t9(t,e)})},this.toggleProjectPinned=e=>{let{pinnedProjectRoots:t}=oL.getState().snapshot;oL.getState().setSnapshot({pinnedProjectRoots:t9(t,e)})},this.toggleProjectCollapsed=e=>{let{collapsedProjectRoots:t}=oL.getState().snapshot;oL.getState().setSnapshot({collapsedProjectRoots:t9(t,e)})},this.markSessionRead=(e,t,n)=>{let r=e?.trim(),i=t?.trim();!r||!i||this.shouldPersistReadAt(r,i,n)&&(oL.getState().markSessionRead(r,i),Qe(r,{uiReadAt:i}).catch(()=>void 0))},this.markVisibleWorkspaceChildRead=e=>{this.markSessionRead(e.sessionKey,e.runStatus===`running`?null:e.lastMessageAt,e.readAt)},this.createSession=(e={})=>{let{projectRoot:t,prompt:n,sessionType:r}=e,i=EL(r??`native`),a=mI(t),o=n?.trim()||null;this.syncDraftThreadState(a),this.uiManager.navigateTo(Q7,{replace:this.uiManager.isAtChatRoot(),state:{chatDraft:{sessionType:i,projectRoot:a,prompt:o}}})},this.startAgentDraftChat=(e,t,n)=>{let r=e.trim()||`main`;this.createSession({prompt:n,sessionType:t}),this.setSelectedAgentId(r)},this.selectSession=e=>{this.uiManager.goToSession(e)},this.setQuery=e=>{let t=oL.getState().snapshot.query,n=this.resolveUpdateValue(t,e);n!==t&&oL.getState().setSnapshot({query:n})}}},fae=async()=>!1,pae=class{constructor(e){this.docBrowserManager=e,this.state={pathname:``},this.actions={navigate:null,confirm:fae},this.syncState=e=>{this.state={...this.state,...e}},this.bindActions=e=>{this.actions={...this.actions,...e}},this.confirm=async e=>this.actions.confirm(e),this.navigateTo=(e,t)=>{this.actions.navigate&&(this.state.pathname===e&&!t?.replace||(this.actions.navigate(e,t),this.state.pathname=e))},this.goToProviders=()=>{this.navigateTo(`/providers`)},this.isCompactViewport=()=>ks.getSnapshot().mode===`mobile`,this.resolvePanelAppEntry=async e=>{let t=e.trim();if(!t)return null;try{return O1((await I.panelApps.listPanelApps()).entries,t)}catch{return null}},this.showContent=async e=>{let{target:t,title:n}=e;if(t.type===`url`){this.docBrowserManager.open(t.payload.url,{dedupeKey:`browser:${t.payload.url}`,kind:`content`,title:n});return}let{appId:r,params:i,path:a}=t.payload;if(a){this.docBrowserManager.open(W$(r,a),{contentParams:i,title:n});return}let o=await this.resolvePanelAppEntry(r);if(o){this.docBrowserManager.openTarget({...Z$(o),contentParams:i},{title:n});return}this.docBrowserManager.open(W$(r),{contentParams:i,title:n})},this.goToChatRoot=e=>{this.navigateTo(`/chat`,e)},this.isAtChatRoot=()=>this.state.pathname===`/chat`||this.state.pathname===`/chat/draft`,this.goToSession=(e,t)=>{this.navigateTo(e9(e),t)}}};function n9(e){let t=e=>{if(!e||typeof e!=`object`)return e;let t=e,n=t.error instanceof Error?{name:t.error.name,message:t.error.message}:t.error;return{data:t.data,error:n,status:t.status,fetchStatus:t.fetchStatus,isLoading:t.isLoading,isFetching:t.isFetching,isFetched:t.isFetched,isSuccess:t.isSuccess}};return{configQuery:t(e.configQuery),providersQuery:t(e.providersQuery),providerTemplatesQuery:t(e.providerTemplatesQuery),sessionsQuery:t(e.sessionsQuery),sessionTypesQuery:t(e.sessionTypesQuery),sessionSkillsSessionId:e.sessionSkillsSessionId,sessionSkillsQuery:t(e.sessionSkillsQuery)}}function mae(e,t){return JSON.stringify(n9(e))!==JSON.stringify(n9({...e,...t}))}var hae=class{constructor(){this.syncSnapshot=e=>{let t=eR.getState();mae(t.snapshot,e)&&t.setSnapshot(e)}}};function r9(e,t,n){return e===t?n:e.startsWith(`${t}/`)||e.startsWith(`${t}\\`)?`${n}${e.slice(t.length)}`:null}function gae(e,t){let n=t.previousPath.trim(),r=t.path.trim();if(!n||!r||n===r)return null;let i=new Map,a=e.workspaceFileTabs.map(e=>{let a=r9(e.path,n,r);if(!a)return e;let o=UR(e,a,e.path===n?t.label:e.label);return i.set(e.key,o.key),o});if(i.size===0)return null;let o=e=>e.kind===`file`&&i.has(e.key)?{kind:`file`,key:i.get(e.key)}:e;return{workspaceFileTabs:a,activeWorkspaceFileKey:e.activeWorkspaceFileKey?i.get(e.activeWorkspaceFileKey)??e.activeWorkspaceFileKey:null,closedWorkspaceTabEntries:e.closedWorkspaceTabEntries.map(o),workspaceNavigationHistory:e.workspaceNavigationHistory.map(o)}}function _ae(e,t){let n=t.trim();if(!n)return null;let r=e,i=e.workspaceFileTabs.filter(e=>r9(e.path,n,n)!==null).map(e=>e.key);for(let e of i){let t=JR(r,{kind:`file`,key:e});t&&(r={...r,...t})}return i.length>0?r:null}var vae=class{constructor(e,t,n){this.uiManager=e,this.sessionListManager=t,this.onWorkspacePanelOpened=n,this.handledUiShowContentEventIds=new Set,this.hasSnapshotChanges=e=>{let t=$.getState().snapshot;for(let[n,r]of Object.entries(e))if(!Object.is(t[n],r))return!0;return!1},this.syncSnapshot=e=>{this.hasSnapshotChanges(e)&&$.getState().setSnapshot(e)},this.clearDeletedSessionState=()=>{$.getState().setSnapshot({sessionKey:null,sessionTypeLabel:null,agentId:null,sessionDisplayName:void 0,draftProjectRoot:null,sessionProjectName:null,canDeleteSession:!1,parentSessionKey:null,parentSessionLabel:null,workspacePanelParentKey:null,activeWorkspacePanelKind:null,childSessionTabs:[],activeChildSessionKey:null,activeSideChatDraft:null,workspaceFileTabs:[],activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.resolveWorkspaceParentSessionKey=()=>oL.getState().snapshot.selectedSessionKey?.trim()||$.getState().snapshot.sessionKey?.trim()||(oL.getState().snapshot.selectedSessionKey??null),this.activateWorkspaceFileTab=(e,t)=>{let{parentSessionKey:n}=e,{workspaceFileTabs:r}=$.getState().snapshot;this.setWorkspaceSelection({workspacePanelParentKey:n,activeWorkspacePanelKind:`file`,workspaceFileTabs:HR(r,e,t),activeWorkspaceFileKey:e.key,activeChildSessionKey:null,activeSideChatDraft:null},{kind:`file`,key:e.key}),this.ensureWorkspaceParentRoute(n),this.onWorkspacePanelOpened?.()},this.ensureWorkspaceParentRoute=e=>{if(!e)return;let{snapshot:{selectedSessionKey:t}}=oL.getState();t!==e&&this.uiManager.goToSession(e)},this.setWorkspaceSelection=(e,t)=>{let{snapshot:n}=$.getState(),r=NR({entries:n.workspaceNavigationHistory,index:n.workspaceNavigationHistoryIndex},t,GR),i=e.workspacePanelParentKey&&e.workspacePanelParentKey!==n.workspacePanelParentKey?[]:n.closedWorkspaceTabEntries.filter(e=>!GR(e,t));$.getState().setSnapshot({...e,closedWorkspaceTabEntries:i,workspaceNavigationHistory:[...r.entries],workspaceNavigationHistoryIndex:r.index})},this.openWorkspacePage=(e,t)=>{let n=e?.trim()||null;!n&&t!==`project-files`||(this.setWorkspaceSelection({workspacePanelParentKey:n,activeWorkspacePanelKind:t,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null},{kind:t}),this.ensureWorkspaceParentRoute(n),this.onWorkspacePanelOpened?.())},this.openWorkspaceOverview=e=>{this.openWorkspacePage(e,`overview`)},this.toggleWorkspacePanel=e=>{let t=e?.trim()||null,{snapshot:n}=$.getState();if(n.workspacePanelParentKey===t&&n.activeWorkspacePanelKind){this.closeWorkspacePanel();return}if(t){this.openWorkspaceOverview(t);return}this.openProjectFiles(null)},this.setWorkspacePanelWidth=e=>{this.syncSnapshot({workspacePanelWidth:kR(e)})},this.setWorkspaceExplorerWidth=e=>{this.syncSnapshot({workspaceExplorerWidth:AR(e)})},this.renameWorkspacePath=e=>{let t=gae($.getState().snapshot,e);t&&this.syncSnapshot(t)},this.removeWorkspacePath=e=>{let t=_ae($.getState().snapshot,e);t&&$.getState().setSnapshot(t)},this.openChildSessions=e=>this.openWorkspacePage(e,`child-sessions`),this.openContinuousAttention=e=>this.openWorkspacePage(e,`continuous-attention`),this.openProjectFiles=e=>this.openWorkspacePage(e,`project-files`),this.materializeRootDraftSession=e=>{let t=e.trim();if(!t||!this.uiManager.isAtChatRoot())return;let n=ZR($.getState().snapshot,t);n&&(this.sessionListManager.syncRouteSessionSelection(t),$.getState().setSnapshot(n),this.uiManager.goToSession(t,{replace:!0}))},this.openChildSessionPanel=e=>{let{activeChildSessionKey:t,childSessionTab:n,parentSessionKey:r}=e,i=r.trim();if(!i)return;let a=t?.trim()||null,o={workspacePanelParentKey:i,activeWorkspacePanelKind:`child-session`,activeChildSessionKey:a,activeSideChatDraft:null,activeWorkspaceFileKey:null};a&&n&&(o.childSessionTabs=XR($.getState().snapshot.childSessionTabs,{sessionKey:a,parentSessionKey:i,label:n.label?.trim()||null,agentId:n.agentId?.trim()||null})),a?this.setWorkspaceSelection(o,{kind:`child-session`,key:a}):$.getState().setSnapshot(o),this.ensureWorkspaceParentRoute(i),this.onWorkspacePanelOpened?.()},this.openSideChatDraft=e=>{let t=e?.trim()||this.resolveWorkspaceParentSessionKey()?.trim();if(!t)return;let n=YR(t);this.setWorkspaceSelection({workspacePanelParentKey:t,activeWorkspacePanelKind:`side-chat-draft`,activeChildSessionKey:null,activeSideChatDraft:n,activeWorkspaceFileKey:null},{kind:`side-chat-draft`,key:n.draftKey}),this.ensureWorkspaceParentRoute(t),this.onWorkspacePanelOpened?.()},this.materializeSideChatDraft=e=>{let t=QR({snapshot:$.getState().snapshot,...e});t&&($.getState().setSnapshot(t.patch),this.ensureWorkspaceParentRoute(t.parentSessionKey))},this.openFilePreview=e=>{let t=VR(e,this.resolveWorkspaceParentSessionKey());t&&this.activateWorkspaceFileTab(t)},this.openWorkspaceFileViewer=(e,t)=>{let n=$.getState().snapshot.workspaceFileTabs.find(t=>t.key===e.trim());if(!n||n.viewMode!==`preview`)return;let r=t??BR(n.path,n.previewViewer);if(!r)return;let i=VR({path:n.path,label:n.label??void 0,viewMode:`preview`,previewViewer:r,line:n.line??void 0,column:n.column??void 0,params:n.params??void 0,rawText:n.rawText??void 0,contentUrl:n.contentUrl??void 0,mimeType:n.mimeType??void 0},n.parentSessionKey);i&&this.activateWorkspaceFileTab(i,n.key)},this.openSessionFromToolAction=e=>{if(e.kind!==`open-session`)return;let t=e.sessionId.trim();if(t){if(e.sessionKind===`child`&&!this.uiManager.isCompactViewport()){let n=e.parentSessionId?.trim()||oL.getState().snapshot.selectedSessionKey||null;if(n){this.openChildSessionPanel({parentSessionKey:n,activeChildSessionKey:t,childSessionTab:{label:e.label,agentId:e.agentId}});return}}this.closeWorkspacePanel(),this.uiManager.goToSession(t)}},this.handleToolAction=async e=>{if(e.kind===`show-content`){await this.showContent(e.request);return}this.openSessionFromToolAction(e)},this.handleUiShowContentEvent=async e=>{let t=e.id.trim();!t||this.handledUiShowContentEventIds.has(t)||(this.handledUiShowContentEventIds.add(t),await this.showContent({target:e.target,title:e.title,purpose:e.purpose,placement:e.placement}))},this.showContent=async e=>{if(e.placement!==`inline`){if(e.target.type===`file`){this.openFilePreview({path:e.target.payload.path,label:e.title,viewMode:`preview`,previewViewer:e.target.payload.viewer,line:e.target.payload.line,column:e.target.payload.column,params:e.target.payload.params});return}await this.uiManager.showContent({target:e.target,title:e.title})}},this.syncVisibleWorkspaceSelection=e=>{e?.kind===`child-session`&&this.sessionListManager.markVisibleWorkspaceChildRead(e.tab)},this.selectChildSessionDetail=e=>{let t=e.trim();t&&this.setWorkspaceSelection({activeChildSessionKey:t,activeWorkspaceFileKey:null,activeWorkspacePanelKind:`child-session`,activeSideChatDraft:null},{kind:`child-session`,key:t})},this.selectWorkspaceFile=e=>{let t=e.trim();if(!t)return;let{workspaceFileTabs:n}=$.getState().snapshot;n.some(e=>e.key===t)&&this.setWorkspaceSelection({activeWorkspaceFileKey:t,activeChildSessionKey:null,activeWorkspacePanelKind:`file`,activeSideChatDraft:null},{kind:`file`,key:t})},this.closeWorkspaceTab=e=>{let{snapshot:t}=$.getState(),n=JR(t,e);n&&$.getState().setSnapshot(n)},this.closeWorkspacePanel=()=>{$.getState().setSnapshot({workspacePanelParentKey:null,activeWorkspacePanelKind:null,activeChildSessionKey:null,activeSideChatDraft:null,activeWorkspaceFileKey:null,closedWorkspaceTabEntries:[],workspaceNavigationHistory:[],workspaceNavigationHistoryIndex:0})},this.openSessionCronPanel=e=>{this.openWorkspacePage(e,`cron`)},this.goBackWorkspacePanel=()=>{this.restoreWorkspaceNavigationStep(`back`)},this.goForwardWorkspacePanel=()=>{this.restoreWorkspaceNavigationStep(`forward`)},this.restoreWorkspaceNavigationStep=e=>{let{snapshot:t}=$.getState(),n=PR({entries:t.workspaceNavigationHistory,index:t.workspaceNavigationHistoryIndex},e);if(!n)return;let r=qR(n.entry,t);r&&$.getState().setSnapshot({...r,workspaceNavigationHistory:[...n.history.entries],workspaceNavigationHistoryIndex:n.history.index})},this.goToParentSession=()=>{let{parentSessionKey:e,activeSideChatDraft:t,childSessionTabs:n,activeChildSessionKey:r}=$.getState().snapshot,i=n.find(e=>e.sessionKey===r)?.parentSessionKey??null,a=e??t?.parentSessionKey??i;a&&(this.closeWorkspacePanel(),this.uiManager.goToSession(a))},this.deleteSession=async()=>{let{snapshot:{selectedSessionKey:e}}=oL.getState();if(e&&await this.uiManager.confirm({title:b(`chatDeleteSessionConfirm`),variant:`destructive`,confirmLabel:b(`delete`)})){$.getState().setSnapshot({isDeletePending:!0});try{await It(e),et(Tt,e),Tt.removeQueries({queryKey:[`ncp-session-messages`,e]}),this.clearDeletedSessionState(),this.uiManager.goToChatRoot({replace:!0})}finally{$.getState().setSnapshot({isDeletePending:!1})}}}}},yae=class{constructor(e){this.chatUiManager=new pae(e.docBrowserManager),this.chatSessionListManager=new dae(this.chatUiManager),this.chatQueryManager=new hae,this.chatComposerIntentManager=e.chatComposerIntentManager,this.chatThreadManager=new vae(this.chatUiManager,this.chatSessionListManager,e.notifyRightPanelOpened)}},bae=class{constructor(){this.nextId=0,this.pendingIntent=null,this.listeners=new Set,this.requestDraft=e=>{let t=e.trim();if(!t)return;let n={id:this.nextId+1,kind:`prompt`,prompt:t};this.nextId=n.id,this.pendingIntent=n,this.listeners.forEach(e=>e(n))},this.requestSystemObjectReference=e=>{let t={id:this.nextId+1,kind:`system-object-reference`,reference:structuredClone(e)};this.nextId=t.id,this.pendingIntent=t,this.listeners.forEach(e=>e(t))},this.consumePending=()=>{let e=this.pendingIntent;return this.pendingIntent=null,e},this.markConsumed=e=>{this.pendingIntent?.id===e&&(this.pendingIntent=null)},this.subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})}};function i9(e,t){let n=2166136261;for(let e=0;e<t.length;e+=1)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return`${e}#excerpt-${(n>>>0).toString(36)}`}var xae=class{constructor(){this.nextId=0,this.pendingIntent=null,this.subscriptions=new Set,this.publish=e=>{let t=this.nextId+1,n=e.targetSessionKey?.trim()||null,r={...e,id:t,targetSessionKey:n};this.nextId=r.id,this.pendingIntent=r,this.subscriptions.forEach(e=>{e.targetSessionKey===r.targetSessionKey&&e.listener(r)})},this.requestFileReference=e=>{let t=e.tokenKey.trim(),n=e.label.trim();!t||!n||this.publish({kind:r,targetSessionKey:e.targetSessionKey?.trim()||null,tokenKey:t,label:n})},this.requestDirectoryReference=e=>{let t=e.tokenKey.trim(),n=e.label.trim();!t||!n||this.publish({kind:p,targetSessionKey:e.targetSessionKey?.trim()||null,tokenKey:t,label:n})},this.requestExcerptReference=e=>{let{endLine:t,excerpt:n,label:r,path:i,startLine:a,targetSessionKey:o}=e,s=i.trim(),c=r.trim(),l=n.trim();!s||!c||!l||this.publish({kind:O,targetSessionKey:o,tokenKey:i9(s,`${s}:${a??`x`}:${t??`x`}:${l}`),path:s,label:c,excerpt:l,startLine:a,endLine:t})},this.requestConversationExcerptReference=e=>{let{targetSessionKey:t,messageId:n,role:r,label:i,excerpt:a}=e,o=n.trim(),s=i.trim(),c=a.trim();!o||!s||!c||this.publish({kind:P,targetSessionKey:t,tokenKey:i9(o,`${o}:${c}`),messageId:o,role:r,label:s,excerpt:c})},this.requestUiResourceReference=e=>{let t=x(e.reference);if(!t)return;let n=t.uri.trim(),r=t.title.trim();this.publish({kind:re,targetSessionKey:e.targetSessionKey,tokenKey:n,label:r,reference:t})},this.consumePending=e=>{if(this.pendingIntent?.targetSessionKey!==e)return null;let t=this.pendingIntent;return this.pendingIntent=null,t},this.markConsumed=e=>{this.pendingIntent?.id===e&&(this.pendingIntent=null)},this.subscribe=(e,t)=>{let n={targetSessionKey:e,listener:t};return this.subscriptions.add(n),()=>{this.subscriptions.delete(n)}}}},a9=120,Sae=200;function Cae(e){let t=e.replace(/\r\n?/gu,`
109
+ `).replace(/^[ \t]*\[[^\]]+\]:\s+\S+.*$/gmu,` `).replace(/^[ \t]*(?:`{3,}|~{3,})[^\n]*$/gmu,` `).replace(/^[ \t]*\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?[ \t]*$/gmu,` `).replace(/^[ \t]*(?:[-*_][ \t]*){3,}$/gmu,` `).replace(/!\[([^\]]*)\]\([^\n)]+\)/gu,`$1`).replace(/\[([^\]]+)\]\([^\n)]+\)/gu,`$1`).replace(/\[([^\]]+)\]\[[^\]]*\]/gu,`$1`).replace(/<(https?:\/\/[^>\s]+)>/gu,`$1`).replace(/<[^>]+>/gu,` `).replace(/^[ \t]{0,3}#{1,6}[ \t]+/gmu,``).replace(/^[ \t]*>+[ \t]?/gmu,``).replace(/^[ \t]*(?:[-+*]|\d+[.)])[ \t]+/gmu,``).replace(/^[ \t]*\[(?: |x|X)\][ \t]*/gmu,``).replace(/(`+)([^`]*?)\1/gu,`$2`).replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/gu,`$2`).replace(/~~(?=\S)([\s\S]*?\S)~~/gu,`$1`).replace(/\*(?=\S)([^*\n]*?\S)\*/gu,`$1`).replace(/\\([\\`*{}[\]()#+.!_>-])/gu,`$1`).replace(/^[ \t]*\|(.+)\|[ \t]*$/gmu,(e,t)=>t.split(`|`).map(e=>e.trim()).filter(Boolean).join(` `)).replace(/\s+/gu,` `).trim(),n=Array.from(t);return n.length<=a9?t:`${n.slice(0,a9-1).join(``)}…`}function wae(e){return Cae(e.parts.filter(e=>e.type===`text`||e.type===`rich-text`).map(e=>e.text).join(` `))}var Tae=class{constructor(e){this.notificationManager=e,this.cleanups=[],this.handledMessageIds=new Set,this.visibleSessionIds=new Set,this.started=!1,this.start=()=>{this.started||(this.started=!0,this.cleanups.push(I.eventBus.on(c.ncpEvent,this.handleNcpEvent)))},this.stop=()=>{if(this.started)for(this.started=!1;this.cleanups.length>0;)this.cleanups.pop()?.()},this.syncVisibleSessions=e=>{this.visibleSessionIds=new Set(e.map(e=>e?.trim()).filter(e=>!!e))},this.handleNcpEvent=e=>{if(e.type!==SK.MessageCompleted)return;let{message:t}=e.payload,n=e.payload.sessionId.trim();if(!n||this.handledMessageIds.has(t.id)||t.role!==`assistant`||t.status!==`final`||hK(t)||(this.rememberHandledMessage(t.id),this.visibleSessionIds.has(n)))return;let r=this.resolveSessionTitle(n),i=wae(t);this.notificationManager.show({id:`chat-reply:${t.id}`,title:r,description:i||b(`chatBackgroundReplyFallbackPreview`),href:e9(n),ariaLabel:b(`chatBackgroundReplyOpenAriaLabel`).replace(`{title}`,r)})},this.resolveSessionTitle=e=>{let t=(eR.getState().snapshot.sessionsQuery?.data?.sessions??[]).find(t=>t.sessionId===e);return t?rI(qI(t)):b(`chatBackgroundReplyFallbackTitle`)},this.rememberHandledMessage=e=>{if(this.handledMessageIds.add(e),this.handledMessageIds.size<=Sae)return;let t=this.handledMessageIds.values().next().value;t&&this.handledMessageIds.delete(t)}}};function o9(){return Ot({queryKey:[`ncp-session-types`],queryFn:un,staleTime:1e4,retry:!1})}var s9=`relative ml-auto flex min-h-[74px] w-[320px] max-w-[calc(100vw-2rem)] rounded-[20px] border border-border/80 bg-background text-left text-foreground shadow-[0_8px_18px_rgba(0,0,0,0.12),0_2px_5px_rgba(0,0,0,0.06)]`,c9=`flex min-h-[72px] min-w-0 flex-1 items-center gap-3 rounded-[inherit] py-3 pl-[18px] pr-[52px]`;function l9({title:e,description:t,iconSrc:n}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border/80 bg-background p-[3px]`,children:(0,H.jsx)(`img`,{"aria-hidden":`true`,alt:``,src:n??`/logo.svg`,className:`h-full w-full object-contain`})}),(0,H.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`block truncate text-[15px] font-semibold leading-5 tracking-[-0.01em]`,children:e}),t?(0,H.jsx)(`span`,{className:`mt-0.5 block truncate text-[14px] leading-5 text-muted-foreground`,children:t}):null]})]})}function u9({dismissLabel:e,onDismiss:t}){return(0,H.jsx)(B,{className:`absolute right-2.5 top-2.5 z-10`,icon:(0,H.jsx)(hi,{className:`h-4 w-4`,"aria-hidden":`true`}),label:e,onClick:t,size:`lg`,tooltipSide:`left`})}function Eae({title:e,description:t,href:n,iconSrc:r,ariaLabel:i,dismissLabel:a,onDismiss:o}){let s=i??[e,t].filter(Boolean).join(`: `);return n?(0,H.jsxs)(`div`,{className:s9,children:[(0,H.jsx)(ue,{to:n,"aria-label":s,className:`${c9} focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/50`,onClick:o,children:(0,H.jsx)(l9,{title:e,description:t,iconSrc:r})}),(0,H.jsx)(u9,{dismissLabel:a,onDismiss:o})]}):(0,H.jsxs)(`div`,{className:s9,children:[(0,H.jsx)(`div`,{role:`status`,"aria-label":s,className:c9,children:(0,H.jsx)(l9,{title:e,description:t,iconSrc:r})}),(0,H.jsx)(u9,{dismissLabel:a,onDismiss:o})]})}var Dae=8e3,Oae=class{constructor(){this.show=e=>R.custom(t=>(0,V.createElement)(Eae,{title:e.title,description:e.description,href:e.href,iconSrc:e.iconSrc,ariaLabel:e.ariaLabel,dismissLabel:e.dismissLabel??b(`notificationDismiss`),onDismiss:()=>{R.dismiss(t)}}),{id:e.id,duration:e.durationMs??Dae,unstyled:!0}),this.dismiss=e=>{R.dismiss(e)}}},kae=`nextclaw://docs`,d9=`github-project`,Aae=`https://github.com/Peiiii/nextclaw`;function f9(){return[{builtIn:!0,icon:{type:`builtin`,name:`apps`},id:`apps`,label:b(`appsTitle`),removable:!1,target:{type:`right-panel-resource`,uri:N$}},{builtIn:!0,icon:{type:`builtin`,name:`docs`},id:`docs`,label:b(`docBrowserHelp`),removable:!1,target:{type:`right-panel-resource`,uri:kae}},{builtIn:!0,icon:{type:`builtin`,name:`new-tab`},id:`new-tab`,label:b(`docBrowserHomeTitle`),removable:!1,target:{type:`right-panel-resource`,uri:j$}},{builtIn:!0,icon:{type:`builtin`,name:`github`},id:d9,label:b(`sideDockGitHubProject`),removable:!1,target:{type:`external-url`,url:Aae}}]}var jae=[`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`];function p9(e){return!!e&&typeof e==`object`}function Mae(e){return jae.includes(e)}function Nae(e){return!p9(e)||typeof e.type!=`string`?null:e.type===`builtin`&&Mae(e.name)?{type:`builtin`,name:e.name}:e.type===`url`&&typeof e.url==`string`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e.type===`text`&&typeof e.value==`string`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function Pae(e){if(!p9(e)||typeof e.id!=`string`||e.id.trim().length===0||typeof e.label!=`string`||e.label.trim().length===0||typeof e.createdAt!=`string`||e.createdAt.trim().length===0||!p9(e.target)||e.target.type!==`right-panel-resource`||typeof e.target.uri!=`string`||e.target.uri.trim().length===0)return null;let t=Nae(e.icon);return t?{createdAt:e.createdAt,icon:t,id:e.id.trim(),label:e.label.trim(),target:{type:`right-panel-resource`,uri:e.target.uri.trim()}}:null}function m9(e){if(!Array.isArray(e))return[];let t=new Map;return e.forEach(e=>{let n=Pae(e);n&&t.set(n.id,n)}),Array.from(t.values())}function Fae(e,t){return{createdAt:t,icon:e.icon,id:e.id,label:e.label,target:e.target}}function Iae(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function Lae(e){return{builtIn:!1,icon:e.icon,id:e.id,label:e.label,removable:!0,target:e.target}}function h9(e,t){let n=new Set(e.map(e=>e.id)),r=new Set(e.map(Iae).filter(e=>e!==null)),i=t.filter(e=>!n.has(e.id)&&!r.has(e.target.uri)).map(Lae);return[...e,...i]}var Rae=`nextclaw.side-dock.state`,zae=1;function g9(e){return!!e&&typeof e==`object`}var _9=N()(_i(e=>({isVisible:!0,pinnedItems:[],setVisible:t=>e({isVisible:t}),setPinnedItems:t=>e({pinnedItems:m9(t)})}),{name:Rae,version:zae,storage:vi(()=>window.localStorage),partialize:e=>({isVisible:e.isVisible,pinnedItems:e.pinnedItems}),merge:(e,t)=>{let n=g9(e)?m9(e.pinnedItems):[],r=g9(e)&&typeof e.isVisible==`boolean`?e.isVisible:!0;return{...t,isVisible:r,pinnedItems:n}}})),Bae={apps:Kr,docs:di,github:oi,"new-tab":pi,"panel-app":Ur,"service-apps":Ur},Vae=new Set([d9]),Hae=/^\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?(?:\u200D\p{Extended_Pictographic}(?:\uFE0F|\uFE0E)?)*$/u;function Uae(e){return Hae.test(e.trim())}function Wae({icon:e}){if(e.type===`url`)return(0,H.jsx)(`img`,{src:e.url,alt:``,className:`h-5 w-5 rounded object-cover`});if(e.type===`text`)return Uae(e.value)?(0,H.jsx)(`span`,{className:`flex h-7 w-7 items-center justify-center text-[20px] leading-none`,"aria-hidden":`true`,children:e.value}):(0,H.jsx)(`span`,{className:`max-w-7 truncate text-center text-[13px] font-semibold leading-none`,"aria-hidden":`true`,children:e.value});let t=Bae[e.name];return(0,H.jsx)(t,{className:`h-5 w-5`,"aria-hidden":`true`})}function v9({active:e,item:t,onOpen:n,onUnpin:r}){let{label:i}=t;return(0,H.jsxs)(ii,{children:[(0,H.jsxs)(`div`,{className:`group relative`,children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":i,title:i,"data-side-dock-item-id":t.id,onClick:()=>n(t),className:u(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,e?`bg-primary/10 text-primary`:`bg-transparent`),children:(0,H.jsx)(Wae,{icon:t.icon})})}),t.removable?(0,H.jsx)(`button`,{type:`button`,"aria-label":b(`sideDockUnpinItem`),title:b(`sideDockUnpinItem`),onClick:e=>{e.stopPropagation(),r(t)},className:`absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-background text-muted-foreground shadow-sm ring-1 ring-border/70 transition-colors hover:bg-muted hover:text-foreground group-hover:flex focus-visible:flex focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`,children:(0,H.jsx)(hi,{className:`h-3 w-3`,"aria-hidden":`true`})}):null]}),(0,H.jsx)(qr,{side:`left`,children:i})]})}function Gae({icon:e,label:t,onClick:n}){return(0,H.jsxs)(ii,{children:[(0,H.jsx)(ai,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,"aria-label":t,title:t,"data-side-dock-action":`hide`,onClick:n,className:u(`flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors`,`hover:bg-primary/10 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border`),children:(0,H.jsx)(e,{className:`h-5 w-5`,"aria-hidden":`true`})})}),(0,H.jsx)(qr,{side:`left`,children:t})]})}function y9(e){return e?.trim()??``}function b9(e){return e.target.type===`right-panel-resource`?e.target.uri:null}function x9(e,t,n,r=!1){if(!t||!n)return!1;let i=y9(b9(e)??void 0);if(!i)return!1;let a=y9(n.resourceUri);return a&&a===i||y9(n.currentUrl)===i?!0:r?!1:e.id===`docs`&&n.kind===`docs`}function Kae(e,t){if(!t)return!1;let n=y9(t.resourceUri),r=y9(t.currentUrl);return e.some(e=>{let t=y9(b9(e)??void 0);return t===n||t===r})}function S9(e){return Vae.has(e.id)}function qae({manager:e}){let t=_9(e=>e.pinnedItems),n=_9(e=>e.setVisible),{currentTab:r,isOpen:i}=Oi(),{confirm:a,ConfirmDialog:o}=On(),s=h9(f9(),t),c=s.filter(e=>!S9(e)),l=s.filter(S9),u=Kae(s,r),d=async()=>{await a({title:b(`sideDockHideConfirmTitle`),description:b(`sideDockHideConfirmDescription`),confirmLabel:b(`sideDockHideConfirmAction`),cancelLabel:b(`cancel`)})&&n(!1)};return(0,H.jsx)($r,{delayDuration:250,children:(0,H.jsxs)(`aside`,{"data-testid":`side-dock`,className:`z-30 flex h-full w-14 shrink-0 flex-col items-center gap-1 border-l border-border/60 bg-background/95 px-2 py-3`,children:[(0,H.jsx)(`div`,{className:`flex w-full flex-col items-center gap-1`,children:c.map(t=>(0,H.jsx)(v9,{active:x9(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id))}),l.length>0?(0,H.jsxs)(`div`,{"data-testid":`side-dock-utility`,className:`mt-auto flex w-full flex-col items-center gap-1`,children:[l.map(t=>(0,H.jsx)(v9,{active:x9(t,i,r,u),item:t,onOpen:e.openItem,onUnpin:t=>e.unpinItem(t.id)},t.id)),(0,H.jsx)(Gae,{icon:ho,label:b(`sideDockHide`),onClick:()=>{d()}})]}):null,(0,H.jsx)(o,{})]})})}var Jae=`pinned`,Yae=new Set([`apps`,`docs`,`github`,`new-tab`,`panel-app`,`service-apps`]);function C9(e){return e.trim()}function Xae(e){let t=0;return Array.from(C9(e)).forEach(e=>{t=t*31+e.charCodeAt(0)>>>0}),`${Jae}-${C9(e).replace(/[^a-zA-Z0-9]+/g,`-`).replace(/^-+|-+$/g,``).toLowerCase()||`resource`}-${t.toString(36)}`}function Zae(e){return e?.type===`builtin`&&Yae.has(e.name)?{type:`builtin`,name:e.name}:e?.type===`url`&&e.url.trim().length>0?{type:`url`,url:e.url.trim()}:e?.type===`text`&&e.value.trim().length>0?{type:`text`,value:e.value.trim()}:null}function Qae(e){return e.kind===`docs`?`docs`:e.kind===`home`?`new-tab`:e.kind===`apps`?e.resourceUri?.includes(`service-apps`)?`service-apps`:`apps`:e.kind===`panel-app`?`panel-app`:`apps`}var $ae=class{constructor(e){this.docBrowserManager=e,this.getItems=()=>h9(f9(),_9.getState().pinnedItems),this.openItem=async e=>{if(e.target.type===`right-panel-resource`){this.docBrowserManager.open(e.target.uri,{dockIcon:e.icon,title:e.label});return}e.target.type===`external-url`&&await gi.openExternalUrl(e.target.url)},this.getDockState=e=>{let t=this.getTabResourceUri(e);if(!t)return{canDock:!1,isDocked:!1,removable:!1};let n=this.findItemByUri(t);return{canDock:!0,isDocked:!!n,removable:n?.removable===!0}},this.pinTab=(e,t=new Date().toISOString())=>{let n=this.getTabResourceUri(e);!e||!n||this.findItemByUri(n)||this.pinItem({builtIn:!1,icon:Zae(e.dockIcon)??{type:`builtin`,name:Qae(e)},id:Xae(n),label:e.title.trim()||n,removable:!0,target:{type:`right-panel-resource`,uri:n}},t)},this.unpinTab=e=>{let t=this.getTabResourceUri(e),n=t?this.findItemByUri(t):void 0;n?.removable&&this.unpinItem(n.id)},this.pinItem=(e,t=new Date().toISOString())=>{if(!e.removable||e.target.type!==`right-panel-resource`)return;let n=C9(e.target.uri),r={...e,target:{type:`right-panel-resource`,uri:n}};this.setPinnedItems(i=>i.some(t=>t.id===e.id||C9(t.target.uri)===n)?i:[...i,Fae(r,t)])},this.unpinItem=e=>{this.setPinnedItems(t=>t.filter(t=>t.id!==e))},this.reorderPinnedItems=e=>{this.setPinnedItems(t=>{let n=new Map(t.map(e=>[e.id,e])),r=e.map(e=>n.get(e)).filter(e=>e!==void 0),i=new Set(r.map(e=>e.id)),a=t.filter(e=>!i.has(e.id));return[...r,...a]})},this.setPinnedItems=e=>{let{pinnedItems:t,setPinnedItems:n}=_9.getState();n(e(t))},this.getTabResourceUri=e=>{let t=e?.resourceUri??e?.currentUrl,n=t?C9(t):``;return n.length>0?n:null},this.findItemByUri=e=>{let t=C9(e);return this.getItems().find(e=>e.target.type===`right-panel-resource`&&C9(e.target.uri)===t)}}},eoe=new class{constructor(){this.resolveOpenTarget=e=>{let{activeTab:t,kind:n,url:r}=e,i=n??(r?void 0:t?.kind)??(r&&wi(r)?`docs`:`home`),a=r?.trim()||(!n&&t&&t.kind!==`docs`?t.currentUrl:i===`home`?`nextclaw://new-tab`:i===`docs`?Ai():`about:blank`),o=i===`docs`?Fi(a,`docs`):a;return{historyPolicy:`managed`,kind:i,title:i===`home`?b(`docBrowserHomeTitle`):Ti(o,i,i===`docs`?b(`docBrowserHelp`):`Detail`),url:o}},this.areUrlsEquivalent=(e,t,n,r)=>n===r?n===`docs`?bi(e)===bi(t):e===t:!1,this.usesManagedHistory=e=>e.currentUrl!==Pi}};function w9(e,t,n){return{...e,tabs:e.tabs.map(e=>e.id===t?n(e):e)}}function T9(e,t){return w9(e,e.activeTabId,t)}function toe(e,t,n){let r=t.resourceUri??t.url,i=n.resourceUri??n.url;return t.tabId===n.tabId&&t.kind===n.kind&&e.areUrlsEquivalent(r,i,t.kind,n.kind)}function E9(e,t){return{kind:t.kind,resourceUri:t.resourceUri??t.url,tabId:e,url:t.url}}function D9(e,t,n){let r=NR({entries:t.activeHistory,index:t.activeHistoryIndex},n,(t,n)=>toe(e,t,n));return{...t,activeHistory:[...r.entries],activeHistoryIndex:r.index}}function noe(e,t,n){for(let r=t.history.length-1;r>=0;--r)if(e.areUrlsEquivalent(t.history[r],n,t.kind,t.kind))return r;return-1}function O9(e,t,n){let r=t.tabs.find(e=>e.id===n.tabId);if(!r)return t;let i=n.resourceUri??n.url,a=e.resolveOpenTarget({activeTab:r,kind:n.kind,url:i}),o=noe(e,r,a.url),s=n.resourceUri!==void 0&&n.resourceUri===r.resourceUri;return w9({...t,activeTabId:r.id,isOpen:!0},r.id,e=>({...e,currentUrl:a.url,dedupeKey:a.dedupeKey,dockIcon:a.dockIcon??e.dockIcon,historyIndex:o>=0?o:e.historyIndex,kind:a.kind,resourceUri:a.resourceUri??a.url,title:s?e.title:a.title}))}function roe(e,t){return!e.isOpen&&e.tabs.length===1&&t?.kind===`home`&&t.currentUrl===`nextclaw://new-tab`}function k9(e,t,n,r){let{activate:i,dedupeKey:a,newTab:o,title:s}=r??{},c=a?.trim()||n.dedupeKey,l=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0],u=c?t.tabs.find(e=>e.dedupeKey===c):void 0;if(u){let a=w9(t,u.id,t=>Di(e,t,n,r,c)),o=i!==!1,s=o?u.id:t.activeTabId,l={...a,activeTabId:s,isOpen:!0};return o||u.id===t.activeTabId?D9(e,l,E9(u.id,n)):l}if(o||c||!l||l.kind!==n.kind){let i=Mi(n.url,n.kind,s??n.title,c,n.resourceUri??n.url,r?.dockIcon??n.dockIcon,n.contentParams);return roe(t,l)?{...t,isOpen:!0,tabs:[i],activeTabId:i.id,activeHistory:[ki(i)],activeHistoryIndex:0}:D9(e,{...t,isOpen:!0,tabs:[...t.tabs,i],activeTabId:i.id},ki(i))}return D9(e,{...T9(t,t=>Di(e,t,n,r,c)),isOpen:!0},E9(t.activeTabId,n))}function ioe(e,t,n,r){let i=t.tabs.find(e=>e.id===t.activeTabId)??t.tabs[0];return k9(e,t,{...e.resolveOpenTarget({activeTab:i,kind:r?.kind,url:n}),contentParams:r?.contentParams},r)}var aoe=class{constructor(e=eoe,t){this.routeResolver=e,this.onRightPanelOpened=t,this.setSnapshot=e=>{ji.getState().setSnapshot(e)},this.open=(e,t)=>{this.setSnapshot(n=>ioe(this.routeResolver,n,e,t)),this.onRightPanelOpened?.()},this.openTarget=(e,t)=>{this.setSnapshot(n=>k9(this.routeResolver,n,e,{...t,dedupeKey:t?.dedupeKey??e.dedupeKey,kind:t?.kind??e.kind,title:t?.title??e.title})),this.onRightPanelOpened?.()},this.reloadByDedupeKeys=e=>{let t=new Set(e);t.size!==0&&this.setSnapshot(e=>({...e,tabs:e.tabs.map(e=>t.has(e.dedupeKey??``)?{...e,navVersion:e.navVersion+1}:e)}))},this.openNewTab=()=>{this.open(void 0,{kind:Ci,newTab:!0})},this.close=()=>{this.setSnapshot(e=>({...e,isOpen:!1}))},this.toggleMode=()=>{this.setSnapshot(e=>({...e,mode:e.mode===`floating`?`docked`:`floating`})),this.onRightPanelOpened?.()},this.setDockedWidth=e=>{this.setSnapshot(t=>({...t,dockedWidth:Si(e)}))},this.navigate=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Mi(Ai(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id,isOpen:!0}}let n=T9(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...Ei(t,n.url),kind:n.kind,navVersion:t.navVersion+1,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?D9(this.routeResolver,n,ki(r)):n})},this.syncUrl=e=>{this.setSnapshot(t=>{if(!t.tabs.length){let e=Mi(Ai(),`docs`,`Docs`);return{...t,tabs:[e],activeTabId:e.id}}let n=T9(t,t=>{if(!this.routeResolver.usesManagedHistory(t))return t;let n=this.routeResolver.resolveOpenTarget({activeTab:t,kind:t.kind,url:e});return this.routeResolver.areUrlsEquivalent(t.currentUrl,n.url,t.kind,n.kind)?t:{...t,currentUrl:n.url,dedupeKey:n.dedupeKey,dockIcon:n.dockIcon,...Ei(t,n.url),kind:n.kind,resourceUri:n.resourceUri??n.url,title:n.title}}),r=n.tabs.find(e=>e.id===n.activeTabId);return r?D9(this.routeResolver,n,ki(r)):n})},this.goBack=()=>{this.setSnapshot(e=>{let t=PR({entries:e.activeHistory,index:e.activeHistoryIndex},`back`);return t?O9(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.goForward=()=>{this.setSnapshot(e=>{let t=PR({entries:e.activeHistory,index:e.activeHistoryIndex},`forward`);return t?O9(this.routeResolver,{...e,activeHistory:[...t.history.entries],activeHistoryIndex:t.history.index},t.entry):e})},this.closeTab=e=>{this.setSnapshot(t=>{if(t.tabs.length<=1)return{...xi(),isOpen:!1};let n=t.tabs.findIndex(t=>t.id===e);if(n<0)return t;let r=t.tabs.filter(t=>t.id!==e),i=t.activeTabId===e?r[Math.max(0,n-1)]?.id??r[0].id:t.activeTabId,a={...t,tabs:r,activeTabId:i},o=r.find(e=>e.id===i)??r[0],s=FR({entries:a.activeHistory,index:a.activeHistoryIndex},t=>t.tabId!==e,ki(o)),c={...a,activeHistory:[...s.entries],activeHistoryIndex:s.index};return t.activeTabId===e?D9(this.routeResolver,c,ki(o)):c})},this.setActiveTab=e=>{this.setSnapshot(t=>{if(!t.tabs.some(t=>t.id===e))return t;let n=t.tabs.find(t=>t.id===e);return n?D9(this.routeResolver,{...t,activeTabId:e,isOpen:!0},ki(n)):t})}}};function ooe(e){return e.activeWorkspacePanelKind!=null}var soe=class{constructor(){this.notificationManager=new Oae,this.inboxManager=new Cie,this.chatCompletionNotificationManager=new Tae(this.notificationManager),this.accountManager=new Aee,this.rightPanelResourceRouteResolver=new p1,this.notifyRightPanelOpened=()=>{let e=ji.getState().snapshot,t=$.getState().snapshot;ks.collapseSidebarForDenseRightPanels({isDocBrowserDocked:e.mode===`docked`,isDocBrowserOpen:e.isOpen,isWorkspacePanelOpen:ooe(t)})},this.docBrowserManager=new aoe(this.rightPanelResourceRouteResolver,this.notifyRightPanelOpened),this.appPackageOperationSettlementManager=new T$(this.docBrowserManager),this.sideDockManager=new $ae(this.docBrowserManager),this.chatComposerIntentManager=new xae,this.chatDraftIntentManager=new bae,this.serviceActionAuthorizationManager=new n$,this.panelAppBridgeManager=new E1(this.serviceActionAuthorizationManager),this.remoteAccessManager=new cs({accountManager:this.accountManager})}},A9=null;function j9(){return A9??=new soe,A9}function M9(){return j9()}var N9=globalThis,P9=N9.__NEXTCLAW_APP_PRESENTER_CONTEXT__??(0,V.createContext)(null);N9.__NEXTCLAW_APP_PRESENTER_CONTEXT__=P9;function coe({children:e}){let t=(0,V.useMemo)(()=>j9(),[]);return(0,H.jsx)(P9.Provider,{value:t,children:e})}function F9(){let e=(0,V.useContext)(P9);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}function loe(){let e=F9();return(0,V.useEffect)(()=>(e.chatCompletionNotificationManager.start(),()=>{e.chatCompletionNotificationManager.stop()}),[e.chatCompletionNotificationManager]),null}var uoe=`NextClaw`,doe=[{prefix:`/marketplace/mcp`,key:`marketplaceMcpPageTitle`},{prefix:`/marketplace/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/marketplace`,key:`marketplace`},{prefix:`/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/cron`,key:`cronPageTitle`},{prefix:`/agents`,key:`agentsPageTitle`},{prefix:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/updates`,key:`runtimeUpdatesPageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function foe(e,t){return e===t||e.startsWith(`${t}/`)}function poe(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of doe)if(foe(t,e))return b(n);return b(`settings`)}function moe(e){let t=e.toLowerCase();return t===`localhost`||t.endsWith(`.localhost`)||t===`::1`||t===`[::1]`||t.startsWith(`127.`)}function hoe(e){let t=e?.host.trim(),n=e?.hostname.trim(),r=e?.port.trim();return!t||!n?null:moe(n)?r||null:t}function goe(e,t){let n=hoe(t);return`${uoe}${n?` ${n}`:``} - ${poe(e)}`}var I9={...C1,...Fn};function _oe({children:e,sideDockManager:t}){let{isOpen:n,mode:r}=Oi();Nn();let{pathname:i}=_e(),a=ce(),o=M9(),{language:s}=jn(),{isMobile:c}=c8(),l=K7(),u=_9(e=>e.isVisible);_9(e=>e.pinnedItems);let d={getDockState:t.getDockState,pinTab:t.pinTab,unpinTab:t.unpinTab},f=(0,V.useCallback)(e=>{let t=R$(e);if(t)return[{key:`chat`,items:[{key:`add-to-chat`,icon:(0,H.jsx)(to,{className:`h-4 w-4`}),label:b(`docBrowserAddToChat`),restoreFocus:!1,onSelect:()=>{let e=i===`/chat`||i.startsWith(`/chat/`),n=i===`/chat`?null:$7(i.slice(6));o.chatComposerIntentManager.requestUiResourceReference({targetSessionKey:e?n:null,reference:t}),e||a(Q7)}}]}]},[a,i,o]);return(0,V.useEffect)(()=>{document.title=goe(i,window.location)},[i,s]),c&&l!==`win32`?(0,H.jsx)(Yie,{pathname:i,isDocBrowserOpen:n,docBrowserDockControls:d,docBrowserRenderers:I9,docBrowserTabMenuGroups:f,topbarLeadingInset:l===`darwin`?`4.75rem`:void 0,children:e}):(0,H.jsx)(Qie,{pathname:i,isMobileLayout:c,isDocBrowserOpen:n,docBrowserMode:r,docBrowserDockControls:d,docBrowserRenderers:I9,docBrowserTabMenuGroups:f,sideDock:u?(0,H.jsx)(qae,{manager:t}):null,children:e})}function voe({children:e}){let t=M9();return(0,H.jsx)(Ni,{manager:t.docBrowserManager,children:(0,H.jsx)(_oe,{sideDockManager:t.sideDockManager,children:e})})}function yoe(){let{isMobile:e}=c8();return e?(0,H.jsx)(Xie,{}):(0,H.jsx)(he,{to:`/model`,replace:!0})}var L9=new Intl.NumberFormat;function boe({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:r,defaultRuntimeLabel:i,onOpenChange:a,onEdit:o}){if(!e)return null;let s=R9(e.model,t?.model),c=xoe({agent:e,defaults:t,runtimeOptions:n,defaultRuntime:r,defaultRuntimeLabel:i}),l=z9(e.contextTokens,t?.contextTokens??2e5),u=z9(e.reservedContextTokens,t?.reservedContextTokens),d=z9(e.maxToolIterations,t?.maxToolIterations??1e3),f=R9(e.thinkingDefault,t?.thinkingDefault??`off`),p=V9(e.runtimeConfig??e.engineConfig,t?.engineConfig),m=V9(e.models,t?.models);return(0,H.jsx)(Ir,{open:e!==null,onOpenChange:a,children:(0,H.jsxs)(zr,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-popover p-0 sm:max-h-[720px] sm:max-w-2xl`,children:[(0,H.jsx)(`div`,{className:`shrink-0 px-5 pb-3 pt-5`,children:(0,H.jsx)(Lr,{className:`text-left`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(dz,{agentId:e.id,displayName:e.displayName,avatarUrl:e.avatarUrl,className:`h-10 w-10 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(Br,{className:`truncate text-base`,children:e.displayName?.trim()||e.id}),(0,H.jsxs)(Nr,{className:`truncate text-xs`,children:[`@`,e.id]})]})]})})}),(0,H.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-5 py-3`,children:[(0,H.jsxs)(U9,{icon:Zi,title:b(`agentsDetailsIdentitySection`),children:[(0,H.jsx)(W9,{label:b(`agentsDetailsFieldDisplayName`),value:e.displayName?.trim()||e.id}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldId`),value:e.id,mono:!0}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldDescription`),value:e.description?.trim()||b(`agentsDetailsEmptyValue`),wide:!0}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldWorkspace`),value:e.workspace??b(`agentsDetailsUnsetValue`),mono:!0,wide:!0})]}),(0,H.jsxs)(U9,{icon:Or,title:b(`agentsDetailsRuntimeSection`),children:[(0,H.jsx)(W9,{label:b(`agentsDetailsFieldModel`),value:s.value,source:s.source}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldRuntime`),value:c.value,source:c.source}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldRuntimeConfig`),value:p.value,source:p.source,mono:!0,prewrap:!0})]}),(0,H.jsxs)(U9,{icon:uee,title:b(`agentsDetailsContextSection`),children:[(0,H.jsx)(W9,{label:b(`agentsDetailsFieldContextTokens`),value:l.value,source:l.source}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldReservedContextTokens`),value:u.value,source:u.source}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldMaxToolIterations`),value:d.value,source:d.source})]}),(0,H.jsxs)(U9,{icon:ea,title:b(`agentsDetailsBehaviorSection`),children:[(0,H.jsx)(W9,{label:b(`agentsDetailsFieldThinkingDefault`),value:f.value,source:f.source}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldModelOverrides`),value:m.value,source:m.source,mono:!0,prewrap:!0}),(0,H.jsx)(W9,{label:b(`agentsDetailsFieldAvatar`),value:e.avatar??b(`agentsDetailsUnsetValue`),mono:!0})]})]}),(0,H.jsxs)(Dr,{className:`shrink-0 px-5 pb-4 pt-2`,children:[(0,H.jsx)(L,{type:`button`,variant:`ghost`,onClick:()=>a(!1),children:b(`cancel`)}),(0,H.jsxs)(L,{type:`button`,variant:`primary`,className:`px-4`,onClick:()=>o(e),children:[(0,H.jsx)(yo,{className:`mr-2 h-4 w-4`}),b(`agentsDetailsEditAction`)]})]})]})})}function R9(e,t){let n=e?.trim();return n?{value:n,source:`override`}:{value:t?.trim()||b(`agentsDetailsUnsetValue`),source:`default`}}function z9(e,t){return typeof e==`number`?{value:L9.format(e),source:`override`}:{value:typeof t==`number`?L9.format(t):b(`agentsDetailsUnsetValue`),source:`default`}}function xoe(e){let{agent:t,defaults:n,runtimeOptions:r,defaultRuntime:i,defaultRuntimeLabel:a}=e,o=t.runtime?.trim()||t.engine?.trim();if(o)return{value:B9(o,r,a),source:`override`};let s=n?.engine?.trim()||i;return{value:s?B9(s,r,a):a,source:`default`}}function B9(e,t,n){let r=EL(e);return r?t.find(e=>e.value===r)?.label??OL(r):n}function V9(e,t){return H9(e)?{value:JSON.stringify(e,null,2),source:`override`}:{value:H9(t)?JSON.stringify(t,null,2):b(`agentsDetailsUnsetValue`),source:`default`}}function H9(e){return!!(e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length>0)}function U9(e){let{icon:t,title:n,children:r}=e;return(0,H.jsxs)(`section`,{className:`space-y-2 border-t border-border/60 pt-3 first:border-t-0 first:pt-0`,children:[(0,H.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold leading-5 text-foreground`,children:[(0,H.jsx)(t,{className:`h-3.5 w-3.5 text-muted-foreground`}),n]}),(0,H.jsx)(`dl`,{className:`grid min-w-0 gap-x-6 gap-y-2.5 pl-5 sm:grid-cols-2`,children:r})]})}function W9(e){let{label:t,value:n,source:r,mono:i=!1,prewrap:a=!1,wide:o=!1}=e,s=a&&n.trim().startsWith(`{`),c=i&&(!a||s);return(0,H.jsxs)(`div`,{className:u(`grid min-w-0 grid-cols-[10rem_minmax(0,1fr)] items-baseline gap-x-2`,(o||s)&&`sm:col-span-2`),children:[(0,H.jsx)(`dt`,{className:`flex min-w-0 items-baseline leading-5`,children:(0,H.jsx)(`span`,{className:`whitespace-nowrap text-xs font-medium text-muted-foreground`,children:t})}),(0,H.jsxs)(`dd`,{className:u(`min-w-0 break-words text-xs leading-5 text-foreground`,s?`max-h-28 overflow-auto whitespace-pre-wrap rounded bg-muted/50 px-2 py-1.5 text-left`:``),children:[(0,H.jsx)(`span`,{className:c?`font-mono`:void 0,children:n}),r?(0,H.jsx)(Soe,{source:r}):null]})]})}function Soe({source:e}){return(0,H.jsxs)(`span`,{className:u(`ml-1 whitespace-nowrap text-xs font-normal leading-5`,e===`override`?`text-blue-500`:`text-muted-foreground`),children:[`(`,b(e===`override`?`agentsDetailsAgentOverride`:`agentsDetailsInheritedDefault`),`)`]})}function Coe({form:e,disabled:t=!1,onChange:n}){return(0,H.jsxs)(`details`,{className:`group rounded-2xl border border-border bg-card`,children:[(0,H.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold text-foreground [&::-webkit-details-marker]:hidden`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(Eo,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`truncate`,children:b(`agentsAdvancedConfigToggle`)})]}),(0,H.jsx)($n,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,H.jsxs)(`div`,{className:`space-y-4 border-t border-border/60 px-4 py-4`,children:[(0,H.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:b(`agentsAdvancedConfigDescription`)}),(0,H.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:(0,H.jsx)(woe,{label:b(`agentsAdvancedContextTokensLabel`),value:e.contextTokens,min:1e3,step:1e3,disabled:t,onChange:e=>n({contextTokens:e})})})]})]})}function woe(e){let{label:t,value:n,min:r,step:i,disabled:a,onChange:o}=e;return(0,H.jsxs)(`label`,{className:`space-y-2 text-sm font-medium text-foreground`,children:[(0,H.jsx)(`span`,{children:t}),(0,H.jsx)(vt,{type:`number`,min:r,step:i,value:n,disabled:a,placeholder:b(`agentsAdvancedInheritPlaceholder`),"aria-label":t,onChange:e=>o(e.target.value)})]})}function Toe(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``,contextTokens:Eoe(e.contextTokens)}}function Eoe(e){return typeof e==`number`?String(e):``}var Doe=SF(`15rem`);function Ooe(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function koe({id:e,value:t,onChange:n,options:r,disabled:i=!1,placeholder:a,className:o,inputClassName:s,emptyText:c,createText:l,toggleLabel:d,maxItems:f=1/0,onEnter:p}){let[m,h]=(0,V.useState)(!1),g=(0,V.useRef)(null);(0,V.useEffect)(()=>{i&&m&&h(!1)},[i,m]);let _=(0,V.useMemo)(()=>Ooe(r),[r]),v=t.trim().toLowerCase(),y=(0,V.useMemo)(()=>{let e=_.map((e,t)=>({option:e,index:t}));v.length>0&&e.sort((e,t)=>{let n=e.option.toLowerCase(),r=t.option.toLowerCase(),i=n===v?0:n.startsWith(v)?1:n.includes(v)?2:3,a=r===v?0:r.startsWith(v)?1:r.includes(v)?2:3;return i===a?e.index-t.index:i-a});let t=e.map(e=>e.option);return Number.isFinite(f)?t.slice(0,Math.max(1,f)):t},[_,v,f]),b=t.trim().length>0&&_.some(e=>e===t.trim()),x=()=>h(!1);return(0,H.jsxs)(wF,{open:m&&!i,onOpenChange:e=>h(!i&&e),children:[(0,H.jsx)(EF,{asChild:!0,children:(0,H.jsxs)(`div`,{ref:g,className:u(`relative`,o),children:[(0,H.jsx)(vt,{id:e,value:t,disabled:i,onFocus:()=>{i||h(!0)},onChange:e=>{n(e.target.value),!m&&!i&&h(!0)},onKeyDown:e=>{e.key===`Enter`&&(p&&(e.preventDefault(),p()),x())},placeholder:a,className:u(`pr-10`,s)}),(0,H.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>h(e=>!e),disabled:i,className:u(`absolute inset-y-0 right-0 inline-flex w-10 items-center justify-center`,i?`cursor-not-allowed text-gray-300`:`text-gray-400 hover:text-gray-600`),"aria-label":d,children:(0,H.jsx)(ca,{className:`h-4 w-4`})})]})}),(0,H.jsx)(DF,{align:`start`,className:`flex w-[var(--radix-popover-trigger-width)] min-w-[12rem] flex-col overflow-hidden rounded-xl border border-gray-200 p-0 shadow-lg`,onInteractOutside:e=>{e.target instanceof Node&&g.current?.contains(e.target)&&e.preventDefault()},onOpenAutoFocus:e=>e.preventDefault(),style:{maxHeight:Doe},children:(0,H.jsxs)(`div`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto py-1`,children:[!b&&t.trim().length>0&&(0,H.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(t.trim()),x()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,H.jsx)(wr,{className:`h-4 w-4 text-transparent`}),(0,H.jsx)(`span`,{className:`truncate text-gray-700`,children:l.replace(`{value}`,t.trim())})]}),y.map(e=>(0,H.jsxs)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:()=>{n(e),x()},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-gray-50`,children:[(0,H.jsx)(wr,{className:u(`h-4 w-4`,e===t.trim()?`text-primary`:`text-transparent`)}),(0,H.jsx)(`span`,{className:`truncate text-gray-700`,children:e})]},e)),y.length===0&&t.trim().length===0&&(0,H.jsx)(`div`,{className:`px-3 py-2 text-sm text-gray-500`,children:c})]})})]})}var Aoe=`provider/model`;function G9(e){let t=new Set;for(let n of e){let e=n.trim();e&&t.add(e)}return[...t]}function K9({id:e,value:t,onChange:n,providerCatalog:r,disabled:i=!1,providerPlaceholder:a,modelPlaceholder:o,className:s}){let[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(``),f=r.length>0,p=o??Aoe,m=(0,V.useMemo)(()=>new Map(r.map(e=>[e.name,e])),[r]),h=m.get(c),g=(0,V.useMemo)(()=>h?.aliases??[],[h]),_=(0,V.useMemo)(()=>G9(h?.models??[]),[h]);return(0,V.useEffect)(()=>{let e=t.trim();if(!f){l(``),d(e);return}if(!e){d(``),l(e=>m.has(e)?e:``);return}let n=B3(e,r)??``,i=m.get(n)?.aliases??[];l(n),d(n?M3(e,i):e)},[f,r,m,t]),f?(0,H.jsxs)(`div`,{className:s,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,H.jsx)(`div`,{className:`sm:w-[38%] sm:min-w-[170px]`,children:(0,H.jsxs)(xr,{value:c,onValueChange:e=>{let t=G9(m.get(e)?.models??[])[0]??``;if(l(e),d(t),!t){n(``);return}n(N3(m.get(e)?.prefix??e,t))},disabled:i,children:[(0,H.jsx)(pr,{className:`h-10 w-full rounded-xl`,children:(0,H.jsx)(or,{placeholder:a??b(`providersSelectPlaceholder`)})}),(0,H.jsx)(gr,{children:r.map(e=>(0,H.jsx)(yr,{value:e.name,children:e.displayName},e.name))})]})}),(0,H.jsx)(`span`,{className:`hidden h-10 items-center justify-center leading-none text-lg font-semibold text-gray-300 sm:inline-flex`,children:`/`}),(0,H.jsx)(koe,{id:e,value:u,onChange:e=>{if(!h){let t=e.trim();d(t),n(t);return}let t=M3(e,g);d(t),n(t?N3(h.prefix,t):``)},options:_,disabled:i||!c,placeholder:p,className:`sm:flex-1`,inputClassName:`h-10 rounded-xl`,emptyText:b(`modelPickerNoOptions`),createText:b(`modelPickerUseCustom`),toggleLabel:b(`modelPickerToggleOptions`)},c)]}),(0,H.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:b(`modelInputCustomHint`)})]}):(0,H.jsxs)(`div`,{className:s,children:[(0,H.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 px-4 py-3`,children:[(0,H.jsx)(`p`,{className:`text-sm font-semibold text-amber-950`,children:b(`providersEmptyTitle`)}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-amber-900`,children:b(`providersEmptyDescription`)})]}),(0,H.jsx)(vt,{id:e,value:t,disabled:i,onChange:e=>n(e.target.value),placeholder:p,className:`mt-3 h-10 rounded-xl`}),(0,H.jsx)(`p`,{className:`mt-2 text-xs text-gray-500`,children:b(`modelInputCustomHint`)})]})}var q9=V.forwardRef(({className:e,...t},n)=>(0,H.jsx)(`textarea`,{className:u(`flex min-h-28 w-full rounded-xl border border-border/75 bg-card px-3.5 py-2.5 text-sm text-foreground placeholder:text-muted-foreground/55 placeholder:font-normal transition-colors focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));q9.displayName=`Textarea`;function joe(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=EL(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:OL(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function Moe({value:e,disabled:t=!1,runtimeOptions:n,defaultRuntime:r,onChange:i}){let a=e.trim()?EL(e):``,o=joe({runtimeOptions:n,currentRuntime:e}),s=o.find(e=>e.value===a)??null,c=s?.reasonMessage?.trim()||(s?.ready===!1?b(`agentsRuntimeUnavailableHelp`):``);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(xr,{value:a||r,onValueChange:e=>i(e===r?``:e),disabled:t,children:[(0,H.jsx)(pr,{"aria-label":b(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,H.jsx)(or,{placeholder:b(`agentsRuntimeSelectPlaceholder`)})}),(0,H.jsx)(gr,{className:`rounded-xl`,children:o.map(e=>(0,H.jsx)(yr,{value:e.value,disabled:e.ready===!1&&e.value!==a,className:`rounded-lg`,children:e.label},e.value))})]}),c?(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c}):null]})}function Noe({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,H.jsx)(Ir,{open:e!==null,onOpenChange:a,children:e?(0,H.jsx)(Poe,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function Poe(e){let{agent:t,pending:n,providerCatalog:r,runtimeOptions:i,defaultRuntime:a,onOpenChange:o,onSubmit:s}=e,[c,l]=(0,V.useState)(Toe(t));return(0,H.jsxs)(zr,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-popover p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,H.jsx)(`div`,{className:`shrink-0 border-b border-border px-6 py-6`,children:(0,H.jsxs)(Lr,{className:`text-left`,children:[(0,H.jsx)(Br,{children:b(`agentsEditDialogTitle`)}),(0,H.jsx)(Nr,{children:b(`agentsEditDialogDescription`)})]})}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(Dn,{tone:`warning`,title:b(`agentsEditHomeReadonly`),description:b(`agentsEditHomeReadonlyHint`),children:(0,H.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:t.workspace??`-`})}),(0,H.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,H.jsx)(vt,{value:c.displayName,onChange:e=>l(t=>({...t,displayName:e.target.value})),placeholder:b(`agentsFormNamePlaceholder`)}),(0,H.jsx)(q9,{value:c.description,onChange:e=>l(t=>({...t,description:e.target.value})),placeholder:b(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,H.jsx)(vt,{value:c.avatar,onChange:e=>l(t=>({...t,avatar:e.target.value})),placeholder:b(`agentsFormAvatarPlaceholder`)}),(0,H.jsx)(K9,{value:c.model,onChange:e=>l(t=>({...t,model:e})),providerCatalog:r,disabled:n,className:`md:col-span-2`}),(0,H.jsx)(Moe,{value:c.runtime,onChange:e=>l(t=>({...t,runtime:e})),runtimeOptions:i,defaultRuntime:a,disabled:n})]}),(0,H.jsx)(Coe,{form:c,disabled:n,onChange:e=>l(t=>({...t,...e}))})]})}),(0,H.jsxs)(Dr,{className:`shrink-0 border-t border-border px-6 py-5`,children:[(0,H.jsx)(L,{type:`button`,variant:`ghost`,onClick:()=>o(!1),disabled:n,children:b(`cancel`)}),(0,H.jsxs)(L,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>s(t.id,c),disabled:n,children:[(0,H.jsx)(yo,{className:`mr-2 h-4 w-4`}),b(`agentsEditSaveAction`)]})]})]})}var Foe=`请直接创建一个默认示例 Agent,不要问我问题。创建完成后,简单告诉我它能做什么。`;function Ioe(e){let t=e.trim();if(!t)return null;let n=Number(t);if(!Number.isFinite(n))throw Error(b(`agentsAdvancedInvalidNumberError`));return Math.trunc(n)}function Loe(e){return{displayName:e.displayName,description:e.description,avatar:e.avatar,model:e.model,...e.runtime.trim()?{runtime:e.runtime.trim()}:{runtime:``},contextTokens:Ioe(e.contextTokens)}}function J9(e){let{icon:t,label:n,disabled:r=!1,destructive:i=!1,onClick:a}=e;return(0,H.jsxs)(`button`,{type:`button`,className:u(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,i?`text-destructive hover:bg-destructive/10`:`text-foreground hover:bg-muted`),onClick:a,disabled:r,children:[(0,H.jsx)(t,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:n})]})}function Roe(e){let{agent:t,runtimeOptions:n,defaultRuntimeLabel:r,updatePending:i,deletePending:a,onStartChat:o,onView:s,onEdit:c,onDelete:l}=e,u=t.runtime?.trim()||t.engine?.trim()||``,d=u?n.find(e=>e.value===EL(u))?.label??OL(u):r;return(0,H.jsx)(ys,{className:`group overflow-hidden border border-border bg-card shadow-none transition-colors duration-200 hover:border-border/80`,children:(0,H.jsxs)(Cs,{className:`relative flex h-full flex-col gap-3 px-3.5 py-3.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-16`,children:[(0,H.jsx)(dz,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-9 w-9 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`truncate text-sm font-semibold text-foreground`,children:t.displayName?.trim()||t.id}),t.builtIn?(0,H.jsxs)(Ii,{tone:`warning`,className:`h-5 gap-1 border-amber-200 bg-amber-50 px-1.5 text-[10px] text-amber-700`,children:[(0,H.jsx)(ko,{className:`h-3 w-3`}),b(`agentsCardBuiltInTag`)]}):null]}),(0,H.jsxs)(`div`,{className:`truncate text-xs text-muted-foreground`,children:[`@`,t.id]})]})]}),(0,H.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 flex items-center gap-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,children:[(0,H.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-muted-foreground hover:text-foreground`,"aria-label":b(`agentsCardStartChat`),title:b(`agentsCardStartChat`),onClick:o,children:(0,H.jsx)(eo,{className:`h-4 w-4`})}),(0,H.jsxs)(wF,{children:[(0,H.jsx)(TF,{asChild:!0,children:(0,H.jsx)(L,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-muted-foreground hover:text-foreground`,"aria-label":b(`chatSessionMoreActions`),title:b(`chatSessionMoreActions`),children:(0,H.jsx)(Ea,{className:`h-4 w-4`})})}),(0,H.jsxs)(DF,{align:`end`,className:`w-44 p-1.5`,children:[(0,H.jsx)(J9,{icon:Oa,label:b(`agentsViewDetailsAction`),onClick:s}),(0,H.jsx)(J9,{icon:yo,label:b(`agentsEditAction`),onClick:c,disabled:i}),t.builtIn?null:(0,H.jsx)(J9,{icon:Vo,label:b(`agentsRemoveAction`),onClick:l,disabled:a,destructive:!0})]})]})]}),(0,H.jsx)(`p`,{className:`line-clamp-2 min-h-10 text-sm leading-5 text-muted-foreground`,children:t.description?.trim()||(t.builtIn?b(`agentsCardBuiltInSummary`):b(`agentsCardCustomSummary`))}),(0,H.jsxs)(`div`,{className:`mt-auto grid gap-2 border-t border-border/60 pt-2 text-xs text-muted-foreground`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(Or,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/60`}),(0,H.jsx)(`span`,{className:`truncate`,children:d})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(Ya,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground/60`}),(0,H.jsx)(`span`,{className:`truncate`,children:t.workspace??`-`})]})]})]})})}function zoe(){let e=tI(),t=fz(),n=d6(),r=p6(),i=m6(),a=o9(),o=pz(),s=mz(),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null),f=(0,V.useMemo)(()=>t.data?.agents??[],[t.data?.agents]),p=(0,V.useMemo)(()=>[...f].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[f]),m=(0,V.useMemo)(()=>H3({config:n.data,providersView:r.data,templatesView:i.data,onlyConfigured:!0}),[n.data,r.data,i.data]),h=(0,V.useMemo)(()=>kL(a.data?.options??[]),[a.data?.options]),g=(0,V.useMemo)(()=>EL(a.data?.defaultType??`native`),[a.data?.defaultType]),_=(0,V.useMemo)(()=>h.find(e=>e.value===g)?.label??OL(g),[g,h]),v=n.data?.agents.defaults,y=e=>{l(e)},x=e=>{d(e)},S=async(e,t)=>{let n;try{n=Loe(t)}catch(e){R.error(e instanceof Error?e.message:b(`agentsAdvancedParseFailed`));return}await o.mutateAsync({agentId:e,data:n}),d(null)},C=t=>{e.chatSessionListManager.startAgentDraftChat(t.id,DL(t,g))},w=()=>{e.chatSessionListManager.startAgentDraftChat(`main`,g,Foe)};return(0,H.jsxs)(Jt,{className:`space-y-6`,children:[(0,H.jsx)(ft,{headingLevel:1,title:b(`agentsHeroEyebrow`),description:b(`agentsHeroDescription`),actions:(0,H.jsxs)(L,{type:`button`,variant:`primary`,className:`h-9 shrink-0 rounded-xl px-4 text-sm font-semibold`,onClick:w,children:[(0,H.jsx)(pi,{className:`mr-2 h-4 w-4`}),b(`agentsCreateButton`)]})}),(0,H.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:t.isLoading?(0,H.jsx)(ys,{className:`md:col-span-2 xl:col-span-3 border-dashed border-border bg-card/70`,children:(0,H.jsx)(Cs,{className:`py-14 text-center text-sm text-muted-foreground`,children:b(`agentsLoading`)})}):p.length===0?(0,H.jsx)(ys,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-border bg-gradient-subtle`,children:(0,H.jsxs)(Cs,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,H.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-card/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,H.jsx)(Zi,{className:`h-8 w-8 text-warning`})}),(0,H.jsx)(`div`,{className:`text-lg font-semibold text-foreground`,children:b(`agentsEmpty`)}),(0,H.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-muted-foreground`,children:b(`agentsEmptyDescription`)}),(0,H.jsxs)(L,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:w,children:[(0,H.jsx)(pi,{className:`mr-2 h-4 w-4`}),b(`agentsCreateButton`)]})]})}):p.map(e=>(0,H.jsx)(Roe,{agent:e,runtimeOptions:h,defaultRuntimeLabel:_,updatePending:o.isPending,deletePending:s.isPending,onStartChat:()=>C(e),onView:()=>y(e),onEdit:()=>x(e),onDelete:()=>s.mutate({agentId:e.id})},e.id))}),(0,H.jsx)(boe,{agent:c,defaults:v,runtimeOptions:h,defaultRuntime:g,defaultRuntimeLabel:_,onOpenChange:e=>{e||l(null)},onEdit:e=>{l(null),d(e)}}),(0,H.jsx)(Noe,{agent:u,pending:o.isPending,providerCatalog:m,runtimeOptions:h,defaultRuntime:g,onOpenChange:e=>{!e&&!o.isPending&&d(null)},onSubmit:S})]})}var Y9=`max-w-[min(1180px,100%)]`;function Boe(e){let{routeSessionKey:t,syncRouteSessionSelection:n}=e;(0,V.useLayoutEffect)(()=>{n(t)},[t,n])}function Voe({view:e,confirmDialog:t}){let{isMobile:n}=c8();return(0,H.jsxs)(`div`,{className:`h-full flex`,children:[n?null:(0,H.jsx)(X7,{}),e===`chat`?n?(0,H.jsx)(Zie,{}):(0,H.jsx)(i7,{}):(0,H.jsx)(`section`,{className:`flex-1 min-h-0 overflow-hidden bg-background`,children:e===`inbox`?(0,H.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col py-4 sm:px-6 sm:py-5 ${Y9}`,children:(0,H.jsx)(Aie,{})}):e===`panel-app`?(0,H.jsx)(w1,{}):e===`cron`?(0,H.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,H.jsx)(`div`,{className:`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${Y9}`,children:(0,H.jsx)(vre,{})})}):e===`agents`?(0,H.jsx)(`div`,{className:`h-full overflow-auto custom-scrollbar`,children:(0,H.jsx)(`div`,{className:`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${Y9}`,children:(0,H.jsx)(zoe,{})})}):(0,H.jsx)(`div`,{className:`h-full overflow-hidden`,children:(0,H.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full flex-col px-4 py-4 sm:px-6 sm:py-5 ${Y9}`,children:(0,H.jsx)(aQ,{forcedType:`skills`})})})}),t]})}function Hoe(e){let t=tI(),n=d6(),r=p6(),i=m6(),a=cL({limit:200}),o=o9(),s=e.sessionKey?.trim()||`draft-session`,c=lL({sessionId:s});(0,V.useEffect)(()=>{t.chatQueryManager.syncSnapshot({configQuery:n,providersQuery:r,providerTemplatesQuery:i,sessionsQuery:a,sessionTypesQuery:o,sessionSkillsSessionId:s,sessionSkillsQuery:c})},[n,t.chatQueryManager,r,s,c,a,o,i])}function Uoe(){let e=tI();(0,V.useEffect)(()=>I.eventBus.on(c.uiShowContent,t=>{e.chatThreadManager.handleUiShowContentEvent(t)}),[e])}function Woe(){let{sessionId:e}=le(),t=(0,V.useMemo)(()=>$7(e),[e]);return{routeSessionKey:t,sessionKey:t??void 0}}function Goe(){let e=tI(),{confirm:t,ConfirmDialog:n}=On(),r=_e(),i=ce();return(0,V.useEffect)(()=>{e.chatUiManager.syncState({pathname:r.pathname}),e.chatUiManager.bindActions({navigate:i,confirm:t})},[t,r.pathname,i,e]),(0,H.jsx)(n,{})}function Koe({view:e}){let t=F9();return(0,H.jsx)(eI,{presenter:(0,V.useMemo)(()=>new yae(t),[t]),children:(0,H.jsx)(qoe,{view:e})})}function qoe({view:e}){let t=F9(),n=tI(),r=Goe(),{routeSessionKey:i,sessionKey:a}=Woe(),o=$(e=>{let{snapshot:t}=e;return t.workspacePanelParentKey!==(a??null)||t.activeWorkspacePanelKind!==`child-session`?null:t.activeChildSessionKey?.trim()||null});return(0,V.useEffect)(()=>(t.chatCompletionNotificationManager.syncVisibleSessions([a,o]),()=>{t.chatCompletionNotificationManager.syncVisibleSessions([])}),[t.chatCompletionNotificationManager,a,o]),Hoe({sessionKey:a??null}),Boe({routeSessionKey:i,syncRouteSessionSelection:n.chatSessionListManager.syncRouteSessionSelection}),Uoe(),(0,H.jsx)(Voe,{view:e,confirmDialog:r})}function X9({view:e}){return(0,H.jsx)(Koe,{view:e})}function Joe(e){let t=e.trim().toLowerCase();return t?!t.startsWith(`skills`):!0}function Yoe(e,t){t.startsWith(`mcp`)&&(e?.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}))}function Xoe(e,t){e&&Joe(t)&&e.invalidateQueries({queryKey:[`config`]}),Yoe(e,t)}function Z9(e){let t=e.trim().replace(/\\/g,`/`).replace(/\/+$/g,``);return/^[a-z]:/i.test(t)?t.toLowerCase():t}function Zoe(e,t){if(!e)return;let n=Z9(t);e.invalidateQueries({predicate:e=>e.queryKey[0]===`server-path-browse`&&typeof e.queryKey[1]==`string`&&Z9(e.queryKey[1])===n})}function Qoe(e){let t=(0,V.useRef)(!1);(0,V.useEffect)(()=>{let n=I.eventBus.on(c.connectionOpen,()=>{ct.handleConnectionRestored(),Ne.refreshAfterRealtimeReconnect(),t.current&&(t.current=!1,e?.invalidateQueries({queryKey:[`ncp-sessions`]}))}),r=I.eventBus.on(c.connectionClose,()=>{ct.handleConnectionInterrupted(null),t.current=!0}),i=I.eventBus.on(c.connectionError,e=>{ct.handleConnectionInterrupted(e?.message??null),t.current=!0}),a=I.eventBus.on(c.configUpdated,({path:t})=>{Xoe(e,t)}),o=I.eventBus.on(c.serverPathChanged,({directoryPath:t})=>Zoe(e,t)),s=I.eventBus.on(c.runtimeUpdateSnapshot,e=>{Ne.reportSnapshot(e)}),l=I.eventBus.on(c.sessionRunStatus,t=>{_n(e,{type:`session.run-status`,payload:t})}),u=I.eventBus.on(c.sessionSummaryUpsert,t=>{_n(e,{type:`session.summary.upsert`,payload:t})}),d=I.eventBus.on(c.sessionSummaryDelete,t=>{_n(e,{type:`session.summary.delete`,payload:t})}),f=I.eventBus.on(c.error,e=>{console.error(`Realtime transport error:`,e.message)});return()=>{n(),r(),i(),a(),o(),s(),l(),u(),d(),f()}},[e])}var $oe={"--width":`320px`},ese=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{ModelConfigPage:e}=await import(`./model-config-page-c8RnUGoH.js`);return{ModelConfigPage:e}},__vite__mapDeps([40,4,41,28,32,30,33,1,34,42,38,39,43,44,45]))).ModelConfigPage})),tse=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{AppearanceSettingsPage:e}=await import(`./appearance-settings-page-BwQDQr0n.js`);return{AppearanceSettingsPage:e}},__vite__mapDeps([46,4,47,27,28,30,41,48,49,29,37,26,31,32,33,1,34,35,36,38,39,42,50,44]))).AppearanceSettingsPage})),nse=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{SearchConfigPage:e}=await import(`./search-config-page-Dp5guS5O.js`);return{SearchConfigPage:e}},__vite__mapDeps([51,4,47,27,28,30,41,31,33,1,34,52,43]))).SearchConfigPage})),rse=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{ProvidersConfigPage:e}=await import(`./providers-config-page-CGUEb5Dx.js`);return{ProvidersConfigPage:e}},__vite__mapDeps([53,4,47,27,28,30,49,29,41,37,31,42,35,36,52,43,45,34]))).ProvidersConfigPage})),ise=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{ExtensionsConfigPage:e}=await import(`./extensions-CG4voDCh.js`);return{ExtensionsConfigPage:e}},__vite__mapDeps([54,41,4,28,36,30]))).ExtensionsConfigPage})),ase=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{ChannelsList:e}=await import(`./channels-list-page-B0z4bh8e.js`);return{ChannelsList:e}},__vite__mapDeps([55,4,47,27,28,30,41,31,32,33,1,34,42,37,52,50,43,45]))).ChannelsList})),ose=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{RuntimeConfig:e}=await import(`./runtime-config-page-C6nzqTHg.js`);return{RuntimeConfig:e}},__vite__mapDeps([56,4,47,27,28,30,41,48,49,29,37,26,31,32,33,1,34,35,36,38,39,42,50,44,57,58,43]))).RuntimeConfig})),sse=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{DesktopUpdateConfig:e}=await import(`./desktop-update-config-DVoD6NxG.js`);return{DesktopUpdateConfig:e}},__vite__mapDeps([59,47,4,27,28,30,41,33,1,34,36,57]))).DesktopUpdateConfig})),cse=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{SecurityConfig:e}=await import(`./security-config-DvHUDxSg.js`);return{SecurityConfig:e}},__vite__mapDeps([60,41,4,28]))).SecurityConfig})),lse=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{SecretsConfigPage:e}=await import(`./secrets-config-page-C7nRMjiv.js`);return{SecretsConfigPage:e}},__vite__mapDeps([61,4,47,27,28,30,41,35,58,43]))).SecretsConfigPage})),use=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{PrivacySettingsPage:e}=await import(`./privacy-settings-page-CPkyTvEE.js`);return{PrivacySettingsPage:e}},__vite__mapDeps([62,47,4,27,28,30,41]))).PrivacySettingsPage})),dse=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{RemoteAccessPage:e}=await import(`./remote-1LxkpRED.js`);return{RemoteAccessPage:e}},[])).RemoteAccessPage})),fse=(0,V.lazy)(async()=>({default:(await ae(async()=>{let{McpMarketplacePage:e}=await import(`./mcp-marketplace-page-BgZGc-S_.js`);return{McpMarketplacePage:e}},__vite__mapDeps([63,48,4,47,27,28,30,49,29,41,37,26,31,32,33,1,34,35,36,38,39,42,50,44]))).McpMarketplacePage}));function pse(){return(0,H.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function mse({children:e}){return(0,H.jsx)(V.Suspense,{fallback:(0,H.jsx)(pse,{}),children:e})}function Q9(e){return(0,H.jsx)(mse,{children:e})}var hse=[{path:`/chat/skills`,redirectTo:`/skills`},{path:`/chat/cron`,redirectTo:`/cron`},{path:`/chat/agents`,redirectTo:`/agents`},{path:`/chat/:sessionId?`,element:Q9((0,H.jsx)(X9,{view:`chat`}))},{path:`/agents`,element:Q9((0,H.jsx)(X9,{view:`agents`}))},{path:`/skills`,element:Q9((0,H.jsx)(X9,{view:`skills`}))},{path:`/skills/scenes/:scene`,element:Q9((0,H.jsx)(X9,{view:`skills`}))},{path:`/cron`,element:Q9((0,H.jsx)(X9,{view:`cron`}))},{path:`/inbox/:deliveryId?`,element:Q9((0,H.jsx)(X9,{view:`inbox`}))},{path:`/apps/panel/:appId`,element:Q9((0,H.jsx)(X9,{view:`panel-app`}))},{path:`/appearance`,element:Q9((0,H.jsx)(tse,{}))},{path:`/model`,element:Q9((0,H.jsx)(ese,{}))},{path:`/search`,element:Q9((0,H.jsx)(nse,{}))},{path:`/providers`,element:Q9((0,H.jsx)(rse,{}))},{path:`/extensions`,element:Q9((0,H.jsx)(ise,{}))},{path:`/channels`,element:Q9((0,H.jsx)(ase,{}))},{path:`/runtime`,element:Q9((0,H.jsx)(ose,{}))},{path:`/updates`,element:Q9((0,H.jsx)(sse,{}))},{path:`/remote`,element:Q9((0,H.jsx)(dse,{}))},{path:`/security`,element:Q9((0,H.jsx)(cse,{}))},{path:`/privacy`,element:Q9((0,H.jsx)(use,{}))},{path:`/secrets`,element:Q9((0,H.jsx)(lse,{}))},{path:`/settings`,element:(0,H.jsx)(yoe,{})},{path:`/marketplace/skills`,redirectTo:`/skills`},{path:`/marketplace`,redirectTo:`/skills`},{path:`/marketplace/mcp`,element:Q9((0,H.jsx)(fse,{}))},{path:`/`,redirectTo:`/chat`},{path:`*`,redirectTo:`/chat`}];function gse(e){return`redirectTo`in e?(0,H.jsx)(se,{path:e.path,element:(0,H.jsx)(he,{to:e.redirectTo,replace:!0})},e.path):(0,H.jsx)(se,{path:e.path,element:e.element},e.path)}function _se(){return(0,H.jsx)(de,{children:hse.map(gse)})}function $9(){return Qoe(Tt),it(),(0,V.useEffect)(()=>(Ne.start(),()=>{Ne.stop()}),[]),(0,H.jsxs)(coe,{children:[(0,H.jsx)(loe,{}),(0,H.jsx)(Eie,{}),(0,H.jsx)(voe,{children:(0,H.jsx)(_se,{})}),(0,H.jsx)(vs,{}),(0,H.jsx)($Q,{})]})}function vse(){let e=Ve(),t=e.isError&&Ie(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,H.jsx)($9,{}):e.data?.enabled&&!e.data.authenticated?(0,H.jsx)(kee,{username:e.data.username}):(0,H.jsx)($9,{})}function yse(){return(0,V.useEffect)(()=>{Qre()},[]),(0,H.jsxs)(ke,{client:Tt,children:[(0,H.jsx)(vse,{}),(0,H.jsx)(Xre,{}),(0,H.jsx)(Zt,{position:`top-right`,richColors:!0,offset:{top:window.nextclawDesktop?.platform===`win32`?56:44,right:72},mobileOffset:window.nextclawDesktop?.platform===`win32`?56:void 0,style:$oe})]})}var bse=window.nextclawDesktop?.platform===`win32`?oe:me;(0,qo.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(tie,{children:(0,H.jsx)(Pn,{children:(0,H.jsx)(bse,{children:(0,H.jsx)(yse,{})})})})}));export{cs as $,O3 as A,IY as B,O6 as C,k6 as D,b6 as E,P3 as F,TF as G,ML as H,B1 as I,Ss as J,ys as K,PY as L,V3 as M,L3 as N,y6 as O,F3 as P,fs as Q,LY as R,C6 as S,Hi as St,v6 as T,wF as U,GL as V,DF as W,xs as X,bs as Y,ps as Z,E6 as _,Xa as _t,S7 as a,os as at,p6 as b,Ea as bt,c8 as c,Yo as ct,g6 as d,Do as dt,ss as et,x6 as f,Eo as ft,D6 as g,Za as gt,j6 as h,ro as ht,R7 as i,is as it,H3 as j,A6 as k,d6 as l,Vo as lt,w6 as m,bo as mt,_9 as n,ns as nt,Yre as o,Qo as ot,S6 as p,xo as pt,Cs as q,Fie as r,rs as rt,c7 as s,Xo as st,K9 as t,$o as tt,f6 as u,Io as ut,h6 as v,qa as vt,_6 as w,T6 as x,sa as xt,m6 as y,Oa as yt,FY as z};