maestro-flow 0.4.3 → 0.4.5

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 (263) hide show
  1. package/.claude/commands/maestro-collab.md +1 -1
  2. package/.claude/commands/maestro-composer.md +1 -1
  3. package/.claude/commands/maestro-impeccable.md +1 -1
  4. package/.claude/commands/maestro-learn.md +1 -1
  5. package/.claude/commands/maestro-overlay.md +1 -1
  6. package/.claude/commands/maestro-quick.md +1 -1
  7. package/.claude/commands/maestro-ralph.md +1 -1
  8. package/.claude/commands/maestro-tools-execute.md +1 -1
  9. package/.claude/commands/maestro-tools-register.md +1 -1
  10. package/.claude/commands/maestro.md +1 -1
  11. package/.claude/commands/manage-issue-discover.md +1 -1
  12. package/.claude/commands/manage-issue.md +1 -1
  13. package/.claude/commands/manage-knowhow-capture.md +3 -1
  14. package/.claude/commands/manage-knowhow.md +1 -1
  15. package/.claude/commands/manage-learn.md +1 -1
  16. package/.claude/commands/manage-status.md +1 -0
  17. package/.claude/commands/manage-wiki.md +1 -1
  18. package/.claude/commands/quality-auto-test.md +1 -2
  19. package/.claude/commands/quality-refactor.md +1 -1
  20. package/.claude/commands/quality-test.md +5 -0
  21. package/.claude/commands/security-audit.md +1 -0
  22. package/.claude/commands/spec-add.md +6 -3
  23. package/.claude/commands/spec-setup.md +0 -3
  24. package/dashboard/dist/assets/{ArtifactsPage-iJZtYsmR.js → ArtifactsPage-CVh0Z2I2.js} +3 -3
  25. package/dashboard/dist/assets/{ChatInput-DNnDLdQF.js → ChatInput-CBI3qHQQ.js} +2 -2
  26. package/dashboard/dist/assets/ChatPage-BjJ9CYox.js +22 -0
  27. package/dashboard/dist/assets/CollabPage-CprGGO9y.js +1 -0
  28. package/dashboard/dist/assets/{ExecutionPanel-BKV3GZ7Q.js → ExecutionPanel-CClxD7cH.js} +1 -1
  29. package/dashboard/dist/assets/KanbanPage-copqjdPg.js +16 -0
  30. package/dashboard/dist/assets/MaestroCoordinatePage-CioZjQ9N.js +4 -0
  31. package/dashboard/dist/assets/{MarkdownRenderer-cYFfe1uX.js → MarkdownRenderer-CtUhoxCT.js} +1 -1
  32. package/dashboard/dist/assets/McpPage-BcPPcJpr.js +21 -0
  33. package/dashboard/dist/assets/{MeetingRoomPage-wnvT7wlB.js → MeetingRoomPage-BgmAKxU-.js} +1 -1
  34. package/dashboard/dist/assets/{OutputPanel-DDL90Idy.js → OutputPanel-DgT3gMyp.js} +1 -1
  35. package/dashboard/dist/assets/{ProblemsPanel-zFN9IIs0.js → ProblemsPanel-BmG7rxoG.js} +1 -1
  36. package/dashboard/dist/assets/{RequirementBoardPage-DOPJoT0I.js → RequirementBoardPage-k8YoeQ0r.js} +1 -1
  37. package/dashboard/dist/assets/{RequirementPage-CEVquRgM.js → RequirementPage-Da2354px.js} +1 -1
  38. package/dashboard/dist/assets/{RoomsPage-D5USEWDh.js → RoomsPage-BtqDiYaU.js} +1 -1
  39. package/dashboard/dist/assets/SpecsPage-ByPVH_M3.js +36 -0
  40. package/dashboard/dist/assets/{TeamsPage-DlcEmr_Q.js → TeamsPage-sFDLN30L.js} +1 -1
  41. package/dashboard/dist/assets/{TreeBrowser-Y48Wz-QY.js → TreeBrowser-oEx8YJXV.js} +1 -1
  42. package/dashboard/dist/assets/WorkflowPage-JrX7CVHh.js +6 -0
  43. package/dashboard/dist/assets/{arrow-left-NCUOENvg.js → arrow-left-DYvgSdIH.js} +1 -1
  44. package/dashboard/dist/assets/{check-o7nfGNHf.js → check-jcgYBWVR.js} +1 -1
  45. package/dashboard/dist/assets/{chevron-right-BXySK2fn.js → chevron-right-DvZ5sMOg.js} +1 -1
  46. package/dashboard/dist/assets/{circle-cooAwnAR.js → circle-DYT-zoRZ.js} +1 -1
  47. package/dashboard/dist/assets/{circle-alert-DcSBokh4.js → circle-alert-Bfbv3gt4.js} +1 -1
  48. package/dashboard/dist/assets/{circle-check-Cd-jce4j.js → circle-check-D82WnpbI.js} +1 -1
  49. package/dashboard/dist/assets/{circle-check-big-BN7Mdp4i.js → circle-check-big-CPVD1GKF.js} +1 -1
  50. package/dashboard/dist/assets/{code-BQa9oL1n.js → code-B3bKFGI4.js} +1 -1
  51. package/dashboard/dist/assets/{columns-3-BzgxelGx.js → columns-3-BeMAQCix.js} +1 -1
  52. package/dashboard/dist/assets/{download-swRJnate.js → download-BCtpoWYB.js} +1 -1
  53. package/dashboard/dist/assets/en-2h6fD0j8.js +1 -0
  54. package/dashboard/dist/assets/{folder-DbGbLNFN.js → folder-CTj6SNNu.js} +1 -1
  55. package/dashboard/dist/assets/index-6-yE5Yl9.css +1 -0
  56. package/dashboard/dist/assets/{index-DIoMBMbv.js → index-BxR_3IbJ.js} +1 -1
  57. package/dashboard/dist/assets/{index-DLBN_7fb.js → index-CWBJLu42.js} +1 -1
  58. package/dashboard/dist/assets/index-DpcPd-UG.js +236 -0
  59. package/dashboard/dist/assets/{list-BTRAIvDq.js → list-BMv8pIQn.js} +1 -1
  60. package/dashboard/dist/assets/{loader-NHtB6Mdn.js → loader-DdM4VOgF.js} +1 -1
  61. package/dashboard/dist/assets/{minus-BjMxRTET.js → minus-D15s2E__.js} +1 -1
  62. package/dashboard/dist/assets/{pen-line-C4_O16H0.js → pen-line-DO6o4xWz.js} +1 -1
  63. package/dashboard/dist/assets/{pencil-DTmKhyDY.js → pencil-qGxg9jOe.js} +1 -1
  64. package/dashboard/dist/assets/{proxy-Dtx5p6IO.js → proxy-DOffTzwA.js} +1 -1
  65. package/dashboard/dist/assets/refresh-cw-C9UNdLCy.js +6 -0
  66. package/dashboard/dist/assets/{rows-2-GR1dZtRu.js → rows-2-CifAA5SL.js} +1 -1
  67. package/dashboard/dist/assets/{search-DVtgy2W7.js → search-pe7pU1YN.js} +1 -1
  68. package/dashboard/dist/assets/{shallow-BOmvDNsv.js → shallow-r7YynQYA.js} +1 -1
  69. package/dashboard/dist/assets/table-Bh772iIw.js +6 -0
  70. package/dashboard/dist/assets/{team-types-BPeOvVdA.js → team-types-C_HqX2p2.js} +1 -1
  71. package/dashboard/dist/assets/{terminal-CzogW4cl.js → terminal-EpmtGBlw.js} +1 -1
  72. package/dashboard/dist/assets/{trash-2-52LATVfW.js → trash-2-Xen46iNQ.js} +1 -1
  73. package/dashboard/dist/assets/{users-DLFE2voE.js → users-BLueDPxF.js} +1 -1
  74. package/dashboard/dist/assets/{zap-DhiYlgyZ.js → zap-DsQCPF61.js} +1 -1
  75. package/dashboard/dist/assets/zh-CN-r3AvxxOL.js +1 -0
  76. package/dashboard/dist/index.html +2 -2
  77. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +70 -1
  78. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  79. package/dashboard/dist-server/src/types/index.d.ts +48 -6
  80. package/dist/src/commands/coordinate.d.ts.map +1 -1
  81. package/dist/src/commands/coordinate.js +2 -0
  82. package/dist/src/commands/coordinate.js.map +1 -1
  83. package/dist/src/commands/hooks.d.ts.map +1 -1
  84. package/dist/src/commands/hooks.js +201 -6
  85. package/dist/src/commands/hooks.js.map +1 -1
  86. package/dist/src/commands/spec.d.ts.map +1 -1
  87. package/dist/src/commands/spec.js +466 -0
  88. package/dist/src/commands/spec.js.map +1 -1
  89. package/dist/src/config/index.d.ts +5 -1
  90. package/dist/src/config/index.d.ts.map +1 -1
  91. package/dist/src/config/index.js +42 -0
  92. package/dist/src/config/index.js.map +1 -1
  93. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  94. package/dist/src/hooks/keyword-spec-injector.js +106 -10
  95. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  96. package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts +13 -0
  97. package/dist/src/hooks/plugins/spec-analytics-plugin.d.ts.map +1 -0
  98. package/dist/src/hooks/plugins/spec-analytics-plugin.js +92 -0
  99. package/dist/src/hooks/plugins/spec-analytics-plugin.js.map +1 -0
  100. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  101. package/dist/src/hooks/plugins/spec-injection-plugin.js +57 -4
  102. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  103. package/dist/src/hooks/spec-analytics.d.ts +128 -0
  104. package/dist/src/hooks/spec-analytics.d.ts.map +1 -0
  105. package/dist/src/hooks/spec-analytics.js +311 -0
  106. package/dist/src/hooks/spec-analytics.js.map +1 -0
  107. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  108. package/dist/src/hooks/spec-injector.js +140 -6
  109. package/dist/src/hooks/spec-injector.js.map +1 -1
  110. package/dist/src/tools/spec-keyword-index.d.ts.map +1 -1
  111. package/dist/src/tools/spec-keyword-index.js +23 -6
  112. package/dist/src/tools/spec-keyword-index.js.map +1 -1
  113. package/dist/src/tools/spec-loader.d.ts +20 -0
  114. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  115. package/dist/src/tools/spec-loader.js +58 -7
  116. package/dist/src/tools/spec-loader.js.map +1 -1
  117. package/dist/src/tools/store-knowhow.d.ts.map +1 -1
  118. package/dist/src/tools/store-knowhow.js +26 -1
  119. package/dist/src/tools/store-knowhow.js.map +1 -1
  120. package/dist/src/tui/config-ui/ConfigHub.d.ts +1 -1
  121. package/dist/src/tui/config-ui/ConfigHub.d.ts.map +1 -1
  122. package/dist/src/tui/config-ui/ConfigHub.js +16 -10
  123. package/dist/src/tui/config-ui/ConfigHub.js.map +1 -1
  124. package/dist/src/tui/config-ui/ConfigSourcesView.d.ts.map +1 -1
  125. package/dist/src/tui/config-ui/ConfigSourcesView.js +3 -2
  126. package/dist/src/tui/config-ui/ConfigSourcesView.js.map +1 -1
  127. package/dist/src/tui/config-ui/HooksPanel.d.ts.map +1 -1
  128. package/dist/src/tui/config-ui/HooksPanel.js +15 -19
  129. package/dist/src/tui/config-ui/HooksPanel.js.map +1 -1
  130. package/dist/src/tui/config-ui/SkillConfigDashboard.d.ts.map +1 -1
  131. package/dist/src/tui/config-ui/SkillConfigDashboard.js +5 -9
  132. package/dist/src/tui/config-ui/SkillConfigDashboard.js.map +1 -1
  133. package/dist/src/tui/config-ui/SkillParamEditor.d.ts.map +1 -1
  134. package/dist/src/tui/config-ui/SkillParamEditor.js +1 -3
  135. package/dist/src/tui/config-ui/SkillParamEditor.js.map +1 -1
  136. package/dist/src/tui/config-ui/SkillsList.d.ts.map +1 -1
  137. package/dist/src/tui/config-ui/SkillsList.js +7 -9
  138. package/dist/src/tui/config-ui/SkillsList.js.map +1 -1
  139. package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts +6 -0
  140. package/dist/src/tui/config-ui/SpecAnalyticsPanel.d.ts.map +1 -0
  141. package/dist/src/tui/config-ui/SpecAnalyticsPanel.js +164 -0
  142. package/dist/src/tui/config-ui/SpecAnalyticsPanel.js.map +1 -0
  143. package/dist/src/tui/config-ui/SpecPanel.d.ts.map +1 -1
  144. package/dist/src/tui/config-ui/SpecPanel.js +918 -20
  145. package/dist/src/tui/config-ui/SpecPanel.js.map +1 -1
  146. package/dist/src/tui/config-ui/index.d.ts +3 -1
  147. package/dist/src/tui/config-ui/index.d.ts.map +1 -1
  148. package/dist/src/tui/config-ui/index.js +4 -0
  149. package/dist/src/tui/config-ui/index.js.map +1 -1
  150. package/dist/src/tui/install-ui/BackupConfig.d.ts.map +1 -1
  151. package/dist/src/tui/install-ui/BackupConfig.js +3 -2
  152. package/dist/src/tui/install-ui/BackupConfig.js.map +1 -1
  153. package/dist/src/tui/install-ui/BlueprintPreview.d.ts.map +1 -1
  154. package/dist/src/tui/install-ui/BlueprintPreview.js +7 -6
  155. package/dist/src/tui/install-ui/BlueprintPreview.js.map +1 -1
  156. package/dist/src/tui/install-ui/ComponentGrid.d.ts.map +1 -1
  157. package/dist/src/tui/install-ui/ComponentGrid.js +3 -2
  158. package/dist/src/tui/install-ui/ComponentGrid.js.map +1 -1
  159. package/dist/src/tui/install-ui/ConfigPanel.d.ts.map +1 -1
  160. package/dist/src/tui/install-ui/ConfigPanel.js +4 -3
  161. package/dist/src/tui/install-ui/ConfigPanel.js.map +1 -1
  162. package/dist/src/tui/install-ui/CyberItem.d.ts.map +1 -1
  163. package/dist/src/tui/install-ui/CyberItem.js +7 -6
  164. package/dist/src/tui/install-ui/CyberItem.js.map +1 -1
  165. package/dist/src/tui/install-ui/CyberdeckBlueprint.d.ts.map +1 -1
  166. package/dist/src/tui/install-ui/CyberdeckBlueprint.js +2 -1
  167. package/dist/src/tui/install-ui/CyberdeckBlueprint.js.map +1 -1
  168. package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -1
  169. package/dist/src/tui/install-ui/ExecutionView.js +3 -2
  170. package/dist/src/tui/install-ui/ExecutionView.js.map +1 -1
  171. package/dist/src/tui/install-ui/GradientHeader.d.ts.map +1 -1
  172. package/dist/src/tui/install-ui/GradientHeader.js +2 -1
  173. package/dist/src/tui/install-ui/GradientHeader.js.map +1 -1
  174. package/dist/src/tui/install-ui/HooksConfig.d.ts.map +1 -1
  175. package/dist/src/tui/install-ui/HooksConfig.js +8 -8
  176. package/dist/src/tui/install-ui/HooksConfig.js.map +1 -1
  177. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  178. package/dist/src/tui/install-ui/InstallConfirm.js +4 -3
  179. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  180. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  181. package/dist/src/tui/install-ui/InstallExecution.js +3 -2
  182. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  183. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  184. package/dist/src/tui/install-ui/InstallFlow.js +3 -2
  185. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  186. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  187. package/dist/src/tui/install-ui/InstallHub.js +9 -8
  188. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  189. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  190. package/dist/src/tui/install-ui/InstallResult.js +3 -2
  191. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  192. package/dist/src/tui/install-ui/McpConfig.d.ts.map +1 -1
  193. package/dist/src/tui/install-ui/McpConfig.js +4 -3
  194. package/dist/src/tui/install-ui/McpConfig.js.map +1 -1
  195. package/dist/src/tui/install-ui/ResultDashboard.d.ts.map +1 -1
  196. package/dist/src/tui/install-ui/ResultDashboard.js +3 -2
  197. package/dist/src/tui/install-ui/ResultDashboard.js.map +1 -1
  198. package/dist/src/tui/install-ui/ReviewPanel.d.ts.map +1 -1
  199. package/dist/src/tui/install-ui/ReviewPanel.js +2 -1
  200. package/dist/src/tui/install-ui/ReviewPanel.js.map +1 -1
  201. package/dist/src/tui/install-ui/StatuslineConfig.d.ts.map +1 -1
  202. package/dist/src/tui/install-ui/StatuslineConfig.js +3 -2
  203. package/dist/src/tui/install-ui/StatuslineConfig.js.map +1 -1
  204. package/dist/src/tui/install-ui/StepSelector.d.ts.map +1 -1
  205. package/dist/src/tui/install-ui/StepSelector.js +11 -10
  206. package/dist/src/tui/install-ui/StepSelector.js.map +1 -1
  207. package/dist/src/tui/overlay-ui/OverlayList.d.ts.map +1 -1
  208. package/dist/src/tui/overlay-ui/OverlayList.js +8 -12
  209. package/dist/src/tui/overlay-ui/OverlayList.js.map +1 -1
  210. package/dist/src/tui/shared/components.d.ts +56 -0
  211. package/dist/src/tui/shared/components.d.ts.map +1 -0
  212. package/dist/src/tui/shared/components.js +55 -0
  213. package/dist/src/tui/shared/components.js.map +1 -0
  214. package/dist/src/tui/shared/helpers.d.ts +24 -0
  215. package/dist/src/tui/shared/helpers.d.ts.map +1 -0
  216. package/dist/src/tui/shared/helpers.js +49 -0
  217. package/dist/src/tui/shared/helpers.js.map +1 -0
  218. package/dist/src/tui/shared/index.d.ts +4 -0
  219. package/dist/src/tui/shared/index.d.ts.map +1 -0
  220. package/dist/src/tui/shared/index.js +7 -0
  221. package/dist/src/tui/shared/index.js.map +1 -0
  222. package/dist/src/tui/shared/tokens.d.ts +79 -0
  223. package/dist/src/tui/shared/tokens.d.ts.map +1 -0
  224. package/dist/src/tui/shared/tokens.js +81 -0
  225. package/dist/src/tui/shared/tokens.js.map +1 -0
  226. package/dist/src/tui/tools-ui/CommandReference.d.ts.map +1 -1
  227. package/dist/src/tui/tools-ui/CommandReference.js +2 -4
  228. package/dist/src/tui/tools-ui/CommandReference.js.map +1 -1
  229. package/dist/src/tui/tools-ui/ConfigSources.d.ts.map +1 -1
  230. package/dist/src/tui/tools-ui/ConfigSources.js +3 -2
  231. package/dist/src/tui/tools-ui/ConfigSources.js.map +1 -1
  232. package/dist/src/tui/tools-ui/RegisterSettings.d.ts.map +1 -1
  233. package/dist/src/tui/tools-ui/RegisterSettings.js +2 -1
  234. package/dist/src/tui/tools-ui/RegisterSettings.js.map +1 -1
  235. package/dist/src/tui/tools-ui/RoleMappings.d.ts.map +1 -1
  236. package/dist/src/tui/tools-ui/RoleMappings.js +3 -5
  237. package/dist/src/tui/tools-ui/RoleMappings.js.map +1 -1
  238. package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
  239. package/dist/src/tui/tools-ui/ToolsDashboard.js +3 -5
  240. package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
  241. package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
  242. package/dist/src/tui/tools-ui/ToolsOverview.js +3 -5
  243. package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
  244. package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts.map +1 -1
  245. package/dist/src/tui/uninstall-ui/UninstallFlow.js +8 -7
  246. package/dist/src/tui/uninstall-ui/UninstallFlow.js.map +1 -1
  247. package/dist/src/types/index.d.ts +48 -6
  248. package/dist/src/types/index.d.ts.map +1 -1
  249. package/package.json +1 -1
  250. package/workflows/knowhow.md +15 -1
  251. package/workflows/specs-add.md +12 -4
  252. package/dashboard/dist/assets/ChatPage-BjBibfE4.js +0 -22
  253. package/dashboard/dist/assets/CollabPage-8lUMUol_.js +0 -1
  254. package/dashboard/dist/assets/KanbanPage-diY3QmGd.js +0 -21
  255. package/dashboard/dist/assets/McpPage-COjuIf7U.js +0 -21
  256. package/dashboard/dist/assets/SpecsPage-BOwBin_o.js +0 -36
  257. package/dashboard/dist/assets/SupervisorPage-5iRyMU5T.js +0 -6
  258. package/dashboard/dist/assets/WorkflowPage-CmQaRVgL.js +0 -6
  259. package/dashboard/dist/assets/en-C_BD3UCD.js +0 -1
  260. package/dashboard/dist/assets/index-BEUaOz_b.css +0 -1
  261. package/dashboard/dist/assets/index-uIqUCT8y.js +0 -236
  262. package/dashboard/dist/assets/table-DCzuJAFh.js +0 -6
  263. package/dashboard/dist/assets/zh-CN-DvQKfow3.js +0 -1
@@ -1,21 +0,0 @@
1
- import{j as e,u as ee,a as ce,S as L,r as p,b as D,c as O,s as R,L as Pe,g as P,I as $,C as te,d as F,e as K,R as fe,P as be,O as ye,f as je,T as Ne,h as we,i as ke,k as Oe,l as $e,m as de,V as Re,n as Ie}from"./index-uIqUCT8y.js";import{u as G}from"./shallow-BOmvDNsv.js";import{S as Me,P as Ke,L as Ue,a as U,u as Fe,T as He,b as We,D as Ve,K as Ye}from"./table-DCzuJAFh.js";import{C as qe}from"./circle-check-big-BN7Mdp4i.js";import{M as Ge,C as Xe}from"./ChatInput-DNnDLdQF.js";import{D as Qe}from"./download-swRJnate.js";import"./index-DLBN_7fb.js";import"./zap-DhiYlgyZ.js";import"./MarkdownRenderer-cYFfe1uX.js";import"./chevron-right-BXySK2fn.js";import"./terminal-CzogW4cl.js";import"./circle-alert-DcSBokh4.js";function Je({chips:t,active:a,onSelect:r}){return e.jsx("div",{className:"flex items-center gap-[var(--spacing-1-5)] overflow-x-auto shrink-0",children:t.map(o=>{const n=o===a;return e.jsx("button",{type:"button",onClick:()=>r(o),className:["px-[var(--spacing-3)] py-[var(--spacing-1)]","text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] whitespace-nowrap","transition-all duration-[var(--duration-fast)] ease-[var(--ease-notion)]","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]",n?"":"hover:text-text-primary"].join(" "),style:n?{borderRadius:"var(--style-chip-radius)",border:"var(--style-chip-border)",backgroundColor:"var(--style-chip-active-bg)",color:"var(--style-chip-active-color)"}:{borderRadius:"var(--style-chip-radius)",border:"var(--style-chip-border)",backgroundColor:"var(--color-bg-card)",color:"var(--color-text-secondary)"},children:o},o)})})}const Ze={pending:"var(--color-tint-pending)",exploring:"var(--color-tint-exploring)",planning:"var(--color-tint-planning)",executing:"var(--color-tint-executing)",verifying:"var(--color-tint-verifying)",testing:"var(--color-tint-testing)",completed:"var(--color-tint-completed)",blocked:"var(--color-tint-blocked)"};function et({phase:t}){const{t:a}=ee(),r=ce(g=>g.setSelectedPhase),n=ce(g=>g.selectedPhase)===t.phase;function d(){r(n?null:t.phase)}function c(g){(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d())}const{tasks_completed:i,tasks_total:l,current_wave:x}=t.execution,h=a("kanban.wave");return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":a("kanban.phase_aria",{phase:t.phase,title:t.title,status:t.status,completed:i,total:l}),"aria-pressed":n,onClick:d,onKeyDown:c,className:["rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]",n?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":""].join(" "),style:{backgroundColor:Ze[t.status]??"var(--color-tint-pending)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Me,{status:t.status,cardVariant:!0}),e.jsxs("span",{className:"text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:["P-",String(t.phase).padStart(2,"0")]})]}),e.jsx("h4",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary leading-[var(--line-height-tight)]",children:t.title}),t.goal&&e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary leading-[var(--line-height-normal)] line-clamp-2",children:t.goal}),l>0&&e.jsx(Ke,{completed:i,total:l,color:L[t.status]}),t.status==="executing"&&x>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] text-status-executing",children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-status-executing animate-pulse motion-reduce:animate-none"}),e.jsxs("span",{children:[h," ",x]})]})]})})}function tt({issue:t,selected:a,onSelect:r}){const o=Ue[t.priority];function n(d){(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())}return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${t.identifier}: ${t.title}. Priority: ${U[t.priority]}`,"aria-pressed":a,onClick:r,onKeyDown:n,className:["rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]","bg-bg-card",a?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":""].join(" "),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:`#${t.state.color}`},"aria-hidden":"true"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-mono font-[var(--font-weight-medium)] text-text-tertiary",children:t.identifier})]}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:`${o}20`,color:o},children:U[t.priority]})]}),e.jsx("h4",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary leading-snug line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"flex gap-[var(--spacing-1)] flex-wrap min-w-0",children:t.labels.slice(0,3).map(d=>e.jsx("span",{className:"text-[length:10px] px-1.5 py-0.5 rounded-full truncate max-w-[80px]",style:{backgroundColor:`#${d.color}20`,color:`#${d.color}`},title:d.name,children:d.name},d.id))}),t.assignee&&e.jsx("span",{className:"w-5 h-5 rounded-full bg-bg-hover shrink-0 flex items-center justify-center text-[length:10px] font-[var(--font-weight-semibold)] text-text-secondary",title:t.assignee.displayName,children:t.assignee.displayName.charAt(0).toUpperCase()})]})]})})}const rt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},at={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},st=[{value:"claude-code",label:"Claude"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"},{value:"agent-sdk",label:"Agent SDK"}],ot={running:{icon:"●",color:"#B89540",animate:!0},queued:{icon:"◷",color:"#5B8DB8"},completed:{icon:"✓",color:"#5A9E78"},failed:{icon:"✕",color:"#C46555"},retrying:{icon:"↻",color:"#B89540",animate:!0}};function nt({issue:t,selected:a,onSelect:r,batchMode:o,isChecked:n,onToggleCheck:d}){var z;const c=rt[t.type]??"#A09D97",i=at[t.priority]??"#A09D97",[l,x]=p.useState(!1),[h,g]=p.useState(t.executor??"claude-code"),m=D(j=>j.isIssueRunning(t.id)),y=D(j=>j.openCliPanel),k=O(j=>j.updateIssue),N=(z=t.execution)==null?void 0:z.status,u=N?ot[N]:null,b=p.useCallback(j=>{j.stopPropagation(),R({action:"execute:issue",issueId:t.id,executor:h})},[t.id,h]),C=p.useCallback(j=>{j.stopPropagation();const T=j.target.value;g(T),k(t.id,{executor:T})},[t.id,k]),v=p.useCallback(j=>{j.stopPropagation(),d==null||d(t.id)},[t.id,d]),s=p.useCallback(j=>{j.stopPropagation(),y(t.id)},[t.id,y]);function S(j){(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),r())}return e.jsx("article",{role:"listitem",children:e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`${t.title}. Type: ${t.type}. Priority: ${t.priority}`,"aria-pressed":a,onClick:r,onKeyDown:S,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),className:["group/card relative rounded-[10px] px-[var(--spacing-4)] py-[var(--spacing-3)] space-y-[var(--spacing-2)] cursor-pointer","transition-all duration-[var(--duration-normal)] ease-[var(--ease-spring)]","hover:shadow-[0_4px_12px_rgba(0,0,0,0.08)] hover:-translate-y-0.5","focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]","active:scale-[0.98] active:shadow-sm active:duration-[var(--duration-fast)]","bg-bg-card motion-safe:animate-[card-enter_200ms_ease-out_both]",a?"shadow-[inset_0_0_0_2px_var(--color-accent-blue)]":"shadow-[var(--shadow-sm)]"].join(" "),children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[(o||l)&&e.jsx("div",{onClick:v,className:["shrink-0 w-4 h-4 rounded border-[1.5px] flex items-center justify-center text-[9px] transition-all duration-100 cursor-pointer",n?"bg-accent-blue border-accent-blue text-white scale-100":"border-border hover:border-text-secondary"].join(" "),style:n?{backgroundColor:"var(--color-accent-blue)",borderColor:"var(--color-accent-blue)"}:{},children:n&&"✓"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:`${c}20`,color:c},children:t.type}),t.path&&e.jsx("span",{className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)",border:"1px solid var(--color-border)"},children:t.path}),t.solution&&e.jsxs("span",{className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full",style:{backgroundColor:"#9178B520",color:"#9178B5"},children:[t.solution.steps.length," steps"]}),t.phase_id!=null&&e.jsxs(Pe,{to:`/workflow?phase=${t.phase_id}`,onClick:j=>j.stopPropagation(),className:"text-[10px] font-medium px-1.5 py-[var(--spacing-0-5)] rounded-full no-underline transition-colors",style:{backgroundColor:"rgba(91, 141, 184, 0.1)",color:"#5B8DB8"},title:`Go to Phase ${t.phase_id}`,children:["P-",String(t.phase_id).padStart(2,"0")]}),u&&e.jsx("span",{className:["text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)]",u.animate?"animate-pulse":""].join(" "),style:{color:u.color},title:`Execution: ${N}`,onClick:m?s:void 0,children:u.icon}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full ml-auto",style:{backgroundColor:`${i}20`,color:i},children:t.priority})]}),e.jsx("h4",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary leading-snug line-clamp-2",children:t.title}),e.jsxs("div",{className:"flex items-center justify-between",children:[(()=>{const j=P(t),T=$[j];return e.jsx("span",{className:"text-[length:10px]",style:{color:T},children:j.replace("_"," ")})})(),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)]",children:[e.jsx("select",{value:h,onChange:C,onClick:j=>j.stopPropagation(),className:["text-[length:10px] bg-transparent border border-border rounded px-1 py-0.5 text-text-secondary cursor-pointer","transition-opacity",l||a?"opacity-100":"opacity-0"].join(" "),"aria-label":"Select executor",children:st.map(j=>e.jsx("option",{value:j.value,children:j.label},j.value))}),!m&&t.status!=="resolved"&&t.status!=="closed"&&e.jsx("button",{type:"button",onClick:b,className:["w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-accent-blue hover:bg-bg-hover transition-all",l||a?"opacity-100":"opacity-0"].join(" "),"aria-label":"Execute issue",title:"Execute issue",children:e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})})}),m&&e.jsx("button",{type:"button",onClick:s,className:"w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-[#B89540] hover:bg-bg-hover transition-all","aria-label":"View execution output",title:"View execution output",children:e.jsx("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})})})]})]})]})})}const lt=[{value:"task",label:"Task",color:"#A09D97"},{value:"bug",label:"Bug",color:"#C46555"},{value:"feature",label:"Feature",color:"#5B8DB8"},{value:"improvement",label:"Improve",color:"#9178B5"}],it=[{value:"urgent",label:"Urgent",color:"#C46555"},{value:"high",label:"High",color:"#B89540"},{value:"medium",label:"Medium",color:"#5B8DB8"},{value:"low",label:"Low",color:"#A09D97"}];function ct({columnId:t,onClose:a,onCreated:r}){const[o,n]=p.useState(""),[d,c]=p.useState("task"),[i,l]=p.useState("medium"),[x,h]=p.useState(!1),g=p.useRef(null),m=p.useRef(null),y=O(u=>u.createIssue);p.useEffect(()=>{requestAnimationFrame(()=>{var u;return(u=g.current)==null?void 0:u.focus()})},[]),p.useEffect(()=>{function u(b){m.current&&!m.current.contains(b.target)&&a()}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);async function k(){const u=o.trim();!u||x||(h(!0),await y({title:u,description:"",type:d,priority:i}),h(!1),n(""),r==null||r(),a())}function N(u){u.key==="Enter"&&!u.shiftKey?(u.preventDefault(),k()):u.key==="Escape"&&(u.preventDefault(),a())}return e.jsxs("div",{ref:m,className:"rounded-[10px] border-2 border-dashed border-accent-blue/40 bg-bg-card px-[var(--spacing-3)] py-[var(--spacing-2-5)] space-y-[var(--spacing-2)] motion-safe:animate-[fade-in_100ms_ease-out]",children:[e.jsx("input",{ref:g,type:"text",value:o,onChange:u=>n(u.target.value),onKeyDown:N,placeholder:"Issue title...",disabled:x,className:"w-full bg-transparent text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary placeholder:text-text-tertiary outline-none"}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("div",{className:"flex gap-[var(--spacing-0-5)]",children:lt.map(u=>e.jsx("button",{type:"button",onClick:()=>c(u.value),className:["text-[length:10px] font-[var(--font-weight-medium)] px-[var(--spacing-1-5)] py-[1px] rounded-full transition-all duration-[var(--duration-fast)]",d===u.value?"ring-1 ring-current":"opacity-50 hover:opacity-80"].join(" "),style:{backgroundColor:`${u.color}20`,color:u.color},children:u.label},u.value))}),e.jsx("div",{className:"w-px h-3 bg-border-divider"}),e.jsx("div",{className:"flex gap-[var(--spacing-0-5)]",children:it.map(u=>e.jsx("button",{type:"button",onClick:()=>l(u.value),className:["text-[length:10px] font-[var(--font-weight-medium)] px-[var(--spacing-1-5)] py-[1px] rounded-full transition-all duration-[var(--duration-fast)]",i===u.value?"ring-1 ring-current":"opacity-50 hover:opacity-80"].join(" "),style:{backgroundColor:`${u.color}20`,color:u.color},children:u.label},u.value))})]}),e.jsxs("div",{className:"flex items-center justify-between text-[length:10px] text-text-tertiary",children:[e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1 py-[1px] rounded bg-bg-hover font-mono text-[9px]",children:"Enter"})," create"," ",e.jsx("kbd",{className:"px-1 py-[1px] rounded bg-bg-hover font-mono text-[9px]",children:"Esc"})," cancel"]}),x&&e.jsx("span",{children:"Creating..."})]})]})}function dt({columnId:t,title:a,phases:r,color:o,animationDelay:n=0,onSelectPhase:d,linearIssues:c,localIssues:i,selectedItem:l,onSelectItem:x,composingColumnId:h,onStartCompose:g,onStopCompose:m,onIssueCreated:y,batchMode:k,selectedIssueIds:N,onToggleIssueCheck:u}){const{t:b}=ee(),C=b("kanban.no_phases"),v=r.length===0&&(!i||i.length===0)&&(!c||c.length===0);return e.jsxs("section",{className:"group/col flex flex-col min-w-[var(--size-card-min-width)] flex-1 bg-bg-secondary rounded-[var(--radius-lg)] overflow-hidden motion-safe:animate-[column-enter_200ms_ease-out_both]",style:{animationDelay:`${n}ms`},"aria-label":`${a} column, ${r.length} phases`,children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{backgroundColor:o},"aria-hidden":"true"}),e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary",children:a}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-card rounded-full px-[var(--spacing-1-5)] tabular-nums",children:r.length+((i==null?void 0:i.length)??0)+((c==null?void 0:c.length)??0)}),e.jsx("button",{type:"button",onClick:()=>g==null?void 0:g(t),className:"ml-auto w-5 h-5 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors opacity-0 group-hover/col:opacity-100 focus-visible:opacity-100","aria-label":"Create issue in this column",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]}),e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-2)] px-[var(--spacing-2)] pb-[var(--spacing-2)] overflow-y-auto flex-1",role:"list",children:[h===t&&m&&e.jsx(ct,{columnId:t,onClose:m,onCreated:y}),v?e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-secondary text-center py-[var(--spacing-6)] italic",children:C}):e.jsxs(e.Fragment,{children:[r.map(s=>e.jsx(et,{phase:s},s.phase)),i&&i.length>0&&e.jsxs(e.Fragment,{children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] py-[var(--spacing-1)]",children:[e.jsx("div",{className:"flex-1 h-px bg-border-divider"}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary font-[var(--font-weight-medium)] uppercase tracking-wider",children:"Issues"}),e.jsx("div",{className:"flex-1 h-px bg-border-divider"})]}),i.map(s=>e.jsx(nt,{issue:s,selected:(l==null?void 0:l.type)==="issue"&&l.issue.id===s.id,onSelect:()=>x==null?void 0:x({type:"issue",issue:s}),batchMode:k,isChecked:N==null?void 0:N.has(s.id),onToggleCheck:u},s.id))]}),c&&c.length>0&&e.jsxs(e.Fragment,{children:[(r.length>0||i&&i.length>0)&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] py-[var(--spacing-1)]",children:[e.jsx("div",{className:"flex-1 h-px bg-border-divider"}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary font-[var(--font-weight-medium)] uppercase tracking-wider",children:"Linear"}),e.jsx("div",{className:"flex-1 h-px bg-border-divider"})]}),c.map(s=>e.jsx(tt,{issue:s,selected:(l==null?void 0:l.type)==="linearIssue"&&l.issue.id===s.id,onSelect:()=>x==null?void 0:x({type:"linearIssue",issue:s})},s.id))]})]})]})]})}const xt={backlog:L.pending,triage:"#C8863A","in-progress":L.executing,review:L.verifying,done:L.completed,deferred:"#8B8685"},pt={backlog:"columns.backlog",triage:"columns.triage","in-progress":"columns.in_progress",review:"columns.review",done:"columns.done",deferred:"columns.deferred"},ut={backlog:"backlog",unstarted:"backlog",started:"in-progress",completed:"done"},ht={open:"backlog",registered:"triage",in_progress:"in-progress",resolved:"review",closed:"done",deferred:"deferred"};function vt(t){var r;const a=new Map;for(const o of te)a.set(o.id,[]);for(const o of t){const n=ht[o.status]??"backlog";(r=a.get(n))==null||r.push(o)}return a}function mt(t){var r;const a=new Map;for(const o of te)a.set(o.id,[]);for(const o of t){const n=ut[o.state.type]??"backlog";(r=a.get(n))==null||r.push(o)}return a}function gt({linearIssues:t,localIssues:a,selectedItem:r,onSelectItem:o,composingColumnId:n,onStartCompose:d,onStopCompose:c,onIssueCreated:i,showDone:l=!0,batchMode:x,selectedIssueIds:h,onToggleIssueCheck:g}){const{t:m}=ee(),y=p.useRef(null),k=p.useCallback(b=>{const C=y.current;if(!C)return;const v=Array.from(C.querySelectorAll('[role="button"][tabindex="0"]')),s=document.activeElement,S=s?v.indexOf(s):-1;let z=-1;b.key==="ArrowDown"||b.key==="ArrowRight"?(b.preventDefault(),z=S<v.length-1?S+1:0):b.key==="ArrowUp"||b.key==="ArrowLeft"?(b.preventDefault(),z=S>0?S-1:v.length-1):b.key==="Home"?(b.preventDefault(),z=0):b.key==="End"&&(b.preventDefault(),z=v.length-1),z>=0&&v[z]&&v[z].focus()},[]);p.useEffect(()=>{const b=y.current;if(b)return b.addEventListener("keydown",k),()=>b.removeEventListener("keydown",k)},[k]);const N=p.useMemo(()=>mt(t??[]),[t]),u=p.useMemo(()=>vt(a??[]),[a]);return e.jsx("div",{ref:y,className:"flex gap-[var(--spacing-3)] h-full overflow-x-auto p-[var(--spacing-3)] scroll-smooth",children:te.filter(b=>l||b.id!=="done").map((b,C)=>e.jsx(dt,{columnId:b.id,title:m(pt[b.id]),phases:[],color:xt[b.id]??L.pending,animationDelay:C*50,onSelectPhase:()=>{},linearIssues:N.get(b.id),localIssues:u.get(b.id),selectedItem:r,onSelectItem:o,composingColumnId:n,onStartCompose:d,onStopCompose:c,onIssueCreated:i,batchMode:x,selectedIssueIds:h,onToggleIssueCheck:g},b.id))})}const ft={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},bt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},yt={open:"Open",registered:"Registered",in_progress:"In Progress",resolved:"Resolved",closed:"Closed",deferred:"Deferred"},A="text-left px-[var(--spacing-3)] py-[var(--spacing-2)] text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-tertiary uppercase tracking-wide";function jt({localIssues:t,linearIssues:a,selectedItem:r,onSelectItem:o}){const n=((t==null?void 0:t.length)??0)>0,d=((a==null?void 0:a.length)??0)>0;return!n&&!d?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"No data available"}):e.jsxs("div",{className:"flex flex-col gap-[var(--spacing-4)] h-full overflow-auto p-[var(--spacing-3)]",children:[n&&e.jsxs("section",{children:[e.jsx(pe,{label:"Issues",count:t.length}),e.jsx("div",{className:"rounded-[var(--radius-lg)] overflow-hidden border border-border-divider",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-bg-secondary",children:[e.jsx("th",{className:`${A} w-[80px]`,children:"Type"}),e.jsx("th",{className:A,children:"Title"}),e.jsx("th",{className:`${A} w-[90px]`,children:"Priority"}),e.jsx("th",{className:`${A} w-[100px]`,children:"Status"})]})}),e.jsx("tbody",{children:t.map((c,i)=>{const l=ft[c.type]??"#A09D97",x=bt[c.priority]??"#A09D97",h=(r==null?void 0:r.type)==="issue"&&r.issue.id===c.id;return e.jsxs("tr",{onClick:()=>o==null?void 0:o({type:"issue",issue:c}),className:xe(i,h),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(ue,{label:c.type,color:l})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary",children:c.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)]",children:e.jsx(ue,{label:c.priority,color:x})}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary whitespace-nowrap",children:yt[c.status]??c.status})]},c.id)})})]})})]}),d&&e.jsxs("section",{children:[e.jsx(pe,{label:"Linear",count:a.length}),e.jsx("div",{className:"rounded-[var(--radius-lg)] overflow-hidden border border-border-divider",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-bg-secondary",children:[e.jsx("th",{className:`${A} w-[80px]`,children:"ID"}),e.jsx("th",{className:A,children:"Title"}),e.jsx("th",{className:`${A} w-[110px]`,children:"State"}),e.jsx("th",{className:`${A} w-[90px]`,children:"Priority"})]})}),e.jsx("tbody",{children:a.map((c,i)=>{const l=(r==null?void 0:r.type)==="linearIssue"&&r.issue.id===c.id;return e.jsxs("tr",{onClick:()=>o==null?void 0:o({type:"linearIssue",issue:c}),className:xe(i,l),children:[e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] font-mono text-text-tertiary",children:c.identifier}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary",children:c.title}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary",children:c.state.name}),e.jsx("td",{className:"px-[var(--spacing-3)] py-[var(--spacing-2-5)] text-[length:var(--font-size-xs)] text-text-secondary",children:U[c.priority]})]},c.id)})})]})})]})]})}function xe(t,a){return["cursor-pointer transition-colors border-t border-border-divider",a?"bg-[rgba(90,130,200,0.08)]":t%2===0?"bg-bg-primary hover:bg-bg-hover":"bg-[rgba(0,0,0,0.015)] hover:bg-bg-hover"].join(" ")}function pe({label:t,count:a}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] mb-[var(--spacing-2)]",children:[e.jsx("h3",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:t}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary bg-bg-secondary rounded-full px-[var(--spacing-1-5)] tabular-nums",children:a})]})}function ue({label:t,color:a}){return e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] px-2 py-[var(--spacing-0-5)] rounded-full whitespace-nowrap",style:{backgroundColor:`${a}20`,color:a},children:t})}/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Nt=[["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"}]],wt=F("inbox",Nt),kt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},Ct={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"};function St({localIssues:t,linearIssues:a,selectedItem:r,onSelectItem:o}){const n=p.useMemo(()=>(t??[]).filter(i=>i.status==="open"||i.status==="registered"||i.status==="in_progress"),[t]),d=p.useMemo(()=>(t??[]).filter(i=>i.status==="resolved"||i.status==="closed"||i.status==="deferred"),[t]),c=((t==null?void 0:t.length)??0)+((a==null?void 0:a.length)??0);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-4)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0 bg-bg-secondary",children:[e.jsx(X,{label:"Issues",value:c,sub:`${n.length} open`,color:L.pending}),e.jsx("div",{className:"w-px h-6 bg-border-divider"}),e.jsx(X,{label:"In Progress",value:(t??[]).filter(i=>i.status==="in_progress").length,sub:"active",color:L.executing}),e.jsx("div",{className:"w-px h-6 bg-border-divider"}),e.jsx(X,{label:"Resolved",value:d.length,sub:"done",color:L.completed})]}),e.jsxs("div",{className:"flex-1 grid grid-cols-[1fr_280px] overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col overflow-hidden border-r border-border-divider",children:[e.jsx(he,{icon:e.jsx(wt,{size:14,strokeWidth:2}),label:"Issue Queue",children:e.jsxs("span",{className:"ml-auto text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] px-[var(--spacing-1-5)] py-px rounded-full bg-border-subtle text-text-secondary",children:[n.length," open"]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-[var(--spacing-1)]",children:n.length===0?e.jsx(zt,{message:"No open issues"}):n.map(i=>{const l=kt[i.type]??"#A09D97",x=Ct[i.priority]??"#A09D97",h=(r==null?void 0:r.type)==="issue"&&r.issue.id===i.id;return e.jsxs("button",{type:"button",onClick:()=>o==null?void 0:o({type:"issue",issue:i}),className:["flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2)] w-full text-left transition-colors",h?"bg-[rgba(90,130,200,0.08)]":"hover:bg-bg-hover"].join(" "),children:[e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] px-[6px] py-[2px] rounded-full shrink-0",style:{backgroundColor:`${l}20`,color:l},children:i.type}),e.jsx("span",{className:"flex-1 text-[length:var(--font-size-xs)] text-text-primary line-clamp-1",children:i.title}),e.jsx("span",{className:"text-[length:9px] font-[var(--font-weight-semibold)] px-[6px] py-[2px] rounded-full shrink-0",style:{backgroundColor:`${x}20`,color:x},children:i.priority})]},i.id)})})]}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsx(he,{icon:e.jsx(qe,{size:14,strokeWidth:2}),label:"Summary"}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[var(--spacing-4)] py-[var(--spacing-3)] flex flex-col gap-[var(--spacing-4)]",children:[((t==null?void 0:t.length)??0)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[length:10px] text-text-tertiary uppercase tracking-wider font-[var(--font-weight-semibold)]",children:"Issues"}),e.jsxs("div",{className:"mt-[var(--spacing-2)] flex flex-col gap-[var(--spacing-1-5)]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"Open"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:n.length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"In Progress"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:(t??[]).filter(i=>i.status==="in_progress").length})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:"Resolved"}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] text-text-primary tabular-nums",children:d.length})]})]})]}),((a==null?void 0:a.length)??0)>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[length:10px] text-text-tertiary uppercase tracking-wider font-[var(--font-weight-semibold)]",children:"Linear"}),e.jsx("div",{className:"mt-[var(--spacing-2)]",children:e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[a.length," issues"]})})]})]})]})]})]})}function X({label:t,value:a,sub:r,color:o}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary",children:t}),e.jsxs("div",{className:"flex items-baseline gap-[var(--spacing-1-5)]",children:[e.jsx("span",{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)]",style:{color:o},children:a}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:r})]})]})}function he({icon:t,label:a,children:r}){return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2-5)] border-b border-border-divider shrink-0",children:[e.jsx("span",{className:"text-text-tertiary",children:t}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-[var(--font-weight-semibold)] uppercase tracking-wider text-text-tertiary",children:a}),r]})}function zt({message:t}){return e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-tertiary text-center py-[var(--spacing-6)] italic",children:t})}function _t({issues:t,onClose:a}){const[r,o]=p.useState(new Set),[n,d]=p.useState(!1),[c,i]=p.useState(null),l=K(m=>m.importIssues);function x(){r.size===t.length?o(new Set):o(new Set(t.map(m=>m.id)))}function h(m){const y=new Set(r);y.has(m)?y.delete(m):y.add(m),o(y)}async function g(){const m=t.filter(y=>r.has(y.id));if(m.length!==0){d(!0);try{const y=await l(m);i(y)}catch(y){i({imported:0,errors:[String(y)]})}finally{d(!1)}}}return e.jsx(fe,{open:!0,onOpenChange:m=>!m&&a(),children:e.jsxs(be,{children:[e.jsx(ye,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),e.jsxs(je,{className:ke("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[600px] max-w-[95vw] max-h-[80vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden focus:outline-none"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border",children:[e.jsx(Ne,{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:"Import from Linear"}),e.jsx(we,{className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary hover:bg-bg-hover",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),c?e.jsxs("div",{className:"p-[var(--spacing-4)] space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-primary",children:["Imported ",c.imported," issue(s)."]}),c.errors.length>0&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-status-blocked",children:c.errors.map((m,y)=>e.jsx("div",{children:m},y))}),e.jsx("button",{type:"button",onClick:a,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] bg-bg-secondary border-b border-border",children:e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["Linear issues will be mapped: ",e.jsx("span",{className:"font-mono",children:"identifier"})," → title prefix, ",e.jsx("span",{className:"font-mono",children:"priority"})," → local priority, ",e.jsx("span",{className:"font-mono",children:"state.type"})," → local status"]})}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:t.length===0?e.jsx("div",{className:"p-[var(--spacing-4)] text-[length:var(--font-size-sm)] text-text-secondary text-center",children:"No Linear issues available"}):e.jsxs("table",{className:"w-full text-[length:var(--font-size-xs)]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-text-tertiary",children:[e.jsx("th",{className:"w-8 p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:r.size===t.length,onChange:x})}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Issue"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Status"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Priority"})]})}),e.jsx("tbody",{children:t.map(m=>e.jsxs("tr",{className:"border-b border-border-divider hover:bg-bg-hover cursor-pointer",onClick:()=>h(m.id),children:[e.jsx("td",{className:"p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:r.has(m.id),onChange:()=>h(m.id)})}),e.jsxs("td",{className:"p-[var(--spacing-2)]",children:[e.jsx("span",{className:"font-mono text-text-tertiary",children:m.identifier})," ",e.jsx("span",{className:"text-text-primary",children:m.title})]}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:m.state.name}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:U[m.priority]})]},m.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-t border-border",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[r.size," of ",t.length," selected"]}),e.jsxs("div",{className:"flex gap-[var(--spacing-2)]",children:[e.jsx("button",{type:"button",onClick:a,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] border border-border text-text-secondary text-[length:var(--font-size-sm)] hover:bg-bg-hover",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void g(),disabled:r.size===0||n,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90 disabled:opacity-50",children:n?"Importing...":`Import ${r.size} issue(s)`})]})]})]})]})]})})}function Et({teams:t,selectedTeamId:a,onClose:r}){var C;const[o,n]=p.useState(a??((C=t[0])==null?void 0:C.id)??""),[d,c]=p.useState(new Set),[i,l]=p.useState(!1),[x,h]=p.useState(null),g=O(v=>v.issues),m=O(v=>v.fetchIssues),y=K(v=>v.exportIssues),k=K(v=>v.refresh);p.useEffect(()=>{m()},[m]);function N(){d.size===g.length?c(new Set):c(new Set(g.map(v=>v.id)))}function u(v){const s=new Set(d);s.has(v)?s.delete(v):s.add(v),c(s)}async function b(){const v=g.filter(s=>d.has(s.id));if(!(v.length===0||!o)){l(!0);try{const s=await y(v,o);h(s),await k()}catch(s){h({exported:0,errors:[String(s)]})}finally{l(!1)}}}return e.jsx(fe,{open:!0,onOpenChange:v=>!v&&r(),children:e.jsxs(be,{children:[e.jsx(ye,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),e.jsxs(je,{className:ke("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[600px] max-w-[95vw] max-h-[80vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden focus:outline-none"),children:[e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-b border-border",children:[e.jsx(Ne,{className:"text-[length:var(--font-size-base)] font-[var(--font-weight-semibold)] text-text-primary",children:"Export to Linear"}),e.jsx(we,{className:"w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary hover:bg-bg-hover",children:e.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),x?e.jsxs("div",{className:"p-[var(--spacing-4)] space-y-[var(--spacing-3)]",children:[e.jsxs("p",{className:"text-[length:var(--font-size-sm)] text-text-primary",children:["Exported ",x.exported," issue(s) to Linear."]}),x.errors.length>0&&e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-status-blocked",children:x.errors.map((v,s)=>e.jsx("div",{children:v},s))}),e.jsx("button",{type:"button",onClick:r,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90",children:"Done"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] bg-bg-secondary border-b border-border space-y-[var(--spacing-2)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx("label",{className:"text-[length:var(--font-size-xs)] text-text-secondary shrink-0",children:"Target team:"}),e.jsx("select",{value:o,onChange:v=>n(v.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] border border-border bg-bg-primary text-text-primary text-[length:var(--font-size-xs)]",children:t.map(v=>e.jsxs("option",{value:v.id,children:[v.key," — ",v.name]},v.id))})]}),e.jsxs("p",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:["Local issues will be created in Linear: ",e.jsx("span",{className:"font-mono",children:"title"})," → title, ",e.jsx("span",{className:"font-mono",children:"priority"})," → Linear priority, ",e.jsx("span",{className:"font-mono",children:"description"})," → description"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:g.length===0?e.jsx("div",{className:"p-[var(--spacing-4)] text-[length:var(--font-size-sm)] text-text-secondary text-center",children:"No local issues available"}):e.jsxs("table",{className:"w-full text-[length:var(--font-size-xs)]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-text-tertiary",children:[e.jsx("th",{className:"w-8 p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:d.size===g.length&&g.length>0,onChange:N})}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Title"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Status"}),e.jsx("th",{className:"text-left p-[var(--spacing-2)]",children:"Priority"})]})}),e.jsx("tbody",{children:g.map(v=>e.jsxs("tr",{className:"border-b border-border-divider hover:bg-bg-hover cursor-pointer",onClick:()=>u(v.id),children:[e.jsx("td",{className:"p-[var(--spacing-2)]",children:e.jsx("input",{type:"checkbox",checked:d.has(v.id),onChange:()=>u(v.id)})}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-primary",children:v.title}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:v.status}),e.jsx("td",{className:"p-[var(--spacing-2)] text-text-secondary",children:v.priority})]},v.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-3)] border-t border-border",children:[e.jsxs("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:[d.size," of ",g.length," selected"]}),e.jsxs("div",{className:"flex gap-[var(--spacing-2)]",children:[e.jsx("button",{type:"button",onClick:r,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] border border-border text-text-secondary text-[length:var(--font-size-sm)] hover:bg-bg-hover",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void b(),disabled:d.size===0||!o||i,className:"px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-sm)] bg-accent-blue text-white text-[length:var(--font-size-sm)] hover:opacity-90 disabled:opacity-50",children:i?"Exporting...":`Export ${d.size} issue(s)`})]})]})]})]})]})})}/**
7
- * @license lucide-react v0.577.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Lt=[["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"}]],Dt=F("layout-dashboard",Lt);/**
12
- * @license lucide-react v0.577.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const Tt=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Bt=F("refresh-cw",Tt);/**
17
- * @license lucide-react v0.577.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const At=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Pt=F("upload",At),Ot={"claude-code":"Claude Code",codex:"Codex",gemini:"Gemini",qwen:"Qwen",opencode:"OpenCode"};function $t(){var k,N;const t=D(u=>u.cliPanelIssueId),a=D(u=>u.closeCliPanel),r=D(u=>u.getSlotForIssue),n=O(u=>u.issues).find(u=>u.id===t),d=t?r(t):void 0,c=(d==null?void 0:d.processId)??((k=n==null?void 0:n.execution)==null?void 0:k.processId)??null,i=Oe(u=>u.processes),l=c?i[c]:void 0,x=p.useCallback(()=>{c&&R({action:"stop",processId:c})},[c]);if(!t||!n)return null;const h=(l==null?void 0:l.status)==="running"||(l==null?void 0:l.status)==="spawning",g=((N=n.execution)==null?void 0:N.status)??"idle",m=(d==null?void 0:d.executor)??n.executor??"claude-code",y=Ot[m]??"Agent";return e.jsxs("div",{className:"flex flex-col h-full border-l border-border-divider bg-bg-primary w-[480px] shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-2)] border-b border-border-divider shrink-0",children:[e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary truncate flex-1",children:n.title}),e.jsx("span",{className:"text-[length:10px] font-[var(--font-weight-medium)] px-2 py-[2px] rounded-full bg-bg-hover text-text-secondary shrink-0",children:y}),e.jsx("span",{className:["text-[length:10px] font-[var(--font-weight-medium)] px-2 py-[2px] rounded-full shrink-0",g==="running"?"bg-[#B8954020] text-[#B89540]":g==="completed"?"bg-[#5A9E7820] text-[#5A9E78]":g==="failed"?"bg-[#C4655520] text-[#C46555]":"bg-bg-hover text-text-secondary"].join(" "),children:g}),h&&e.jsx("button",{type:"button",onClick:x,className:"text-[length:var(--font-size-xs)] px-2 py-1 rounded-[var(--radius-sm)] border border-[#C46555] text-[#C46555] hover:bg-[#C4655510] transition-colors shrink-0",children:"Stop"}),e.jsx("button",{type:"button",onClick:a,className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors shrink-0","aria-label":"Close panel",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:e.jsx(Ge,{processId:c})}),e.jsx(Xe,{processId:c,executor:m})]})}const Rt=[{value:"claude-code",label:"Claude Code"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"}];function It(){const t=D(c=>c.selectedIssueIds),a=D(c=>c.clearSelection),[r,o]=p.useState("claude-code"),n=t.size,d=p.useCallback(()=>{n!==0&&(R({action:"execute:batch",issueIds:Array.from(t),executor:r}),a())},[t,r,n,a]);return n===0?null:e.jsxs("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50 flex items-center gap-[var(--spacing-2)] px-[var(--spacing-4)] py-[var(--spacing-2)] rounded-full bg-bg-card border border-border shadow-[0_8px_32px_rgba(0,0,0,0.12)] backdrop-blur-sm",children:[e.jsxs("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-semibold)] text-text-primary",children:[n," selected"]}),e.jsx("div",{className:"w-px h-5 bg-border-divider"}),e.jsx("select",{value:r,onChange:c=>o(c.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] border border-border bg-bg-primary text-text-primary text-[length:var(--font-size-xs)] cursor-pointer",children:Rt.map(c=>e.jsx("option",{value:c.value,children:c.label},c.value))}),e.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-3)] py-[var(--spacing-1)] rounded-full bg-accent-blue text-white text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] hover:opacity-90 transition-opacity",children:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]}),e.jsx("button",{type:"button",onClick:a,className:"w-6 h-6 flex items-center justify-center rounded-full text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors","aria-label":"Clear selection",children:e.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const Mt={create_issue:{bg:"rgba(91, 141, 184, 0.1)",text:"#5B8DB8"},execute_issue:{bg:"rgba(90, 158, 120, 0.1)",text:"#5A9E78"},analyze_issue:{bg:"rgba(145, 120, 181, 0.1)",text:"#9178B5"},plan_issue:{bg:"rgba(145, 120, 181, 0.1)",text:"#9178B5"},advance_phase:{bg:"rgba(184, 149, 64, 0.1)",text:"#B89540"},flag_blocker:{bg:"rgba(196, 101, 85, 0.1)",text:"#C46555"}};function Kt(){const t=D(l=>l.recentDecisions),[a,r]=p.useState(new Set),[o,n]=p.useState(!1),d=p.useMemo(()=>{const l=[];for(const x of t)for(const h of x.deferred){const g=`${x.id}-${h.type}-${h.target}`;a.has(g)||l.push({decisionId:x.id,action:h,timestamp:x.timestamp})}return l.slice(-5)},[t,a]),c=p.useCallback(l=>{l.action.type==="execute_issue"&&R({action:"execute:issue",issueId:l.action.target,executor:l.action.executor??"claude-code"}),r(x=>{const h=new Set(x);return h.add(`${l.decisionId}-${l.action.type}-${l.action.target}`),h})},[]),i=p.useCallback(l=>{r(x=>{const h=new Set(x);return h.add(`${l.decisionId}-${l.action.type}-${l.action.target}`),h})},[]);return d.length===0?null:e.jsxs("div",{className:"border-b border-border-divider bg-bg-secondary",children:[e.jsx("div",{className:"flex items-center justify-between px-[var(--spacing-4)] py-[var(--spacing-1-5)]",children:e.jsxs("button",{type:"button",onClick:()=>n(!o),className:"flex items-center gap-[var(--spacing-1-5)] text-[length:var(--font-size-xs)] font-[var(--font-weight-medium)] text-text-secondary hover:text-text-primary transition-colors",children:[e.jsx("span",{className:"inline-block w-[5px] h-[5px] rounded-full bg-accent-blue animate-pulse"}),"Commander Recommendations (",d.length,")",e.jsx("svg",{className:`w-3 h-3 transition-transform duration-150 ${o?"":"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]})}),!o&&e.jsx("div",{className:"flex flex-wrap gap-[var(--spacing-2)] px-[var(--spacing-4)] pb-[var(--spacing-2)]",children:d.map(l=>{const x=Mt[l.action.type]??{bg:"var(--color-bg-secondary)",text:"var(--color-text-secondary)"};return e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] px-[var(--spacing-3)] py-[var(--spacing-1-5)] rounded-[var(--radius-md)] text-[length:var(--font-size-xs)]",style:{backgroundColor:x.bg},children:[e.jsx("span",{className:"font-[var(--font-weight-medium)]",style:{color:x.text},children:l.action.type.replace("_"," ")}),e.jsx("span",{className:"text-text-secondary truncate max-w-[200px]",title:l.action.target,children:l.action.target}),l.action.reason&&e.jsxs("span",{className:"text-text-tertiary truncate max-w-[150px]",title:l.action.reason,children:["— ",l.action.reason]}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-1)] ml-auto",children:[l.action.type==="execute_issue"&&e.jsx("button",{type:"button",onClick:()=>c(l),className:"text-[10px] font-[var(--font-weight-medium)] px-[var(--spacing-2)] py-[var(--spacing-0-5)] rounded-full transition-colors",style:{backgroundColor:"rgba(90, 158, 120, 0.15)",color:"#5A9E78"},children:"Approve"}),e.jsx("button",{type:"button",onClick:()=>i(l),className:"text-[10px] text-text-tertiary hover:text-text-secondary transition-colors px-1",children:"x"})]})]},`${l.decisionId}-${l.action.type}-${l.action.target}`)})})]})}const Ce=[{value:"bug",label:"Bug",color:"#C46555"},{value:"feature",label:"Feature",color:"#5B8DB8"},{value:"improvement",label:"Improve",color:"#9178B5"},{value:"task",label:"Task",color:"#A09D97"}],Se=[{value:"urgent",label:"Urgent",color:"#C46555"},{value:"high",label:"High",color:"#B89540"},{value:"medium",label:"Medium",color:"#5B8DB8"},{value:"low",label:"Low",color:"#A09D97"}];function ve({type:t,setType:a,priority:r,setPriority:o,dark:n}){const d=n?"20":"18",c=n?"35":"28";return e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[Ce.map(i=>e.jsx("button",{type:"button",onClick:()=>a(i.value),className:"text-[10px] font-medium px-2 py-[2px] rounded-full transition-all duration-100",style:{background:`${i.color}${t===i.value?c:d}`,color:i.color,outline:t===i.value?`1.5px solid ${i.color}70`:"none"},children:i.label},i.value)),e.jsx("div",{className:"w-px h-3",style:{backgroundColor:n?"rgba(255,255,255,0.12)":"var(--color-border-divider)"}}),Se.map(i=>e.jsx("button",{type:"button",onClick:()=>o(i.value),className:"text-[10px] font-medium px-2 py-[2px] rounded-full transition-all duration-100",style:{background:`${i.color}${r===i.value?c:d}`,color:i.color,outline:r===i.value?`1.5px solid ${i.color}70`:"none"},children:i.label},i.value))]})}function Ut({open:t,columnId:a,style:r,onClose:o,onCreated:n}){const[d,c]=p.useState(""),[i,l]=p.useState(""),[x,h]=p.useState("task"),[g,m]=p.useState("medium"),[y,k]=p.useState(!1),N=p.useRef(null),u=p.useRef(null),b=O(s=>s.createIssue);p.useEffect(()=>{t&&(c(""),l(""),h("task"),m("medium"),requestAnimationFrame(()=>{var s;return(s=N.current)==null?void 0:s.focus()}))},[t]),p.useEffect(()=>{function s(S){S.key==="Escape"&&o()}return t&&window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,o]);const C=p.useCallback(async()=>{const s=d.trim();!s||y||(k(!0),await b({title:s,description:i.trim(),type:x,priority:g}),k(!1),n==null||n(),o())},[d,i,x,g,y,b,n,o]);function v(s){s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&C()}return t?r===1?e.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[13vh]",style:{backgroundColor:"rgba(0,0,0,0.75)",backdropFilter:"blur(3px)"},onClick:o,children:e.jsxs("div",{className:"w-full max-w-[540px] mx-4 rounded-[14px] overflow-hidden motion-safe:animate-[modal-enter_150ms_ease-out_both]",style:{backgroundColor:"#1D1B18",boxShadow:"0 28px 90px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.07)",borderTop:"2.5px solid var(--color-accent-orange)"},onClick:s=>s.stopPropagation(),children:[e.jsx("div",{className:"px-5 pt-5 pb-3",children:e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),C()),v(s)},placeholder:"What needs to be done?",className:"w-full bg-transparent text-[length:var(--font-size-base)] font-medium outline-none",style:{color:"rgba(255,255,255,0.88)",caretColor:"var(--color-accent-orange)"}})}),e.jsx("div",{className:"px-5 pb-4 pt-3 border-t",style:{borderColor:"rgba(255,255,255,0.07)"},children:e.jsx(ve,{type:x,setType:h,priority:g,setPriority:m,dark:!0})}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-2.5 border-t text-[10px]",style:{borderColor:"rgba(255,255,255,0.07)",color:"rgba(255,255,255,0.3)"},children:[e.jsxs("span",{children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:"↵"})," ","create · "," ",e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:"Esc"})," ","cancel"]}),e.jsx("span",{className:"opacity-60",children:a})]})]})}):r===2?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:"rgba(0,0,0,0.44)"},onClick:o,children:e.jsxs("div",{className:"w-full max-w-[540px] rounded-[var(--radius-xl)] border overflow-hidden motion-safe:animate-[modal-enter_160ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-lg)"},onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"New Issue"}),e.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full capitalize",style:{backgroundColor:"var(--color-bg-secondary)",color:"var(--color-text-tertiary)"},children:a.replace("-"," ")})]}),e.jsx("button",{type:"button",onClick:o,className:"w-6 h-6 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"px-5 py-4 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:["Title ",e.jsx("span",{style:{color:"var(--color-accent-red)"},children:"*"})]}),e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:v,placeholder:"Issue title...",className:"w-full px-3 py-2 rounded-[var(--radius-default)] border text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-placeholder bg-transparent outline-none transition-colors",style:{borderColor:"var(--color-border)"},onFocus:s=>{s.target.style.borderColor="var(--color-accent-blue)"},onBlur:s=>{s.target.style.borderColor="var(--color-border)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:"Description"}),e.jsx("textarea",{ref:u,value:i,onChange:s=>l(s.target.value),onKeyDown:v,placeholder:"Optional description...",rows:3,className:"w-full px-3 py-2 rounded-[var(--radius-default)] border text-[length:var(--font-size-sm)] text-text-primary placeholder:text-text-placeholder bg-transparent outline-none resize-none transition-colors",style:{borderColor:"var(--color-border)"},onFocus:s=>{s.target.style.borderColor="var(--color-accent-blue)"},onBlur:s=>{s.target.style.borderColor="var(--color-border)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--color-text-tertiary)"},children:"Type"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Ce.map(s=>e.jsx("button",{type:"button",onClick:()=>h(s.value),className:"text-[11px] font-medium px-3 py-1 rounded-[var(--radius-default)] transition-all",style:{background:x===s.value?`${s.color}25`:"var(--color-bg-secondary)",color:x===s.value?s.color:"var(--color-text-secondary)",outline:x===s.value?`1.5px solid ${s.color}55`:"none"},children:s.label},s.value))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-wider mb-2",style:{color:"var(--color-text-tertiary)"},children:"Priority"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Se.map(s=>e.jsx("button",{type:"button",onClick:()=>m(s.value),className:"text-[11px] font-medium px-3 py-1 rounded-[var(--radius-default)] transition-all",style:{background:g===s.value?`${s.color}25`:"var(--color-bg-secondary)",color:g===s.value?s.color:"var(--color-text-secondary)",outline:g===s.value?`1.5px solid ${s.color}55`:"none"},children:s.label},s.value))})]})]}),e.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-t",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("span",{className:"text-[10px]",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"var(--color-bg-secondary)"},children:"⌘↵"})," ","to create"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:o,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] border transition-colors hover:bg-bg-hover",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!d.trim()||y,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] text-white font-medium transition-all disabled:opacity-40",style:{backgroundColor:"var(--color-accent-orange)"},children:y?"Creating…":"Create Issue"})]})]})]})}):e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--color-bg-primary)"},onClick:o,children:[e.jsxs("div",{className:"absolute top-5 right-6 flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void C(),disabled:!d.trim()||y,className:"px-4 py-1.5 rounded-[var(--radius-default)] text-[length:var(--font-size-xs)] text-white font-medium transition-all disabled:opacity-40",style:{backgroundColor:"var(--color-accent-orange)"},children:y?"Creating…":"Create"}),e.jsx("button",{type:"button",onClick:o,className:"w-8 h-8 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"w-full max-w-[720px] px-8 motion-safe:animate-[modal-enter_180ms_ease-out_both]",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"text-[10px] font-semibold uppercase tracking-widest mb-4",style:{color:"var(--color-text-tertiary)"},children:["New Issue · ",a.replace("-"," ")]}),e.jsx("input",{ref:N,value:d,onChange:s=>c(s.target.value),onKeyDown:s=>{var S;s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),(S=u.current)==null||S.focus()),v(s)},placeholder:"Untitled issue",className:"w-full bg-transparent outline-none mb-5 leading-tight",style:{fontSize:"var(--font-size-2xl)",fontWeight:700,color:"var(--color-text-primary)",caretColor:"var(--color-accent-orange)"}}),e.jsx("textarea",{ref:u,value:i,onChange:s=>l(s.target.value),onKeyDown:v,placeholder:"Add a description… (optional)",rows:7,className:"w-full bg-transparent outline-none resize-none leading-relaxed mb-8",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-secondary)",caretColor:"var(--color-accent-orange)"}}),e.jsxs("div",{className:"flex items-center gap-4 pt-4 border-t flex-wrap",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(ve,{type:x,setType:h,priority:g,setPriority:m}),e.jsxs("div",{className:"ml-auto text-[10px]",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("kbd",{className:"px-1 py-0.5 rounded font-mono text-[9px]",style:{backgroundColor:"var(--color-bg-secondary)"},children:"⌘↵"})," ","to create"]})]})]})]}):null}const me={high:{color:"#5A9E78",bg:"#5A9E7820"},medium:{color:"#B89540",bg:"#B8954020"},low:{color:"#C46555",bg:"#C4655520"}};function Ft(t){return t>=.7?"high":t>=.4?"medium":"low"}function Ht({analysis:t}){const a=Ft(t.confidence),r=me[a]??me.low;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Root Cause"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.root_cause})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Impact"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.impact})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:"Confidence"}),e.jsxs("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{backgroundColor:r.bg,color:r.color},children:[a," (",Math.round(t.confidence*100),"%)"]})]}),t.related_files.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Related Files"}),e.jsx("ul",{className:"space-y-0.5",children:t.related_files.map((o,n)=>e.jsx("li",{className:"font-mono text-[11px] truncate",style:{color:"var(--color-text-secondary)"},children:o},n))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Suggested Approach"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.suggested_approach})]}),e.jsxs("div",{className:"text-[10px] pt-1",style:{color:"var(--color-text-tertiary)"},children:["Analyzed by ",t.analyzed_by," at ",new Date(t.analyzed_at).toLocaleString()]})]})}function Wt({solution:t}){return e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",style:{fontSize:"var(--font-size-xs)"},children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:[e.jsx("th",{className:"py-1 pr-2 w-6",children:"#"}),e.jsx("th",{className:"py-1 pr-2",children:"Target"}),e.jsx("th",{className:"py-1 pr-2",children:"Description"}),e.jsx("th",{className:"py-1",children:"Verification"})]})}),e.jsx("tbody",{children:t.steps.map((a,r)=>e.jsxs("tr",{className:"border-t",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx("td",{className:"py-1.5 pr-2 font-mono",style:{color:"var(--color-text-tertiary)"},children:r+1}),e.jsx("td",{className:"py-1.5 pr-2 font-mono truncate max-w-[120px]",style:{color:"var(--color-text-secondary)"},title:a.target,children:a.target??"-"}),e.jsx("td",{className:"py-1.5 pr-2",style:{color:"var(--color-text-secondary)"},children:a.description}),e.jsx("td",{className:"py-1.5",style:{color:"var(--color-text-tertiary)"},children:a.verification??"-"})]},r))})]})}),t.context&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1",style:{color:"var(--color-text-tertiary)"},children:"Context"}),e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.context})]}),t.planned_by&&e.jsxs("div",{className:"text-[10px] pt-1",style:{color:"var(--color-text-tertiary)"},children:["Planned by ",t.planned_by,t.planned_at&&` at ${new Date(t.planned_at).toLocaleString()}`]})]})}const Vt={idle:"#A09D97",queued:"#5B8DB8",running:"#B89540",completed:"#5A9E78",failed:"#C46555",retrying:"#B89540"};function Yt({execution:t}){const a=Vt[t.status]??"#A09D97",r=t.result;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:a}}),e.jsx("span",{className:"text-[11px] font-medium capitalize",style:{color:"var(--color-text-primary)"},children:t.status})]}),r&&e.jsxs(e.Fragment,{children:[r.summary&&e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:r.summary}),e.jsxs("div",{className:"flex flex-wrap gap-3",style:{fontSize:"var(--font-size-xs)"},children:[r.commitHash&&e.jsxs("div",{style:{color:"var(--color-text-secondary)"},children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Commit: "}),e.jsx("span",{className:"font-mono",children:r.commitHash.slice(0,8)})]}),r.prUrl&&e.jsxs("div",{children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"PR: "}),e.jsx("a",{href:r.prUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",style:{color:"var(--color-accent-blue)"},children:r.prUrl.replace(/^https?:\/\/[^/]+/,"")})]}),r.filesChanged!=null&&e.jsxs("div",{style:{color:"var(--color-text-secondary)"},children:[e.jsx("span",{style:{color:"var(--color-text-tertiary)"},children:"Files: "}),r.filesChanged]})]})]})]})}const qt={bug:"#C46555",feature:"#5B8DB8",improvement:"#9178B5",task:"#A09D97"},Gt={urgent:"#C46555",high:"#B89540",medium:"#5B8DB8",low:"#A09D97"},Xt={idle:"#A09D97",queued:"#5B8DB8",running:"#B89540",completed:"#5A9E78",failed:"#C46555",retrying:"#B89540"};function Q(){return e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function _({label:t,color:a,bg:r}){return e.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full",style:{backgroundColor:r,color:a},children:t})}function w({label:t,children:a}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider mb-1.5",style:{color:"var(--color-text-tertiary)"},children:t}),a]})}const Qt=[{value:"gemini",label:"Gemini"},{value:"qwen",label:"Qwen"}],Jt=[{value:"standard",label:"Standard"},{value:"deep",label:"Deep"}];function Zt({issue:t}){var r;const a=[{label:"Analyze",done:!!t.analysis},{label:"Plan",done:!!t.solution&&t.solution.steps.length>0},{label:"Execute",done:!!((r=t.execution)!=null&&r.result)}];return e.jsx("div",{className:"flex items-center gap-1 mb-2.5",children:a.map((o,n)=>e.jsxs("div",{className:"flex items-center gap-1",children:[n>0&&e.jsx("div",{className:"w-6 h-px",style:{backgroundColor:o.done||a[n-1].done?"var(--color-accent-blue)":"var(--color-border)"}}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex items-center justify-center text-[7px]",style:{backgroundColor:o.done?"var(--color-accent-blue)":"transparent",border:o.done?"none":"1.5px solid var(--color-border)",color:o.done?"white":"var(--color-text-tertiary)"},children:o.done?"✓":""}),e.jsx("span",{className:"text-[9px]",style:{color:o.done?"var(--color-text-primary)":"var(--color-text-tertiary)"},children:o.label})]})]},o.label))})}function J({issue:t}){const a=$e(),[r,o]=p.useState("gemini"),[n,d]=p.useState("standard"),c=P(t);if(c!=="open"&&c!=="analyzing"&&c!=="planned")return null;const i=h=>{R(h),a("/chat")},l=t.solution&&t.solution.steps.length>0?"Execute":t.analysis?"Continue":"Run Pipeline",x=t.analysis?t.solution?{label:"Execute",onClick:()=>i({action:"execute:issue",issueId:t.id})}:{label:"Plan",onClick:()=>i({action:"issue:plan",issueId:t.id,tool:r})}:{label:"Analyze",onClick:()=>i({action:"issue:analyze",issueId:t.id,tool:r,depth:n})};return e.jsxs("div",{children:[e.jsx(Zt,{issue:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:r,onChange:h=>o(h.target.value),className:"text-[10px] px-1.5 py-1 rounded border cursor-pointer",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)",color:"var(--color-text-tertiary)"},children:Qt.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))}),e.jsx("select",{value:n,onChange:h=>d(h.target.value),className:"text-[10px] px-1.5 py-1 rounded border cursor-pointer",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-primary)",color:"var(--color-text-tertiary)"},children:Jt.map(h=>e.jsx("option",{value:h.value,children:h.label},h.value))}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{type:"button",onClick:x.onClick,className:"text-[11px] font-medium px-3.5 py-1.5 rounded-md transition-colors hover:opacity-90 border",style:{borderColor:"var(--color-border)",color:"var(--color-text-secondary)",backgroundColor:"transparent"},children:x.label}),e.jsx("button",{type:"button",onClick:()=>i({action:"issue:pipeline",issueId:t.id,tool:r}),className:"text-[11px] font-medium px-3.5 py-1.5 rounded-md transition-colors hover:opacity-90",style:{backgroundColor:"var(--color-accent-blue)",color:"white"},children:l})]})]})}function Z({issue:t}){var o;const{tasks:a,loading:r}=Fe((o=t.task_refs)!=null&&o.length?t.id:null);return e.jsxs(e.Fragment,{children:[t.analysis&&e.jsx(w,{label:"Analysis",children:e.jsx(Ht,{analysis:t.analysis})}),a.length>0&&e.jsx(w,{label:`Execution Plan (${a.length})`,children:e.jsx(He,{tasks:a})}),r&&e.jsx(w,{label:"Execution Plan",children:e.jsx("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:"Loading…"})}),!a.length&&!r&&t.solution&&e.jsx(w,{label:"Solution",children:e.jsx(Wt,{solution:t.solution})}),t.execution&&t.execution.result&&e.jsx(w,{label:"Execution Result",children:e.jsx(Yt,{execution:t.execution})})]})}function er({issue:t,style:a,onClose:r}){var c,i;const o=qt[t.type]??"#A09D97",n=Gt[t.priority]??"#A09D97",d=t.execution?Xt[t.execution.status]??"#A09D97":"#A09D97";return p.useEffect(()=>{function l(x){x.key==="Escape"&&r()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[r]),a===1?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[60]",style:{backgroundColor:"rgba(0,0,0,0.22)"},onClick:r}),e.jsxs("div",{className:"fixed right-0 top-0 bottom-0 z-[70] w-[400px] flex flex-col overflow-hidden motion-safe:animate-[slide-in-right_180ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderLeft:"1px solid var(--color-border)",boxShadow:"var(--shadow-lg)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-5 py-3 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--color-text-tertiary)"},children:t.id.slice(0,14)}),e.jsx(_,{label:t.type,color:o,bg:`${o}20`}),e.jsx(_,{label:t.priority,color:n,bg:`${n}20`})]}),e.jsx("button",{type:"button",onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(Q,{})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[e.jsx("h2",{className:"font-bold leading-snug",style:{fontSize:"var(--font-size-lg)",color:"var(--color-text-primary)"},children:t.title}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.executor})}),t.description&&e.jsx(w,{label:"Description",children:e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.description})}),e.jsx(Z,{issue:t}),t.execution&&t.execution.status!=="idle"&&e.jsx(w,{label:"Execution",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.execution.status}),t.execution.retryCount>0&&e.jsxs("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:["(x",t.execution.retryCount,")"]})]}),t.execution.lastError&&e.jsx("div",{className:"rounded px-2.5 py-2",style:{fontSize:"var(--font-size-xs)",color:"#C46555",backgroundColor:"#C4655510",border:"1px solid #C4655530"},children:t.execution.lastError})]})}),e.jsx(w,{label:"Activity",children:e.jsxs("div",{className:"space-y-1",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:[e.jsxs("div",{children:["Created ",E(t.created_at)]}),e.jsxs("div",{children:["Updated ",E(t.updated_at)]})]})})]}),e.jsx("div",{className:"shrink-0 px-5 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx(J,{issue:t})})]})]}):a===2?e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-6",style:{backgroundColor:"rgba(0,0,0,0.52)"},onClick:r,children:e.jsxs("div",{className:"w-full max-w-[880px] rounded-[var(--radius-xl)] border overflow-hidden flex max-h-[86vh] motion-safe:animate-[modal-enter_180ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border)",boxShadow:"var(--shadow-lg)"},onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden border-r",style:{borderColor:"var(--color-border-divider)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-6 py-3.5 border-b",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx("span",{className:"text-[10px] font-mono",style:{color:"var(--color-text-tertiary)"},children:t.id}),e.jsx("button",{type:"button",onClick:r,className:"w-7 h-7 flex items-center justify-center rounded text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(Q,{})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(_,{label:t.type,color:o,bg:`${o}20`}),e.jsx(_,{label:t.priority,color:n,bg:`${n}20`}),(()=>{const l=P(t),x=$[l];return e.jsx(_,{label:l.replace("_"," "),color:x,bg:`${x}20`})})()]}),e.jsx("h2",{className:"font-bold leading-snug mb-5",style:{fontSize:"var(--font-size-xl)",color:"var(--color-text-primary)"},children:t.title}),t.description?e.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.description}):e.jsx("p",{className:"italic",style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-placeholder)"},children:"No description provided."}),((c=t.execution)==null?void 0:c.lastError)&&e.jsxs("div",{className:"mt-5 rounded-[var(--radius-md)] p-3",style:{backgroundColor:"#C4655510",border:"1px solid #C4655330"},children:[e.jsx("div",{className:"font-semibold mb-1",style:{fontSize:"var(--font-size-xs)",color:"#C46555"},children:"Execution Error"}),e.jsx("div",{className:"whitespace-pre-wrap",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:t.execution.lastError})]}),e.jsx("div",{className:"mt-5 space-y-5",children:e.jsx(Z,{issue:t})})]})]}),e.jsx("div",{className:"shrink-0 px-6 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx(J,{issue:t})}),e.jsxs("div",{className:"w-[270px] shrink-0 overflow-y-auto px-5 py-5 space-y-5",style:{backgroundColor:"var(--color-bg-secondary)"},children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-tertiary)"},children:"Properties"}),e.jsx(w,{label:"Type",children:e.jsx(_,{label:t.type,color:o,bg:`${o}25`})}),e.jsx(w,{label:"Priority",children:e.jsx(_,{label:t.priority,color:n,bg:`${n}25`})}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-secondary)"},children:t.executor})}),t.execution&&t.execution.status!=="idle"&&e.jsxs(w,{label:"Execution",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d}}),e.jsxs("span",{style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)"},children:[t.execution.status,t.execution.retryCount>0&&` (x${t.execution.retryCount})`]})]}),t.execution.startedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Started ",E(t.execution.startedAt)]})]}),e.jsxs("div",{className:"pt-3 border-t space-y-3",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(w,{label:"Created",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.created_at)})}),e.jsx(w,{label:"Updated",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.updated_at)})})]})]})]})}):e.jsxs("div",{className:"fixed inset-0 z-[60] flex flex-col motion-safe:animate-[slide-up_220ms_ease-out_both]",style:{backgroundColor:"var(--color-bg-primary)"},children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-6 py-2.5 border-b",style:{borderColor:"var(--color-border-divider)",backgroundColor:"var(--color-bg-card)"},children:[e.jsxs("nav",{className:"flex items-center gap-1.5",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-tertiary)"},children:[e.jsx("span",{children:"Kanban"}),e.jsx("span",{children:"›"}),e.jsx("span",{children:"Issues"}),e.jsx("span",{children:"›"}),e.jsx("span",{className:"font-medium truncate max-w-[360px]",style:{color:"var(--color-text-primary)"},children:t.title})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{label:t.type,color:o,bg:`${o}20`}),e.jsx(_,{label:t.priority,color:n,bg:`${n}20`}),(()=>{const l=P(t),x=$[l];return e.jsx(_,{label:l.replace("_"," "),color:x,bg:`${x}20`})})(),e.jsxs("button",{type:"button",onClick:r,className:"ml-2 flex items-center gap-1.5 px-3 py-1.5 rounded-[var(--radius-default)] border text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors",style:{borderColor:"var(--color-border)",fontSize:"var(--font-size-xs)"},children:[e.jsx(Q,{}),"Close"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx("div",{className:"flex-1 overflow-y-auto px-12 py-10",children:e.jsxs("div",{className:"max-w-[740px] mx-auto",children:[e.jsx("div",{className:"font-mono mb-4",style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:t.id}),e.jsx("h1",{className:"font-bold leading-tight mb-6",style:{fontSize:"var(--font-size-2xl)",color:"var(--color-text-primary)"},children:t.title}),t.description?e.jsx("div",{className:"leading-relaxed whitespace-pre-wrap",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-secondary)"},children:t.description}):e.jsx("div",{className:"italic",style:{fontSize:"var(--font-size-base)",color:"var(--color-text-placeholder)"},children:"No description provided."}),((i=t.execution)==null?void 0:i.lastError)&&e.jsxs("div",{className:"mt-8 rounded-[var(--radius-md)] p-5",style:{backgroundColor:"#C4655510",border:"1px solid #C4655330"},children:[e.jsx("div",{className:"font-semibold mb-2",style:{fontSize:"var(--font-size-sm)",color:"#C46555"},children:"Execution Error"}),e.jsx("pre",{className:"whitespace-pre-wrap leading-relaxed",style:{fontSize:"var(--font-size-xs)",color:"var(--color-text-secondary)",fontFamily:"var(--font-mono)"},children:t.execution.lastError})]}),e.jsx("div",{className:"mt-8 space-y-6",children:e.jsx(Z,{issue:t})})]})}),e.jsx("div",{className:"shrink-0 px-12 py-3",style:{borderTop:"1px solid var(--color-border-divider)"},children:e.jsx("div",{className:"max-w-[740px] mx-auto",children:e.jsx(J,{issue:t})})})]}),e.jsxs("div",{className:"w-[280px] shrink-0 border-l overflow-y-auto px-6 py-8 space-y-6",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-secondary)"},children:[e.jsx(w,{label:"Type",children:e.jsx(_,{label:t.type,color:o,bg:`${o}20`})}),e.jsx(w,{label:"Priority",children:e.jsx(_,{label:t.priority,color:n,bg:`${n}20`})}),e.jsx(w,{label:"Status",children:(()=>{const l=P(t),x=$[l];return e.jsx("span",{className:"text-[11px] font-medium px-2.5 py-1 rounded-full",style:{backgroundColor:`${x}20`,color:x},children:l.replace("_"," ")})})()}),t.executor&&e.jsx(w,{label:"Executor",children:e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.executor})}),t.execution&&t.execution.status!=="idle"&&e.jsx(w,{label:"Execution",children:e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:d}}),e.jsx("span",{style:{fontSize:"var(--font-size-sm)",color:"var(--color-text-primary)"},children:t.execution.status})]}),t.execution.retryCount>0&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:[t.execution.retryCount," retry attempt",t.execution.retryCount>1?"s":""]}),t.execution.startedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Started ",E(t.execution.startedAt)]}),t.execution.completedAt&&e.jsxs("div",{style:{fontSize:"10px",color:"var(--color-text-tertiary)"},children:["Completed ",E(t.execution.completedAt)]})]})}),e.jsxs("div",{className:"pt-4 border-t space-y-4",style:{borderColor:"var(--color-border-divider)"},children:[e.jsx(w,{label:"Created",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.created_at)})}),e.jsx(w,{label:"Updated",children:e.jsx("span",{style:{fontSize:"11px",color:"var(--color-text-secondary)"},children:E(t.updated_at)})})]})]})]})]})}function E(t){const a=Date.now(),r=new Date(t).getTime(),o=a-r;if(o<0)return"just now";const n=Math.floor(o/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const d=Math.floor(n/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}const tr=["All","Open","Registered","In Progress","Resolved","Deferred"],ge=["kanban","table","center"];function vr(){const[t,a]=p.useState("kanban"),[r,o]=p.useState("All"),[n,d]=p.useState(null),[c,i]=p.useState(!1),[l,x]=p.useState(!1),[h,g]=p.useState(!1),[m,y]=p.useState(null),[k,N]=p.useState(!1),[u,b]=p.useState("backlog"),[C,v]=p.useState(null),s=de(f=>f.createModalStyle),S=de(f=>f.detailModalStyle),{register:z,unregister:j}=p.useContext(Re),{issues:T,fetchIssues:H}=O(G(f=>({issues:f.issues,fetchIssues:f.fetchIssues}))),{selectedIssueIds:re,toggleSelect:ze,cliPanelIssueId:I,supervisorStatus:rr}=D(G(f=>({selectedIssueIds:f.selectedIssueIds,toggleSelect:f.toggleSelect,cliPanelIssueId:f.cliPanelIssueId,supervisorStatus:f.supervisorStatus}))),_e=re.size>0,{configured:W,board:V,teams:Y,selectedTeamId:ae,loading:se,checkStatus:oe,fetchTeams:ne,selectTeam:Ee,refresh:Le}=K(G(f=>({configured:f.configured,board:f.board,teams:f.teams,selectedTeamId:f.selectedTeamId,loading:f.loading,checkStatus:f.checkStatus,fetchTeams:f.fetchTeams,selectTeam:f.selectTeam,refresh:f.refresh})));p.useEffect(()=>{H()},[H]),p.useEffect(()=>{oe()},[oe]),p.useEffect(()=>{W&&ne()},[W,ne]);const M=p.useMemo(()=>V?V.columns.flatMap(f=>f.issues):[],[V]),De=n!==null&&!I,le=p.useCallback(f=>{a(ge[f]??"kanban")},[]);p.useEffect(()=>{z({items:[{label:"Kanban",icon:e.jsx(Ie,{size:14}),shortcut:"K"},{label:"Table",icon:e.jsx(We,{size:14}),shortcut:"L"},{label:"Center",icon:e.jsx(Dt,{size:14}),shortcut:"C"}],activeIndex:ge.indexOf(t),onSwitch:le})},[z,t,le]),p.useEffect(()=>()=>j(),[j]),p.useEffect(()=>{function f(B){B.target instanceof HTMLInputElement||B.target instanceof HTMLTextAreaElement||B.target instanceof HTMLSelectElement||B.key==="c"&&!B.metaKey&&!B.ctrlKey&&(b("backlog"),N(!0))}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]);function q(f){if(f.type==="issue"){v(f.issue),d(null);return}const B=(n==null?void 0:n.type)===f.type&&f.type==="linearIssue"&&n.issue.id===f.issue.id;d(B?null:f)}function Te(f){b(f),N(!0)}function Be(){d(null)}function ie(){H()}const Ae=(n==null?void 0:n.type)==="linearIssue"?"Linear Issue":"Issue Detail";return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(Kt,{}),e.jsx("div",{className:"px-[var(--spacing-4)] py-[var(--spacing-2)] border-b border-border-divider shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-[var(--spacing-3)]",children:[e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)]",children:[e.jsx(Je,{chips:[...tr],active:r,onSelect:o}),e.jsxs("button",{type:"button",onClick:()=>g(!h),className:["flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-[length:var(--font-size-xs)] transition-colors",h?"border-accent-blue text-accent-blue bg-[var(--color-accent-blue-10,rgba(90,130,200,0.1))]":"text-text-secondary hover:text-text-primary"].join(" "),style:h?void 0:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:h?"Hide Done column":"Show Done column",children:[e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),"Done"]})]}),W&&e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] shrink-0",children:[Y.length>0&&e.jsx("select",{value:ae??"",onChange:f=>Ee(f.target.value),className:"px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-primary text-[length:var(--font-size-xs)]",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:Y.map(f=>e.jsxs("option",{value:f.id,children:[f.key," — ",f.name]},f.id))}),e.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary text-[length:var(--font-size-xs)] transition-colors",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Import from Linear",children:[e.jsx(Qe,{size:12}),e.jsx("span",{children:"Import"})]}),e.jsxs("button",{type:"button",onClick:()=>x(!0),className:"flex items-center gap-[var(--spacing-1)] px-[var(--spacing-2)] py-[var(--spacing-1)] rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary text-[length:var(--font-size-xs)] transition-colors",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Export to Linear",children:[e.jsx(Pt,{size:12}),e.jsx("span",{children:"Export"})]}),e.jsx("button",{type:"button",onClick:()=>void Le(),disabled:se,className:"flex items-center justify-center w-7 h-7 rounded-[var(--radius-sm)] text-text-secondary hover:text-text-primary transition-colors disabled:opacity-50",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},title:"Refresh Linear board",children:e.jsx(Bt,{size:12,className:se?"animate-spin":""})})]})]})}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex-1 overflow-auto min-w-0",children:[t==="kanban"&&e.jsx(gt,{linearIssues:M,localIssues:T,selectedItem:n,onSelectItem:q,composingColumnId:m,onStartCompose:Te,onStopCompose:()=>y(null),onIssueCreated:ie,showDone:h,batchMode:_e,selectedIssueIds:re,onToggleIssueCheck:ze}),t==="table"&&e.jsx(jt,{localIssues:T,linearIssues:M,selectedItem:n,onSelectItem:q}),t==="center"&&e.jsx(St,{localIssues:T,linearIssues:M,selectedItem:n,onSelectItem:q})]}),I&&e.jsx($t,{}),!I&&e.jsx(Ve,{open:De,onClose:Be,title:Ae,children:n&&e.jsx(Ye,{selectedItem:n})})]}),e.jsx(It,{}),c&&e.jsx(_t,{issues:M,onClose:()=>i(!1)}),l&&e.jsx(Et,{teams:Y,selectedTeamId:ae,onClose:()=>x(!1)}),e.jsx(Ut,{open:k,columnId:u,style:s,onClose:()=>N(!1),onCreated:ie}),C&&!I&&e.jsx(er,{issue:C,style:S,onClose:()=>v(null)})]})}export{vr as KanbanPage};
@@ -1,21 +0,0 @@
1
- import{d as K,o as ge,a5 as E,j as e,r as y,X as ve,a6 as Q,a4 as se,R as ye,P as je,O as Ne,f as we,T as Ce,h as ke,i as B,V as Me,n as Le}from"./index-uIqUCT8y.js";import{L as Oe}from"./list-BTRAIvDq.js";import{T as oe}from"./terminal-CzogW4cl.js";import{S as ae}from"./search-DVtgy2W7.js";import{T as Se}from"./trash-2-52LATVfW.js";import{C as Ee}from"./chevron-right-BXySK2fn.js";import{F as Ae,a as De,D as Ie}from"./folder-DbGbLNFN.js";import{D as Te}from"./download-swRJnate.js";import{m as M}from"./proxy-Dtx5p6IO.js";import{P as Pe}from"./pen-line-C4_O16H0.js";import{A as Be}from"./index-DIoMBMbv.js";import{C as We}from"./check-o7nfGNHf.js";import{C as Re}from"./code-BQa9oL1n.js";import{M as _e}from"./minus-BjMxRTET.js";/**
2
- * @license lucide-react v0.577.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Fe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ze=K("chevron-left",Fe);/**
7
- * @license lucide-react v0.577.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Ge=[["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"}]],q=K("globe",Ge);/**
12
- * @license lucide-react v0.577.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const Ve=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],$e=K("package",Ve);/**
17
- * @license lucide-react v0.577.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const Je=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Ye=K("wrench",Je);function He(t,o,r){return t==="project"&&r?`project:${o}@${r}`:`${t}:${o}`}function Ue(t){const o=[],r=t.globalServers??{},n=t.projects??{},a=t.enterpriseServers??{},i=t.codex;for(const[d,m]of Object.entries(r))o.push(Y(d,m,"global"));for(const[d,m]of Object.entries(n)){const b=m.mcpServers??{},l=m.disabledMcpServers??[];for(const[x,p]of Object.entries(b))o.push({...Y(x,p,"project",d),enabled:!l.includes(x)})}for(const[d,m]of Object.entries(a))o.push({...Y(d,m,"enterprise"),enabled:!0});if(i!=null&&i.servers)for(const[d,m]of Object.entries(i.servers)){const b=o.find(l=>l.name===d&&l.scope==="global");b?b.cli.codex=!0:o.push({...Y(d,m,"codex"),cli:{claude:!1,codex:!0}})}return o}function Y(t,o,r,n){const a=typeof o.url=="string";return{id:He(r,t,n),name:t,scope:r,projectPath:n,enabled:o.enabled!==!1,transport:a?"http":"stdio",command:typeof o.command=="string"?o.command:void 0,args:Array.isArray(o.args)?o.args:void 0,url:a?o.url:void 0,env:typeof o.env=="object"&&o.env!==null?o.env:void 0,cli:{claude:r!=="codex",codex:r==="codex"},raw:o}}const f=ge((t,o)=>({servers:[],templates:[],categories:[],loading:!1,error:null,activeView:"list",scopeFilter:"all",search:"",selectedServer:null,templateSearch:"",templateCategory:null,editingServer:null,setActiveView:r=>t({activeView:r}),setScopeFilter:r=>t({scopeFilter:r}),setSearch:r=>t({search:r}),setSelectedServer:r=>t({selectedServer:r}),setTemplateSearch:r=>t({templateSearch:r}),setTemplateCategory:r=>t({templateCategory:r}),setEditingServer:r=>t({editingServer:r}),fetchConfig:async()=>{t({loading:!0,error:null});try{const r=await fetch(E.CONFIG);if(!r.ok)throw new Error(`Failed: ${r.status}`);const n=await r.json();t({servers:Ue(n),loading:!1})}catch(r){t({loading:!1,error:String(r)})}},fetchTemplates:async()=>{try{const[r,n]=await Promise.all([fetch(E.TEMPLATES),fetch(E.TEMPLATES_CATEGORIES)]);if(!r.ok||!n.ok)return;const a=await r.json(),i=await n.json();t({templates:a.templates??[],categories:i.categories??[]})}catch{}},toggleServer:async(r,n,a)=>{t(i=>({servers:i.servers.map(d=>d.name===n?{...d,enabled:a}:d)}));try{await fetch(E.TOGGLE,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:r,serverName:n,enable:a})})}catch{o().fetchConfig()}},removeServer:async(r,n)=>{const a=o().servers;t(i=>({servers:i.servers.filter(d=>d.name!==n)}));try{(await fetch(E.REMOVE_SERVER,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:r,serverName:n})})).ok||t({servers:a})}catch{t({servers:a})}},addGlobalServer:async(r,n)=>{try{await fetch(E.ADD_GLOBAL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverName:r,serverConfig:n})}),o().fetchConfig()}catch{}},removeGlobalServer:async r=>{const n=o().servers;t(a=>({servers:a.servers.filter(i=>i.name!==r)}));try{(await fetch(E.REMOVE_GLOBAL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverName:r})})).ok||t({servers:n})}catch{t({servers:n})}},updateServer:async(r,n)=>{try{await fetch(E.UPDATE_SERVER,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:r.scope,serverName:r.name,serverConfig:n,projectPath:r.projectPath})}),t({editingServer:null}),o().fetchConfig()}catch{}},installTemplate:async(r,n,a)=>{try{await fetch(E.TEMPLATES_INSTALL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({templateName:r,projectPath:n,scope:a})}),o().fetchConfig()}catch{}},filteredServers:()=>{const{servers:r,scopeFilter:n,search:a}=o();let i=r;if(n!=="all"&&(i=i.filter(d=>d.scope===n)),a){const d=a.toLowerCase();i=i.filter(m=>{var b,l;return m.name.toLowerCase().includes(d)||(((b=m.command)==null?void 0:b.toLowerCase().includes(d))??!1)||(((l=m.url)==null?void 0:l.toLowerCase().includes(d))??!1)})}return i},filteredTemplates:()=>{const{templates:r,templateSearch:n,templateCategory:a}=o();let i=r;if(a&&(i=i.filter(d=>d.category===a)),n){const d=n.toLowerCase();i=i.filter(m=>{var b;return m.name.toLowerCase().includes(d)||(((b=m.description)==null?void 0:b.toLowerCase().includes(d))??!1)})}return i},projectGroups:()=>{const{servers:r}=o(),n=new Map;for(const i of r){const d=i.projectPath??null,m=n.get(d)??[];m.push(i),n.set(d,m)}const a=[];for(const[i,d]of n)a.push({projectPath:i,servers:d});return a},selectedEntry:()=>{const{servers:r,selectedServer:n}=o();return n?r.find(a=>a.id===n)??null:null}}));function G({size:t=14,className:o,style:r}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:o,style:r,children:e.jsx("path",{d:"M17.304 3.541l-5.15 16.918H9.29l5.15-16.918zm-9.757 10.3l-2.1 3.613H2.131l3.256-5.576zm2.74-7.354L6.41 13.49l-2.037-3.5L8.052 3.54z"})})}function V({size:t=14,className:o,style:r}){return e.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:o,style:r,children:e.jsx("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.14-.08 4.779-2.759a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.366-1.973V11.6a.766.766 0 0 0 .388.677l5.815 3.354-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.124 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.41-.676zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zM8.307 12.863l-2.02-1.164a.08.08 0 0 1-.038-.057V6.074a4.5 4.5 0 0 1 7.375-3.453l-.14.08-4.779 2.758a.795.795 0 0 0-.393.681zm1.097-2.361l2.602-1.506 2.607 1.506v3.012l-2.602 1.506-2.607-1.506z"})})}const ne={global:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue, #5B8DB8)"},project:{bg:"rgba(145,120,181,0.12)",text:"var(--color-status-planning, #9178B5)"},enterprise:{bg:"rgba(200,134,58,0.12)",text:"var(--color-status-verifying, #C8863A)"},codex:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed, #5A9E78)"}},le={stdio:{bg:"rgba(91,141,184,0.08)",text:"var(--color-accent-blue, #5B8DB8)"},http:{bg:"rgba(145,120,181,0.08)",text:"var(--color-status-planning, #9178B5)"}};function Xe({server:t,onClose:o}){var x;const r=f(p=>p.removeServer),n=f(p=>p.removeGlobalServer),a=f(p=>p.setEditingServer),i=y.useMemo(()=>t.env?Object.entries(t.env):[],[t.env]),d=y.useMemo(()=>JSON.stringify(t.raw,null,2),[t.raw]),m=ne[t.scope]??ne.global,b=le[t.transport]??le.stdio;function l(){t.scope==="global"?n(t.name):r(t.projectPath??"",t.name),o()}return e.jsxs(M.aside,{initial:{width:0,opacity:0},animate:{width:380,opacity:1},exit:{width:0,opacity:0},transition:{type:"spring",stiffness:400,damping:30},className:"shrink-0 border-l border-border bg-bg-card overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-[10px] px-[18px] py-[14px] border-b border-border-divider shrink-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-[var(--radius-lg)] shrink-0 flex items-center justify-center",style:{background:b.bg,color:b.text},children:t.transport==="stdio"?e.jsx(oe,{size:18,strokeWidth:1.8}):e.jsx(q,{size:18,strokeWidth:1.8})}),e.jsx("span",{className:"text-[15px] font-bold text-text-primary flex-1 min-w-0 truncate",children:t.name}),e.jsx("button",{type:"button",onClick:o,"aria-label":"Close detail panel",className:"flex items-center justify-center w-7 h-7 rounded-[var(--radius-md)] text-text-tertiary hover:text-text-primary hover:bg-bg-hover transition-colors",children:e.jsx(ve,{size:14,strokeWidth:2})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-[18px] py-[16px]",style:{width:380},children:[e.jsxs(_,{label:"Info",children:[e.jsx(H,{label:"Scope",children:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:m.bg,color:m.text},children:t.scope})}),e.jsx(H,{label:"Transport",children:e.jsx("span",{className:"text-[9px] font-semibold px-[7px] py-[2px] rounded-[4px] uppercase",style:{background:b.bg,color:b.text},children:t.transport})}),e.jsx(H,{label:"Status",children:e.jsxs("span",{className:"text-[12px] font-semibold flex items-center gap-[4px]",style:{color:t.enabled?"var(--color-status-completed, #5A9E78)":"var(--color-text-tertiary)"},children:[e.jsx("span",{className:"w-[7px] h-[7px] rounded-full inline-block",style:{background:t.enabled?"var(--color-status-completed, #5A9E78)":"var(--color-text-tertiary)"}}),t.enabled?"Enabled":"Disabled"]})}),t.projectPath&&e.jsx(H,{label:"Source",children:e.jsx("span",{className:"font-mono text-[11px] text-text-primary break-all",children:t.projectPath})})]}),e.jsxs(_,{label:"CLI Presence",children:[e.jsx(ie,{icon:e.jsx(G,{size:12}),label:"Claude Code",present:t.cli.claude,tintBg:"rgba(200,134,58,0.08)",tintColor:"var(--color-status-verifying, #C8863A)"}),e.jsx(ie,{icon:e.jsx(V,{size:12}),label:"Codex CLI",present:t.cli.codex,tintBg:"rgba(90,158,120,0.08)",tintColor:"var(--color-status-completed, #5A9E78)"})]}),e.jsx(_,{label:"Command",children:e.jsx("div",{className:"bg-bg-secondary border border-border-divider rounded-[var(--radius-lg)] px-3 py-[10px] font-mono text-[11px] text-text-primary leading-[1.7] whitespace-pre-wrap break-all",children:t.command?`${t.command}${(x=t.args)!=null&&x.length?" "+t.args.join(" "):""}`:t.url??"(no command)"})}),i.length>0&&e.jsx(_,{label:"Environment",children:e.jsx("div",{className:"bg-bg-secondary border border-border-divider rounded-[var(--radius-lg)] overflow-hidden",children:e.jsx("table",{className:"w-full border-collapse",children:e.jsx("tbody",{children:i.map(([p,s])=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-2 py-1 text-[11px] font-mono font-medium whitespace-nowrap border-b border-border-divider",style:{color:"var(--color-accent-blue, #5B8DB8)"},children:p}),e.jsx("td",{className:"px-2 py-1 text-[11px] font-mono text-text-secondary break-all border-b border-border-divider",children:s})]},p))})})})}),e.jsx(_,{label:"Raw Config",children:e.jsx("div",{className:"rounded-[var(--radius-lg)] px-3 py-[10px] font-mono text-[11px] leading-[1.7] whitespace-pre-wrap break-all",style:{background:"var(--color-code-bg, #2C2723)",color:"var(--color-code-text, #D9D0C4)",border:"1px solid var(--color-code-border, #3D3731)"},children:d})})]}),e.jsxs("div",{className:"flex gap-[6px] px-[18px] py-3 border-t border-border-divider shrink-0",children:[e.jsxs("button",{type:"button",onClick:()=>a(t),className:"flex-1 flex items-center justify-center gap-[4px] px-[10px] py-[5px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-text-secondary hover:border-text-tertiary hover:text-text-primary transition-all",children:[e.jsx(Pe,{size:11,strokeWidth:2}),"Edit"]}),e.jsxs("button",{type:"button",onClick:l,className:"flex-1 flex items-center justify-center gap-[4px] px-[10px] py-[5px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-status-failed hover:border-status-failed hover:bg-red-50 transition-all",children:[e.jsx(Se,{size:11,strokeWidth:2}),"Remove"]})]})]})}function _({label:t,children:o}){return e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.05em] text-text-tertiary mb-[6px]",children:t}),o]})}function H({label:t,children:o}){return e.jsxs("div",{className:"flex items-center gap-2 py-[3px]",children:[e.jsx("span",{className:"text-[11px] font-semibold text-text-secondary min-w-[70px] shrink-0",children:t}),o]})}function ie({icon:t,label:o,present:r,tintBg:n,tintColor:a}){return e.jsxs("div",{className:"flex items-center gap-[10px] px-[10px] py-2 rounded-[var(--radius-md)] mb-1",style:{background:r?n:void 0},children:[e.jsx("div",{className:"w-6 h-[18px] rounded-[4px] flex items-center justify-center",style:{background:n,color:a},children:t}),e.jsx("span",{className:"text-[12px] font-semibold text-text-primary flex-1",children:o}),e.jsx("span",{className:"text-[10px] font-semibold",style:{color:r?"var(--color-status-completed, #5A9E78)":"var(--color-text-tertiary)"},children:r?"Installed":"Not found"})]})}const re=["write_file","edit_file","read_file","read_many_files","team_msg"],u=ge((t,o)=>({open:!1,step:"mode",mode:"global",projectPath:"",detection:null,selectedComponents:new Set,backup:!0,mcpEnabled:!0,enabledTools:new Set(re),detecting:!1,installing:!1,result:null,error:null,manifests:[],setOpen:r=>{t(r?{open:r,step:"mode",result:null,error:null,detection:null}:{open:r})},setStep:r=>t({step:r}),setMode:r=>t({mode:r}),setProjectPath:r=>t({projectPath:r}),toggleComponent:r=>t(n=>{const a=new Set(n.selectedComponents);return a.has(r)?a.delete(r):a.add(r),{selectedComponents:a}}),selectAllComponents:()=>t(r=>{if(!r.detection)return{};const n=r.detection.components.filter(a=>a.available).map(a=>a.id);return r.selectedComponents.has("mcp")&&n.push("mcp"),{selectedComponents:new Set(n)}}),setBackup:r=>t({backup:r}),setMcpEnabled:r=>t({mcpEnabled:r}),toggleTool:r=>t(n=>{const a=new Set(n.enabledTools);return a.has(r)?a.delete(r):a.add(r),{enabledTools:a}}),detect:async()=>{const{mode:r,projectPath:n}=o();t({detecting:!0,error:null});try{const a=await fetch(Q.DETECT,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:r,projectPath:r==="project"?n:void 0})}),i=await a.json();if(!a.ok)throw new Error(i.error??`HTTP ${a.status}`);const d=i,m=d.components.filter(b=>b.available).map(b=>b.id);m.push("mcp"),t({detecting:!1,detection:d,selectedComponents:new Set(m),step:"configure"})}catch(a){t({detecting:!1,error:String(a)})}},install:async()=>{const{mode:r,projectPath:n,selectedComponents:a,backup:i,mcpEnabled:d,enabledTools:m}=o();t({installing:!0,error:null,step:"progress"});try{const l=await(await fetch(Q.EXECUTE,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:r,projectPath:r==="project"?n:void 0,components:Array.from(a),backup:i,mcpConfig:d&&a.has("mcp")?{enabled:!0,enabledTools:Array.from(m)}:void 0})})).json();t({installing:!1,result:l})}catch(b){t({installing:!1,result:{success:!1,filesInstalled:0,dirsCreated:0,manifestPath:"",disabledItemsRestored:0,mcpRegistered:!1,components:[],error:String(b)}})}},fetchManifests:async()=>{try{const r=await fetch(Q.MANIFESTS);if(!r.ok)return;const n=await r.json();t({manifests:n.manifests??[]})}catch{}},reset:()=>t({step:"mode",mode:"global",projectPath:"",detection:null,selectedComponents:new Set,backup:!0,mcpEnabled:!0,enabledTools:new Set(re),detecting:!1,installing:!1,result:null,error:null})}));function Ke(t){const o=t.includes("/")?"/":t.includes("\\")?"\\":"/",r=t.endsWith(o)?t.slice(0,-1):t,n=r.lastIndexOf(o);return n>=0?r.slice(n+1):r}const qe=[{id:"all",label:"All"},{id:"global",label:"Global",color:"var(--color-accent-blue, #5B8DB8)"},{id:"project",label:"Project",color:"var(--color-status-planning, #9178B5)"},{id:"enterprise",label:"Enterprise",color:"var(--color-status-verifying, #C8863A)"}],ce={global:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue, #5B8DB8)"},project:{bg:"rgba(145,120,181,0.12)",text:"var(--color-status-planning, #9178B5)"},enterprise:{bg:"rgba(200,134,58,0.12)",text:"var(--color-status-verifying, #C8863A)"},codex:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed, #5A9E78)"}};function Qe(){const t=f(c=>c.servers),o=f(c=>c.scopeFilter),r=f(c=>c.search),n=y.useMemo(()=>{let c=t;if(o!=="all"&&(c=c.filter(C=>C.scope===o)),r){const C=r.toLowerCase();c=c.filter(z=>{var O,T;return z.name.toLowerCase().includes(C)||(((O=z.command)==null?void 0:O.toLowerCase().includes(C))??!1)||(((T=z.url)==null?void 0:T.toLowerCase().includes(C))??!1)})}return c},[t,o,r]),a=f(c=>c.selectedServer),i=f(c=>c.setScopeFilter),d=f(c=>c.setSearch),m=f(c=>c.setSelectedServer),b=f(c=>c.toggleServer),l=f(c=>c.removeServer),x=f(c=>c.removeGlobalServer),p=f(c=>c.setEditingServer),s=u(c=>c.setOpen),h=t.filter(c=>c.enabled).length,w=t.filter(c=>c.scope==="global").length,k=t.filter(c=>c.scope==="project").length,S=t.filter(c=>c.scope==="enterprise").length,A=t.filter(c=>c.transport==="stdio").length,L=t.filter(c=>c.transport==="http").length,$={all:t.length,global:w,project:k,enterprise:S},W=a?t.find(c=>c.id===a)??null:null;function g(c){b(c.projectPath??"",c.name,!c.enabled)}function j(c){c.scope==="global"?x(c.name):l(c.projectPath??"",c.name)}function N(c){p(c)}return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-5 px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[e.jsx(U,{color:"var(--color-status-completed, #5A9E78)",value:h,label:"Active"}),e.jsx(U,{color:"var(--color-accent-blue, #5B8DB8)",value:w,label:"Global"}),e.jsx(U,{color:"var(--color-status-planning, #9178B5)",value:k,label:"Project"}),e.jsx(U,{color:"var(--color-status-verifying, #C8863A)",value:S,label:"Enterprise"})]}),e.jsxs("div",{className:"flex items-center gap-[10px] px-5 py-2 border-b border-border-divider shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-[6px] px-3 py-[6px] rounded-[var(--radius-lg)] bg-bg-card border border-border w-[260px] focus-within:border-[var(--color-status-planning,#9178B5)] transition-colors",children:[e.jsx(ae,{size:13,strokeWidth:2,className:"text-text-tertiary shrink-0"}),e.jsx("input",{type:"text",placeholder:"Search servers...",value:r,onChange:c=>d(c.target.value),className:"border-none bg-transparent outline-none text-[12px] text-text-primary w-full placeholder:text-text-tertiary"})]}),e.jsx("div",{className:"flex gap-[6px]",children:qe.map(c=>{const C=o===c.id;return e.jsxs("button",{type:"button",onClick:()=>i(c.id),className:["flex items-center gap-1 px-[10px] py-1 rounded-full border text-[10px] font-semibold whitespace-nowrap transition-all cursor-pointer",C?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border hover:border-text-tertiary hover:text-text-secondary"].join(" "),children:[c.color&&!C&&e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:c.color}}),c.label,e.jsx("span",{className:"font-mono text-[9px] opacity-60",children:$[c.id]})]},c.id)})}),e.jsx("div",{className:"w-px h-[18px] bg-border-divider"}),e.jsx("div",{className:"flex gap-[6px]",children:["stdio","http"].map(c=>e.jsxs("button",{type:"button",className:"flex items-center gap-1 px-[10px] py-1 rounded-full border border-border bg-bg-card text-[10px] font-semibold text-text-tertiary hover:border-text-tertiary hover:text-text-secondary transition-all cursor-pointer whitespace-nowrap",children:[c.toUpperCase(),e.jsx("span",{className:"font-mono text-[9px] opacity-60",children:c==="stdio"?A:L})]},c))}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:()=>s(!0),className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[var(--radius-lg)] border border-border bg-bg-card text-[11px] font-semibold text-text-secondary cursor-pointer transition-all hover:border-text-tertiary hover:text-text-primary whitespace-nowrap",children:[e.jsx(Te,{size:13,strokeWidth:2}),"Install Wizard"]}),e.jsxs("button",{type:"button",className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[11px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md whitespace-nowrap",children:[e.jsx(se,{size:13,strokeWidth:2}),"Add Server"]})]}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx("div",{className:"flex-1 overflow-y-auto min-w-0",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap w-[36px]"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap",children:"Name"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap",children:"Command / URL"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap",children:"Scope"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap",children:"CLI"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap w-[50px]",children:"On"}),e.jsx("th",{className:"sticky top-0 z-10 text-left text-[10px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-[14px] py-2 bg-bg-secondary border-b border-border whitespace-nowrap w-[140px]"})]})}),e.jsx("tbody",{children:(()=>{if(!(o==="all"||o==="project"))return n.map(v=>e.jsx(Z,{server:v,selected:a===v.id,onSelect:()=>m(a===v.id?null:v.id),onToggle:()=>g(v),onEdit:()=>N(v),onRemove:()=>j(v)},v.id));const C=n.filter(v=>v.scope==="project"),z=n.filter(v=>v.scope!=="project"),O=new Map;for(const v of C){const R=v.projectPath??"",J=O.get(R)??[];J.push(v),O.set(R,J)}const T=[];for(const v of z)T.push(e.jsx(Z,{server:v,selected:a===v.id,onSelect:()=>m(a===v.id?null:v.id),onToggle:()=>g(v),onEdit:()=>N(v),onRemove:()=>j(v)},v.id));for(const[v,R]of O){const J=Ke(v);T.push(e.jsx(Ze,{folderName:J,fullPath:v,count:R.length},`group:${v}`));for(const P of R)T.push(e.jsx(Z,{server:P,selected:a===P.id,onSelect:()=>m(a===P.id?null:P.id),onToggle:()=>g(P),onEdit:()=>N(P),onRemove:()=>j(P)},P.id))}return T.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"text-center py-8 text-text-tertiary text-[length:var(--font-size-sm)]",children:"No servers found"})}):T})()})]})}),e.jsx(Be,{children:W&&e.jsx(Xe,{server:W,onClose:()=>m(null)})})]})]})}function U({color:t,value:o,label:r}){return e.jsxs("div",{className:"flex items-center gap-[6px]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:t}}),e.jsx("span",{className:"text-[16px] font-extrabold text-text-primary font-mono",children:o}),e.jsx("span",{className:"text-[10px] font-semibold text-text-tertiary uppercase tracking-[0.04em]",children:r})]})}function Ze({folderName:t,fullPath:o,count:r}){return e.jsx("tr",{className:"group-header-row",children:e.jsx("td",{colSpan:7,className:"px-[14px] py-[6px] bg-[rgba(145,120,181,0.04)] border-b border-border-divider",children:e.jsxs("div",{className:"flex items-center gap-[8px]",children:[e.jsx(Ae,{size:13,strokeWidth:1.8,style:{color:"var(--color-status-planning, #9178B5)",opacity:.7}}),e.jsx("span",{className:"text-[11px] font-bold text-text-secondary",title:o,children:t}),e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary opacity-60",children:r})]})})})}function Z({server:t,selected:o,onSelect:r,onToggle:n,onEdit:a,onRemove:i}){var x;const d=ce[t.scope]??ce.global,m=t.command?`${t.command}${(x=t.args)!=null&&x.length?" "+t.args.join(" "):""}`:t.url??"",b=!t.cli.claude&&t.cli.codex,l=t.cli.claude&&!t.cli.codex;return e.jsxs("tr",{onClick:r,className:["cursor-pointer transition-colors group",o?"[&>td]:bg-[rgba(145,120,181,0.07)]":"hover:[&>td]:bg-bg-hover"].join(" "),children:[e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsx("div",{className:"w-7 h-7 rounded-[var(--radius-md)] shrink-0 flex items-center justify-center",style:{background:t.transport==="stdio"?"rgba(91,141,184,0.08)":"rgba(145,120,181,0.08)",color:t.transport==="stdio"?"var(--color-accent-blue, #5B8DB8)":"var(--color-status-planning, #9178B5)"},children:t.transport==="stdio"?e.jsx(oe,{size:14,strokeWidth:1.8}):e.jsx(q,{size:14,strokeWidth:1.8})})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:t.name})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsx("span",{className:"font-mono text-[11px] text-text-tertiary max-w-[280px] whitespace-nowrap overflow-hidden text-ellipsis block",children:m})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle whitespace-nowrap",children:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:d.bg,color:d.text},children:t.scope})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsxs("div",{className:"flex gap-[3px]",children:[e.jsx("span",{className:["w-5 h-4 rounded-[3px] flex items-center justify-center",t.cli.claude?"":"opacity-25"].join(" "),style:{background:"rgba(200,134,58,0.08)",color:"var(--color-status-verifying, #C8863A)"},title:"Claude Code",children:e.jsx(G,{size:11})}),e.jsx("span",{className:["w-5 h-4 rounded-[3px] flex items-center justify-center",t.cli.codex?"":"opacity-25"].join(" "),style:{background:"rgba(90,158,120,0.08)",color:"var(--color-status-completed, #5A9E78)"},title:"Codex CLI",children:e.jsx(V,{size:11})})]})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle text-center",children:e.jsxs("label",{className:"relative inline-block w-8 h-[18px] cursor-pointer",onClick:p=>p.stopPropagation(),children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:n,disabled:t.scope==="enterprise",className:"sr-only peer"}),e.jsx("div",{className:["w-8 h-[18px] rounded-full transition-colors duration-200",t.scope==="enterprise"?"opacity-50 cursor-default":""].join(" "),style:{background:t.enabled?"var(--color-status-completed, #5A9E78)":"var(--color-border, #E8E5DE)"},children:e.jsx("div",{className:"absolute top-[2px] left-[2px] w-[14px] h-[14px] rounded-full bg-white shadow-sm transition-transform duration-200",style:{transform:t.enabled?"translateX(14px)":"translateX(0)"}})})]})}),e.jsx("td",{className:"px-[14px] py-2 border-b border-border-divider align-middle",children:e.jsxs("div",{className:"flex gap-1 items-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:p=>p.stopPropagation(),children:[(l||b)&&e.jsx("button",{type:"button",className:"flex items-center gap-[3px] px-2 py-1 rounded-[5px] border border-border bg-bg-card text-text-tertiary hover:border-[var(--color-accent-blue,#5B8DB8)] hover:text-[var(--color-accent-blue,#5B8DB8)] hover:bg-[rgba(91,141,184,0.04)] transition-all whitespace-nowrap",title:l?"Copy to Codex":"Copy to Claude",children:l?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{size:10,strokeWidth:2.5}),e.jsx("span",{className:"w-[14px] h-[11px] rounded-[2px] flex items-center justify-center",style:{background:"rgba(90,158,120,0.08)",color:"var(--color-status-completed, #5A9E78)"},children:e.jsx(V,{size:9})})]}):e.jsxs(e.Fragment,{children:[e.jsx(ze,{size:10,strokeWidth:2.5}),e.jsx("span",{className:"w-[14px] h-[11px] rounded-[2px] flex items-center justify-center",style:{background:"rgba(200,134,58,0.08)",color:"var(--color-status-verifying, #C8863A)"},children:e.jsx(G,{size:9})})]})}),e.jsx("button",{type:"button",onClick:a,className:"flex items-center gap-1 px-[10px] py-[5px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-text-secondary hover:border-text-tertiary hover:text-text-primary transition-all",children:e.jsx(Pe,{size:11,strokeWidth:2})}),t.scope!=="enterprise"&&e.jsx("button",{type:"button",onClick:i,className:"flex items-center gap-1 px-[10px] py-[5px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-status-failed hover:border-status-failed hover:bg-red-50 transition-all",children:e.jsx(Se,{size:11,strokeWidth:2})})]})})]})}function et(t){const o=t.includes("/")?"/":t.includes("\\")?"\\":"/",r=t.endsWith(o)?t.slice(0,-1):t,n=r.lastIndexOf(o);return n>=0?r.slice(n+1):r}const tt={global:{label:"Global Servers",color:"var(--color-accent-blue, #5B8DB8)"},project:{label:"Project Servers",color:"var(--color-status-planning, #9178B5)"},enterprise:{label:"Enterprise Managed",color:"var(--color-status-verifying, #C8863A)"},codex:{label:"Codex Servers",color:"var(--color-status-completed, #5A9E78)"}},de={global:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue, #5B8DB8)"},project:{bg:"rgba(145,120,181,0.12)",text:"var(--color-status-planning, #9178B5)"},enterprise:{bg:"rgba(200,134,58,0.12)",text:"var(--color-status-verifying, #C8863A)"},codex:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed, #5A9E78)"}},xe={stdio:{bg:"rgba(91,141,184,0.08)",text:"var(--color-accent-blue, #5B8DB8)"},http:{bg:"rgba(145,120,181,0.08)",text:"var(--color-status-planning, #9178B5)"}};function rt(){const t=f(l=>l.servers),o=f(l=>l.scopeFilter),r=f(l=>l.search),n=f(l=>l.selectedServer),a=f(l=>l.setSelectedServer),i=f(l=>l.toggleServer),d=y.useMemo(()=>{let l=t;if(o!=="all"&&(l=l.filter(x=>x.scope===o)),r){const x=r.toLowerCase();l=l.filter(p=>{var s,h;return p.name.toLowerCase().includes(x)||(((s=p.command)==null?void 0:s.toLowerCase().includes(x))??!1)||(((h=p.url)==null?void 0:h.toLowerCase().includes(x))??!1)})}return l},[t,o,r]),m=y.useMemo(()=>{const l=new Map;for(const p of d){const s=l.get(p.scope)??[];s.push(p),l.set(p.scope,s)}const x=[];for(const p of["global","project","enterprise","codex"]){const s=l.get(p);if(s&&s.length>0){const h=tt[p]??{label:p,color:"var(--color-text-tertiary)"},w={scope:p,label:h.label,color:h.color,servers:s};if(p==="project"){const k=new Map;for(const S of s){const A=S.projectPath??"__unknown__",L=k.get(A)??[];L.push(S),k.set(A,L)}w.projectSubGroups=[];for(const[S,A]of k)w.projectSubGroups.push({projectPath:S,folderName:et(S),servers:A})}x.push(w)}}return x},[d]);function b(l){i(l.projectPath??"",l.name,!l.enabled)}return d.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No servers found"}):e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:m.map((l,x)=>e.jsxs(M.div,{className:"mb-5",initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.25,delay:x*.06},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-[10px] pb-[6px] border-b border-border-divider",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:l.color}}),e.jsx("span",{className:"text-[12px] font-bold text-text-primary",children:l.label}),e.jsxs("span",{className:"text-[10px] text-text-tertiary font-mono",children:[l.servers.length," server",l.servers.length!==1?"s":""]})]}),l.projectSubGroups?e.jsx("div",{className:"flex flex-col gap-[14px]",children:l.projectSubGroups.map(p=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-[8px] mb-[8px]",children:[e.jsx(Ae,{size:13,strokeWidth:1.8,style:{color:"var(--color-status-planning, #9178B5)",opacity:.7}}),e.jsx("span",{className:"text-[11px] font-bold text-text-secondary",title:p.projectPath,children:p.folderName}),e.jsx("span",{className:"text-[9px] font-mono text-text-tertiary opacity-60",children:p.servers.length})]}),e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-[10px]",children:p.servers.map((s,h)=>e.jsx(pe,{server:s,selected:n===s.id,isEnterprise:!1,delay:h*.04,onSelect:()=>a(n===s.id?null:s.id),onToggle:()=>b(s)},s.id))})]},p.projectPath))}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-[10px]",children:l.servers.map((p,s)=>e.jsx(pe,{server:p,selected:n===p.id,isEnterprise:l.scope==="enterprise",delay:s*.04,onSelect:()=>a(n===p.id?null:p.id),onToggle:()=>b(p)},p.id))})]},l.scope))})}function pe({server:t,selected:o,isEnterprise:r,delay:n,onSelect:a,onToggle:i}){var s;const d=de[t.scope]??de.global,m=xe[t.transport]??xe.stdio,b=t.command?`${t.command}${(s=t.args)!=null&&s.length?" "+t.args.join(" "):""}`:t.url??"",l=t.env?Object.keys(t.env):[],x=!t.cli.claude&&t.cli.codex,p=t.cli.claude&&!t.cli.codex;return e.jsxs(M.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,delay:n},onClick:a,className:["bg-bg-card border rounded-[10px] p-[14px] cursor-pointer transition-all duration-200 flex flex-col gap-2",o?"border-[var(--color-status-planning,#9178B5)] shadow-[0_0_0_2px_rgba(145,120,181,0.2)]":"border-border hover:border-text-tertiary hover:shadow-md hover:-translate-y-[2px]"].join(" "),style:r?{borderColor:"rgba(200,134,58,0.3)",background:"rgba(200,134,58,0.04)"}:void 0,children:[e.jsxs("div",{className:"flex items-center gap-[10px]",children:[e.jsx("div",{className:"w-9 h-9 rounded-[var(--radius-lg)] shrink-0 flex items-center justify-center",style:{background:t.transport==="stdio"?"rgba(91,141,184,0.08)":"rgba(145,120,181,0.08)",color:t.transport==="stdio"?"var(--color-accent-blue, #5B8DB8)":"var(--color-status-planning, #9178B5)"},children:t.transport==="stdio"?e.jsx(oe,{size:18,strokeWidth:1.8}):e.jsx(q,{size:18,strokeWidth:1.8})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-bold text-text-primary truncate",children:t.name}),e.jsxs("div",{className:"flex gap-[5px] mt-[3px]",children:[e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:d.bg,color:d.text},children:t.scope}),e.jsx("span",{className:"text-[9px] font-semibold px-[7px] py-[2px] rounded-[4px] uppercase",style:{background:m.bg,color:m.text},children:t.transport})]})]}),e.jsxs("label",{className:"relative inline-block w-8 h-[18px] shrink-0 cursor-pointer",onClick:h=>h.stopPropagation(),children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:i,disabled:r,className:"sr-only"}),e.jsx("div",{className:["w-8 h-[18px] rounded-full transition-colors duration-200 relative",r?"opacity-50 cursor-default":""].join(" "),style:{background:t.enabled?"var(--color-status-completed, #5A9E78)":"var(--color-border, #E8E5DE)"},children:e.jsx("div",{className:"absolute top-[2px] left-[2px] w-[14px] h-[14px] rounded-full bg-white shadow-sm transition-transform duration-200",style:{transform:t.enabled?"translateX(14px)":"translateX(0)"}})})]})]}),b&&e.jsx("div",{className:"font-mono text-[10px] text-text-secondary bg-bg-secondary rounded-[var(--radius-md)] px-[10px] py-[6px] whitespace-nowrap overflow-hidden text-ellipsis",style:r?{background:"rgba(200,134,58,0.08)"}:void 0,children:r?"managed (read-only)":b}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"flex gap-1 flex-wrap flex-1 min-w-0",children:l.map(h=>e.jsx("span",{className:"text-[9px] font-mono px-[6px] py-[2px] rounded-[4px]",style:{background:"rgba(91,141,184,0.08)",color:"var(--color-accent-blue, #5B8DB8)"},children:h},h))}),e.jsxs("div",{className:"flex gap-[3px] shrink-0 items-center",children:[(p||x)&&e.jsx("button",{type:"button",onClick:h=>h.stopPropagation(),className:"flex items-center gap-[3px] px-[7px] py-[3px] rounded-[4px] border border-border bg-bg-card text-text-tertiary transition-all hover:border-[var(--color-accent-blue,#5B8DB8)] hover:text-[var(--color-accent-blue,#5B8DB8)] hover:bg-[rgba(91,141,184,0.04)]",title:p?"Copy to Codex":"Copy to Claude",children:p?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{size:9,strokeWidth:2.5}),e.jsx(V,{size:11,style:{color:"var(--color-status-completed, #5A9E78)"}})]}):e.jsxs(e.Fragment,{children:[e.jsx(ze,{size:9,strokeWidth:2.5}),e.jsx(G,{size:11,style:{color:"var(--color-status-verifying, #C8863A)"}})]})}),e.jsxs("div",{className:"flex gap-[3px]",children:[e.jsx("span",{className:["w-5 h-4 rounded-[3px] flex items-center justify-center",t.cli.claude?"":"opacity-25"].join(" "),style:{background:"rgba(200,134,58,0.08)",color:"var(--color-status-verifying, #C8863A)"},title:"Claude Code",children:e.jsx(G,{size:11})}),e.jsx("span",{className:["w-5 h-4 rounded-[3px] flex items-center justify-center",t.cli.codex?"":"opacity-25"].join(" "),style:{background:"rgba(90,158,120,0.08)",color:"var(--color-status-completed, #5A9E78)"},title:"Codex CLI",children:e.jsx(V,{size:11})})]})]})]})]})}const me={database:{icon:e.jsx(Ie,{size:18,strokeWidth:1.8}),bg:"rgba(91,141,184,0.08)",color:"var(--color-accent-blue, #5B8DB8)"},search:{icon:e.jsx(ae,{size:18,strokeWidth:1.8}),bg:"rgba(145,120,181,0.08)",color:"var(--color-status-planning, #9178B5)"},code:{icon:e.jsx(Re,{size:18,strokeWidth:1.8}),bg:"rgba(90,158,120,0.08)",color:"var(--color-status-completed, #5A9E78)"},filesystem:{icon:e.jsx(De,{size:18,strokeWidth:1.8}),bg:"rgba(184,149,64,0.08)",color:"var(--color-status-idle, #B89540)"},api:{icon:e.jsx(q,{size:18,strokeWidth:1.8}),bg:"rgba(200,134,58,0.08)",color:"var(--color-status-verifying, #C8863A)"},utility:{icon:e.jsx(Ye,{size:18,strokeWidth:1.8}),bg:"rgba(160,157,151,0.08)",color:"var(--color-text-tertiary, #A09D97)"}},st={database:{bg:"rgba(91,141,184,0.12)",color:"var(--color-accent-blue, #5B8DB8)"},sql:{bg:"rgba(90,158,120,0.12)",color:"var(--color-status-completed, #5A9E78)"},search:{bg:"rgba(145,120,181,0.12)",color:"var(--color-status-planning, #9178B5)"},code:{bg:"rgba(90,158,120,0.12)",color:"var(--color-status-completed, #5A9E78)"},tools:{bg:"rgba(90,158,120,0.12)",color:"var(--color-status-completed, #5A9E78)"},filesystem:{bg:"rgba(184,149,64,0.12)",color:"var(--color-status-idle, #B89540)"},files:{bg:"rgba(184,149,64,0.12)",color:"var(--color-status-idle, #B89540)"},api:{bg:"rgba(200,134,58,0.12)",color:"var(--color-status-verifying, #C8863A)"},web:{bg:"rgba(200,134,58,0.12)",color:"var(--color-status-verifying, #C8863A)"},docs:{bg:"rgba(145,120,181,0.12)",color:"var(--color-status-planning, #9178B5)"},research:{bg:"rgba(200,134,58,0.12)",color:"var(--color-status-verifying, #C8863A)"}},ot={database:"var(--color-accent-blue, #5B8DB8)",search:"var(--color-status-planning, #9178B5)",code:"var(--color-status-completed, #5A9E78)",filesystem:"var(--color-status-idle, #B89540)",api:"var(--color-status-verifying, #C8863A)",utility:"var(--color-text-tertiary, #A09D97)"};function at(){const t=f(s=>s.templates),o=f(s=>s.categories),r=f(s=>s.servers),n=f(s=>s.templateSearch),a=f(s=>s.templateCategory),i=y.useMemo(()=>{let s=t;if(a&&(s=s.filter(h=>h.category===a)),n){const h=n.toLowerCase();s=s.filter(w=>{var k;return w.name.toLowerCase().includes(h)||(((k=w.description)==null?void 0:k.toLowerCase().includes(h))??!1)})}return s},[t,n,a]),d=f(s=>s.setTemplateSearch),m=f(s=>s.setTemplateCategory),b=f(s=>s.installTemplate),l=y.useMemo(()=>new Set(r.map(s=>s.name.toLowerCase())),[r]),x=y.useMemo(()=>{const s={};for(const h of t)h.category&&(s[h.category]=(s[h.category]??0)+1);return s},[t]),p=y.useMemo(()=>t.filter(s=>l.has(s.name.toLowerCase())).length,[t,l]);return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-5 px-5 py-2 border-b border-border-divider bg-bg-primary shrink-0",children:[e.jsx(ee,{color:"var(--color-status-planning, #9178B5)",value:t.length,label:"Templates"}),e.jsx(ee,{color:"var(--color-accent-blue, #5B8DB8)",value:o.length,label:"Categories"}),e.jsx(ee,{color:"var(--color-status-completed, #5A9E78)",value:p,label:"Installed"})]}),e.jsxs("div",{className:"flex items-center gap-[10px] px-5 py-2 border-b border-border-divider shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-[6px] px-3 py-[6px] rounded-[var(--radius-lg)] bg-bg-card border border-border w-[260px] focus-within:border-[var(--color-status-planning,#9178B5)] transition-colors",children:[e.jsx(ae,{size:13,strokeWidth:2,className:"text-text-tertiary shrink-0"}),e.jsx("input",{type:"text",placeholder:"Search templates...",value:n,onChange:s=>d(s.target.value),className:"border-none bg-transparent outline-none text-[12px] text-text-primary w-full placeholder:text-text-tertiary"})]}),e.jsxs("div",{className:"flex gap-[6px]",children:[e.jsxs("button",{type:"button",onClick:()=>m(null),className:["flex items-center gap-1 px-[10px] py-1 rounded-full border text-[10px] font-semibold whitespace-nowrap transition-all cursor-pointer",a===null?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border hover:border-text-tertiary hover:text-text-secondary"].join(" "),children:["All",e.jsx("span",{className:"font-mono text-[9px] opacity-60",children:t.length})]}),o.map(s=>{const h=a===s,w=ot[s.toLowerCase()];return e.jsxs("button",{type:"button",onClick:()=>m(h?null:s),className:["flex items-center gap-1 px-[10px] py-1 rounded-full border text-[10px] font-semibold whitespace-nowrap transition-all cursor-pointer",h?"bg-text-primary text-white border-text-primary":"bg-bg-card text-text-tertiary border-border hover:border-text-tertiary hover:text-text-secondary"].join(" "),children:[w&&!h&&e.jsx("span",{className:"w-[6px] h-[6px] rounded-full",style:{background:w}}),s,e.jsx("span",{className:"font-mono text-[9px] opacity-60",children:x[s]??0})]},s)})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",className:"flex items-center gap-[6px] px-[14px] py-[6px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[11px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md whitespace-nowrap",children:[e.jsx(se,{size:13,strokeWidth:2}),"New Template"]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:i.length===0?e.jsx("div",{className:"flex items-center justify-center h-full text-text-tertiary text-[length:var(--font-size-sm)]",children:"No templates found"}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] gap-3",children:i.map((s,h)=>e.jsx(nt,{template:s,installed:l.has(s.name.toLowerCase()),delay:h*.04,onInstall:()=>void b(s.name)},s.id))})})]})}function ee({color:t,value:o,label:r}){return e.jsxs("div",{className:"flex items-center gap-[6px]",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:t}}),e.jsx("span",{className:"text-[16px] font-extrabold text-text-primary font-mono",children:o}),e.jsx("span",{className:"text-[10px] font-semibold text-text-tertiary uppercase tracking-[0.04em]",children:r})]})}function nt({template:t,installed:o,delay:r,onInstall:n}){var m,b;const a=((m=t.category)==null?void 0:m.toLowerCase())??"",i=me[a]??me.utility,d=t.serverConfig.command?`${t.serverConfig.command}${(b=t.serverConfig.args)!=null&&b.length?" "+t.serverConfig.args.join(" "):""}`:"";return e.jsxs(M.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,delay:r},className:"bg-bg-card border border-border rounded-[10px] p-[14px] transition-all duration-200 cursor-pointer flex flex-col gap-[10px] hover:border-text-tertiary hover:shadow-md hover:-translate-y-[2px]",children:[e.jsxs("div",{className:"flex items-start gap-[10px]",children:[e.jsx("div",{className:"w-9 h-9 rounded-[var(--radius-lg)] shrink-0 flex items-center justify-center",style:{background:i.bg,color:i.color},children:i.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-bold text-text-primary",children:t.name}),t.description&&e.jsx("div",{className:"text-[11px] text-text-secondary leading-[1.5] mt-[2px] line-clamp-2",children:t.description})]})]}),d&&e.jsx("div",{className:"font-mono text-[10px] text-text-secondary bg-bg-secondary rounded-[var(--radius-md)] px-[10px] py-[6px] whitespace-nowrap overflow-hidden text-ellipsis",children:d}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex gap-1 flex-wrap",children:(t.tags??[]).map(l=>{const x=st[l.toLowerCase()]??{bg:"rgba(160,157,151,0.12)",color:"var(--color-text-tertiary)"};return e.jsx("span",{className:"text-[9px] font-semibold px-[6px] py-[2px] rounded-[4px] uppercase tracking-[0.03em]",style:{background:x.bg,color:x.color},children:l},l)})}),o?e.jsxs("span",{className:"flex items-center gap-1 px-[10px] py-1 rounded-[var(--radius-md)] border text-[10px] font-semibold whitespace-nowrap",style:{borderColor:"var(--color-status-completed, #5A9E78)",color:"var(--color-status-completed, #5A9E78)",background:"rgba(90,158,120,0.06)"},children:[e.jsx(We,{size:10,strokeWidth:2.5}),"Installed"]}):e.jsxs("button",{type:"button",onClick:l=>{l.stopPropagation(),n()},className:"flex items-center gap-1 px-[10px] py-1 rounded-[var(--radius-md)] border border-border bg-bg-card text-[10px] font-semibold text-text-secondary transition-all hover:border-[var(--color-status-completed,#5A9E78)] hover:text-[var(--color-status-completed,#5A9E78)] hover:bg-[rgba(90,158,120,0.04)] whitespace-nowrap cursor-pointer",children:[e.jsx(Te,{size:10,strokeWidth:2.5}),"Install"]})]})]})}const be={global:{bg:"rgba(91,141,184,0.12)",text:"var(--color-accent-blue, #5B8DB8)"},project:{bg:"rgba(145,120,181,0.12)",text:"var(--color-status-planning, #9178B5)"},enterprise:{bg:"rgba(200,134,58,0.12)",text:"var(--color-status-verifying, #C8863A)"},codex:{bg:"rgba(90,158,120,0.12)",text:"var(--color-status-completed, #5A9E78)"}};function lt(){const t=f(n=>n.editingServer),o=f(n=>n.setEditingServer),r=f(n=>n.updateServer);return t?e.jsx(ye,{open:!!t,onOpenChange:n=>{n||o(null)},children:e.jsxs(je,{children:[e.jsx(Ne,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(we,{className:B("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[560px] max-w-[95vw] max-h-[85vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden","focus:outline-none","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"),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ce,{className:"text-[14px] font-semibold text-text-primary",children:"Edit Server"}),e.jsx(ct,{scope:t.scope})]}),e.jsx(ke,{className:B("w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-tertiary hover:text-text-primary hover:bg-bg-hover","transition-colors"),"aria-label":"Close",children:e.jsx(ve,{size:14,strokeWidth:2})})]}),e.jsx(it,{server:t,onSave:n=>void r(t,n),onCancel:()=>o(null)})]})]})}):null}function it({server:t,onSave:o,onCancel:r}){var W;const n=t.transport==="stdio",a=t.scope==="enterprise",[i,d]=y.useState(t.command??""),[m,b]=y.useState(((W=t.args)==null?void 0:W.join(" "))??""),[l,x]=y.useState(t.url??""),[p,s]=y.useState(()=>t.env?Object.entries(t.env).map(([g,j])=>({key:g,value:j})):[]),[h,w]=y.useState(!1),k=y.useMemo(()=>()=>{const g={...t.raw};if(n){g.command=i;const N=m.trim().split(/\s+/).filter(Boolean);N.length>0?g.args=N:delete g.args,delete g.url}else g.url=l,delete g.command,delete g.args;delete g.env;const j={};for(const N of p)N.key.trim()&&(j[N.key.trim()]=N.value);return Object.keys(j).length>0&&(g.env=j),delete g.enabled,g},[t.raw,n,i,m,l,p]);function S(){w(!0),o(k())}function A(){s(g=>[...g,{key:"",value:""}])}function L(g){s(j=>j.filter((N,c)=>c!==g))}function $(g,j,N){s(c=>c.map((C,z)=>z===g?{...C,[j]:N}:C))}return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:[e.jsx(D,{label:"Server Name",children:e.jsx("input",{type:"text",value:t.name,readOnly:!0,className:"w-full px-3 py-2 rounded-[var(--radius-md)] border border-border bg-bg-secondary text-[12px] text-text-tertiary font-mono cursor-not-allowed"})}),e.jsx(D,{label:"Transport",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:n?"rgba(91,141,184,0.08)":"rgba(145,120,181,0.08)",color:n?"var(--color-accent-blue, #5B8DB8)":"var(--color-status-planning, #9178B5)"},children:t.transport})})}),a&&e.jsx("div",{className:"mb-4 px-3 py-2 rounded-[var(--radius-md)] border border-[var(--color-status-verifying,#C8863A)] bg-[rgba(200,134,58,0.06)] text-[11px] text-[var(--color-status-verifying,#C8863A)]",children:"Enterprise-managed servers cannot be edited from the dashboard."}),n&&e.jsx(D,{label:"Command",children:e.jsx("input",{type:"text",value:i,onChange:g=>d(g.target.value),disabled:a,placeholder:"e.g. npx",className:F})}),n&&e.jsx(D,{label:"Arguments",children:e.jsx("input",{type:"text",value:m,onChange:g=>b(g.target.value),disabled:a,placeholder:"space-separated arguments",className:F})}),!n&&e.jsx(D,{label:"URL",children:e.jsx("input",{type:"text",value:l,onChange:g=>x(g.target.value),disabled:a,placeholder:"https://...",className:F})}),e.jsx(D,{label:"Environment Variables",children:e.jsxs("div",{className:"space-y-2",children:[p.map((g,j)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:g.key,onChange:N=>$(j,"key",N.target.value),disabled:a,placeholder:"KEY",className:B(F,"w-[160px] shrink-0 font-mono text-[11px]")}),e.jsx("input",{type:"text",value:g.value,onChange:N=>$(j,"value",N.target.value),disabled:a,placeholder:"value",className:B(F,"flex-1 font-mono text-[11px]")}),!a&&e.jsx("button",{type:"button",onClick:()=>L(j),className:"shrink-0 w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-text-tertiary hover:text-status-failed hover:bg-red-50 transition-colors",children:e.jsx(_e,{size:12,strokeWidth:2})})]},j)),!a&&e.jsxs("button",{type:"button",onClick:A,className:"flex items-center gap-1 px-2 py-1 text-[10px] font-semibold text-text-tertiary hover:text-text-primary transition-colors",children:[e.jsx(se,{size:11,strokeWidth:2}),"Add variable"]})]})})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border shrink-0",children:[e.jsx("button",{type:"button",onClick:r,className:"px-4 py-[6px] rounded-[var(--radius-md)] border border-border bg-bg-card text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-colors",children:"Cancel"}),e.jsx("button",{type:"button",onClick:S,disabled:h||a,className:B("px-4 py-[6px] rounded-[var(--radius-md)] border-none bg-text-primary text-white text-[11px] font-semibold transition-all","hover:-translate-y-px hover:shadow-md",(h||a)&&"opacity-50 cursor-not-allowed hover:translate-y-0 hover:shadow-none"),children:h?"Saving...":"Save Changes"})]})]})}const F=B("w-full px-3 py-2 rounded-[var(--radius-md)] border border-border bg-bg-card","text-[12px] text-text-primary outline-none","focus:border-[var(--color-status-planning,#9178B5)] transition-colors","placeholder:text-text-tertiary","disabled:opacity-50 disabled:cursor-not-allowed");function D({label:t,children:o}){return e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.05em] text-text-tertiary mb-[6px]",children:t}),o]})}function ct({scope:t}){const o=be[t]??be.global;return e.jsx("span",{className:"text-[9px] font-bold px-[7px] py-[2px] rounded-[4px] uppercase tracking-[0.03em] font-mono",style:{background:o.bg,color:o.text},children:t})}const ue=[{id:"mode",label:"Mode"},{id:"configure",label:"Configure"},{id:"review",label:"Review"},{id:"progress",label:"Install"}];function dt({current:t}){const o=ue.findIndex(r=>r.id===t);return e.jsx("div",{className:"flex items-center gap-1 px-1",children:ue.map((r,n)=>{const a=n<o,i=n===o;return e.jsxs("div",{className:"flex items-center gap-1",children:[n>0&&e.jsx("div",{className:"w-8 h-px",style:{background:a?"var(--color-status-completed, #5A9E78)":"var(--color-border, #E8E5DE)"}}),e.jsxs("div",{className:"flex items-center gap-[6px]",children:[e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[9px] font-bold font-mono",style:{background:a?"var(--color-status-completed, #5A9E78)":i?"var(--color-text-primary, #1A1917)":"var(--color-bg-card, #F8F7F5)",color:a||i?"#fff":"var(--color-text-tertiary)",border:!a&&!i?"1px solid var(--color-border, #E8E5DE)":"none"},children:a?e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}):n+1}),e.jsx("span",{className:"text-[11px] font-semibold whitespace-nowrap",style:{color:i?"var(--color-text-primary)":"var(--color-text-tertiary)"},children:r.label})]})]},r.id)})})}function xt(){const t=u(x=>x.mode),o=u(x=>x.setMode),r=u(x=>x.projectPath),n=u(x=>x.setProjectPath),a=u(x=>x.detecting),i=u(x=>x.error),d=u(x=>x.detect),m=u(x=>x.manifests),b=u(x=>x.fetchManifests);y.useEffect(()=>{b()},[b]);const l=t==="global"||t==="project"&&r.trim().length>0;return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[520px] mx-auto py-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[14px] font-semibold text-text-primary mb-1",children:"Installation Mode"}),e.jsx("p",{className:"text-[12px] text-text-tertiary",children:"Choose where to install maestro commands, agents, and workflows."})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(he,{selected:t==="global",onClick:()=>o("global"),title:"Global",description:"Install to home directory (~/.claude/, ~/.maestro/). Available across all projects.",recommended:!0}),e.jsx(he,{selected:t==="project",onClick:()=>o("project"),title:"Project",description:"Install to a specific project directory. Commands are project-scoped."})]}),t==="project"&&e.jsxs("div",{className:"flex flex-col gap-[6px]",children:[e.jsx("label",{className:"text-[11px] font-semibold text-text-secondary uppercase tracking-[0.04em]",children:"Project Path"}),e.jsx("input",{type:"text",value:r,onChange:x=>n(x.target.value),placeholder:"/path/to/your/project",className:"w-full px-3 py-2 rounded-[var(--radius-md)] border border-border bg-bg-card text-[12px] text-text-primary placeholder:text-text-tertiary focus:outline-none focus:border-[var(--color-status-planning,#9178B5)] transition-colors"})]}),m.length>0&&e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-[rgba(184,149,64,0.04)] px-4 py-3",children:[e.jsx("p",{className:"text-[11px] font-semibold text-[var(--color-status-executing,#B89540)] mb-1",children:"Existing installations found"}),e.jsx("div",{className:"flex flex-col gap-1",children:m.slice(0,3).map(x=>e.jsxs("p",{className:"text-[10px] text-text-tertiary font-mono",children:[x.scope," — v",x.version," — ",new Date(x.installedAt).toLocaleDateString()]},x.id))})]}),i&&e.jsx("div",{className:"rounded-[var(--radius-md)] border border-[rgba(196,101,85,0.3)] bg-[rgba(196,101,85,0.04)] px-4 py-3",children:e.jsx("p",{className:"text-[11px] text-status-failed",children:i})}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{type:"button",disabled:!l||a,onClick:()=>void d(),className:"flex items-center gap-[6px] px-5 py-[8px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md disabled:opacity-40 disabled:cursor-default disabled:transform-none",children:a?e.jsxs(e.Fragment,{children:[e.jsx(pt,{}),"Scanning..."]}):"Next"})})]})}function he({selected:t,onClick:o,title:r,description:n,recommended:a}){return e.jsxs("button",{type:"button",onClick:o,className:"flex items-start gap-3 p-4 rounded-[var(--radius-lg)] border text-left transition-all cursor-pointer w-full",style:{borderColor:t?"var(--color-text-primary, #1A1917)":"var(--color-border, #E8E5DE)",background:t?"rgba(26,25,23,0.02)":"var(--color-bg-card, #F8F7F5)"},children:[e.jsx("div",{className:"w-[18px] h-[18px] rounded-full border-2 flex items-center justify-center shrink-0 mt-[1px]",style:{borderColor:t?"var(--color-text-primary, #1A1917)":"var(--color-border, #E8E5DE)"},children:t&&e.jsx("div",{className:"w-[10px] h-[10px] rounded-full",style:{background:"var(--color-text-primary, #1A1917)"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-text-primary",children:r}),a&&e.jsx("span",{className:"text-[8px] font-bold px-[6px] py-[1px] rounded-full bg-[rgba(90,158,120,0.1)] text-[var(--color-status-completed,#5A9E78)] uppercase tracking-wider",children:"Recommended"})]}),e.jsx("p",{className:"text-[11px] text-text-tertiary mt-[2px] leading-[1.4]",children:n})]})]})}function pt(){return e.jsxs("svg",{className:"animate-spin w-[14px] h-[14px]",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",opacity:"0.3"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}function mt(){const t=u(s=>s.detection),o=u(s=>s.selectedComponents),r=u(s=>s.toggleComponent),n=u(s=>s.selectAllComponents),a=u(s=>s.backup),i=u(s=>s.setBackup),d=u(s=>s.mcpEnabled),m=u(s=>s.setMcpEnabled),b=u(s=>s.enabledTools),l=u(s=>s.toggleTool),x=u(s=>s.setStep);if(!t)return null;const p=t.components.filter(s=>s.available).every(s=>o.has(s.id));return e.jsxs("div",{className:"flex flex-col gap-5 max-w-[560px] mx-auto py-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-text-primary",children:"Components"}),e.jsx("button",{type:"button",onClick:n,className:"text-[10px] font-semibold text-text-tertiary hover:text-text-primary transition-colors cursor-pointer",children:p?"All selected":"Select all"})]}),e.jsxs("div",{className:"flex flex-col gap-[6px]",children:[t.components.map(s=>e.jsxs("label",{className:"flex items-center gap-3 px-3 py-[10px] rounded-[var(--radius-md)] border border-border bg-bg-card cursor-pointer hover:bg-bg-hover transition-colors",style:{opacity:s.available?1:.4,pointerEvents:s.available?"auto":"none"},children:[e.jsx("input",{type:"checkbox",checked:o.has(s.id),onChange:()=>r(s.id),disabled:!s.available,className:"w-[14px] h-[14px] accent-[var(--color-text-primary,#1A1917)] cursor-pointer"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:s.label}),e.jsxs("span",{className:"text-[10px] text-text-tertiary ml-2 font-mono",children:[s.fileCount," files"]})]}),e.jsx("span",{className:"text-[9px] text-text-tertiary font-mono max-w-[200px] truncate",title:s.targetDir,children:s.targetDir.replace(/\\/g,"/").replace(/^.*\/\./,"~/.")})]},s.id)),e.jsxs("label",{className:"flex items-center gap-3 px-3 py-[10px] rounded-[var(--radius-md)] border border-border bg-bg-card cursor-pointer hover:bg-bg-hover transition-colors",children:[e.jsx("input",{type:"checkbox",checked:o.has("mcp"),onChange:()=>r("mcp"),className:"w-[14px] h-[14px] accent-[var(--color-text-primary,#1A1917)] cursor-pointer"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[12px] font-semibold text-text-primary",children:"MCP Server"}),e.jsx("span",{className:"text-[10px] text-text-tertiary ml-2",children:"Register maestro-tools MCP"})]})]})]})]}),t.existingManifest&&e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-[rgba(184,149,64,0.3)] bg-[rgba(184,149,64,0.04)] px-4 py-3",children:[e.jsxs("p",{className:"text-[11px] font-semibold text-[var(--color-status-executing,#B89540)] mb-2",children:["Existing installation (v",t.existingManifest.version,") will be overwritten"]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:a,onChange:s=>i(s.target.checked),className:"w-[14px] h-[14px] accent-[var(--color-status-executing,#B89540)] cursor-pointer"}),e.jsx("span",{className:"text-[11px] text-text-secondary",children:"Create backup before installing"})]})]}),o.has("mcp")&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-[13px] font-semibold text-text-primary",children:"MCP Tools"}),e.jsxs("label",{className:"flex items-center gap-[6px] cursor-pointer ml-auto",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:s=>m(s.target.checked),className:"w-[13px] h-[13px] accent-[var(--color-text-primary,#1A1917)] cursor-pointer"}),e.jsx("span",{className:"text-[10px] text-text-secondary font-semibold",children:"Enable MCP"})]})]}),d&&e.jsx("div",{className:"flex flex-wrap gap-[6px]",children:re.map(s=>e.jsx("button",{type:"button",onClick:()=>l(s),className:"px-[10px] py-[5px] rounded-full border text-[10px] font-mono font-semibold transition-all cursor-pointer",style:{borderColor:b.has(s)?"var(--color-text-primary)":"var(--color-border)",background:b.has(s)?"var(--color-text-primary)":"var(--color-bg-card)",color:b.has(s)?"#fff":"var(--color-text-tertiary)"},children:s},s))})]}),t.disabledItems.length>0&&e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-bg-card px-4 py-3",children:[e.jsxs("p",{className:"text-[11px] font-semibold text-text-secondary mb-1",children:[t.disabledItems.length," disabled item(s) will be preserved"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.disabledItems.map(s=>e.jsxs("span",{className:"text-[9px] font-mono text-text-tertiary px-[6px] py-[2px] rounded bg-bg-secondary",children:[s.name," (",s.type,")"]},s.relativePath))})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsx("button",{type:"button",onClick:()=>x("mode"),className:"px-4 py-[7px] rounded-[var(--radius-lg)] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary hover:text-text-primary hover:border-text-tertiary transition-all cursor-pointer",children:"Back"}),e.jsx("button",{type:"button",onClick:()=>x("review"),disabled:o.size===0,className:"px-5 py-[8px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md disabled:opacity-40 disabled:cursor-default disabled:transform-none",children:"Review"})]})]})}function bt(){const t=u(s=>s.mode),o=u(s=>s.projectPath),r=u(s=>s.detection),n=u(s=>s.selectedComponents),a=u(s=>s.backup),i=u(s=>s.mcpEnabled),d=u(s=>s.enabledTools),m=u(s=>s.setStep),b=u(s=>s.install);if(!r)return null;const l=r.components.filter(s=>s.available&&n.has(s.id)),x=l.reduce((s,h)=>s+h.fileCount,0),p=n.has("mcp");return e.jsxs("div",{className:"flex flex-col gap-5 max-w-[560px] mx-auto py-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-[14px] font-semibold text-text-primary mb-1",children:"Review Installation"}),e.jsx("p",{className:"text-[12px] text-text-tertiary",children:"Confirm the following will be installed."})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(X,{label:"Mode",value:t}),e.jsx(X,{label:"Components",value:String(l.length+(p?1:0))}),e.jsx(X,{label:"Files",value:String(x)}),e.jsx(X,{label:"Backup",value:a&&r.existingManifest?"Yes":"No"})]}),t==="project"&&o&&e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:"font-semibold text-text-secondary",children:"Project:"}),e.jsx("span",{className:"font-mono text-text-tertiary",children:o})]}),e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border overflow-hidden",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left text-[9px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-3 py-[6px] bg-bg-secondary border-b border-border",children:"Component"}),e.jsx("th",{className:"text-left text-[9px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-3 py-[6px] bg-bg-secondary border-b border-border",children:"Target"}),e.jsx("th",{className:"text-right text-[9px] font-semibold uppercase tracking-[0.05em] text-text-tertiary px-3 py-[6px] bg-bg-secondary border-b border-border w-[60px]",children:"Files"})]})}),e.jsxs("tbody",{children:[l.map(s=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[11px] font-semibold text-text-primary",children:s.label}),e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[10px] font-mono text-text-tertiary max-w-[250px] truncate",title:s.targetDir,children:s.targetDir.replace(/\\/g,"/").replace(/^.*\/\./,"~/.")}),e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[11px] font-mono text-text-secondary text-right",children:s.fileCount})]},s.id)),p&&e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[11px] font-semibold text-text-primary",children:"MCP Server"}),e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[10px] font-mono text-text-tertiary",children:t==="project"?".mcp.json":"~/.claude.json"}),e.jsx("td",{className:"px-3 py-2 border-b border-border-divider text-[11px] font-mono text-text-secondary text-right",children:"—"})]})]})]})}),p&&i&&e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-bg-card px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-semibold text-text-secondary uppercase tracking-[0.04em] mb-1",children:"MCP Tools"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:Array.from(d).map(s=>e.jsx("span",{className:"text-[9px] font-mono font-semibold px-[7px] py-[2px] rounded-full bg-[rgba(90,158,120,0.08)] text-[var(--color-status-completed,#5A9E78)]",children:s},s))})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsx("button",{type:"button",onClick:()=>m("configure"),className:"px-4 py-[7px] rounded-[var(--radius-lg)] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary hover:text-text-primary hover:border-text-tertiary transition-all cursor-pointer",children:"Back"}),e.jsx("button",{type:"button",onClick:()=>void b(),className:"px-5 py-[8px] rounded-[var(--radius-lg)] border-none bg-[var(--color-status-completed,#5A9E78)] text-white text-[12px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md",children:"Install"})]})]})}function X({label:t,value:o}){return e.jsxs("div",{className:"flex-1 rounded-[var(--radius-md)] border border-border bg-bg-card px-3 py-2 text-center",children:[e.jsx("div",{className:"text-[14px] font-extrabold text-text-primary font-mono capitalize",children:o}),e.jsx("div",{className:"text-[9px] font-semibold text-text-tertiary uppercase tracking-[0.04em]",children:t})]})}function ut(){const t=u(a=>a.installing),o=u(a=>a.result),r=u(a=>a.setOpen),n=u(a=>a.reset);return t?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-16",children:[e.jsxs("svg",{className:"animate-spin w-8 h-8 text-text-primary",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",opacity:"0.15"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]}),e.jsx("p",{className:"text-[13px] font-semibold text-text-primary",children:"Installing..."}),e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"Copying files and registering configuration"})]}):o?o.success?e.jsxs("div",{className:"flex flex-col items-center gap-5 py-10 max-w-[440px] mx-auto",children:[e.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center",style:{background:"rgba(90,158,120,0.1)"},children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-status-completed, #5A9E78)",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-[14px] font-semibold text-text-primary mb-1",children:"Installation Complete"}),e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"All components installed successfully."})]}),e.jsxs("div",{className:"w-full rounded-[var(--radius-md)] border border-border bg-bg-card overflow-hidden",children:[e.jsx(I,{label:"Files installed",value:String(o.filesInstalled)}),e.jsx(I,{label:"Directories created",value:String(o.dirsCreated)}),e.jsx(I,{label:"Components",value:o.components.join(", ")}),o.disabledItemsRestored>0&&e.jsx(I,{label:"Disabled items restored",value:String(o.disabledItemsRestored)}),e.jsx(I,{label:"MCP registered",value:o.mcpRegistered?"Yes":"No"}),e.jsx(I,{label:"Manifest",value:o.manifestPath.replace(/\\/g,"/").split("/").slice(-1)[0],last:!0})]}),e.jsx("button",{type:"button",onClick:()=>r(!1),className:"px-5 py-[8px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer transition-all hover:-translate-y-px hover:shadow-md",children:"Done"})]}):e.jsxs("div",{className:"flex flex-col items-center gap-5 py-10 max-w-[440px] mx-auto",children:[e.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center",style:{background:"rgba(196,101,85,0.1)"},children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"var(--color-status-failed, #C46555)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-[14px] font-semibold text-text-primary mb-1",children:"Installation Failed"}),e.jsx("p",{className:"text-[11px] text-status-failed",children:o.error})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:n,className:"px-4 py-[7px] rounded-[var(--radius-lg)] border border-border bg-bg-card text-[12px] font-semibold text-text-secondary hover:text-text-primary transition-all cursor-pointer",children:"Try Again"}),e.jsx("button",{type:"button",onClick:()=>r(!1),className:"px-4 py-[7px] rounded-[var(--radius-lg)] border-none bg-text-primary text-white text-[12px] font-semibold cursor-pointer transition-all",children:"Close"})]})]}):null}function I({label:t,value:o,last:r}){return e.jsxs("div",{className:"flex items-center justify-between px-4 py-[8px]",style:{borderBottom:r?"none":"1px solid var(--color-border-divider)"},children:[e.jsx("span",{className:"text-[10px] font-semibold text-text-tertiary uppercase tracking-[0.04em]",children:t}),e.jsx("span",{className:"text-[11px] font-mono text-text-primary",children:o})]})}function ht(){const t=u(a=>a.open),o=u(a=>a.setOpen),r=u(a=>a.step),n=u(a=>a.installing);return e.jsx(ye,{open:t,onOpenChange:a=>{!a&&n||o(a)},children:e.jsxs(je,{children:[e.jsx(Ne,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.jsxs(we,{className:B("fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2","w-[640px] max-w-[95vw] max-h-[85vh]","rounded-[var(--radius-lg)] border border-border bg-bg-primary shadow-lg","flex flex-col overflow-hidden","focus:outline-none","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"),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(Ce,{className:"text-[14px] font-semibold text-text-primary",children:"Install Wizard"}),e.jsx(dt,{current:r})]}),!n&&e.jsx(ke,{className:B("w-7 h-7 flex items-center justify-center rounded-[var(--radius-sm)]","text-text-tertiary hover:text-text-primary hover:bg-bg-hover","transition-colors"),"aria-label":"Close",children:e.jsxs("svg",{className:"w-[14px] h-[14px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5",children:[r==="mode"&&e.jsx(xt,{}),r==="configure"&&e.jsx(mt,{}),r==="review"&&e.jsx(bt,{}),r==="progress"&&e.jsx(ut,{})]})]})]})})}const ft=[{label:"List",icon:e.jsx(Oe,{size:14,strokeWidth:1.8}),shortcut:"1"},{label:"Cards",icon:e.jsx(Le,{size:14,strokeWidth:1.8}),shortcut:"2"},{label:"Templates",icon:e.jsx($e,{size:14,strokeWidth:1.8}),shortcut:"3"}],fe=["list","cards","templates"],te={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function zt(){const t=f(l=>l.activeView),o=f(l=>l.setActiveView),r=f(l=>l.fetchConfig),n=f(l=>l.fetchTemplates),a=f(l=>l.loading),i=f(l=>l.error),{register:d,unregister:m}=y.useContext(Me),b=y.useCallback(l=>o(fe[l]),[o]);return y.useEffect(()=>{d({items:ft.map(l=>({label:l.label,icon:l.icon,shortcut:l.shortcut})),activeIndex:fe.indexOf(t),onSwitch:b})},[t,d,b]),y.useEffect(()=>()=>m(),[m]),y.useEffect(()=>{function l(x){x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement||(x.key==="1"?o("list"):x.key==="2"?o("cards"):x.key==="3"&&o("templates"))}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[o]),y.useEffect(()=>{r(),n()},[r,n]),a?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading MCP configuration..."}):i?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-status-failed text-[length:var(--font-size-sm)]",children:"Failed to load MCP config"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:i}),e.jsx("button",{type:"button",onClick:()=>void r(),className:"px-3 py-1 rounded-[var(--radius-md)] text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all",style:{border:"var(--style-btn-secondary-border)",background:"var(--style-btn-secondary-bg)"},children:"Retry"})]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsx(ht,{}),e.jsx(lt,{}),e.jsxs(Be,{mode:"wait",children:[t==="list"&&e.jsx(M.div,{className:"flex-1 flex flex-col overflow-hidden",variants:te,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(Qe,{})},"list"),t==="cards"&&e.jsx(M.div,{className:"flex-1 flex flex-col overflow-hidden",variants:te,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(rt,{})},"cards"),t==="templates"&&e.jsx(M.div,{className:"flex-1 flex flex-col overflow-hidden",variants:te,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.25,ease:[.34,1.56,.64,1]},children:e.jsx(at,{})},"templates")]})]})}export{zt as McpPage};