tower-studio 0.2.37 → 0.2.39

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 (219) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +2 -2
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +44 -32
  13. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  34. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +81 -69
  35. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +2 -2
  38. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +44 -32
  39. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +2 -2
  42. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +44 -32
  43. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +2 -2
  46. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +61 -49
  47. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +2 -2
  50. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +115 -103
  51. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +2 -2
  54. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +98 -86
  55. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +2 -2
  58. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +81 -69
  59. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +2 -2
  62. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +86 -74
  63. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +2 -2
  66. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +44 -32
  67. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +2 -2
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +84 -72
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +3 -3
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +95 -83
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +2 -2
  78. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +62 -50
  79. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +5 -5
  82. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
  83. package/.next/standalone/.next/server/chunks/[root-of-the-server]__00llstz._.js +1 -1
  84. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01n7exm._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01yu.gw._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qif839._.js +1 -1
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qijr4h._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~foo~5._.js +2 -2
  89. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/src_lib_0i2.v2d._.js +1 -1
  91. package/.next/standalone/.next/server/chunks/src_lib_12xey8u._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/ssr/{0ws9_lucide-react_dist_esm_icons_0odx0ph._.js → 0ws9_lucide-react_dist_esm_icons_10_90yo._.js} +2 -2
  94. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-tolks._.js +2 -2
  95. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__05b5dyi._.js → [root-of-the-server]__0.~z1-.._.js} +2 -2
  96. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05sv58d._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__062b.yt._.js +2 -2
  99. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__093tt4a._.js +2 -2
  100. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e-k-gl._.js +3 -0
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0guqcva._.js +2 -2
  102. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gzafdq._.js +1 -1
  103. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0csj88a._.js → [root-of-the-server]__0i0o7w5._.js} +2 -2
  104. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  105. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0oy9qt7._.js → [root-of-the-server]__0k1ivnj._.js} +2 -2
  106. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vjz4a4._.js → [root-of-the-server]__0kgd-1s._.js} +2 -2
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p0te97._.js +2 -2
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0siyg1p._.js +2 -2
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t6f4lq._.js +2 -2
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0th-t1a._.js +2 -2
  111. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kdfgja._.js → [root-of-the-server]__0xte.35._.js} +2 -2
  112. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/{_0r1f9zc._.js → _0-qd2ss._.js} +2 -2
  114. package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/ssr/{_0pp8emp._.js → _00kwrmr._.js} +2 -2
  116. package/.next/standalone/.next/server/chunks/ssr/_00t6138._.js +2 -2
  117. package/.next/standalone/.next/server/chunks/ssr/_05jv_cy._.js +3 -0
  118. package/.next/standalone/.next/server/chunks/ssr/{_0ub.iem._.js → _06nlsbw._.js} +2 -2
  119. package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
  120. package/.next/standalone/.next/server/chunks/ssr/_07c-9da._.js +3 -0
  121. package/.next/standalone/.next/server/chunks/ssr/_0_z-t6g._.js +3 -0
  122. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +2 -2
  123. package/.next/standalone/.next/server/chunks/ssr/_0cxhub8._.js +2 -2
  124. package/.next/standalone/.next/server/chunks/ssr/{_0v0y2s~._.js → _0gb8a9_._.js} +2 -2
  125. package/.next/standalone/.next/server/chunks/ssr/_0gxccup._.js +3 -0
  126. package/.next/standalone/.next/server/chunks/ssr/_0hh17jg._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/{_0lqxllh._.js → _0m.34j8._.js} +2 -2
  128. package/.next/standalone/.next/server/chunks/ssr/_0mpce0d._.js +2 -2
  129. package/.next/standalone/.next/server/chunks/ssr/_0muaopo._.js +2 -2
  130. package/.next/standalone/.next/server/chunks/ssr/_0n1l7yo._.js +2 -2
  131. package/.next/standalone/.next/server/chunks/ssr/_0ng0eku._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/{_0r_ch71._.js → _0t0oltj._.js} +3 -3
  134. package/.next/standalone/.next/server/chunks/ssr/{_0.-xze1._.js → _0v66l8c._.js} +2 -2
  135. package/.next/standalone/.next/server/chunks/ssr/_0w9~m7o._.js +3 -0
  136. package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0hhlpw6._.js → node_modules__pnpm_06f0dao._.js} +2 -2
  138. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +1 -1
  150. package/.next/standalone/.next/server/chunks/ssr/src_lib_0sms4xl._.js +1 -1
  151. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  152. package/.next/standalone/.next/server/pages/500.html +1 -1
  153. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/server-reference-manifest.json +356 -272
  155. package/.next/standalone/.next/static/chunks/0.euy5rie4v3d.js +1 -0
  156. package/.next/standalone/.next/static/chunks/0.lqb7y9kz5z6.js +1 -0
  157. package/.next/standalone/.next/static/chunks/01.nidb8sf6bh.js +1 -0
  158. package/.next/standalone/.next/static/chunks/{00_-_qcmfqtqx.js → 01ijm9dpmm34q.js} +1 -1
  159. package/.next/standalone/.next/static/chunks/023v9juzhzc~d.js +1 -0
  160. package/.next/standalone/.next/static/chunks/02jsekc779t5~.js +1 -0
  161. package/.next/standalone/.next/static/chunks/0651zmy-w~saj.js +1 -0
  162. package/.next/standalone/.next/static/chunks/0_-2es-r~03mg.js +1 -0
  163. package/.next/standalone/.next/static/chunks/{0m227i3p__4qz.js → 0a._hcvzq4ko7.js} +2 -2
  164. package/.next/standalone/.next/static/chunks/{0o0ngxu962xwu.js → 0dha37i1oc6z~.js} +1 -1
  165. package/.next/standalone/.next/static/chunks/0e9ykduz3_0e1.js +1 -0
  166. package/.next/standalone/.next/static/chunks/0fy6w5d_zyro0.js +1 -0
  167. package/.next/standalone/.next/static/chunks/0g-gbdkcssn.g.js +1 -0
  168. package/.next/standalone/.next/static/chunks/{08ewy5rmh_n_s.js → 0h4k3cicu7g-w.js} +1 -1
  169. package/.next/standalone/.next/static/chunks/{03tc~x4m3si-p.js → 0h73q-9fyea0t.js} +1 -1
  170. package/.next/standalone/.next/static/chunks/0h7~fn.p-fxz_.js +1 -0
  171. package/.next/standalone/.next/static/chunks/0j2n.h0~von8h.js +1 -0
  172. package/.next/standalone/.next/static/chunks/0k.hp06ufx4yp.js +1 -0
  173. package/.next/standalone/.next/static/chunks/0lk-i0jm2ubea.css +1 -0
  174. package/.next/standalone/.next/static/chunks/0p5rare_o5zb1.js +5 -0
  175. package/.next/standalone/.next/static/chunks/{08cuzj12jsob5.js → 0q~4dhw.phxg3.js} +1 -1
  176. package/.next/standalone/.next/static/chunks/{0oaelsx9hpsxi.js → 0t_3wwd~mmc.1.js} +1 -1
  177. package/.next/standalone/.next/static/chunks/{0950xt.ix3j1q.js → 0u.3xek3m2ud..js} +1 -1
  178. package/.next/standalone/.next/static/chunks/0u.b0t7fueh-x.js +1 -0
  179. package/.next/standalone/.next/static/chunks/{10mwqzqdpi9d5.js → 0v.l5.sqos562.js} +1 -1
  180. package/.next/standalone/.next/static/chunks/{0o3eu9q3qnvi..js → 0w14di5d0vw6-.js} +1 -1
  181. package/.next/standalone/.next/static/chunks/0z2blg_osfipv.js +1 -0
  182. package/.next/standalone/.next/static/chunks/{0c.6n7.lv8~10.js → 11.r6a56ss7qu.js} +1 -1
  183. package/.next/standalone/.next/static/chunks/112wpv9rqw4dp.js +1 -0
  184. package/.next/standalone/.next/static/chunks/{09a43rligfn_v.js → 134c60acdsr_g.js} +1 -1
  185. package/.next/standalone/.next/static/chunks/13rq33eiffqaz.js +1 -0
  186. package/.next/standalone/package.json +3 -2
  187. package/dist/mcp-server.cjs +6 -3
  188. package/package.json +3 -2
  189. package/scripts/migrations/0003-backfill-systemconfig-from-legacy-db.ts +113 -0
  190. package/scripts/run-migrations.ts +12 -0
  191. package/skills/tower/SKILL.md +81 -2
  192. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rzkdlf._.js +0 -3
  193. package/.next/standalone/.next/server/chunks/ssr/_00z0339._.js +0 -3
  194. package/.next/standalone/.next/server/chunks/ssr/_0_r-f5a._.js +0 -3
  195. package/.next/standalone/.next/server/chunks/ssr/_0gzdrnf._.js +0 -3
  196. package/.next/standalone/.next/server/chunks/ssr/_0nk7qd4._.js +0 -3
  197. package/.next/standalone/.next/server/chunks/ssr/_0z7hp2l._.js +0 -3
  198. package/.next/standalone/.next/static/chunks/00.kucs-nzw72.js +0 -1
  199. package/.next/standalone/.next/static/chunks/014cs5ykpuy3m.js +0 -1
  200. package/.next/standalone/.next/static/chunks/01f6i88h8guls.js +0 -1
  201. package/.next/standalone/.next/static/chunks/034x~85_u-f26.js +0 -1
  202. package/.next/standalone/.next/static/chunks/03v.cnuy3h3rb.js +0 -1
  203. package/.next/standalone/.next/static/chunks/05dlhgy_00kj1.js +0 -1
  204. package/.next/standalone/.next/static/chunks/05p_suay02eo1.js +0 -1
  205. package/.next/standalone/.next/static/chunks/0ckcff42.pa_j.js +0 -1
  206. package/.next/standalone/.next/static/chunks/0dt3ljzz2pz0r.css +0 -1
  207. package/.next/standalone/.next/static/chunks/0kuz7yd.6hpd1.js +0 -1
  208. package/.next/standalone/.next/static/chunks/0mk6~akqfc05t.js +0 -1
  209. package/.next/standalone/.next/static/chunks/0p.-6dhm_nm9f.js +0 -1
  210. package/.next/standalone/.next/static/chunks/0qc.bnyy68-yh.js +0 -1
  211. package/.next/standalone/.next/static/chunks/0qfx4.vrc9a9n.js +0 -5
  212. package/.next/standalone/.next/static/chunks/0qonpqhvpg-tt.js +0 -1
  213. package/.next/standalone/.next/static/chunks/0s46.9vyvnj99.js +0 -1
  214. package/.next/standalone/.next/static/chunks/0u~0j4_f3gwi2.js +0 -1
  215. package/.next/standalone/.next/static/chunks/0~uo_7-sxehxf.js +0 -1
  216. package/.next/standalone/.next/static/chunks/15~2jg4z8h54~.js +0 -1
  217. /package/.next/standalone/.next/static/{FO1_JUKAw5Zm07Nlq0G6X → JutVIyokVf-YrN6j2WEwG}/_buildManifest.js +0 -0
  218. /package/.next/standalone/.next/static/{FO1_JUKAw5Zm07Nlq0G6X → JutVIyokVf-YrN6j2WEwG}/_clientMiddlewareManifest.js +0 -0
  219. /package/.next/standalone/.next/static/{FO1_JUKAw5Zm07Nlq0G6X → JutVIyokVf-YrN6j2WEwG}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,449636,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(533499),n=e.i(514798);let a=(0,n.createServerReference)("0071dfd5a1f5a0664caf5d4992d299f27fe650d0ec",n.callServer,void 0,n.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var i=e.i(166407);let l=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var o=e.i(280027),c=e.i(519455),d=e.i(912505),u=e.i(572989);let m=(0,u.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var x=e.i(360325),h=e.i(746798),p=e.i(56978);function f({cols:e,rows:s,active:r}){let n=Array.from({length:e*s});return(0,t.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${r?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${e}, 1fr)`,gridTemplateRows:`repeat(${s}, 1fr)`},children:n.map((e,s)=>(0,t.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${r?"bg-primary":"bg-muted-foreground/40"}`},s))})}let g="custom";function b({value:e,customValue:n,onChange:a}){let{t:i}=(0,r.useI18n)(),[o,d]=(0,s.useState)(!1),u=(0,s.useRef)(null),m=e===g,x=m?null:l.find(t=>t.id===e)??l[2],[h,j]=(0,s.useState)(n?.cols??2),[v,k]=(0,s.useState)(n?.rows??2),[w,N]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,s.useEffect)(()=>{(0,p.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{N({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{n&&(j(n.cols),k(n.rows))},[n?.cols,n?.rows]),(0,s.useEffect)(()=>{if(o)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){u.current&&!u.current.contains(e.target)&&d(!1)}},[o]);let y=(e,t,s)=>Math.max(t,Math.min(s,e)),S=m?h:x?.cols??2,C=m?v:x?.rows??2,I=m?`${h}\xd7${v}`:x?.label??"";return(0,t.jsxs)("div",{ref:u,className:"relative",children:[(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>d(e=>!e),className:"gap-2",children:[(0,t.jsx)(f,{cols:S,rows:C,active:!1}),(0,t.jsx)("span",{children:I}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),o&&(0,t.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,t.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:i("missions.gridPreset")}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[l.map(s=>{let r=s.id===e;return(0,t.jsxs)("button",{onClick:()=>{a(s.id),d(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${r?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:s.cols,rows:s.rows,active:r}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${r?"text-primary":"text-foreground"}`,children:s.label}),(0,t.jsx)("span",{className:`text-xs ${r?"text-primary/60":"text-muted-foreground"}`,children:s.desc})]},s.id)}),(0,t.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,t.jsxs)("button",{onClick:()=>{m||a(g,{cols:h,rows:v})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${m?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:h,rows:v,active:m}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${m?"text-primary":"text-foreground"}`,children:i("missions.gridCustom")}),(0,t.jsxs)("span",{className:`text-xs ${m?"text-primary/60":"text-muted-foreground"}`,children:[h,"×",v]})]}),m&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:i("missions.gridCols")}),(0,t.jsx)("input",{type:"number",min:w.minCols,max:w.maxCols,value:h,onChange:e=>{let t;j(t=y(Number(e.target.value),w.minCols,w.maxCols)),a(g,{cols:t,rows:v})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:i("missions.gridRows")}),(0,t.jsx)("input",{type:"number",min:w.minRows,max:w.maxRows,value:v,onChange:e=>{let t;k(t=y(Number(e.target.value),w.minRows,w.maxRows)),a(g,{cols:h,rows:t})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var j=e.i(585012),v=e.i(670123),k=e.i(759684);let w="123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";function N(e,t,s){return t<=0?0:((e+s)%t+t)%t}function y({open:e,panes:n,selectedIndex:a,onSelect:i,onClose:l}){let{t:o}=(0,r.useI18n)();return((0,s.useEffect)(()=>{if(e)return window.addEventListener("keydown",t,{capture:!0}),()=>window.removeEventListener("keydown",t,{capture:!0});function t(e){if("Escape"===e.key){e.preventDefault(),e.stopPropagation(),l();return}if(e.metaKey||e.ctrlKey||e.altKey||/^[0-9]$/.test(e.key))return;let t=function(e){if(1!==e.length)return null;let t=w.indexOf(e.toUpperCase());return -1===t?null:t}(e.key);null===t||t>=n.length||(e.preventDefault(),e.stopPropagation(),i(t))}},[e,n.length,i,l]),!e||"u"<typeof document)?null:(0,j.createPortal)((0,t.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs",onClick:l}),(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:"fixed top-1/2 left-1/2 z-50 w-full max-w-[calc(100%-2rem)] sm:max-w-5xl -translate-x-1/2 -translate-y-1/2 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 outline-none",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,t.jsx)("span",{className:"font-heading text-base font-medium leading-none",children:o("missions.selector.title")}),(0,t.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:n.length}),(0,t.jsx)("span",{className:"ml-1 truncate text-xs text-muted-foreground",children:o("missions.selector.hint")})]}),(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-sm",className:"absolute top-2 right-2",onClick:l,"aria-label":o("missions.launcher.cancel"),children:(0,t.jsx)(v.XIcon,{})}),(0,t.jsx)(k.ScrollArea,{className:"mt-4 max-h-[60vh]",children:(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 pr-3",children:n.map((e,s)=>{let r=s<0||s>=w.length?null:w[s],n=s===a;return(0,t.jsxs)("button",{type:"button",onClick:()=>i(s),className:["flex flex-col gap-2 rounded-lg border bg-card p-3 text-left transition-all hover:border-primary/40 hover:bg-accent/50",n?"border-primary ring-2 ring-inset ring-primary":"border-border"].join(" "),children:[(0,t.jsxs)("span",{className:"truncate text-[11px] text-muted-foreground",children:[e.workspaceName," ›"," ",e.projectAlias||e.projectName]}),(0,t.jsx)("div",{className:"flex items-center justify-center py-2",children:(0,t.jsx)("span",{className:["flex h-12 w-12 items-center justify-center rounded-md border text-2xl font-semibold tabular-nums",n?"bg-primary text-primary-foreground border-primary":"bg-muted/80 text-foreground border-border"].join(" "),children:r??"·"})}),(0,t.jsx)("span",{className:"line-clamp-2 text-sm font-medium text-foreground",children:e.taskTitle})]},e.executionId)})})})]})]}),document.body)}var S=e.i(720247),C=e.i(775712),I=e.i(19578),R=e.i(538059),T=e.i(67013);let E=(0,u.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),M=(0,u.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var A=e.i(657153);let P=(0,u.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var L=e.i(487486),$=e.i(502699),O=e.i(360112);let D=(0,I.default)(()=>e.A(243288).then(e=>e.TaskTerminal),{loadableGenerated:{modules:[346069]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function B({execution:e,isRemoving:n,removeReason:a,onStop:i,onSessionEnd:l,index:o,onRegisterControls:d}){let{t:u}=(0,r.useI18n)(),m=(0,R.useRouter)(),{attributes:x,listeners:p,setNodeRef:f,transform:g,transition:b}=(0,C.useSortable)({id:e.executionId}),j={transform:T.CSS.Transform.toString(g),transition:b,opacity:+!n},[v,k]=(0,s.useState)(()=>e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0);(0,s.useEffect)(()=>{if(n)return;let t=setInterval(()=>{k(e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(t)},[e.startedAt,n]);let w=Math.floor(v/60),N=`${w}m ${v%60}s`;async function y(){let t=e.worktreePath??e.projectLocalPath;if(!t)return;let s=e.subPath?`${t}/${e.subPath}`:t;try{await (0,$.openInTerminal)(s)}catch{O.toast.error(u("preview.terminalError"))}}return(0,t.jsxs)("div",{ref:f,style:j,"data-pane-index":o,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...x,children:[(0,t.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,t.jsx)("button",{...p,"aria-label":u("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,t.jsx)(E,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[e.workspaceName," ›"," ",e.projectAlias||e.projectName," ›"," ",(0,t.jsx)("span",{className:"text-foreground font-semibold",children:e.taskTitle})]}),n?(0,t.jsx)(L.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===a?u("missions.statusStopped"):u("missions.statusCompleted")}):(0,t.jsx)(L.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:u("missions.statusRunning")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:N}),e.projectLocalPath&&(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:y}),children:(0,t.jsx)(P,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.TooltipContent,{children:u("missions.openInTerminal")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>m.push(`/workspaces/${e.workspaceId}/tasks/${e.taskId}`)}),children:(0,t.jsx)(M,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.TooltipContent,{children:u("missions.openFullView")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>i(e.taskId),disabled:n}),children:(0,t.jsx)(A.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.TooltipContent,{children:u("missions.stopTask")})]})]}),(0,t.jsx)("div",{className:"relative flex-1 overflow-hidden",children:(0,t.jsx)(D,{taskId:e.taskId,worktreePath:e.worktreePath??e.projectLocalPath,onSessionEnd:t=>l?.(e.taskId,t),useCanvasRenderer:!0,onReady:t=>d(e.taskId,t)})})]})}var z=e.i(169751);let H=(0,n.createServerReference)("40f853112fcaa1cca93f27a775dd93d4463cca0dbf",n.callServer,void 0,n.findSourceMapURL,"getWorkspacesWithRecentTasks"),_=(0,n.createServerReference)("40d862f3200d9e4060d8c7f5ab39edb04fcfa1d5c1",n.callServer,void 0,n.findSourceMapURL,"getProjectTasks");var V=e.i(19825),W=e.i(608269),F=e.i(793479),U=e.i(776639),G=e.i(368490);let K=(0,u.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var X=e.i(922541),q=e.i(738690);let J={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},Q={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function Y({status:e}){return(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[e]??"bg-slate-100 text-slate-600"}`,children:J[e]??e})}function Z({task:e,isRunning:s,launchingId:r,onLaunchNew:n,onResume:a,t:i}){let l=e.executions?.[0]?.sessionId,o=r===e.id;return(0,t.jsxs)("div",{className:"group/task grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:`text-sm truncate ${s?"italic text-muted-foreground":""}`,children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)(Y,{status:e.status}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:Q[e.priority]??e.priority})]})]}),s?(0,t.jsx)("span",{className:"text-[10px] italic text-muted-foreground",children:i("missions.alreadyMonitored")}):(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity",children:[l&&(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>a(e.id,l),disabled:o,title:i("missions.continueSession"),children:[(0,t.jsx)(X.RotateCcw,{className:"h-3 w-3 mr-1"}),i("missions.continueLabel")]}),(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>n(e.id),disabled:o,title:i("missions.launchNew"),children:[(0,t.jsx)(K,{className:"h-3 w-3 mr-1"}),o?"...":i("missions.launchNewLabel")]})]})]})}function ee({open:e,onOpenChange:n,onLaunchNew:a,onResume:i,runningTaskIds:l,launchingId:d}){let{t:u}=(0,r.useI18n)(),[m,x]=(0,s.useState)([]),[h,p]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[b,j]=(0,s.useState)([]),[v,w]=(0,s.useState)("");(0,s.useEffect)(()=>{e&&(p(""),g(""),j([]),w(""),H(100).then(x).catch(()=>O.toast.error(u("missions.error.launchFailed"))))},[e,u]),(0,s.useEffect)(()=>{f?_(f).then(e=>{j(e.filter(e=>"TODO"===e.status||"IN_PROGRESS"===e.status||"IN_REVIEW"===e.status))}).catch(()=>O.toast.error(u("missions.error.launchFailed"))):j([])},[f,u]);let N=(0,s.useMemo)(()=>{let e=[];for(let t of m)for(let s of t.projects)for(let r of s.tasks)("TODO"===r.status||"IN_PROGRESS"===r.status||"IN_REVIEW"===r.status)&&e.push({task:r,workspaceName:t.name,projectName:s.alias??s.name});return e},[m]),y=(0,s.useMemo)(()=>new z.default(N,{keys:["task.title"],threshold:.4,distance:200}),[N]),S=(0,s.useMemo)(()=>{let e=v.trim();return e?y.search(e,{limit:30}).map(e=>e.item):[]},[y,v]),C=v.trim().length>0,I=m.find(e=>e.id===h),R=I?.projects??[];return(0,t.jsx)(U.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(U.DialogContent,{className:"sm:max-w-2xl max-h-[80vh]",children:[(0,t.jsx)(U.DialogHeader,{children:(0,t.jsx)(U.DialogTitle,{children:u("missions.fullPickerTitle")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(q.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(F.Input,{value:v,onChange:e=>w(e.target.value),placeholder:u("missions.fullPicker.searchPlaceholder"),className:"pl-8 pr-8 h-8"}),v&&(0,t.jsx)(c.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6",onClick:()=>w(""),"aria-label":u("missions.fullPicker.clearSearch"),children:(0,t.jsx)(A.X,{className:"h-3.5 w-3.5"})})]}),!C&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(o.Select,{value:h,onValueChange:e=>{p(e??""),g("")},children:[(0,t.jsx)(o.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:m.find(e=>e.id===h)?.name??u("missions.launcher.selectWorkspace")})}),(0,t.jsx)(o.SelectContent,{children:m.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)(o.Select,{value:f,onValueChange:e=>g(e??""),disabled:!h,children:[(0,t.jsx)(o.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:R.find(e=>e.id===f)?.name??u("missions.launcher.selectProject")})}),(0,t.jsx)(o.SelectContent,{children:R.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.alias??e.name},e.id))})]})]})]}),(0,t.jsx)(k.ScrollArea,{className:"max-h-[60vh] -mx-2",children:C?0===S.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:u("missions.fullPicker.noSearchResults")}):S.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"px-3 pt-2 pb-0.5 text-[11px] text-muted-foreground",children:[e.workspaceName," · ",e.projectName]}),(0,t.jsx)(Z,{task:e.task,isRunning:l.has(e.task.id),launchingId:d,onLaunchNew:a,onResume:i,t:u})]},e.task.id)):0===b.length&&f?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:u("missions.launcher.noTasks")}):0===b.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:u("missions.fullPickerHint")}):b.map(e=>(0,t.jsx)(Z,{task:e,isRunning:l.has(e.id),launchingId:d,onLaunchNew:a,onResume:i,t:u},e.id))})]})})}function et({open:e,onOpenChange:n,onLaunched:a,runningTaskIds:i=new Set,anchorRef:l}){let{t:o}=(0,r.useI18n)(),d=(0,s.useRef)(null),[u,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null),[g,b]=(0,s.useState)(!1),[j,v]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{e&&(h(!0),H(5).then(m).catch(()=>O.toast.error(o("missions.error.launchFailed"))).finally(()=>h(!1)))},[e,o]);let w=(0,s.useMemo)(()=>u.filter(e=>e.projects.some(e=>e._count.tasks>0)),[u]),N=(0,s.useCallback)(e=>{v(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);(0,s.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){let t=e.target;if(d.current&&!d.current.contains(t)){if(l?.current&&l.current.contains(t))return;n(!1)}}},[e,n,l]);let y=(0,s.useCallback)(async e=>{try{f(e),await (0,V.startPtyExecution)(e,""),a(e),n(!1),b(!1)}catch{O.toast.error(o("missions.error.launchFailed"))}finally{f(null)}},[a,n,o]),S=(0,s.useCallback)(async(e,t)=>{try{f(e),await (0,W.resumePtyExecution)(e,t),a(e),n(!1),b(!1)}catch{O.toast.error(o("missions.error.launchFailed"))}finally{f(null)}},[a,n,o]),C=(0,s.useCallback)(()=>{n(!1),b(!0)},[n]);return e||g?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{ref:d,className:"absolute right-0 z-50 mt-1 grid max-h-[480px] w-[28rem] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-border",children:(0,t.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:o("missions.pickerTitle")})}),(0,t.jsx)(k.ScrollArea,{children:x?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===w.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("missions.noAvailableTasks")}):w.map(e=>{let s=j.has(e.id),r=e.projects.filter(e=>e._count.tasks>0);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",onClick:()=>N(e.id),className:"flex h-auto w-full justify-start gap-1.5 rounded-none border-b border-border/50 px-3 py-1.5 hover:bg-accent",children:[(0,t.jsx)(G.ChevronRight,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${s?"":"rotate-90"}`}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:e.name})]}),!s&&(0,t.jsx)("div",{className:"ml-[19px] mt-0.5 border-l border-border/50",children:r.map(e=>(0,t.jsxs)("div",{className:"py-0.5",children:[(0,t.jsx)("div",{className:"pl-3 pt-1.5 pb-1",children:(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:e.alias??e.name})}),(0,t.jsx)("div",{className:"pl-3",children:e.tasks.map(e=>(0,t.jsx)(Z,{task:e,isRunning:i.has(e.id),launchingId:p,onLaunchNew:y,onResume:S,t:o},e.id))})]},e.id))})]},e.id)})}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsx)(c.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:C,children:o("missions.showMoreTasks")})})]}),(0,t.jsx)(ee,{open:g,onOpenChange:b,onLaunchNew:y,onResume:S,runningTaskIds:i,launchingId:p})]}):null}e.i(508271);var es=e.i(841359);e.s(["MissionsClient",0,function({initialExecutions:e}){let{t:n}=(0,r.useI18n)(),[u,p]=(0,s.useState)(e),[f,g]=(0,s.useState)(()=>localStorage.getItem("missions-grid-preset")??"3x2"),[j,v]=(0,s.useState)(()=>{try{let e=localStorage.getItem("missions-grid-custom");if(e){let t=JSON.parse(e);if("number"==typeof t?.cols&&"number"==typeof t?.rows)return{cols:Math.max(1,Math.min(10,t.cols)),rows:Math.max(1,Math.min(10,t.rows))}}}catch{}return{cols:2,rows:2}}),[k,w]=(0,s.useState)(!1),[I,R]=(0,s.useState)(""),T=(0,s.useRef)(null),[E,M]=(0,s.useState)("input"),[A,P]=(0,s.useState)(0),L=(0,s.useRef)(new Map),$=(0,s.useRef)([]),D=(0,s.useRef)(2),z=(0,s.useRef)(A);z.current=A;let H=(0,s.useCallback)((e,t)=>{t?L.current.set(e,t):L.current.delete(e)},[]),[_,V]=(0,s.useState)(new Map),W=(0,s.useRef)(_);(0,s.useEffect)(()=>{W.current=_},[_]);let F=(0,s.useRef)(new Map),U=l.find(e=>e.id===f)??l[2],G="custom"===f?j.cols:U.cols,K="custom"===f?j.rows:U.rows,X=(0,s.useRef)(null),[q,J]=(0,s.useState)("480px");(0,s.useEffect)(()=>{let e=X.current;if(!e)return;let t=()=>{let t=(e.clientHeight-32-16*(K-1))/K;J(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[K]);let Q=(0,s.useCallback)((e,t)=>{e&&(g(e),localStorage.setItem("missions-grid-preset",e),"custom"===e&&t&&(v(t),localStorage.setItem("missions-grid-custom",JSON.stringify(t))))},[]),Y=(0,S.useSensors)((0,S.useSensor)(S.PointerSensor,{activationConstraint:{distance:8}})),Z=(0,s.useCallback)(e=>{let{active:t,over:s}=e;s&&t.id!==s.id&&p(e=>{let r=e.findIndex(e=>e.executionId===t.id),n=e.findIndex(e=>e.executionId===s.id);return(0,C.arrayMove)(e,r,n)})},[]),ee=(0,s.useCallback)((e,t)=>{if(W.current.has(e))return;V(s=>new Map([...s,[e,t]]));let s=setTimeout(()=>{p(t=>t.filter(t=>t.executionId!==e)),V(t=>{let s=new Map(t);return s.delete(e),s}),F.current.delete(e)},500);F.current.set(e,s)},[]);(0,s.useEffect)(()=>{let e=setInterval(async()=>{try{let e=await a();p(t=>{let s=W.current,{merged:r,goneIds:n}=function({prev:e,fresh:t,removingIds:s}){let r=new Set(t.map(e=>e.executionId)),n=[];e.forEach(e=>{r.has(e.executionId)||s.has(e.executionId)||n.push(e.executionId)});let a=e.filter(e=>r.has(e.executionId)||s.has(e.executionId)),i=new Set(e.map(e=>e.executionId));return{merged:[...a,...t.filter(e=>!i.has(e.executionId))],goneIds:n}}({prev:t,fresh:e,removingIds:new Set(s.keys())});return n.forEach(e=>ee(e,"completed")),r})}catch{}},4e3);return()=>clearInterval(e)},[ee]),(0,s.useEffect)(()=>{let e=F.current;return()=>{e.forEach(e=>clearTimeout(e))}},[]);let er=(0,s.useCallback)(async e=>{try{await (0,i.stopPtyExecution)(e),p(t=>{let s=t.find(t=>t.taskId===e);return s&&ee(s.executionId,"stopped"),t})}catch{O.toast.error(n("missions.error.stopFailed"))}},[ee,n]),en=(0,s.useCallback)((e,t)=>{p(t=>{let s=t.find(t=>t.taskId===e);return s&&ee(s.executionId,"completed"),t})},[ee]),ea=(0,s.useCallback)(e=>{a().then(e=>{p(t=>{let s=new Set(t.map(e=>e.executionId));return[...t,...e.filter(e=>!s.has(e.executionId))]})}).catch(()=>{})},[]),ei=(0,s.useCallback)(e=>{let t=$.current;e<0||e>=t.length||(t[e]?.focus(),P(e),M("input"),X.current?.querySelector(`[data-pane-index="${e}"]`)?.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"}))},[]),el=(0,s.useCallback)(()=>{$.current[z.current]?.blur(),M("nav")},[]),eo=(0,s.useCallback)(()=>{ei(z.current)},[ei]),ec=(0,s.useCallback)(()=>{"input"===E?el():eo()},[E,el,eo]),ed=(0,s.useCallback)(()=>{let e=$.current.length;0!==e&&ei(N(z.current,e,1))},[ei]),eu=(0,s.useCallback)(()=>{let e=$.current.length;0!==e&&ei(N(z.current,e,-1))},[ei]),em=(0,s.useCallback)(e=>{let t=$.current.length;0!==t&&(M("nav"),P(s=>(function(e,t,s,r){if(s<=0)return 0;let n=Math.max(1,t);switch(r){case"left":return N(e,s,-1);case"right":return N(e,s,1);case"up":{let t=e-n;return t<0?e:t}case"down":{let t=e+n;return t>=s?e:t}default:return e}})(s,D.current,t,e)))},[]),ex=(0,s.useCallback)(e=>{let t=$.current.length;0!==t&&(M("nav"),P(s=>N(s,t,e)))},[]);(0,es.useActionShortcut)("missions.jump",e=>{let t=Number(e.key);Number.isInteger(t)&&t>=1&&ei(t-1)}),(0,es.useActionShortcut)("missions.moveSelection",e=>{em("ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":"ArrowLeft"===e.key?"left":"right")}),(0,es.useActionShortcut)("missions.cycle",()=>ex(1)),(0,es.useActionShortcut)("missions.cycleBack",()=>ex(-1)),(0,es.useActionShortcut)("missions.focus",()=>eo()),(0,es.useActionShortcut)("missions.next",()=>ed()),(0,es.useActionShortcut)("missions.prev",()=>eu()),(0,es.useActionShortcut)("missions.exit",()=>el()),(0,s.useEffect)(()=>{let e=X.current;if(!e)return;let t=e=>{let t=e.target,s=t?.closest("[data-pane-index]");if(!s)return;let r=Number(s.dataset.paneIndex);Number.isInteger(r)&&(P(r),M("input"))};return e.addEventListener("focusin",t),()=>e.removeEventListener("focusin",t)},[]);let eh=Array.from(new Map(u.map(e=>[e.workspaceId,e.workspaceName])).entries()).map(([e,t])=>({id:e,name:t})),ep=I?u.filter(e=>e.workspaceId===I):u;$.current=ep.map(e=>L.current.get(e.taskId)).filter(e=>!!e),D.current=G,(0,s.useEffect)(()=>{P(e=>{let t=ep.length;return 0===t?0:Math.min(e,t-1)})},[ep.length]);let ef=new Set(u.map(e=>e.taskId));return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,t.jsx)("h1",{className:"text-base font-semibold",children:n("missions.pageTitle")}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsxs)(h.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",className:`h-7 gap-1.5 px-2 shrink-0 text-xs font-medium text-muted-foreground ${"nav"===E?"bg-accent text-foreground":""}`,onClick:ec,disabled:0===ep.length}),children:[(0,t.jsx)(x.Keyboard,{className:"h-3.5 w-3.5"}),"input"===E?n("missions.mode.input"):n("missions.mode.nav")]}),(0,t.jsx)(h.TooltipContent,{className:"max-w-xs",children:n("missions.mode.toggleHint")})]}),(0,t.jsxs)(o.Select,{value:I,onValueChange:e=>R(e??""),children:[(0,t.jsx)(o.SelectTrigger,{className:"w-36 h-8",children:(0,t.jsx)("span",{className:"truncate",children:I?eh.find(e=>e.id===I)?.name??n("missions.filterAll"):n("missions.filterAll")})}),(0,t.jsxs)(o.SelectContent,{children:[(0,t.jsx)(o.SelectItem,{value:"",children:n("missions.filterAll")}),eh.map(e=>(0,t.jsx)(o.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(b,{value:f,customValue:j,onChange:Q}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Button,{ref:T,onClick:()=>w(e=>!e),children:n("missions.launchTask")}),(0,t.jsx)(et,{open:k,onOpenChange:w,onLaunched:ea,runningTaskIds:ef,anchorRef:T})]})]}),(0,t.jsx)("div",{ref:X,className:"flex-1 overflow-auto min-h-0 p-4",children:0===ep.length&&0===_.size?(0,t.jsx)(d.EmptyState,{icon:m,title:n("missions.emptyTitle"),description:n("missions.emptyDesc"),className:"h-full",action:(0,t.jsx)(c.Button,{onClick:()=>w(!0),children:n("missions.launchTask")})}):(0,t.jsx)(S.DndContext,{id:"missions-dnd",sensors:Y,collisionDetection:S.closestCenter,onDragEnd:Z,children:(0,t.jsx)(C.SortableContext,{items:ep.map(e=>e.executionId),strategy:C.rectSortingStrategy,children:(0,t.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${G}, 1fr)`,gridAutoRows:q},children:ep.map((e,s)=>(0,t.jsx)(B,{execution:e,isRemoving:_.has(e.executionId),removeReason:_.get(e.executionId),onStop:er,onSessionEnd:en,index:s,onRegisterControls:H},e.executionId))})})})}),(0,t.jsx)(y,{open:"nav"===E,panes:ep,selectedIndex:A,onSelect:ei,onClose:eo})]})}],449636)}]);
@@ -1,5 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,465536,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},930787,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var h="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===h.length?h+="..":h+="/..");return h.length>0?h+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},756502,e=>{"use strict";let t=(0,e.i(572989).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},914935,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(210702),n=e.i(487278),o=e.i(232545),i=e.i(464249),l=e.i(998626),c=e.i(49007),d=e.i(902539),u=e.i(263938),m=e.i(645378),h=e.i(453889),x=e.i(572989);let p=(0,x.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var g=e.i(755146),f=e.i(759684),j=e.i(776639),b=e.i(746798),v=e.i(519455),w=e.i(793479),N=e.i(514798);let y=(0,N.createServerReference)("40dc5994c5145791aa6b750c6db19b674339691e95",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("60de99d8abadfb18ea24da9fe6659ba6eb8f9b8b90",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("4033f23e3fceeb4827b06ccb240c11c6786038f237",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("40d05a29d8dc5caa8d25e073a30ecc92f40fcd0db5",N.callServer,void 0,N.findSourceMapURL,"reorderWorkspaces");var T=e.i(578775);let P=(0,N.createServerReference)("40d973f296d8738cf4afb3d63fdcf700207ef10e8f",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("40021a9d736acd9bcfa12e8373f683a674b28086a3",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var O=e.i(889620),I=e.i(533499),M=e.i(360112),$=e.i(720247),A=e.i(775712),L=e.i(67013);let R=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function E({workspaces:e}){let i,l=(0,s.useRouter)(),c=(0,s.usePathname)(),{t:u}=(0,I.useI18n)(),[x,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&g(!0)},[]);let[j,w]=(0,r.useState)(!1),[N,T]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[L,F]=(0,r.useState)(null),[W,U]=(0,r.useState)(""),[H,K]=(0,r.useState)(R[0]),[V,G]=(0,r.useState)(null),[q,X]=(0,r.useState)(e);(0,r.useEffect)(()=>{X(e)},[e]);let J=(0,$.useSensors)((0,$.useSensor)($.PointerSensor,{activationConstraint:{distance:8}})),Y=(0,r.useCallback)(t=>{let{active:r,over:s}=t;if(!s||r.id===s.id)return;let a=q.findIndex(e=>e.id===r.id),n=q.findIndex(e=>e.id===s.id);if(-1===a||-1===n)return;let o=(0,A.arrayMove)(q,a,n);X(o),S(o.map(e=>e.id)).then(()=>l.refresh()).catch(()=>{X(e),M.toast.error(u("sidebar.reorderError"))})},[q,e,l,u]),Z=c.split("/workspaces/")[1]?.split("/")[0],Q=(0,r.useCallback)(e=>{if(Z===e)return;let t=(0,O.getLastProjectId)(e);l.push(t?`/workspaces/${e}?projectId=${t}`:`/workspaces/${e}`)},[Z,l]),ee=(0,r.useCallback)(()=>{g(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),et=(0,r.useCallback)(async()=>{if(!W.trim())return;let e=await y({name:W.trim(),description:H});U(""),K(R[0]),w(!1),l.refresh(),l.push(`/workspaces/${e.id}`)},[W,H,l]),er=(0,r.useCallback)(async()=>{W.trim()&&V&&(await k(V,{name:W.trim(),description:H}),U(""),T(!1),G(null),l.refresh())},[W,H,V,l]),es=(0,r.useCallback)(e=>{G(e.id),U(e.name),K(e.description&&R.includes(e.description)?e.description:R[0]),T(!0)},[]),ea=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void M.toast.error(u("sidebar.lastWorkspaceError"));if(confirm(u("sidebar.deleteConfirm",{name:r})))try{await C(t),l.refresh(),Z===t&&l.push("/workspaces")}catch{M.toast.error(u("sidebar.lastWorkspaceError"))}},[Z,l,u,e.length]),en=(0,r.useCallback)(e=>{F(e),D(!0)},[]),eo=e=>e.description&&R.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(x){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:ee,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.expand")})]}),(0,t.jsx)(f.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=Z===e.id,s=eo(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>Q(e.id),className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>w(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===c?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("missions.navLabel")})]}),(r=Z||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${c.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(m.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${c.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(h.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${c.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.archive")})]})]}):null]}),(0,t.jsx)(B,{open:j,onOpenChange:w,title:u("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:et,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:ee,className:"text-muted-foreground",title:u("sidebar.collapse"),children:(0,t.jsx)(d.ChevronsLeft,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:u("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{U(""),K(R[0]),w(!0)},title:u("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(f.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:(0,t.jsx)($.DndContext,{id:"workspace-sidebar",sensors:J,collisionDetection:$.closestCenter,onDragEnd:Y,children:(0,t.jsx)(A.SortableContext,{items:q.map(e=>e.id),strategy:A.verticalListSortingStrategy,children:q.map(e=>(0,t.jsx)(z,{ws:e,isActive:Z===e.id,icon:eo(e),disableDelete:q.length<=1,t:u,onSelect:()=>Q(e.id),onEdit:()=>es(e),onManageLabels:()=>en(e.id),onDelete:()=>ea(e.id,e.name)},e.id))})})})}),(0,t.jsxs)(a.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===c?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("missions.navLabel")})]}),(i=Z||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${i}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(m.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.archive")})]})]}):null,(0,t.jsx)(B,{open:j,onOpenChange:w,title:u("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:et,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),(0,t.jsx)(B,{open:N,onOpenChange:e=>{T(e),e||G(null)},title:u("workspace.edit"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:er,submitLabel:u("common.save"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),L&&(0,t.jsx)(_,{open:P,onOpenChange:e=>{D(e),e||F(null)},workspaceId:L})]})}function z({ws:e,isActive:r,icon:s,disableDelete:a,t:n,onSelect:o,onEdit:d,onManageLabels:m,onDelete:h}){var x;let p,f,j,{attributes:b,listeners:v,setNodeRef:w,transform:N,transition:y,isDragging:k}=(0,A.useSortable)({id:e.id}),C={transform:L.CSS.Transform.toString(N),transition:y,opacity:k?.4:1};return(0,t.jsxs)("div",{ref:w,style:C,...b,...v,className:`group relative flex touch-none items-center rounded-lg transition-all ${r?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:o,className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${r?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:s})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${r?"text-foreground":"text-secondary-foreground"}`,children:e.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(x=e.updatedAt,f=Math.floor((p=Date.now()-new Date(x).getTime())/6e4),j=Math.floor(p/36e5),f<60?`${f}m ago`:j<24?`${j}h ago`:`${Math.floor(j/24)}d ago`)})]})]}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsx)(g.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(g.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(g.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.rename")]}),(0,t.jsxs)(g.DropdownMenuItem,{onClick:m,children:[(0,t.jsx)(u.Tag,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.manageLabels")]}),(0,t.jsxs)(g.DropdownMenuItem,{className:a?"text-muted-foreground opacity-50":"text-rose-400",disabled:a,onClick:h,children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.delete")]})]})]})]})}function B({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:h}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:R.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:h}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let F=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function _({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,I.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(F[0]);(0,r.useEffect)(()=>{e&&(0,T.getLabelsForWorkspace)(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await P({name:l.trim(),color:d,workspaceId:a}),i(await (0,T.getLabelsForWorkspace)(a)),c(""))},h=async e=>{await D(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>h(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:F.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}e.i(508271);var W=e.i(841359),U=e.i(289813);let H=(0,U.create)(e=>({createProjectOpen:!1,importProjectOpen:!1,setCreateProjectOpen:t=>e({createProjectOpen:t}),setImportProjectOpen:t=>e({importProjectOpen:t})}));var K=e.i(821957),V=e.i(738690),G=e.i(386343);let q=(0,x.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var X=e.i(242941),J=e.i(989548),Y=e.i(387091),Z=e.i(15299);e.s([],678787),e.i(678787),e.i(708878);var Q=e.i(581263),ee=e.i(462902);let et=r.createContext(void 0);function er(){let e=r.useContext(et);if(void 0===e)throw Error((0,ee.default)(13));return e}let es={imageLoadingStatus:()=>null},ea=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,Q.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:es});return(0,t.jsx)(et.Provider,{value:c,children:d})});var en=e.i(887642),eo=e.i(804849),ei=e.i(504068),el=e.i(809058),ec=e.i(193214),ed=e.i(954588);let eu={...es,...el.transitionStatusMapping},em=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=er(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,eo.useIsoLayoutEffect)(()=>{if(!e)return n("error"),ed.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:h,setMounted:x}=(0,ec.useTransitionStatus)(u),p=r.useRef(null),g=(0,en.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,eo.useIsoLayoutEffect)(()=>{"idle"!==d&&g(d)},[d,g]),(0,ei.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||x(!1)}});let f=(0,Q.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:h},ref:[t,p],props:l,stateAttributesMapping:eu,enabled:m});return m?f:null});var eh=e.i(161476);let ex=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=er(),[l,c]=r.useState(void 0===n),d=(0,eh.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,Q.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:es,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,ex,"Image",0,em,"Root",0,ea],129448);var ep=e.i(129448),ep=ep,eg=e.i(975157);function ef({className:e,size:r="default",...s}){return(0,t.jsx)(ep.Root,{"data-slot":"avatar","data-size":r,className:(0,eg.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...s})}function ej({className:e,...r}){return(0,t.jsx)(ep.Fallback,{"data-slot":"avatar-fallback",className:(0,eg.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let eb=(0,x.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var ev=e.i(226145);let ew=(0,x.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),eN=(0,x.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var ey=e.i(657153);let ek=(0,N.createServerReference)("6071f62865d7cc8fd3ab220abf5ecfbc0ec631d910",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var eC=e.i(773535);let eS=[{id:"all",key:"search.all",icon:V.Search},{id:"task",key:"search.task",icon:m.FileText},{id:"project",key:"search.project",icon:eb},{id:"repository",key:"search.repository",icon:ev.GitBranch},{id:"note",key:"search.note",icon:ew},{id:"asset",key:"search.asset",icon:eN}],eT=["task","project","repository","note","asset"],eP={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function eD({result:e,onSelect:r}){let s=eS.find(t=>t.id===e.type)?.icon??m.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function eO({open:e,onOpenChange:a}){let n,{t:o}=(0,I.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,h]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1),[g,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,eC.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),h([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){h([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ek(l,d);e||(h(t),p(!1))},g),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,g]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(V.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),h([])},className:"text-muted-foreground",children:(0,t.jsx)(ey.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eS.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(f.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!x&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),eT.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(eP[e])}),n[e].map(e=>(0,t.jsx)(eD,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(eD,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eI=e.i(338187),eM=e.i(400355),e$=e.i(597746),eA=e.i(938499),eL=e.i(233274),eR=e.i(905455),eE=e.i(624687);function ez(e){return e.replace(/\.git\/?$/,"")}e.i(465536),e.i(930787);let eB=(0,N.createServerReference)("4092804c67622795f702440c3e64d76bd68b0f7dd4",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eF=e.i(65021),e_=e.i(224277);function eW({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,I.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)("idle"),[P,D]=(0,r.useState)(""),[O,$]=(0,r.useState)(!1),[A,L]=(0,r.useState)(!1),R=()=>{l(""),d(""),m(""),p(""),f(""),y(!1),C("FRONTEND"),T("idle"),D(""),$(!1)},E=async()=>{if(g.trim()&&!O&&"success"===S){$(!0);try{let e=await (0,eF.analyzeProjectDirectory)(g.trim(),o);m(e)}catch{M.toast.error(n("project.analyzeError"))}finally{$(!1)}}},z=async e=>{p(e),T("idle"),D("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:ez(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:ez(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),N||f(await eB(e))},B=async()=>{if(x.trim()&&g.trim()){T("cloning"),D("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(x.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:g.trim()})}),r=await t.json();if(!t.ok){T("error"),D(r.error||"Clone failed");return}T("success")}catch{T("error"),D("Network error")}}},F=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:g.trim()||void 0,projectType:k}),R(),s(!1))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||R()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:x,onChange:e=>z(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:g,onChange:e=>{f(e.target.value),y(!0)},className:"flex-1 min-w-0 font-mono text-xs"}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"outline",onClick:()=>L(!0),className:"shrink-0 gap-1.5 px-2.5 text-xs text-muted-foreground"}),children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("folder.browse")})]}),(0,t.jsx)(b.TooltipContent,{children:n("folder.selectFolder")})]})]}),g.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),x.trim()&&g.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===S||"success"===S,onClick:B,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===S?(0,t.jsx)(eM.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===S?(0,t.jsx)(e$.Check,{className:"h-3 w-3"}):(0,t.jsx)(ev.GitBranch,{className:"h-3 w-3"}),"cloning"===S?n("git.cloning"):"success"===S?n("git.cloned"):n("git.clone")]}),"error"===S&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),P]}),"success"===S&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eR.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:E,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!g.trim()||O?"opacity-50":""}`}),children:[O?(0,t.jsx)(eM.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eL.Sparkles,{className:"h-3 w-3"}),O?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:g.trim()?"success"!==S?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eE.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),R()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:F,disabled:!i.trim()||O,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})}),(0,t.jsx)(e_.FolderBrowserDialog,{open:A,onOpenChange:L,onSelect:e=>{if(f(e),y(!0),!i.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";t&&l(t)}}})]})}var eU=e.i(756502),eU=eU,eH=e.i(699375);let eK=(0,N.createServerReference)("60697db45fd919041164efede51525c37717402587",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eV=(0,N.createServerReference)("4046e8aa9ca2e60552574e42d4b0ea37efacf35831",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eG({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,I.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[O,$]=(0,r.useState)(""),[A,L]=(0,r.useState)(!1),[R,E]=(0,r.useState)(""),[z,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[W,U]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),f(""),C("FRONTEND"),T(!1),D(!1),$(""),L(!1),E(""),B(""),_(!1),U(!1)},K=async e=>{f(e),T(!1),D(!1),$(""),E(""),B(""),_(!1),l(e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(D(e),E(""),B(""),_(!1),!e)return void $("");if(x)try{let e=await eB(x);e&&($(e),e===g&&_(!0))}catch{}if(g)try{let e=await fetch(`/api/git?path=${encodeURIComponent(g)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[x,g]),G=async()=>{if(g&&!W){U(!0);try{let e=await (0,eF.analyzeProjectDirectory)(g.trim(),o);m(e)}catch{M.toast.error(n("project.analyzeError"))}finally{U(!1)}}},q=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:g.trim()||void 0,projectType:k},t=await a?.(e);if(P&&O&&O!==g&&t&&"id"in t){L(!0),E("");try{let e=await eV(t.id);if(!e.safe)return void E(e.reason);let r=await eK(t.id,O);if(!r.success)return void E(r.error??n("project.migrateError"));M.toast.success(n("project.migrateSuccess"))}catch(t){let e=t instanceof Error?t.message:String(t);E(`${n("project.migrateError")}:${e}`);return}finally{L(!1)}}H(),s(!1)},X=!i.trim()||!g.trim()||A||W||P&&!!z;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:g,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),x&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:x,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&g&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eH.Switch,{checked:P,onCheckedChange:e=>V(e)})]}),P&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:O,onChange:e=>{$(e.target.value),_(e.target.value===g)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(eU.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),z&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),z]}),R&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),R]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eR.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:G,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!g||W?"opacity-50":""}`}),children:[W?(0,t.jsx)(eM.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eL.Sparkles,{className:"h-3 w-3"}),W?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:g?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eE.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:q,disabled:X,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:A?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(e_.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eq({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:(0,t.jsx)("path",{d:"M12 .5C5.65.5.5 5.65.5 12.02c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2c-3.2.7-3.87-1.36-3.87-1.36-.52-1.34-1.27-1.7-1.27-1.7-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.34.96.1-.74.4-1.25.72-1.54-2.56-.29-5.25-1.28-5.25-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.04 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.18-1.18 3.18-1.18.62 1.58.23 2.75.11 3.04.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.4-5.25 5.69.41.36.78 1.05.78 2.12v3.14c0 .31.21.68.79.56A11.52 11.52 0 0 0 23.5 12.02C23.5 5.65 18.35.5 12 .5Z"})})}function eX({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,I.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eI.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:x}=function(){let{resolvedTheme:e,setTheme:t}=(0,K.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[f,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);(0,W.useActionShortcut)("global.search",()=>j(!0));let C=H(e=>e.createProjectOpen),S=H(e=>e.importProjectOpen),T=H(e=>e.setCreateProjectOpen),P=H(e=>e.setImportProjectOpen);return(0,r.useEffect)(()=>{C&&N(!0)},[C]),(0,r.useEffect)(()=>{S&&k(!0)},[S]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(V.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,t.jsx)(q,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(J.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(X.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"中"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:x,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(Y.Sun,{className:"h-4 w-4"}):(0,t.jsx)(Z.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>window.open("https://github.com/jp-liu/tower","_blank","noopener,noreferrer"),className:"text-muted-foreground","aria-label":n("topbar.github")}),children:(0,t.jsx)(eq,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("topbar.github")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsx)(g.DropdownMenuTrigger,{render:(0,t.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(ef,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ej,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(g.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(g.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(G.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(eO,{open:f,onOpenChange:j}),(0,t.jsx)(eW,{open:w,onOpenChange:e=>{N(e),e||T(!1)},onCreateProject:e}),(0,t.jsx)(eG,{open:y,onOpenChange:e=>{k(e),e||P(!1)},onCreateProject:e})]})}var eJ=e.i(83434),eY=e.i(966001),eZ=e.i(174076),eQ=e.i(19578),e0=e.i(232280);let e1=(0,eQ.default)(()=>e.A(427768).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[103363]},ssr:!1});function e2({mode:e}){let{isOpen:s,closeAssistant:a,sessions:n,activeSessionId:c,createNewSession:d,switchSession:u,removeSession:m,renameSession:h}=(0,eI.useAssistant)(),{t:x}=(0,I.useI18n)(),[p,f]=(0,r.useState)(null),[b,N]=(0,r.useState)(""),y=()=>{f(null),N("")},k=()=>{p&&b.trim()&&(h(p.id,b),y())},C=n.find(e=>e.id===c),S=C?.title??x("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(J.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:x("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsxs)(g.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":x("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:S}),(0,t.jsx)(e0.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(g.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,className:"w-[280px]",children:[0===n.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:x("assistant.noSessions")}):n.map(e=>(0,t.jsxs)(g.DropdownMenuItem,{className:"flex items-center justify-between gap-1 pr-1",onClick:()=>u(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100",onClick:t=>{var r;t.stopPropagation(),f({id:e.id,title:r=e.title}),N(r)},"aria-label":x("assistant.renameSession"),children:(0,t.jsx)(i.Pencil,{className:"h-3 w-3"})}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),m(e.id)},"aria-label":x("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id)),n.length>0&&(0,t.jsx)(g.DropdownMenuSeparator,{}),(0,t.jsxs)(g.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:x("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:d,"aria-label":x("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:a,"aria-label":x("assistant.closeLabel"),children:(0,t.jsx)(ey.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:s?(0,t.jsx)(e1,{}):null}),(0,t.jsx)(j.Dialog,{open:null!==p,onOpenChange:e=>{e||y()},children:(0,t.jsxs)(j.DialogContent,{children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:x("assistant.renameSessionTitle")})}),(0,t.jsx)(w.Input,{autoFocus:!0,value:b,onChange:e=>N(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),k())},placeholder:x("assistant.renameSessionPlaceholder")}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:y,children:x("common.cancel")}),(0,t.jsx)(v.Button,{onClick:k,disabled:!b.trim(),children:x("common.save")})]})]})})]})}var e5=e.i(125177);function e4({onDismiss:e}){let{t:s}=(0,I.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,t.jsx)(e5.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var e3=e.i(689199),e8=e.i(163241);let e6=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function e7({onComplete:e}){let{t:s}=(0,I.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=e6[a],m=(0,r.useCallback)(async()=>{await (0,e8.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),h=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),x=(0,r.useCallback)(()=>{let e=h();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[h]);(0,r.useEffect)(()=>{x();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=h();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!h()&&(n(e=>{let t=e+1;return t<e6.length?t:e}),a>=e6.length-1&&m())},5e3));let t=()=>x();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,h,x,l,m]),(0,r.useEffect)(()=>{let e=setInterval(x,1e3);return()=>clearInterval(e)},[x]);let p=(0,r.useCallback)(()=>{a<e6.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
2
- ellipse at ${o.left+o.width/2}px ${o.top+o.height/2}px,
3
- transparent ${Math.max(o.width,o.height)}px,
4
- rgba(0,0,0,0.6) ${Math.max(o.width,o.height)+30}px
5
- )`},onClick:p}),(0,t.jsx)("div",{className:"pointer-events-none fixed z-[10001] rounded-lg ring-2 ring-amber-400 ring-offset-2 ring-offset-background",style:{left:o.left-4,top:o.top-4,width:o.width+8,height:o.height+8}}),(0,t.jsxs)("div",{className:"fixed z-[10002] w-72 rounded-xl border border-border bg-card p-4 shadow-2xl",style:(()=>{if(!o)return{display:"none"};let e={position:"fixed",zIndex:10001};switch(u.placement){case"right":e.left=o.right+12,e.top=o.top+o.height/2,e.transform="translateY(-50%)";break;case"bottom":e.left=o.left+o.width/2,e.top=o.bottom+12,e.transform="translateX(-50%)";break;case"left":e.right=window.innerWidth-o.left+12,e.top=o.top+o.height/2,e.transform="translateY(-50%)";break;case"top":e.left=o.left+o.width/2,e.bottom=window.innerHeight-o.top+12,e.transform="translateX(-50%)"}return e})(),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:s(u.titleKey)}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground leading-relaxed",children:s(u.descKey)})]}),(0,t.jsx)("button",{onClick:m,className:"shrink-0 rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(ey.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex gap-1",children:e6.map((e,r)=>(0,t.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${r===a?"bg-amber-400":r<a?"bg-amber-400/40":"bg-muted"}`},r))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.Button,{variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:m,children:s("tour.skip")}),(0,t.jsx)(v.Button,{className:"h-7 px-3 text-xs bg-amber-500/15 text-amber-300 ring-1 ring-amber-500/25 hover:bg-amber-500/25",onClick:p,children:s(a<e6.length-1?"tour.next":"tour.done")})]})]})]})]})}):null}var e9=e.i(469051);let te=(0,x.default)("sun-moon",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);var tt=e.i(769757),tr=e.i(360325),ts=e.i(317056);let ta=(0,U.create)(e=>({open:!1,setOpen:t=>e({open:t}),toggle:()=>e(e=>({open:!e.open}))})),tn=(0,U.create)(e=>({open:!1,setOpen:t=>e({open:t}),toggle:()=>e(e=>({open:!e.open}))}));function to(){let{t:e,locale:r,setLocale:a}=(0,I.useI18n)(),n=(0,s.useRouter)(),{resolvedTheme:i,setTheme:l}=(0,K.useTheme)(),c=ta(e=>e.open),d=ta(e=>e.setOpen),u=ta(e=>e.toggle),m=H(e=>e.setCreateProjectOpen),x=H(e=>e.setImportProjectOpen),p=tn(e=>e.toggle);(0,W.useActionShortcut)("global.commandPalette",()=>u());let g=e=>{d(!1),e()};return(0,t.jsxs)(ts.CommandDialog,{open:c,onOpenChange:d,title:e("palette.title"),children:[(0,t.jsx)(ts.CommandInput,{placeholder:e("palette.placeholder")}),(0,t.jsxs)(ts.CommandList,{children:[(0,t.jsx)(ts.CommandEmpty,{children:e("palette.empty")}),(0,t.jsxs)(ts.CommandGroup,{heading:e("palette.group.navigation"),children:[(0,t.jsxs)(ts.CommandItem,{onSelect:()=>g(()=>n.push("/missions")),children:[(0,t.jsx)(e9.LayoutGrid,{}),e("palette.gotoMissions")]}),(0,t.jsxs)(ts.CommandItem,{onSelect:()=>g(()=>n.push("/settings")),children:[(0,t.jsx)(G.Settings,{}),e("palette.openSettings")]})]}),(0,t.jsxs)(ts.CommandGroup,{heading:e("palette.group.actions"),children:[(0,t.jsxs)(ts.CommandItem,{onSelect:()=>g(()=>m(!0)),children:[(0,t.jsx)(o.Plus,{}),e("palette.newProject")]}),(0,t.jsxs)(ts.CommandItem,{onSelect:()=>g(()=>x(!0)),children:[(0,t.jsx)(h.FolderOpen,{}),e("palette.importProject")]}),(0,t.jsxs)(ts.CommandItem,{onSelect:()=>g(()=>p()),children:[(0,t.jsx)(tr.Keyboard,{}),e("palette.openHelp")]})]}),(0,t.jsxs)(ts.CommandGroup,{heading:e("palette.group.preferences"),children:[(0,t.jsxs)(ts.CommandItem,{onSelect:()=>g(()=>l("dark"===i?"light":"dark")),children:[(0,t.jsx)(te,{}),e("palette.toggleTheme")]}),(0,t.jsxs)(ts.CommandItem,{onSelect:()=>g(()=>a("zh"===r?"en":"zh")),children:[(0,t.jsx)(tt.Languages,{}),e("palette.toggleLocale")]})]})]})]})}var ti=e.i(371385),tl=e.i(75566),tc=e.i(851289);let td=["global","panels","missions"],tu=new Set(["missions.cycleBack"]);function tm(){let{t:e}=(0,I.useI18n)(),s=tn(e=>e.open),a=tn(e=>e.setOpen),n=tn(e=>e.toggle),o=(0,tl.useKeymapStore)(e=>e.overrides),[i,l]=(0,r.useState)("");(0,W.useActionShortcut)("global.help",()=>n());let c=i.trim().toLowerCase(),d=td.map(t=>{let r=ti.SHORTCUT_ACTIONS.filter(e=>e.group===t&&!tu.has(e.id)).map(t=>({id:t.id,description:e(t.descriptionKey),keys:(0,tl.resolveKeysFrom)(o,t.id)})).filter(e=>!c||e.description.toLowerCase().includes(c));return{title:e(`shortcuts.group.${t}`),shortcuts:r}}).filter(e=>e.shortcuts.length>0);return(0,t.jsx)(j.Dialog,{open:s,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-2xl",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:e("shortcuts.help.title")})}),(0,t.jsx)(w.Input,{value:i,onChange:e=>l(e.target.value),placeholder:e("shortcuts.help.searchPlaceholder")}),(0,t.jsx)("div",{className:"max-h-[60vh] space-y-4 overflow-y-auto",children:d.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-semibold text-muted-foreground",children:e.title}),(0,t.jsx)("div",{className:"space-y-0.5",children:e.shortcuts.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-md px-2 py-1.5 text-sm",children:[(0,t.jsx)("span",{className:"truncate",children:e.description}),(0,t.jsx)("div",{className:"flex shrink-0 items-center",children:(0,t.jsx)(tc.KeyCombo,{keys:e.keys})})]},e.id))})]},e.title))})]})})}function th({workspaces:e,isFirstRun:a,username:n,children:o,handleCreateProject:i}){let l=(0,s.usePathname)(),c=(0,s.useRouter)(),{isOpen:d,displayMode:u,closeAssistant:m}=(0,eI.useAssistant)();(0,W.useActionShortcut)("global.gotoWorkspace",t=>{let r=/^Digit([1-9])$/.exec(t.code);if(!r)return;let s=e[Number(r[1])-1];if(!s)return;let a=(0,O.getLastProjectId)(s.id);c.push(a?`/workspaces/${s.id}?projectId=${a}`:`/workspaces/${s.id}`)});let h=l.split("/workspaces/")[1]?.split("/")[0]||e[0]?.id;(0,W.useActionShortcut)("panels.taskManager",()=>c.push("/missions")),(0,W.useActionShortcut)("panels.assets",()=>{h&&c.push(`/workspaces/${h}/assets`)}),(0,W.useActionShortcut)("panels.notes",()=>{h&&c.push(`/workspaces/${h}/notes`)}),(0,W.useActionShortcut)("panels.archive",()=>{h&&c.push(`/workspaces/${h}/archive`)}),(0,r.useEffect)(()=>{a&&!l.startsWith("/onboarding")&&c.replace("/onboarding")},[a,l,c]);let[x,p]=(0,r.useState)(!1),[g,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>{a||l.startsWith("/onboarding")||(0,eC.getConfigValue)("onboarding.tourCompleted",!1).then(e=>{e?f(!0):p(!0)})},[a,l]);let b=()=>{p(!1),f(!0)},[v,w]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(0,eC.getConfigValue)("notification.enabled",!0).then(w)},[]);let N=l.startsWith("/onboarding");if(!function(e){let t=(0,s.useRouter)(),a=(0,r.useRef)(t),n=(0,r.useRef)(e),{t:o}=(0,I.useI18n)(),i=(0,r.useRef)(o);a.current=t,n.current=e,i.current=o,(0,r.useEffect)(()=>{if(!e)return;let t=null,r=null,s=!1;async function o(){if(s)return;let e=await (0,e3.getActualWsPort)();s||((t=new WebSocket(`ws://localhost:${e}/terminal?taskId=__notifications__`)).onmessage=e=>{if(n.current)try{let t=JSON.parse(e.data);if("type"in t&&"stop"===t.type)M.toast.success(t.taskTitle,{description:i.current("notification.taskCompleted"),duration:8e3});else if("Notification"in window&&"granted"===window.Notification.permission){let e=new window.Notification("Tower",{body:t.taskTitle,icon:"/web-app-manifest-192x192.png"});e.onclick=()=>{window.focus(),a.current.push(`/workspaces/${t.workspaceId}/tasks/${t.taskId}`),e.close()}}else M.toast.info(t.taskTitle,{description:"COMPLETED"===t.status?i.current("notification.taskCompleted"):i.current("notification.taskFailed")})}catch{}},t.onclose=()=>{s||(r=setTimeout(o,5e3))},t.onerror=()=>{t?.close()})}return o(),()=>{s=!0,r&&clearTimeout(r),t?.close()}},[e])}(v&&!N),N)return(0,t.jsx)(t.Fragment,{children:o});let y=/\/workspaces\/[^/]+\/tasks\/[^/]+/.test(l),k=/\/workspaces\/[^/]+\/(notes|assets|archive)/.test(l),C=d&&"sidebar"===u?(0,t.jsx)(e2,{mode:"sidebar"}):null,S="dialog"===u?(0,t.jsx)(j.Dialog,{open:d,onOpenChange:e=>{e||m()},children:(0,t.jsx)(j.DialogContent,{showCloseButton:!1,style:{width:"90vw",minWidth:"360px",maxWidth:"600px",height:"70vh",minHeight:"480px",maxHeight:"800px",padding:0},children:(0,t.jsx)(e2,{mode:"dialog"})})}):null;return y||k?(0,t.jsxs)(t.Fragment,{children:[g&&(0,t.jsx)(e4,{onDismiss:()=>f(!1)}),(0,t.jsx)("div",{className:"flex h-screen overflow-hidden",children:(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(eX,{onCreateProject:i,username:n}),(0,t.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[C,(0,t.jsx)("main",{className:"flex-1 overflow-hidden bg-background",children:(0,t.jsx)(eY.ErrorBoundary,{children:o})})]})]})}),S,x&&(0,t.jsx)(e7,{onComplete:b}),(0,t.jsx)(to,{}),(0,t.jsx)(tm,{})]}):(0,t.jsxs)(t.Fragment,{children:[g&&(0,t.jsx)(e4,{onDismiss:()=>f(!1)}),(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[(0,t.jsx)(E,{workspaces:e}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(eX,{onCreateProject:i,username:n}),(0,t.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[C,(0,t.jsx)("main",{className:"flex-1 overflow-auto bg-background",children:(0,t.jsx)(eY.ErrorBoundary,{children:o})})]})]})]}),S,x&&(0,t.jsx)(e7,{onComplete:b}),(0,t.jsx)(to,{}),(0,t.jsx)(tm,{})]})}e.s(["LayoutClient",0,function({workspaces:e,isFirstRun:r,username:a,children:n}){let o=(0,s.useRouter)(),i=(0,s.usePathname)(),l=i.split("/workspaces/")[1]?.split("/")[0],c=async t=>{let r=l||(e.length>0?e[0].id:null);if(!r){let e=await y({name:"Default Workspace"}),r=await (0,eZ.createProject)({...t,workspaceId:e.id});return o.refresh(),o.push(`/workspaces/${e.id}`),{id:r.id}}let s=await (0,eZ.createProject)({...t,workspaceId:r});return o.refresh(),o.push(`/workspaces/${r}`),{id:s.id}};return(0,t.jsx)(eI.AssistantProvider,{children:(0,t.jsx)(eJ.TerminalPortalProvider,{children:(0,t.jsx)(th,{workspaces:e,isFirstRun:r,username:a,handleCreateProject:c,children:n})})})}],914935)},782406,e=>{"use strict";var t=e.i(289721),r=e.i(821957);e.s(["ThemeProvider",0,function({children:e,...s}){return(0,t.jsx)(r.ThemeProvider,{...s,children:e})}])},713354,e=>{"use strict";var t=e.i(289721),r=e.i(821957),s=e.i(360112),a=e.i(59737),a=a,n=e.i(756502),n=n,o=e.i(567098),o=o;let i=(0,e.i(572989).default)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var l=e.i(519587),l=l;e.s(["Toaster",0,({...e})=>{let{theme:c="system"}=(0,r.useTheme)();return(0,t.jsx)(s.Toaster,{theme:c,className:"toaster group",icons:{success:(0,t.jsx)(a.default,{className:"size-4"}),info:(0,t.jsx)(n.default,{className:"size-4"}),warning:(0,t.jsx)(o.default,{className:"size-4"}),error:(0,t.jsx)(i,{className:"size-4"}),loading:(0,t.jsx)(l.default,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})}],713354)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,776405,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",0,t])},732649,e=>{"use strict";e.s(["mergeClasses",0,(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()])},346481,807283,e=>{"use strict";e.s(["default",0,{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}],346481),e.s(["hasA11yProp",0,e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1}],807283)},458464,e=>{"use strict";var t=e.i(965652),r=e.i(346481),n=e.i(807283),u=e.i(732649);let o=(0,t.createContext)({}),i=(0,t.forwardRef)(({color:e,size:i,strokeWidth:c,absoluteStrokeWidth:l,className:a="",children:s,iconNode:f,...d},h)=>{let{size:p=24,strokeWidth:y=2,absoluteStrokeWidth:g=!1,color:v="currentColor",className:m=""}=(0,t.useContext)(o)??{},R=l??g?24*Number(c??y)/Number(i??p):c??y;return(0,t.createElement)("svg",{ref:h,...r.default,width:i??p??r.default.width,height:i??p??r.default.height,stroke:e??v,strokeWidth:R,className:(0,u.mergeClasses)("lucide",m,a),...!s&&!(0,n.hasA11yProp)(d)&&{"aria-hidden":"true"},...d},[...f.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(s)?s:[s]])});e.s(["default",0,i],458464)},514798,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return o.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var u in n)Object.defineProperty(r,u,{enumerable:!0,get:n[u]});let o=e.r(16587),i=e.r(233906),c=e.r(278793)},738690,e=>{"use strict";var t=e.i(298751);e.s(["Search",()=>t.default])},611893,e=>{"use strict";var t=e.i(965652);let r=t.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});e.s(["CompositeListContext",0,r,"useCompositeListContext",0,function(){return t.useContext(r)}])},655728,e=>{"use strict";var t,r=e.i(965652),n=e.i(804849),u=e.i(611893);let o=((t={})[t.None=0]="None",t[t.GuessFromOrder=1]="GuessFromOrder",t);e.s(["IndexGuessBehavior",0,o,"useCompositeListItem",0,function(e={}){let{label:t,metadata:i,textRef:c,indexGuessBehavior:l,index:a}=e,{register:s,unregister:f,subscribeMapChange:d,elementsRef:h,labelsRef:p,nextIndexRef:y}=(0,u.useCompositeListContext)(),g=r.useRef(-1),[v,m]=r.useState(a??(l===o.GuessFromOrder?()=>{if(-1===g.current){let e=y.current;y.current+=1,g.current=e}return g.current}:-1)),R=r.useRef(null),E=r.useCallback(e=>{if(R.current=e,-1!==v&&null!==e&&(h.current[v]=e,p)){let r=void 0!==t;p.current[v]=r?t:c?.current?.textContent??e.textContent}},[v,h,p,t,c]);return(0,n.useIsoLayoutEffect)(()=>{if(null!=a)return;let e=R.current;if(e)return s(e,i),()=>{f(e)}},[a,s,f,i]),(0,n.useIsoLayoutEffect)(()=>{if(null==a)return d(e=>{let t=R.current?e.get(R.current)?.index:null;null!=t&&m(t)})},[a,d,m]),r.useMemo(()=>({ref:E,index:v}),[v,E])}])},579028,e=>{"use strict";var t=e.i(965652),r=e.i(903224),n=e.i(887642),u=e.i(804849),o=e.i(611893),i=e.i(289721);function c(){return new Map}function l(){return new Set}function a(e,t){let r=e.compareDocumentPosition(t);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}e.s(["CompositeList",0,function(e){let{children:s,elementsRef:f,labelsRef:d,onMapChange:h}=e,p=(0,n.useStableCallback)(h),y=t.useRef(0),g=(0,r.useRefWithInit)(l).current,v=(0,r.useRefWithInit)(c).current,[m,R]=t.useState(0),E=t.useRef(m),b=(0,n.useStableCallback)((e,t)=>{v.set(e,t??null),E.current+=1,R(E.current)}),O=(0,n.useStableCallback)(e=>{v.delete(e),E.current+=1,R(E.current)}),C=t.useMemo(()=>{let e=new Map;return Array.from(v.keys()).filter(e=>e.isConnected).sort(a).forEach((t,r)=>{let n=v.get(t)??{};e.set(t,{...n,index:r})}),e},[v,m]);(0,u.useIsoLayoutEffect)(()=>{if("function"!=typeof MutationObserver||0===C.size)return;let e=new MutationObserver(e=>{let t=new Set,r=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(r),e.addedNodes.forEach(r)}),0===t.size&&(E.current+=1,R(E.current))});return C.forEach((t,r)=>{r.parentElement&&e.observe(r.parentElement,{childList:!0})}),()=>{e.disconnect()}},[C]),(0,u.useIsoLayoutEffect)(()=>{E.current===m&&(f.current.length!==C.size&&(f.current.length=C.size),d&&d.current.length!==C.size&&(d.current.length=C.size),y.current=C.size),p(C)},[p,C,f,d,m]),(0,u.useIsoLayoutEffect)(()=>()=>{f.current=[]},[f]),(0,u.useIsoLayoutEffect)(()=>()=>{d&&(d.current=[])},[d]);let I=(0,n.useStableCallback)(e=>(g.add(e),()=>{g.delete(e)}));(0,u.useIsoLayoutEffect)(()=>{g.forEach(e=>e(C))},[g,C]);let L=t.useMemo(()=>({register:b,unregister:O,subscribeMapChange:I,elementsRef:f,labelsRef:d,nextIndexRef:y}),[b,O,I,f,d,y]);return(0,i.jsx)(o.CompositeListContext.Provider,{value:L,children:s})}])},234951,471959,748299,e=>{"use strict";e.i(708878);var t=e.i(965652),r=e.i(92615),n=e.i(20746),u=e.i(887642),o=e.i(804849),i=e.i(102094),c=e.i(682354),l=e.i(447594),a=e.i(358527),s=e.i(205995),f=e.i(67077),d=e.i(586622),h=e.i(777321),p=e.i(331033);function y(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function g(e,t){return y(t,e===p.ARROW_UP||e===p.ARROW_DOWN,e===p.ARROW_LEFT||e===p.ARROW_RIGHT)}function v(e,t,r){return y(t,e===p.ARROW_DOWN,r?e===p.ARROW_LEFT:e===p.ARROW_RIGHT)||"Enter"===e||" "===e||""===e}e.s(["useListNavigation",0,function(e,m){let R="rootStore"in e?e.rootStore:e,E=R.useState("open"),b=R.useState("floatingElement"),O=R.useState("domReferenceElement"),C=R.context.dataRef,{listRef:I,activeIndex:L,onNavigate:S=()=>{},enabled:x=!0,selectedIndex:k=null,allowEscape:M=!1,loopFocus:T=!1,nested:_=!1,rtl:N=!1,virtual:w=!1,focusItemOnOpen:A="auto",focusItemOnHover:P=!0,openOnArrowKeyDown:D=!0,disabledIndices:W,orientation:j="vertical",parentOrientation:F,cols:U=1,id:B,resetOnPointerLeave:G=!0,externalTree:K}=m,z=(0,c.getFloatingFocusElement)(b),V=(0,n.useValueAsRef)(z),$=(0,s.useFloatingParentNodeId)(),q=(0,s.useFloatingTree)(K);(0,o.useIsoLayoutEffect)(()=>{C.current.orientation=j},[C,j]);let H=(0,c.isTypeableCombobox)(O),X=t.useRef(A),J=t.useRef(k??-1),Q=t.useRef(null),Y=t.useRef(!0),Z=(0,u.useStableCallback)(e=>{S(-1===J.current?null:J.current,e)}),ee=t.useRef(Z),et=t.useRef(!!b),er=t.useRef(E),en=t.useRef(!1),eu=t.useRef(!1),eo=(0,n.useValueAsRef)(W),ei=(0,n.useValueAsRef)(E),ec=(0,n.useValueAsRef)(k),el=(0,n.useValueAsRef)(G),ea=(0,u.useStableCallback)(()=>{function e(e){w?q?.events.emit("virtualfocus",e):(0,h.enqueueFocus)(e,{sync:en.current,preventScroll:!0})}let t=I.current[J.current],r=eu.current;t&&e(t),(en.current?e=>e():requestAnimationFrame)(()=>{let n=I.current[J.current]||t;!n||(t||e(n),ef&&(r||!Y.current)&&n.scrollIntoView?.({block:"nearest",inline:"nearest"}))})});(0,o.useIsoLayoutEffect)(()=>{x&&(E&&b?(J.current=k??-1,X.current&&null!=k&&(eu.current=!0,Z())):et.current&&(J.current=-1,ee.current()))},[x,E,b,k,Z]),(0,o.useIsoLayoutEffect)(()=>{if(x){if(!E){en.current=!1;return}if(b)if(null==L){if(en.current=!1,null!=ec.current)return;if(et.current&&(J.current=-1,ea()),(!er.current||!et.current)&&X.current&&(null!=Q.current||!0===X.current&&null==Q.current)){let e=0,t=()=>{null==I.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(J.current=null==Q.current||v(Q.current,j,N)||_?(0,a.getMinListIndex)(I):(0,a.getMaxListIndex)(I),Q.current=null,Z())};t()}}else(0,a.isIndexOutOfListBounds)(I,L)||(J.current=L,ea(),eu.current=!1)}},[x,E,b,L,ec,_,I,j,N,Z,ea,eo]),(0,o.useIsoLayoutEffect)(()=>{if(!x||b||!q||w||!et.current)return;let e=q.nodesRef.current,t=e.find(e=>e.id===$)?.context?.elements.floating,r=(0,c.activeElement)((0,i.ownerDocument)(b)),n=e.some(e=>e.context&&(0,c.contains)(e.context.elements.floating,r));t&&!n&&Y.current&&t.focus({preventScroll:!0})},[x,b,q,$,w]),(0,o.useIsoLayoutEffect)(()=>{ee.current=Z,er.current=E,et.current=!!b}),(0,o.useIsoLayoutEffect)(()=>{E||(Q.current=null,X.current=A)},[E,A]);let es=null!=L,ef=t.useMemo(()=>{function e(e){if(!ei.current)return;let t=I.current.indexOf(e.currentTarget);-1!==t&&J.current!==t&&(J.current=t,Z(e))}return{onFocus(t){en.current=!0,e(t)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(t){en.current=!0,eu.current=!1,P&&e(t)},onPointerLeave(e){if(!ei.current||!Y.current||"touch"===e.pointerType)return;en.current=!0;let t=e.relatedTarget;if(!(!P||I.current.includes(t))&&el.current&&((0,h.enqueueFocus)(null,{sync:!0}),J.current=-1,Z(e),!w)){let e=V.current,t=(0,c.activeElement)((0,i.ownerDocument)(e));e&&(0,c.contains)(e,t)&&e.focus({preventScroll:!0})}}}},[ei,V,P,I,Z,el,w]),ed=t.useCallback(()=>F??q?.nodesRef.current.find(e=>e.id===$)?.context?.dataRef?.current.orientation,[$,q,F]),eh=(0,u.useStableCallback)(e=>{var t;let n,u;if(Y.current=!1,en.current=!0,229===e.which||!ei.current&&e.currentTarget===V.current)return;if(_&&(t=e.key,n=N?t===p.ARROW_RIGHT:t===p.ARROW_LEFT,u=t===p.ARROW_UP,"both"===j||"horizontal"===j&&U&&U>1?"Escape"===t:y(j,n,u))){g(e.key,ed())||(0,l.stopEvent)(e),R.setOpen(!1,(0,f.createChangeEventDetails)(d.REASONS.listNavigation,e.nativeEvent)),(0,r.isHTMLElement)(O)&&(w?q?.events.emit("virtualfocus",O):O.focus());return}let o=J.current,i=(0,a.getMinListIndex)(I,W),s=(0,a.getMaxListIndex)(I,W);if(H||("Home"===e.key&&((0,l.stopEvent)(e),J.current=i,Z(e)),"End"===e.key&&((0,l.stopEvent)(e),J.current=s,Z(e))),U>1){let t=Array.from({length:I.current.length},()=>({width:1,height:1})),r=(0,a.createGridCellMap)(t,U,!1),n=r.findIndex(e=>null!=e&&!(0,a.isListIndexDisabled)(I,e,W)),u=r.reduce((e,t,r)=>null==t||(0,a.isListIndexDisabled)(I,t,W)?e:r,-1),o=r[(0,a.getGridNavigatedIndex)({current:r.map(e=>null!=e?I.current[e]:null)},{event:e,orientation:j,loopFocus:T,rtl:N,cols:U,disabledIndices:(0,a.getGridCellIndices)([...("function"!=typeof W?W:null)||I.current.map((e,t)=>(0,a.isListIndexDisabled)(I,t,W)?t:void 0),void 0],r),minIndex:n,maxIndex:u,prevIndex:(0,a.getGridCellIndexOfCorner)(J.current>s?i:J.current,t,r,U,e.key===p.ARROW_DOWN?"bl":e.key===(N?p.ARROW_LEFT:p.ARROW_RIGHT)?"tr":"tl"),stopEvent:!0})];if(null!=o&&(J.current=o,Z(e)),"both"===j)return}if(g(e.key,j)){if((0,l.stopEvent)(e),E&&!w&&(0,c.activeElement)(e.currentTarget.ownerDocument)===e.currentTarget){J.current=v(e.key,j,N)?i:s,Z(e);return}v(e.key,j,N)?T?o>=s?M&&o!==I.current.length?J.current=-1:(en.current=!1,J.current=i):J.current=(0,a.findNonDisabledListIndex)(I,{startingIndex:o,disabledIndices:W}):J.current=Math.min(s,(0,a.findNonDisabledListIndex)(I,{startingIndex:o,disabledIndices:W})):T?o<=i?M&&-1!==o?J.current=I.current.length:(en.current=!1,J.current=s):J.current=(0,a.findNonDisabledListIndex)(I,{startingIndex:o,decrement:!0,disabledIndices:W}):J.current=Math.max(i,(0,a.findNonDisabledListIndex)(I,{startingIndex:o,decrement:!0,disabledIndices:W})),(0,a.isIndexOutOfListBounds)(I,J.current)&&(J.current=-1),Z(e)}}),ep=t.useMemo(()=>w&&E&&es&&{"aria-activedescendant":`${B}-${L}`},[w,E,es,B,L]),ey=t.useMemo(()=>({"aria-orientation":"both"===j?void 0:j,...!H?ep:{},onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&E&&!w){let t=(0,c.getTarget)(e.nativeEvent);if(t&&!(0,c.contains)(V.current,t))return;(0,l.stopEvent)(e),R.setOpen(!1,(0,f.createChangeEventDetails)(d.REASONS.focusOut,e.nativeEvent)),(0,r.isHTMLElement)(O)&&O.focus();return}eh(e)},onPointerMove(){Y.current=!0}}),[ep,eh,V,j,H,R,E,w,O]),eg=t.useMemo(()=>{function e(e){"auto"===A&&(0,l.isVirtualClick)(e.nativeEvent)&&(X.current=!w)}function t(e){X.current=A,"auto"===A&&(0,l.isVirtualPointerEvent)(e.nativeEvent)&&(X.current=!0)}return{onKeyDown(e){var t,r;let n=R.select("open");Y.current=!1;let u=e.key.startsWith("Arrow"),o=(t=e.key,r=ed(),y(r,N?t===p.ARROW_LEFT:t===p.ARROW_RIGHT,t===p.ARROW_DOWN)),i=g(e.key,j),c=(_?o:i)||"Enter"===e.key||""===e.key.trim();if(w&&n)return eh(e);if(n||D||!u){if(c){let t=g(e.key,ed());Q.current=_&&t?null:e.key}if(_){o&&((0,l.stopEvent)(e),n?(J.current=(0,a.getMinListIndex)(I,eo.current),Z(e)):R.setOpen(!0,(0,f.createChangeEventDetails)(d.REASONS.listNavigation,e.nativeEvent,e.currentTarget)));return}i&&(null!=ec.current&&(J.current=ec.current),(0,l.stopEvent)(e),!n&&D?R.setOpen(!0,(0,f.createChangeEventDetails)(d.REASONS.listNavigation,e.nativeEvent,e.currentTarget)):eh(e),n&&Z(e))}},onFocus(e){R.select("open")&&!w&&(J.current=-1,Z(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[eh,eo,A,I,_,Z,R,D,j,ed,N,ec,w]),ev=t.useMemo(()=>({...ep,...eg}),[ep,eg]);return t.useMemo(()=>x?{reference:ev,floating:ey,item:ef,trigger:eg}:{},[x,ev,ey,eg,ef])}],234951);var m=e.i(161476);e.s(["useTypeahead",0,function(e,r){let n="rootStore"in e?e.rootStore:e,i=n.context.dataRef,s=n.useState("open"),{listRef:f,elementsRef:d,activeIndex:h,onMatch:p,onTypingChange:y,enabled:g=!0,resetMs:v=750,selectedIndex:R=null}=r,E=(0,m.useTimeout)(),b=t.useRef(""),O=t.useRef(R??h??-1),C=t.useRef(null);(0,o.useIsoLayoutEffect)(()=>{(s||null===R)&&(E.clear(),C.current=null,""!==b.current&&(b.current=""))},[s,R,E]),(0,o.useIsoLayoutEffect)(()=>{s&&""===b.current&&(O.current=R??h??-1)},[s,R,h]);let I=(0,u.useStableCallback)(e=>{e?i.current.typing||(i.current.typing=e,y?.(e)):i.current.typing&&(i.current.typing=e,y?.(e))}),L=(0,u.useStableCallback)(e=>{function t(e,r,n=0){if(0===e.length)return -1;let u=(n%e.length+e.length)%e.length,o=r.toLocaleLowerCase();for(let t=0;t<e.length;t+=1){let r=(u+t)%e.length,n=e[r];if(n?.toLocaleLowerCase().startsWith(o)&&function(e){let t=d?.current[e];return!t||(0,a.isElementVisible)(t)}(r))return r}return -1}let r=f.current;if(b.current.length>0&&" "===e.key&&((0,l.stopEvent)(e),I(!0)),b.current.length>0&&" "!==b.current[0]&&-1===t(r,b.current)&&" "!==e.key&&I(!1),null==r||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;s&&" "!==e.key&&((0,l.stopEvent)(e),I(!0));let n=""===b.current;n&&(O.current=R??h??-1),r.every(e=>!e||e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase())&&b.current===e.key&&(b.current="",O.current=C.current),b.current+=e.key,E.start(v,()=>{b.current="",O.current=C.current,I(!1)});let u=n?R??h??-1:O.current,o=t(r,b.current,(u??0)+1);-1!==o?(p?.(o),C.current=o):" "!==e.key&&(b.current="",I(!1))}),S=(0,u.useStableCallback)(e=>{let t=e.relatedTarget,r=n.select("domReferenceElement"),u=n.select("floatingElement"),o=(0,c.contains)(r,t),i=(0,c.contains)(u,t);o||i||(E.clear(),b.current="",O.current=C.current,I(!1))}),x=t.useMemo(()=>({onKeyDown:L,onBlur:S}),[L,S]),k=t.useMemo(()=>({onKeyDown:L,onBlur:S}),[L,S]);return t.useMemo(()=>g?{reference:x,floating:k}:{},[g,x,k])}],471959),e.s(["getPseudoElementBounds",0,function(e){let t=e.getBoundingClientRect(),r=window.getComputedStyle(e,"::before"),n=window.getComputedStyle(e,"::after");if("none"===r.content&&"none"===n.content)return t;let u=parseFloat(r.width)||0,o=parseFloat(r.height)||0,i=parseFloat(n.width)||0,c=parseFloat(n.height)||0,l=Math.max(t.width,u,i),a=Math.max(t.height,o,c),s=l-t.width,f=a-t.height;return{left:t.left-s/2,right:t.right+s/2,top:t.top-f/2,bottom:t.bottom+f/2}}],748299)},983640,e=>{"use strict";var t=e.i(965652),r=e.i(581263);let n=t.forwardRef(function(e,t){let{className:n,render:u,orientation:o="horizontal",...i}=e;return(0,r.useRenderElement)("div",e,{state:{orientation:o},ref:t,props:[{role:"separator","aria-orientation":o},i]})});e.s(["Separator",0,n])},533133,e=>{"use strict";var t=e.i(152279);e.s(["CheckIcon",()=>t.default])},314338,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["default",0,t])},226145,e=>{"use strict";let t=(0,e.i(572989).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);e.s(["GitBranch",0,t],226145)},501244,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return c},formatWithValidation:function(){return a},urlObjectKeys:function(){return l}};for(var u in n)Object.defineProperty(r,u,{enumerable:!0,get:n[u]});let o=e.r(744066)._(e.r(565893)),i=/https?|ftp|gopher|file/;function c(e){let{auth:t,hostname:r}=e,n=e.protocol||"",u=e.pathname||"",c=e.hash||"",l=e.query||"",a=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?a=t+e.host:r&&(a=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(a+=":"+e.port)),l&&"object"==typeof l&&(l=String(o.urlQueryToSearchParams(l)));let s=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||i.test(n))&&!1!==a?(a="//"+(a||""),u&&"/"!==u[0]&&(u="/"+u)):a||(a=""),c&&"#"!==c[0]&&(c="#"+c),s&&"?"!==s[0]&&(s="?"+s),u=u.replace(/[?#]/g,encodeURIComponent),s=s.replace("#","%23"),`${n}${a}${u}${s}${c}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function a(e){return c(e)}},668649,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return u}});let n=e.r(965652);function u(e,t){let r=(0,n.useRef)(null),u=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=u.current;t&&(u.current=null,t())}else e&&(r.current=o(e,n)),t&&(u.current=o(t,n))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},927683,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return o}});let n=e.r(204575),u=e.r(394864);function o(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,u.hasBasePath)(r.pathname)}catch(e){return!1}}},573088,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},210702,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return v},useLinkStatus:function(){return R}};for(var u in n)Object.defineProperty(r,u,{enumerable:!0,get:n[u]});let o=e.r(744066),i=e.r(289721),c=o._(e.r(965652)),l=e.r(501244),a=e.r(74122),s=e.r(668649),f=e.r(204575),d=e.r(44204);e.r(619172);let h=e.r(840535),p=e.r(255397),y=e.r(927683),g=e.r(530620);function v(t){var r,n;let u,o,v,[R,E]=(0,c.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,c.useRef)(null),{href:O,as:C,children:I,prefetch:L=null,passHref:S,replace:x,shallow:k,scroll:M,onClick:T,onMouseEnter:_,onTouchStart:N,legacyBehavior:w=!1,onNavigate:A,transitionTypes:P,ref:D,unstable_dynamicOnHover:W,...j}=t;u=I,w&&("string"==typeof u||"number"==typeof u)&&(u=(0,i.jsx)("a",{children:u}));let F=c.default.useContext(a.AppRouterContext),U=!1!==L,B=!1!==L?null===(n=L)||"auto"===n?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,G="string"==typeof(r=C||O)?r:(0,l.formatUrl)(r);if(w){if(u?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=c.default.Children.only(u)}let K=w?o&&"object"==typeof o&&o.ref:D,z=c.default.useCallback(e=>(null!==F&&(b.current=(0,p.mountLinkInstance)(e,G,F,B,U,E)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[U,G,F,B,E]),V={ref:(0,s.useMergedRef)(z,K),onClick(t){w||"function"!=typeof T||T(t),w&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!F||t.defaultPrevented||function(t,r,n,u,o,i,l){if("u">typeof window){let a,{nodeName:s}=t.currentTarget;if("A"===s.toUpperCase()&&((a=t.currentTarget.getAttribute("target"))&&"_self"!==a||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,y.isLocalURL)(r)){u&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(238105);c.default.startTransition(()=>{f(r,u?"replace":"push",!1===o?h.ScrollBehavior.NoScroll:h.ScrollBehavior.Default,n.current,l)})}}(t,G,b,x,M,A,P)},onMouseEnter(e){w||"function"!=typeof _||_(e),w&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),F&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===W)},onTouchStart:function(e){w||"function"!=typeof N||N(e),w&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),F&&U&&(0,p.onNavigationIntent)(e.currentTarget,!0===W)}};return(0,f.isAbsoluteUrl)(G)?V.href=G:w&&!S&&("a"!==o.type||"href"in o.props)||(V.href=(0,d.addBasePath)(G)),v=w?c.default.cloneElement(o,V):(0,i.jsx)("a",{...j,...V,children:u}),(0,i.jsx)(m.Provider,{value:R,children:v})}e.r(573088);let m=(0,c.createContext)(p.IDLE_LINK_STATUS),R=()=>(0,c.useContext)(m);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,565893,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return o}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,i(e));else t.set(r,i(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},204575,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return k},MissingStaticPage:function(){return v},NormalizeError:function(){return b},PageNotFoundError:function(){return x},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return w}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>o.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function p(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await p(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class b extends Error{}class x extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class v extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class k extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(e){return JSON.stringify({message:e.message,stack:e.stack})}},619172,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},578775,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("4026f39b36357e46d8d5e1027d089a1739d81ecabc",t.callServer,void 0,t.findSourceMapURL,"getLabelsForWorkspace");e.s(["getLabelsForWorkspace",0,r])},821957,e=>{"use strict";var t=e.i(965652),r=(e,t,r,n,s,a,i,o)=>{let l=document.documentElement,c=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&a?s.map(e=>a[e]||e):s;r?(l.classList.remove(...n),l.classList.add(a&&a[t]?a[t]:t)):l.setAttribute(e,t)}),r=t,o&&c.includes(r)&&(l.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},n=["light","dark"],s="(prefers-color-scheme: dark)",a="u"<typeof window,i=t.createContext(void 0),o={setTheme:e=>{},themes:[]},l=["light","dark"],c=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:a=!0,enableColorScheme:o=!0,storageKey:c="theme",themes:p=l,defaultTheme:m=a?"system":"light",attribute:g="data-theme",value:y,children:b,nonce:x,scriptProps:v})=>{let[k,w]=t.useState(()=>d(c,m)),[S,j]=t.useState(()=>"system"===k?h():k),C=y?Object.values(y):p,M=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&a&&(t=h());let s=y?y[t]:t,i=r?f(x):null,l=document.documentElement,c=e=>{"class"===e?(l.classList.remove(...C),s&&l.classList.add(s)):e.startsWith("data-")&&(s?l.setAttribute(e,s):l.removeAttribute(e))};if(Array.isArray(g)?g.forEach(c):c(g),o){let e=n.includes(m)?m:null,r=n.includes(t)?t:e;l.style.colorScheme=r}null==i||i()},[x]),E=t.useCallback(e=>{let t="function"==typeof e?e(k):e;w(t);try{localStorage.setItem(c,t)}catch(e){}},[k]),N=t.useCallback(t=>{j(h(t)),"system"===k&&a&&!e&&M("system")},[k,e]);t.useEffect(()=>{let e=window.matchMedia(s);return e.addListener(N),N(e),()=>e.removeListener(N)},[N]),t.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?w(e.newValue):E(m))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[E]),t.useEffect(()=>{M(null!=e?e:k)},[e,k]);let P=t.useMemo(()=>({theme:k,setTheme:E,forcedTheme:e,resolvedTheme:"system"===k?S:k,themes:a?[...p,"system"]:p,systemTheme:a?S:void 0}),[k,E,e,S,a,p]);return t.createElement(i.Provider,{value:P},t.createElement(u,{forcedTheme:e,storageKey:c,attribute:g,enableSystem:a,enableColorScheme:o,defaultTheme:m,value:y,themes:p,nonce:x,scriptProps:v}),b)},u=t.memo(({forcedTheme:e,storageKey:n,attribute:s,enableSystem:a,enableColorScheme:i,defaultTheme:o,value:l,themes:c,nonce:u,scriptProps:d})=>{let f=JSON.stringify([s,n,o,e,c,l,a,i]).slice(1,-1);return t.createElement("script",{...d,suppressHydrationWarning:!0,nonce:"u"<typeof window?u:"",dangerouslySetInnerHTML:{__html:`(${r.toString()})(${f})`}})}),d=(e,t)=>{let r;if(!a){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(s)),e.matches?"dark":"light");e.s(["ThemeProvider",0,e=>t.useContext(i)?t.createElement(t.Fragment,null,e.children):t.createElement(c,{...e}),"useTheme",0,()=>{var e;return null!=(e=t.useContext(i))?e:o}])},689199,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("008f1d70c23c8fc694e191710a68f9e6dbb24d2b7d",t.callServer,void 0,t.findSourceMapURL,"getActualWsPort");e.s(["getActualWsPort",0,r])},225499,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40b4640c57401cd27cb33d9aaa952b629581721f99",t.callServer,void 0,t.findSourceMapURL,"installExtension");e.s(["installExtension",0,r])},812983,e=>{"use strict";let t=(0,e.i(572989).default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]);e.s(["FileCode",0,t],812983)},887911,e=>{"use strict";var t=e.i(738690),r=e.i(812983);let n={rg:{id:"rg",name:"代码搜索 (ripgrep)",description:"基于 rg 的全文代码搜索",icon:t.Search,sizeMB:5,homepageUrl:"https://github.com/BurntSushi/ripgrep#installation",manualInstall:!0},monaco:{id:"monaco",name:"代码编辑器 (Monaco)",description:"VS Code 同款 Web 编辑器",icon:r.FileCode,sizeMB:15,homepageUrl:"https://microsoft.github.io/monaco-editor/"}},s=[n.rg,n.monaco];e.s(["listExtensionMetadata",0,function(){return s}])},163241,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60328d14d064267c9ac3962fe5cb2f7b5165c4a29d",t.callServer,void 0,t.findSourceMapURL,"setConfigValue");e.s(["setConfigValue",0,r])},387091,15299,769757,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,r],387091);let n=(0,t.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,n],15299);let s=(0,t.default)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);e.s(["Languages",0,s],769757)},938499,e=>{"use strict";let t=(0,e.i(572989).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",0,t],938499)},651236,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return s}});let n=e.r(415440);function s({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},37982,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},607717,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return l}});let n=e.r(289721),s=e.r(585012),a=e.r(465687),i=e.r(37982),o=e.r(695597);function l({moduleIds:e}){if("u">typeof window)return null;let t=a.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let c=(0,o.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,s.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},105931,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return c}});let n=e.r(289721),s=e.r(965652),a=e.r(651236),i=e.r(607717);function o(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},c=function(e){let t={...l,...e},r=(0,s.lazy)(()=>t.loader().then(o)),c=t.loading;function u(e){let o=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,u=l?s.Suspense:s.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(u,{...l?{fallback:o}:{},children:d})}return u.displayName="LoadableComponent",u}},19578,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(481258)._(e.r(105931));function s(e,t){let r={};"function"==typeof e&&(r.loader=e);let s={...r,...t};return(0,n.default)({...s,modules:s.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},966001,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(938499),s=e.i(194358),a=e.i(519455);class i extends r.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(n.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,t.jsxs)(a.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,t.jsx)(s.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}e.s(["ErrorBoundary",0,i])},699375,e=>{"use strict";var t,r=e.i(289721);e.s([],159880),e.i(159880),e.i(708878);var n=e.i(965652),s=e.i(314757),a=e.i(887642),i=e.i(362891),o=e.i(804849),l=e.i(416369),c=e.i(954588),u=e.i(581263),d=e.i(565455),f=e.i(207516),h=e.i(282109),p=e.i(462902);let m=n.createContext(void 0);var g=e.i(551974);let y=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),b={...g.fieldValidityMapping,checked:e=>e?{[y.checked]:""}:{[y.unchecked]:""}};var x=e.i(421689),v=e.i(890514),k=e.i(571870),w=e.i(179279),S=e.i(103353),j=e.i(67077),C=e.i(586622),M=e.i(353052);let E=n.forwardRef(function(e,t){let{checked:p,className:g,defaultChecked:y,"aria-labelledby":E,id:N,inputRef:P,name:A,nativeButton:I=!1,onCheckedChange:T,readOnly:R=!1,required:K=!1,disabled:O=!1,render:L,uncheckedValue:z,value:F,..._}=e,{clearErrors:$}=(0,k.useFormContext)(),{state:D,setTouched:U,setDirty:B,validityData:V,setFilled:H,setFocused:J,shouldValidateOnChange:q,validationMode:W,disabled:G,name:Z,validation:X}=(0,v.useFieldRootContext)(),{labelId:Q}=(0,w.useLabelableContext)(),Y=G||O,ee=Z??A,et=(0,a.useStableCallback)(T),er=n.useRef(null),en=(0,i.useMergedRefs)(er,P,X.inputRef),es=n.useRef(null),ea=(0,f.useBaseUiId)(),ei=(0,S.useLabelableId)({id:N,implicit:!1,controlRef:es}),eo=I?void 0:ei,[el,ec]=(0,s.useControlled)({controlled:p,default:!!y,name:"Switch",state:"checked"});(0,x.useField)({id:ea,commit:X.commit,value:el,controlRef:es,name:ee,getValue:()=>el}),(0,o.useIsoLayoutEffect)(()=>{er.current&&H(er.current.checked)},[er,H]),(0,M.useValueChanged)(el,()=>{$(ee),B(el!==V.initialValue),H(el),q()?X.commit(el):X.commit(el,!0)});let{getButtonProps:eu,buttonRef:ed}=(0,h.useButton)({disabled:Y,native:I}),ef=function(e,t,r,s=!0,a){let[i,l]=n.useState(),c=(0,f.useBaseUiId)(a?`${a}-label`:void 0),u=e??t??i;return(0,o.useIsoLayoutEffect)(()=>{let n=e||t||!s?void 0:function(e,t){let r=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let r=e.id;if(r){let t=e.nextElementSibling;if(t&&t.htmlFor===r)return t}let n=e.labels;return n&&n[0]}(e);if(r)return!r.id&&t&&(r.id=t),r.id||void 0}(r.current,c);i!==n&&l(n)}),u}(E,Q,er,!I,eo),eh=n.useMemo(()=>(0,d.mergeProps)({checked:el,disabled:Y,id:eo,name:ee,required:K,style:ee?l.visuallyHiddenInput:l.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:en,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,r=(0,j.createChangeEventDetails)(C.REASONS.none,e.nativeEvent);et?.(t,r),r.isCanceled||ec(t)},onFocus(){es.current?.focus()}},X.getInputValidationProps,void 0!==F?{value:F}:c.EMPTY_OBJECT),[el,Y,en,eo,ee,et,K,ec,X,F]),ep=n.useMemo(()=>({...D,checked:el,disabled:Y,readOnly:R,required:K}),[D,el,Y,R,K]),em=(0,u.useRenderElement)("span",e,{state:ep,ref:[t,es,ed],props:[{id:I?ei:ea,role:"switch","aria-checked":el,"aria-readonly":R||void 0,"aria-required":K||void 0,"aria-labelledby":ef,onFocus(){Y||J(!0)},onBlur(){let e=er.current;e&&!Y&&(U(!0),J(!1),"onBlur"===W&&X.commit(e.checked))},onClick(e){R||Y||(e.preventDefault(),er.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},X.getValidationProps,_,eu],stateAttributesMapping:b});return(0,r.jsxs)(m.Provider,{value:ep,children:[em,!el&&ee&&void 0!==z&&(0,r.jsx)("input",{type:"hidden",name:ee,value:z}),(0,r.jsx)("input",{...eh})]})}),N=n.forwardRef(function(e,t){let{render:r,className:s,...a}=e,{state:i}=(0,v.useFieldRootContext)(),o=function(){let e=n.useContext(m);if(void 0===e)throw Error((0,p.default)(63));return e}(),l={...i,...o};return(0,u.useRenderElement)("span",e,{state:l,ref:t,stateAttributesMapping:b,props:a})});e.s(["Root",0,E,"Thumb",0,N],803205);var P=e.i(803205),P=P,A=e.i(975157);e.s(["Switch",0,function({className:e,size:t="default",...n}){return(0,r.jsx)(P.Root,{"data-slot":"switch","data-size":t,className:(0,A.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:(0,r.jsx)(P.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],699375)},464249,e=>{"use strict";let t=(0,e.i(572989).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],464249)},889620,e=>{"use strict";let t="workspace-last-project";function r(){try{let e=localStorage.getItem(t);if(!e)return{};let r=JSON.parse(e);return r&&"object"==typeof r?r:{}}catch{return{}}}e.s(["getLastProjectId",0,function(e){return r()[e]??null},"setLastProjectId",0,function(e,n){try{let s=r();if(s[e]===n)return;localStorage.setItem(t,JSON.stringify({...s,[e]:n}))}catch{}}])},263938,e=>{"use strict";let t=(0,e.i(572989).default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);e.s(["Tag",0,t],263938)},989548,338187,e=>{"use strict";let t=(0,e.i(572989).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,t],989548);var r=e.i(289721),n=e.i(965652);e.i(508271);var s=e.i(841359),a=e.i(773535);let i="tower-assistant-sessions",o="tower-assistant-active-session";function l(){try{let e=localStorage.getItem(i);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t}catch{return[]}}function c(){return localStorage.getItem(o)}function u(e){null===e?localStorage.removeItem(o):localStorage.setItem(o,e)}let d=(0,n.createContext)(null);function f(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let h="assistant-attachment-cache";function p(e,t,r){try{let n=sessionStorage.getItem(h),s=n?JSON.parse(n):{};s[e]||(s[e]={}),s[e][t]=r,sessionStorage.setItem(h,JSON.stringify(s))}catch{}}e.s(["AssistantProvider",0,function({children:e}){let[t,o]=(0,n.useState)(!1),[m,g]=(0,n.useState)(!1),[y,b]=(0,n.useState)("sidebar"),[x,v]=(0,n.useState)(null),[k,w]=(0,n.useState)([]),[S,j]=(0,n.useState)("idle"),[C,M]=(0,n.useState)(!1),E=(0,n.useRef)([]),N=(0,n.useRef)(null),P=(0,n.useRef)(null),[A,I]=(0,n.useState)([]),[T,R]=(0,n.useState)(null),K=(0,n.useRef)(!1),O=(0,n.useCallback)(()=>{w([...E.current])},[]),L=(0,n.useCallback)(async()=>{b("dialog"===await (0,a.getConfigValue)("assistant.displayMode","sidebar")?"dialog":"sidebar")},[]);(0,n.useEffect)(()=>{L()},[L]);let z=(0,n.useCallback)(async()=>{I(l())},[]),F=(0,n.useCallback)(async e=>{M(!0);try{let t=await fetch(`/api/internal/assistant/sessions?sessionId=${encodeURIComponent(e)}`);if(!t.ok)return;let r=await t.json();if(Array.isArray(r.messages)){E.current=r.messages;let t=function(e){try{let t=sessionStorage.getItem(h);if(!t)return{};return JSON.parse(t)[e]??{}}catch{return{}}}(e);if(Object.keys(t).length>0){let e=0;E.current=E.current.map(r=>{if("user"===r.role){let n=t[e];if(e++,n?.length)return{...r,attachmentFilenames:n}}return r})}w([...E.current])}}catch{}finally{M(!1)}},[]);(0,n.useEffect)(()=>{z();let e=c();e&&(R(e),N.current=e,F(e))},[z,F]);let _=(0,n.useCallback)(()=>{P.current?.abort(),N.current=null,K.current=!1,R(null),u(null),E.current=[],w([]),j("idle")},[]),$=(0,n.useCallback)(e=>{P.current?.abort(),N.current=e,K.current=!0,R(e),u(e),E.current=[],w([]),j("idle"),F(e)},[F]),D=(0,n.useCallback)(e=>{let t;t=l().filter(t=>t.id!==e),localStorage.setItem(i,JSON.stringify(t)),c()===e&&u(null),I(l()),T===e&&_()},[T,_]),U=(0,n.useCallback)((e,t)=>{let r=t.trim();if(r){var n;let t;n={title:r},t=l().map(t=>t.id===e?{...t,...n,updatedAt:new Date().toISOString()}:t),localStorage.setItem(i,JSON.stringify(t)),I(l())}},[]),B=(0,n.useCallback)(async()=>{g(!0);try{await L(),o(!0)}finally{g(!1)}},[L]),V=(0,n.useCallback)(()=>{o(!1),P.current?.abort()},[]),H=(0,n.useCallback)(()=>{t||m?V():B()},[t,m,V,B]);(0,s.useActionShortcut)("global.assistant",()=>H());let J=(0,n.useCallback)(async(e,t)=>{if(!e.trim()&&!t?.attachmentFilenames?.length)return;P.current?.abort();let r=new AbortController;P.current=r;let n=0!==E.current.length||K.current?null:e,s=f();if(E.current=[...E.current,{id:f(),role:"user",content:e,attachmentFilenames:t?.attachmentFilenames?.length?t.attachmentFilenames:void 0},{id:s,role:"thinking",content:"",isStreaming:!0}],O(),t?.attachmentFilenames?.length&&N.current){let e=E.current.filter(e=>"user"===e.role).length-1;p(N.current,e,t.attachmentFilenames)}j("connecting");let a=null;try{let o=await fetch("/api/internal/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e,sessionId:N.current,attachmentFilenames:t?.attachmentFilenames??[]}),signal:r.signal});if(!o.ok||!o.body)throw Error(`HTTP ${o.status}`);j("streaming");let c=o.body.getReader(),d=new TextDecoder,h="";for(;;){let{done:e,value:r}=await c.read();if(e)break;let o=(h+=d.decode(r,{stream:!0})).split("\n");for(let e of(h=o.pop()??"",o)){let r;if(e.startsWith("data: ")){try{r=JSON.parse(e.slice(6).trim())}catch{continue}if(r.sessionId){let e=N.current;if(N.current=r.sessionId,n&&!K.current&&r.sessionId!==e){K.current=!0;let e=new Date().toISOString(),s={id:r.sessionId,title:function(e){let t=e.trim();return t?t.length>30?t.slice(0,30):t:"New Session"}(n),createdAt:e,updatedAt:e};!function(e){let t=[e,...l().filter(t=>t.id!==e.id)].slice(0,10);localStorage.setItem(i,JSON.stringify(t))}(s),I(l()),R(r.sessionId),u(r.sessionId),t?.attachmentFilenames?.length&&p(r.sessionId,0,t.attachmentFilenames)}}switch(r.type){case"text_delta":{let e=E.current.filter(e=>e.id!==s);a?E.current=e.map(e=>e.id===a?{...e,content:e.content+(r.content??""),isStreaming:!0}:e):(a=f(),E.current=[...e,{id:a,role:"assistant",content:r.content??"",isStreaming:!0}]),O();break}case"text":{let e=E.current.filter(e=>e.id!==s);a?E.current=e.map(e=>e.id===a?{...e,content:r.content??e.content,isStreaming:!0}:e):(a=f(),E.current=[...e,{id:a,role:"assistant",content:r.content??"",isStreaming:!0}]),O();break}case"tool_start":{let e=E.current.filter(e=>e.id!==s);a?(E.current=e.map(e=>e.id===a?{...e,isStreaming:!1}:e),a=null):E.current=e,E.current=[...E.current,{id:f(),role:"tool",content:`Calling ${r.content??"tool"}...`,toolName:r.content,isStreaming:!0}],O();break}case"tool_use":{let e=E.current.filter(e=>e.id!==s),t=a?e.map(e=>e.id===a?{...e,isStreaming:!1}:e):e;a=null,E.current=[...t,{id:f(),role:"tool",content:JSON.stringify(r.toolInput??{},null,2),toolName:r.content}],O();break}case"tool_result":E.current=[...E.current,{id:f(),role:"tool",content:String(r.toolOutput??""),toolName:`${r.content??"tool"} (result)`}],O();break;case"error":E.current=[...E.current.filter(e=>e.id!==s),{id:f(),role:"assistant",content:`Error: ${r.content??"Unknown error"}`}],O(),j("error");break;case"done":a&&(E.current=E.current.map(e=>e.id===a?{...e,isStreaming:!1}:e)),E.current=E.current.filter(e=>e.id!==s),O(),j("idle")}}}}E.current=E.current.filter(e=>e.id!==s),O(),j(e=>"streaming"===e?"idle":e),z()}catch(e){if("AbortError"===e.name)return;E.current=[...E.current.filter(e=>e.id!==s),{id:f(),role:"assistant",content:`Connection error: ${e.message??"Unknown error"}`}],O(),j("error")}},[O,z]),q=(0,n.useCallback)(()=>{P.current?.abort(),P.current=null;let e=[...E.current].reverse().find(e=>"user"===e.role),t=e?.content??null;if(e){let t=E.current.lastIndexOf(e);E.current=E.current.slice(0,t),w([...E.current])}return j("idle"),t},[]),W=k[k.length-1],G="connecting"===S||"streaming"===S||W?.role==="thinking"&&!0===W.isStreaming;return(0,r.jsx)(d.Provider,{value:{isOpen:t,isStarting:m,displayMode:y,worktreePath:x,toggleAssistant:H,closeAssistant:V,chatMessages:k,chatStatus:S,isChatThinking:G,isLoadingHistory:C,sendChatMessage:J,cancelChat:q,sessions:A,activeSessionId:T,createNewSession:_,switchSession:$,removeSession:D,renameSession:U,refreshSessions:z},children:e})},"useAssistant",0,function(){let e=(0,n.useContext)(d);if(!e)throw Error("useAssistant must be used within an AssistantProvider");return e}],338187)},275360,e=>{"use strict";let t=(0,e.i(572989).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",0,t],275360)},431828,763131,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);e.s(["FolderGit2",0,r],431828);let n=(0,t.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",0,n],763131)},256753,e=>{"use strict";let t=(0,e.i(572989).default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,t],256753)},224277,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(977982),s=e.i(431828),a=e.i(763131),i=e.i(472074),o=e.i(738690),l=e.i(256753),c=e.i(275360),u=e.i(597746),d=e.i(657153),f=e.i(776639),h=e.i(519455),p=e.i(793479),m=e.i(746798),g=e.i(533499),y=e.i(759684);e.s(["FolderBrowserDialog",0,function({open:e,onOpenChange:b,onSelect:x,gitOnly:v=!1}){let{t:k}=(0,g.useI18n)(),[w,S]=(0,r.useState)(null),[j,C]=(0,r.useState)(!1),[M,E]=(0,r.useState)(null),[N,P]=(0,r.useState)(""),[A,I]=(0,r.useState)(""),[T,R]=(0,r.useState)(!1),K=(0,r.useRef)(null),[O,L]=(0,r.useState)(!1),[z,F]=(0,r.useState)(""),_=(0,r.useRef)(null),$=(0,r.useCallback)(async e=>{C(!0),E(null),I(""),R(!1);try{let t=e?`/api/browse-fs?path=${encodeURIComponent(e)}`:"/api/browse-fs",r=await fetch(t);if(!r.ok){let e=await r.json();E(e.error||"Failed");return}let n=await r.json();return S(n),P(n.currentPath),n}catch{E("Failed to browse filesystem")}finally{C(!1)}},[]);(0,r.useEffect)(()=>{e&&($().then(e=>{e?.isWindows&&R(!0)}),setTimeout(()=>K.current?.focus(),200))},[e,$]);let D=()=>{N.trim()&&$(N.trim())},U=async()=>{let e=z.trim();if(e&&w?.currentPath)try{let t=await fetch("/api/browse-fs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentPath:w.currentPath,name:e})});if(!t.ok){let e=await t.json();E(e.error||k("folder.newFolderError"));return}L(!1),F(""),$(w.currentPath)}catch{E(k("folder.newFolderError"))}},B=()=>{L(!1),F("")},V=w?.folders.filter(e=>e.name.toLowerCase().includes(A.toLowerCase()))??[];return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:b,children:(0,t.jsx)(f.DialogContent,{className:"p-0 gap-0",style:{maxWidth:"36rem",overflow:"hidden"},children:(0,t.jsxs)("div",{className:"flex flex-col max-h-[60vh] overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-5 pt-5 pb-3 shrink-0",children:[(0,t.jsx)(f.DialogTitle,{children:v?k("folder.selectGitRepo"):k("folder.selectFolder")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:k("folder.hint")})]}),(0,t.jsxs)("div",{className:"border-t border-border px-4 pt-3 pb-2 shrink-0",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("folder.manualInput")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(p.Input,{ref:K,value:N,onChange:e=>P(e.target.value),onKeyDown:e=>"Enter"===e.key&&D(),placeholder:"/path/to/your/project",title:N,className:"flex-1 min-w-0"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:D,className:"h-8 px-3 shrink-0",children:k("folder.goTo")})]})]}),(0,t.jsxs)("div",{className:"px-4 py-2 shrink-0",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("folder.searchDir")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsx)(o.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("input",{value:A,onChange:e=>I(e.target.value),placeholder:k("folder.filterPlaceholder"),className:"h-8 w-full rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 border-y border-border px-4 py-2 shrink-0 min-w-0",children:[(0,t.jsxs)(m.Tooltip,{children:[(0,t.jsx)(m.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{w?.isWindows?R(!0):w?.homePath&&$(w.homePath)},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(a.Home,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(m.TooltipContent,{side:"bottom",sideOffset:4,children:k("folder.home")})]}),(0,t.jsxs)(m.Tooltip,{children:[(0,t.jsx)(m.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{w&&("__DRIVES__"===w.parentPath?R(!0):(R(!1),$(w.parentPath)))},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(i.ChevronUp,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(m.TooltipContent,{side:"bottom",sideOffset:4,children:k("folder.parent")})]}),(0,t.jsxs)(m.Tooltip,{children:[(0,t.jsx)(m.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{L(!0),F(""),setTimeout(()=>_.current?.focus(),50)},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(c.FolderPlus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(m.TooltipContent,{side:"bottom",sideOffset:4,children:k("folder.newFolder")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground font-mono",title:w?.currentPath??"",children:w?.currentPath??"..."})]}),(0,t.jsxs)(y.ScrollArea,{className:"min-h-0 flex-1",children:[O&&(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/30 px-4 py-2",children:[(0,t.jsx)(n.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,t.jsx)("input",{ref:_,value:z,onChange:e=>F(e.target.value),onKeyDown:e=>{"Enter"===e.key&&U(),"Escape"===e.key&&B()},placeholder:k("folder.newFolderPlaceholder"),className:"h-7 flex-1 rounded-md border border-border bg-background px-2 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:U,disabled:!z.trim(),className:"text-emerald-400 hover:text-emerald-300",children:(0,t.jsx)(u.Check,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:B,className:"text-muted-foreground",children:(0,t.jsx)(d.X,{className:"h-3.5 w-3.5"})})]}),j&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}),M&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-rose-400",children:M}),T&&(!w?.drives||0===w.drives.length)&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-8 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:k("folder.noDrives")}),(0,t.jsxs)("span",{className:"text-[10px] opacity-60",children:[w?.diag??"old-build"," · platform=",w?.platform??"?"," · drives=",w?.drives?.length??0," · ",w?.currentPath??"?"]})]}),T&&w?.drives&&w.drives.map(e=>(0,t.jsxs)("button",{onClick:()=>{var t;return t=e.path,void(R(!1),$(t))},className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)(l.HardDrive,{className:"h-4 w-4 text-blue-400 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:e.name}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.path})]},e.path)),!T&&!j&&!M&&0===V.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:k("folder.empty")}),!T&&!j&&!M&&V.map(e=>(0,t.jsxs)("button",{onClick:()=>{e.isGit||v?(x(e.path),b(!1)):$(e.path)},onDoubleClick:()=>$(e.path),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[e.isGit?(0,t.jsx)(s.FolderGit2,{className:"h-4 w-4 text-emerald-400 shrink-0"}):(0,t.jsx)(n.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:e.name}),e.isGit&&(0,t.jsx)("span",{className:"shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 ring-1 ring-emerald-500/20",children:"git"})]},e.path))]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 shrink-0 border-t border-border",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>b(!1),children:k("common.cancel")}),(0,t.jsx)(h.Button,{onClick:()=>{w?.currentPath&&(x(w.currentPath),b(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:k("folder.selectPath")})]})]})})})}])},905455,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["SegmentedControl",0,function({options:e,value:n,onChange:s,className:a}){return(0,t.jsx)("div",{className:(0,r.cn)("inline-flex rounded-md border border-border bg-muted p-1 gap-1",a),children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>s(e.value),className:(0,r.cn)("rounded px-3 py-1 text-sm transition-colors",n===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}])},233274,e=>{"use strict";let t=(0,e.i(572989).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],233274)},65021,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60a292b7637bc9c6bbcf1e4b13a3eb2f18317daf40",t.callServer,void 0,t.findSourceMapURL,"analyzeProjectDirectory");e.s(["analyzeProjectDirectory",0,r])},174076,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40fb6f67ebac76ac251cbb28c80f7071af885e8214",t.callServer,void 0,t.findSourceMapURL,"createProject");e.s(["createProject",0,r])},469051,e=>{"use strict";let t=(0,e.i(572989).default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);e.s(["LayoutGrid",0,t],469051)},338271,289813,941068,e=>{"use strict";var t=e.i(965652);let r=e=>{let t,r=new Set,n=(e,n)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=n?n:"object"!=typeof s||null===s)?s:Object.assign({},t,s),r.forEach(r=>r(t,e))}},s=()=>t,a={setState:n,getState:s,getInitialState:()=>i,subscribe:e=>(r.add(e),()=>r.delete(e))},i=t=e(n,s,a);return a},n=e=>{let n=e?r(e):r,s=e=>(function(e,r=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>r(e.getState()),[e,r]),t.default.useCallback(()=>r(e.getInitialState()),[e,r]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(s,n),s},s=e=>e?n(e):n;e.s(["create",0,s],289813);let a=["Shift","Meta","Alt","Control"],i="object"==typeof navigator?navigator.platform:"",o=/Mac|iPod|iPhone|iPad/.test(i)?"Meta":"Control",l="Win32"===i?["Control","Alt"]:["Alt"];function c(e,t){return"function"==typeof e.getModifierState&&(e.getModifierState(t)||l.includes(t)&&e.getModifierState("AltGraph"))}function u(e){return e.trim().split(" ").map(e=>{let t=e.split(/(?<=\w|\])\+/),r=t.pop(),n=r.match(/^\((.+)\)$/),s=n?RegExp(`^(?:${n[1]})$`,"iv"):r,a=[],i=[];for(let e of t){let t=e.match(/^\[(.*)\]$/),r=t?.[1]??e;r="$mod"===r?o:r,t?i.push(r):a.push(r)}return[a,i,s]})}e.s(["matchKeybindingPress",0,function(e,[t,r,n]){let s=t.includes("AltGraph");return!((n instanceof RegExp?!(n.test(e.key)||n.test(e.code)):n.toUpperCase()!==e.key.toUpperCase()&&n!==e.code)||t.find(t=>!c(e,t))||a.find(a=>!t.includes(a)&&!r.includes(a)&&n!==a&&c(e,a)&&!(s&&l.includes(a))))},"parseKeybinding",0,u],941068);let d=0,f=0,h=s(e=>({entries:new Map,register:t=>{var r;let n=(d+=1,`sc_${d}`);f+=1;let s=Array.isArray(r=t.keys)?[...r]:[r],a={...t,id:n,keys:s,presses:s.map(e=>u(e)),seq:f};return e(e=>{let t=new Map(e.entries);return t.set(n,a),{entries:t}}),n},unregister:t=>{e(e=>{if(!e.entries.has(t))return e;let r=new Map(e.entries);return r.delete(t),{entries:r}})}}));e.s(["selectAllShortcuts",0,function(e){return Array.from(e.entries.values())},"useShortcutStore",0,h],338271)},889383,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(338271),s=e.i(941068);function a(e){return(e.priority??0)+1e3*("global"!==e.scope)}e.s(["ShortcutProvider",0,function({children:e}){return(0,r.useEffect)(()=>{function e(e){let t=(0,n.selectAllShortcuts)(n.useShortcutStore.getState());if(0===t.length)return;let r=function(e,t,r){let n=[];for(let a of e){if(a.when&&!1===a.when())continue;let e=null;for(let r of a.presses){if(1!==r.length)continue;let n=r[0];if((0,s.matchKeybindingPress)(t,n)){e=n;break}}if(e){if(r){if(function(e){let[t]=e;return t.some(e=>"Control"===e||"Meta"===e||"Alt"===e)}(e)){if(!1===a.allowInInput)continue}else if(!a.allowInInput)continue}n.push(a)}}return 0===n.length?null:(n.sort((e,t)=>{let r=a(e),n=a(t);return r!==n?n-r:t.seq-e.seq}),n[0])}(t,e,function(e){if(!e)return!1;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||!0===e.isContentEditable}(document.activeElement));r&&(!1!==r.preventDefault&&e.preventDefault(),e.stopPropagation(),r.handler(e))}return window.addEventListener("keydown",e,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0})}},[]),(0,t.jsx)(t.Fragment,{children:e})}],889383)},454711,e=>{"use strict";var t=e.i(965652),r=e.i(338271);e.s(["useShortcut",0,function(...e){let n=function(e){let t=e[0];if("string"==typeof t||Array.isArray(t))return Array.isArray(t)&&t.length>0&&"string"!=typeof t[0]?t:[{keys:t,handler:e[1],...e[2]??{}}];return[t]}(e),s=(0,t.useRef)(n);(0,t.useEffect)(()=>{s.current=n});let a=(0,r.useShortcutStore)(e=>e.register),i=(0,r.useShortcutStore)(e=>e.unregister),o=JSON.stringify(n.map(e=>({keys:e.keys,scope:e.scope,description:e.description,group:e.group,allowInInput:e.allowInInput,preventDefault:e.preventDefault,priority:e.priority,hidden:e.hidden,hasWhen:"function"==typeof e.when})));(0,t.useEffect)(()=>{let e=s.current.map((e,t)=>a({...e,handler:e=>s.current[t]?.handler(e),when:e.when?()=>s.current[t]?.when?.()??!0:void 0}));return()=>{for(let t of e)i(t)}},[o,a,i])}])},743059,e=>{"use strict";var t=e.i(338271);function r(){if("u"<typeof navigator)return!1;let e=navigator.userAgentData?.platform;return/mac/i.test(e??navigator.userAgent??"")}let n={ArrowLeft:"←",ArrowRight:"→",ArrowUp:"↑",ArrowDown:"↓"};function s(e){let t=r();return e.split("+").map(e=>(function(e,t){switch(e){case"$mod":case"Meta":return t?"⌘":"Ctrl";case"Control":return"Ctrl";case"Alt":return t?"⌥":"Alt";case"Shift":return"⇧";case"Escape":return"Esc";case"Enter":return"↵";case"Tab":return"Tab";default:if(/^Digit[0-9]$/.test(e))return e.slice(5);return n[e]??e}})(e,t))}function a(e){return e.map(e=>s(e).join("+"))}e.s(["compactKeyList",0,function(e){if(e.length<3)return e;let t=e.map(e=>{let t=/^(.*?)(?:Digit)?([1-9])$/.exec(e);return t?{prefix:t[1],digit:Number(t[2])}:null});if(t.some(e=>null===e))return e;let r=t[0].prefix;return t.every(e=>e.prefix===r)&&t.every((e,t)=>e.digit===t+1)?[`${r}1–${t[t.length-1].digit}`]:e},"isMac",0,r,"renderComboTokens",0,s,"renderKeys",0,a,"useShortcutHelp",0,function(){let e=(0,t.useShortcutStore)(t.selectAllShortcuts),r=new Map;for(let t of e){if(t.hidden)continue;let e=t.group??t.scope??"global",n=r.get(e);n?n.push(t):r.set(e,[t])}return{groups:Array.from(r.entries()).map(([e,t])=>({title:e,shortcuts:t})),renderKeys:a}}])},371385,75566,841359,e=>{"use strict";let t=[{id:"global.search",defaultKeys:["$mod+k"],descriptionKey:"shortcuts.search",group:"global",scope:"global",configurable:!0},{id:"global.commandPalette",defaultKeys:["$mod+p"],descriptionKey:"shortcuts.commandPalette",group:"global",scope:"global",configurable:!0},{id:"global.help",defaultKeys:["$mod+/","?"],descriptionKey:"shortcuts.openHelp",group:"global",scope:"global",configurable:!0},{id:"global.assistant",defaultKeys:["$mod+l"],descriptionKey:"shortcuts.assistant",group:"global",scope:"global",configurable:!0},{id:"global.gotoWorkspace",defaultKeys:["Alt+Digit1","Alt+Digit2","Alt+Digit3","Alt+Digit4","Alt+Digit5","Alt+Digit6","Alt+Digit7","Alt+Digit8","Alt+Digit9"],descriptionKey:"shortcuts.gotoWorkspace",group:"global",scope:"global",configurable:!1,allowInInput:!0},{id:"panels.taskManager",defaultKeys:["$mod+Control+j"],descriptionKey:"shortcuts.panels.taskManager",group:"panels",scope:"global",configurable:!0},{id:"panels.assets",defaultKeys:["$mod+Control+k"],descriptionKey:"shortcuts.panels.assets",group:"panels",scope:"global",configurable:!0},{id:"panels.notes",defaultKeys:["$mod+Control+l"],descriptionKey:"shortcuts.panels.notes",group:"panels",scope:"global",configurable:!0},{id:"panels.archive",defaultKeys:["$mod+Control+;"],descriptionKey:"shortcuts.panels.archive",group:"panels",scope:"global",configurable:!0},{id:"missions.exit",defaultKeys:["Control+;"],descriptionKey:"shortcuts.missions.exitToNav",group:"missions",scope:"missions",configurable:!0,allowInInput:!0},{id:"missions.jump",defaultKeys:["1","2","3","4","5","6","7","8","9"],descriptionKey:"shortcuts.missions.jump",group:"missions",scope:"missions",configurable:!1},{id:"missions.moveSelection",defaultKeys:["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],descriptionKey:"shortcuts.missions.moveSel",group:"missions",scope:"missions",configurable:!1},{id:"missions.cycle",defaultKeys:["Tab"],descriptionKey:"shortcuts.missions.cyclePane",group:"missions",scope:"missions",configurable:!1},{id:"missions.cycleBack",defaultKeys:["Shift+Tab"],descriptionKey:"shortcuts.missions.cyclePane",group:"missions",scope:"missions",configurable:!1},{id:"missions.focus",defaultKeys:["Enter"],descriptionKey:"shortcuts.missions.focusSel",group:"missions",scope:"missions",configurable:!1},{id:"missions.next",defaultKeys:["$mod+ArrowRight"],descriptionKey:"shortcuts.missions.nextPane",group:"missions",scope:"missions",configurable:!0,allowInInput:!0},{id:"missions.prev",defaultKeys:["$mod+ArrowLeft"],descriptionKey:"shortcuts.missions.prevPane",group:"missions",scope:"missions",configurable:!0,allowInInput:!0}],r=new Map(t.map(e=>[e.id,e]));function n(e){let t=r.get(e);if(!t)throw Error(`Unknown shortcut action: ${e}`);return t}e.s(["SHORTCUT_ACTIONS",0,t,"getAction",0,n],371385);var s=e.i(289813);let a="tower-keymap-overrides";function i(e){try{window.localStorage.setItem(a,JSON.stringify(e))}catch{}}function o(e,t){return e[t]??[...n(t).defaultKeys]}let l=(0,s.create)((e,t)=>({overrides:function(){try{let e=window.localStorage.getItem(a);if(!e)return{};let t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t))return t;return{}}catch{return{}}}(),setBinding:(t,r)=>e(e=>{let n={...e.overrides,[t]:r};return i(n),{overrides:n}}),resetBinding:t=>e(e=>{if(!(t in e.overrides))return e;let r={...e.overrides};return delete r[t],i(r),{overrides:r}}),resetAll:()=>{i({}),e({overrides:{}})},resolveKeys:e=>o(t().overrides,e)}));e.s(["resolveKeysFrom",0,o,"useKeymapStore",0,l],75566);var c=e.i(533499),u=e.i(454711);function d(e){return l(t=>t.overrides[e])??[...n(e).defaultKeys]}e.s(["useActionShortcut",0,function(e,t,r){let s=n(e),a=d(e),{t:i}=(0,c.useI18n)();(0,u.useShortcut)(a,t,{scope:s.scope,description:i(s.descriptionKey),group:i(`shortcuts.group.${s.group}`),allowInInput:s.allowInInput,...r})},"useResolvedKeys",0,d],841359)},508271,158956,e=>{"use strict";e.i(889383),e.i(454711);var t=e.i(743059);e.i(338271),e.i(371385),e.i(841359),e.s(["serializeKeyEvent",0,function(e){let{key:r}=e;if("Control"===r||"Shift"===r||"Alt"===r||"Meta"===r)return null;let n=(0,t.isMac)(),s=[];return(n?e.metaKey:e.ctrlKey)&&s.push("$mod"),(n?e.ctrlKey:e.metaKey)&&s.push(n?"Control":"Meta"),e.altKey&&s.push("Alt"),e.shiftKey&&s.push("Shift"),s.push(1===r.length&&/[a-zA-Z]/.test(r)?r.toLowerCase():r),s.join("+")}],158956),e.i(75566),e.s([],508271)},773535,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("6086ca5502a7fc3a40c487b758649db2e2ecd161d2",t.callServer,void 0,t.findSourceMapURL,"getConfigValue");e.s(["getConfigValue",0,r])},59737,e=>{"use strict";let t=(0,e.i(572989).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",0,t])},977982,472074,e=>{"use strict";let t=(0,e.i(572989).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],977982);var r=e.i(792566);e.s(["ChevronUp",()=>r.default],472074)},194358,e=>{"use strict";let t=(0,e.i(572989).default)("refresh-cw",[["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"}]]);e.s(["RefreshCw",0,t],194358)},567098,e=>{"use strict";let t=(0,e.i(572989).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},770303,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(514798);let s=(0,n.createServerReference)("40d0968e9fa1c8b754c9e9def91c0a2c07f3003abd",n.callServer,void 0,n.findSourceMapURL,"checkExtension");var a=e.i(225499);let i=(0,n.createServerReference)("40384d46b1738e8f02779aaf2987bcaf1b7f85734c",n.callServer,void 0,n.findSourceMapURL,"uninstallExtension");var o=e.i(887911);let l={installed:!1},c=(0,r.createContext)(null);e.s(["ExtensionContext",0,c,"ExtensionProvider",0,function({children:e,initialStatus:n}){let[u,d]=(0,r.useState)(()=>n??Object.fromEntries((0,o.listExtensionMetadata)().map(e=>[e.id,l]))),[f,h]=(0,r.useState)(new Set),p=(0,r.useRef)(new Set),m=(0,r.useCallback)(async e=>{let t=await s(e);d(r=>({...r,[e]:t}))},[]),g=(0,r.useCallback)(async e=>{if(p.current.has(e))return{success:!1,error:"install already in progress"};p.current.add(e),h(t=>{let r=new Set(t);return r.add(e),r});try{let t=await (0,a.installExtension)(e);return t.success&&await m(e),t}finally{p.current.delete(e),h(t=>{let r=new Set(t);return r.delete(e),r})}},[m]),y=(0,r.useCallback)(async e=>{if(p.current.has(e))return{success:!1,error:"operation already in progress"};p.current.add(e),h(t=>{let r=new Set(t);return r.add(e),r});try{let t=await i(e);return t.success&&await m(e),t}finally{p.current.delete(e),h(t=>{let r=new Set(t);return r.delete(e),r})}},[m]),b=(0,r.useMemo)(()=>({statusMap:u,loading:!1,installing:f,refresh:m,install:g,uninstall:y}),[u,f,m,g,y]);return(0,t.jsx)(c.Provider,{value:b,children:e})}],770303)},360325,e=>{"use strict";let t=(0,e.i(572989).default)("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);e.s(["Keyboard",0,t],360325)},386343,125177,851289,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,r],386343);let n=(0,t.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);e.s(["Bell",0,n],125177);var s=e.i(289721),a=e.i(965652);e.i(508271);var i=e.i(743059),o=e.i(975157);function l({children:e}){return(0,s.jsx)("kbd",{className:(0,o.cn)("inline-flex min-w-[1.5rem] items-center justify-center rounded-md","border border-border bg-muted px-1.5 py-0.5","text-[11px] font-medium leading-none text-foreground","shadow-[inset_0_-1px_0_var(--border)]"),children:e})}e.s(["KeyCombo",0,function({keys:e}){let t=(0,i.compactKeyList)(e);return(0,s.jsx)("span",{className:"inline-flex flex-wrap items-center gap-1.5",children:t.map((e,t)=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1",children:[t>0&&(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground/40",children:"/"}),(0,i.renderComboTokens)(e).map((e,t)=>(0,s.jsxs)(a.Fragment,{children:[t>0&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground/60",children:"+"}),(0,s.jsx)(l,{children:e})]},t))]},`${e}-${t}`))})}],851289)},243288,e=>{e.v(t=>Promise.all(["static/chunks/0u~0j4_f3gwi2.js","static/chunks/0ep-qrl_zzch8.js","static/chunks/03tc~x4m3si-p.js","static/chunks/17oc2l.ekcs8b.css"].map(t=>e.l(t))).then(()=>t(346069)))},427768,e=>{e.v(t=>Promise.all(["static/chunks/050agjgyp545k.js","static/chunks/0o6zqtzz_7ysr.js"].map(t=>e.l(t))).then(()=>t(103363)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56978,e=>{"use strict";var c=e.i(514798);let r=(0,c.createServerReference)("403e249332bbafc27c9bd0589236bf3e4c6d842ee8",c.callServer,void 0,c.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,r])}]);