tower-studio 0.2.36 → 0.2.38

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 (206) 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 +26 -26
  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 +61 -61
  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 +26 -26
  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 +26 -26
  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 +43 -43
  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 +97 -97
  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 +84 -84
  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 +71 -71
  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 +72 -72
  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 +26 -26
  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 +70 -70
  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 +81 -81
  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 +46 -46
  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]__05nz.tg._.js +1 -1
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qif839._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~foo~5._.js +1 -1
  89. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  91. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-tolks._.js +2 -2
  92. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__046-2.-._.js +3 -0
  93. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0bsx096._.js → [root-of-the-server]__04p5fnx._.js} +2 -2
  94. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05sv58d._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__062b.yt._.js +2 -2
  97. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__093tt4a._.js +2 -2
  98. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bgr0ql._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0pa9_bd._.js → [root-of-the-server]__0dixwk_._.js} +2 -2
  100. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0guqcva._.js +2 -2
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gzafdq._.js +1 -1
  102. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vv4hxw._.js → [root-of-the-server]__0i97rbw._.js} +2 -2
  103. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__13~k9z5._.js → [root-of-the-server]__0mbvmq1._.js} +2 -2
  105. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p0te97._.js +2 -2
  106. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0iatlhd._.js → [root-of-the-server]__0rlar2j._.js} +2 -2
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0siyg1p._.js +2 -2
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t6f4lq._.js +2 -2
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0th-t1a._.js +2 -2
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/_00t6138._.js +2 -2
  113. package/.next/standalone/.next/server/chunks/ssr/{_0mhdb-a._.js → _00vn2qb._.js} +2 -2
  114. package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
  115. package/.next/standalone/.next/server/chunks/ssr/_07_.oek._.js +3 -0
  116. package/.next/standalone/.next/server/chunks/ssr/{_0zidle2._.js → _09j.h2h._.js} +2 -2
  117. package/.next/standalone/.next/server/chunks/ssr/_09ri_be._.js +3 -0
  118. package/.next/standalone/.next/server/chunks/ssr/_0_q.4.i._.js +3 -0
  119. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/_0cxhub8._.js +2 -2
  121. package/.next/standalone/.next/server/chunks/ssr/{_0ebel46._.js → _0ght75u._.js} +2 -2
  122. package/.next/standalone/.next/server/chunks/ssr/_0hh17jg._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/ssr/{_0izxa9k._.js → _0j84cn0._.js} +2 -2
  124. package/.next/standalone/.next/server/chunks/ssr/_0mpce0d._.js +2 -2
  125. package/.next/standalone/.next/server/chunks/ssr/_0muaopo._.js +2 -2
  126. package/.next/standalone/.next/server/chunks/ssr/_0n1l7yo._.js +2 -2
  127. package/.next/standalone/.next/server/chunks/ssr/_0nk7qd4._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/_0no6nrx._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ssr/{_0xx4aa5._.js → _0qkt.3y._.js} +2 -2
  130. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/{_0jf91oa._.js → _0t53a7_._.js} +3 -3
  132. package/.next/standalone/.next/server/chunks/ssr/_0vqyl_~._.js +3 -0
  133. package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/{_0soj-y2._.js → _13glpna._.js} +2 -2
  135. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +1 -1
  147. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  148. package/.next/standalone/.next/server/pages/500.html +1 -1
  149. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/server-reference-manifest.json +215 -215
  151. package/.next/standalone/.next/static/chunks/0.nk_89kz3j6c.js +1 -0
  152. package/.next/standalone/.next/static/chunks/01.g0gvh6h11a.js +2 -0
  153. package/.next/standalone/.next/static/chunks/03zzmb3y7kpxl.js +1 -0
  154. package/.next/standalone/.next/static/chunks/04t77qlr4-sw7.js +1 -0
  155. package/.next/standalone/.next/static/chunks/097rglx2_e2oo.js +1 -0
  156. package/.next/standalone/.next/static/chunks/{0xy8x3-.0bopl.js → 0a234qgxmvbfu.js} +1 -1
  157. package/.next/standalone/.next/static/chunks/{01tsz1~lswudb.js → 0bsigqvr2-qcp.js} +1 -1
  158. package/.next/standalone/.next/static/chunks/{0m_l01d2lzffq.js → 0c0u4it7gyb1..js} +1 -1
  159. package/.next/standalone/.next/static/chunks/0dt3ljzz2pz0r.css +1 -0
  160. package/.next/standalone/.next/static/chunks/{188_7xt~9qo5z.js → 0jlzko424.5et.js} +1 -1
  161. package/.next/standalone/.next/static/chunks/{0xc5b.xin3frr.js → 0khxfvo-tgpbc.js} +1 -1
  162. package/.next/standalone/.next/static/chunks/0nfwp8f87wok1.js +1 -0
  163. package/.next/standalone/.next/static/chunks/0qu5zm6k.e_de.js +5 -0
  164. package/.next/standalone/.next/static/chunks/0rbykdrqih-0t.js +1 -0
  165. package/.next/standalone/.next/static/chunks/{0n9bv.-ktyu9g.js → 0w7_~s93hxxkk.js} +1 -1
  166. package/.next/standalone/.next/static/chunks/0wbzgoyu4~g4x.js +1 -0
  167. package/.next/standalone/.next/static/chunks/{0odml~1zfmatg.js → 0yl2smjfz2bzk.js} +1 -1
  168. package/.next/standalone/.next/static/chunks/{06pdwir_r4uhn.js → 10q75vl~mg7vy.js} +1 -1
  169. package/.next/standalone/.next/static/chunks/11pivwhywsmj9.js +1 -0
  170. package/.next/standalone/.next/static/chunks/{0m5kd96epukmx.js → 13ipvyn1q8z4y.js} +1 -1
  171. package/.next/standalone/.next/static/chunks/13qts-1uv7-ee.js +1 -0
  172. package/.next/standalone/.next/static/chunks/14bii1nj2yewi.js +1 -0
  173. package/.next/standalone/.next/static/chunks/14man4i21otxe.js +1 -0
  174. package/.next/standalone/.next/static/chunks/{0p0_.0f~k5o3x.js → 151eqj4g7bidp.js} +1 -1
  175. package/.next/standalone/.next/static/chunks/15_ulpp1r-6ra.js +1 -0
  176. package/.next/standalone/.next/static/chunks/15~2jg4z8h54~.js +1 -0
  177. package/.next/standalone/.next/static/chunks/{02_isu4z4lk1~.js → 17ldo-bezxis..js} +1 -1
  178. package/.next/standalone/.next/static/chunks/{0ntang9wkuj-8.js → 183k6undfylp5.js} +1 -1
  179. package/.next/standalone/package.json +2 -2
  180. package/package.json +2 -2
  181. package/scripts/migrations/0002-backfill-done-at.ts +29 -0
  182. package/skills/tower/SKILL.md +81 -2
  183. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10xjtl0._.js +0 -3
  184. package/.next/standalone/.next/server/chunks/ssr/_0.7vx4q._.js +0 -3
  185. package/.next/standalone/.next/server/chunks/ssr/_0gc019m._.js +0 -3
  186. package/.next/standalone/.next/server/chunks/ssr/_0m_1ssw._.js +0 -3
  187. package/.next/standalone/.next/server/chunks/ssr/_0nghgzi._.js +0 -3
  188. package/.next/standalone/.next/server/chunks/ssr/_0reranf._.js +0 -3
  189. package/.next/standalone/.next/static/chunks/0-fc2i1mw_t-2.js +0 -2
  190. package/.next/standalone/.next/static/chunks/0.7r6od5..1~d.css +0 -1
  191. package/.next/standalone/.next/static/chunks/0.duc36elgwmt.js +0 -1
  192. package/.next/standalone/.next/static/chunks/093zwcwn8el.s.js +0 -1
  193. package/.next/standalone/.next/static/chunks/0gx4n5njdyksz.js +0 -1
  194. package/.next/standalone/.next/static/chunks/0l49-stccar4a.js +0 -1
  195. package/.next/standalone/.next/static/chunks/0l~z-vsf.633k.js +0 -5
  196. package/.next/standalone/.next/static/chunks/0m_9-3_hpbfly.js +0 -1
  197. package/.next/standalone/.next/static/chunks/0sm78n1ikzixj.js +0 -1
  198. package/.next/standalone/.next/static/chunks/0v73i.x591~km.js +0 -1
  199. package/.next/standalone/.next/static/chunks/0wkd~xb2skr1g.js +0 -1
  200. package/.next/standalone/.next/static/chunks/0xyj_-7b.4l1l.js +0 -1
  201. package/.next/standalone/.next/static/chunks/10f-2fo.qg504.js +0 -1
  202. package/.next/standalone/.next/static/chunks/11p_dl5tngif4.js +0 -1
  203. package/.next/standalone/.next/static/chunks/153-zn4e8fta1.js +0 -1
  204. /package/.next/standalone/.next/static/{SCktqI1yaRGMJYovFwj4q → 08PQLn-tnfP4XX6HBzxZ7}/_buildManifest.js +0 -0
  205. /package/.next/standalone/.next/static/{SCktqI1yaRGMJYovFwj4q → 08PQLn-tnfP4XX6HBzxZ7}/_clientMiddlewareManifest.js +0 -0
  206. /package/.next/standalone/.next/static/{SCktqI1yaRGMJYovFwj4q → 08PQLn-tnfP4XX6HBzxZ7}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,715443,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("4044480c2820912250aa5e72984e1e2006506180c4",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,s])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},487486,e=>{"use strict";var t=e.i(565455),s=e.i(581263),r=e.i(294237),i=e.i(975157);let n=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:a,...o}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(n({variant:r}),e)},o),render:a,state:{slot:"badge",variant:r}},(0,s.useRenderElement)(l.defaultTagName??"div",l,l)}],487486)},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:r,description:i,action:n,className:a}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",a),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:r}),i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:i}),n&&(0,t.jsx)("div",{className:"mt-2",children:n})]})}])},52741,711352,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40abfe70a3623ef00cf758e9e7cee6754bb8472af0",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,s],52741);let r=(0,t.createServerReference)("60e36e14585f0c7db20e4e4a22c1130d5a951c8208",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,r],711352)},933318,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7cfaa9a0379e65ef57f4fbea360fffc99b5913feb6",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,s])},169751,e=>{"use strict";function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}function s(e){return null==e?"":function(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function r(e){return"string"==typeof e}function i(e){return"number"==typeof e}function n(e){return"object"==typeof e}function a(e){return null!=e}function o(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let u=Object.prototype.hasOwnProperty;class c{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let s=d(e);this._keys.push(s),this._keyMap[s.id]=s,t+=s.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(e){let s=null,i=null,n=null,a=1,o=null;if(r(e)||t(e))n=e,s=h(e),i=m(e);else{if(!u.call(e,"name"))throw Error("Missing name property in key");let t=e.name;if(n=t,u.call(e,"weight")&&(a=e.weight)<=0)throw Error(`Property 'weight' in key '${t}' must be a positive integer`);s=h(t),i=m(t),o=e.getFn}return{path:s,id:i,weight:a,src:n,getFn:o}}function h(e){return t(e)?e:e.split(".")}function m(e){return t(e)?e.join("."):e}let f=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,useTokenSearch:!1,getFn:function(e,o){let u=[],c=!1,d=(e,o,h,m)=>{if(a(e))if(o[h]){var f,x;let g=e[o[h]];if(!a(g))return;if(h===o.length-1&&(r(g)||i(g)||!0===(f=g)||!1===f||n(x=f)&&null!==x&&"[object Boolean]"==l(f)||"bigint"==typeof g))u.push(void 0!==m?{v:s(g),i:m}:s(g));else if(t(g)){c=!0;for(let e=0,t=g.length;e<t;e+=1)d(g[e],o,h+1,e)}else o.length&&d(g,o,h+1,m)}else u.push(void 0!==m?{v:e,i:m}:e)};return d(e,r(o)?o.split("."):o,0),c?u:u[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}),x=/[^ ]+/g;class g{constructor({getFn:e=f.getFn,fieldNormWeight:t=f.fieldNormWeight}={}){this.norm=function(e=1,t=3){let s=new Map,r=Math.pow(10,t);return{get(t){let i=t.match(x).length;if(s.has(i))return s.get(i);let n=parseFloat(Math.round(1/Math.pow(i,.5*e)*r)/r);return s.set(i,n),n},clear(){s.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,r(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();r(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t<s;t+=1)this.records[t].i-=1}removeAll(e){for(let t=e.length-1;t>=0;t-=1)this.records.splice(e[t],1);for(let e=0,t=this.records.length;e<t;e+=1)this.records[e].i=e}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!a(e)||o(e))return;let s={v:e,i:t,n:this.norm.get(e)};this.records.push(s)}_addObject(e,i){let n={i:i,$:{}};this.keys.forEach((i,l)=>{let u=i.getFn?i.getFn(e):this.getFn(e,i.path);if(a(u)){if(t(u)){let e=[];for(let t=0,i=u.length;t<i;t+=1){let i=u[t];if(a(i)){if(r(i)){if(!o(i)){let s={v:i,i:t,n:this.norm.get(i)};e.push(s)}}else if(a(i.v)){let t=r(i.v)?i.v:s(i.v);if(!o(t)){let s={v:t,i:i.i,n:this.norm.get(t)};e.push(s)}}}}n.$[l]=e}else if(r(u)&&!o(u)){let e={v:u,n:this.norm.get(u)};n.$[l]=e}}}),this.records.push(n)}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function p(e,t,{getFn:s=f.getFn,fieldNormWeight:r=f.fieldNormWeight}={}){let i=new g({getFn:s,fieldNormWeight:r});return i.setKeys(e.map(d)),i.setSources(t),i.create(),i}function v(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let s=1,r=e.length;s<r;s+=1){let r=t[t.length-1],i=e[s];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}let b={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},y=RegExp("["+Object.keys(b).join("")+"]","g"),k=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(y,e=>b[e]):e=>e;class C{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:u=f.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:u},e=o?e:e.toLowerCase(),e=l?k(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(e,t)=>{this.chunks.push({pattern:e,alphabet:function(e){let t={};for(let s=0,r=e.length;s<r;s+=1){let i=e.charAt(s);t[i]=(t[i]||0)|1<<r-s-1}return t}(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,s=d-t;for(;e<s;)c(this.pattern.substr(e,32),e),e+=32;if(t){const e=d-32;c(this.pattern.substr(e),e)}}else c(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:s,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=s?k(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,ignoreLocation:u}=this.options,c=[],d=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:s,startIndex:m})=>{let{isMatch:x,score:g,indices:p}=function(e,t,s,{location:r=f.location,distance:i=f.distance,threshold:n=f.threshold,findAllMatches:a=f.findAllMatches,minMatchCharLength:o=f.minMatchCharLength,includeMatches:l=f.includeMatches,ignoreLocation:u=f.ignoreLocation}={}){let c;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let d=t.length,h=e.length,m=Math.max(0,Math.min(r,h)),x=n,g=m,p=(e,t)=>{let s=e/d;if(u)return s;let r=Math.abs(m-t);return i?s+r/i:r?1:s},v=o>1||l,b=v?Array(h):[];for(;(c=e.indexOf(t,g))>-1;)if(x=Math.min(p(0,c),x),g=c+d,v){let e=0;for(;e<d;)b[c+e]=1,e+=1}g=-1;let y=[],k=1,C=d+h,j=1<<d-1;for(let t=0;t<d;t+=1){let r=0,i=C;for(;r<i;)p(t,m+i)<=x?r=i:C=i,i=Math.floor((C-r)/2+r);C=i;let n=Math.max(1,m-i+1),o=a?h:Math.min(m+i,h)+d,l=Array(o+2);l[o+1]=(1<<t)-1;for(let r=o;r>=n;r-=1){let i=r-1,a=s[e[i]];if(v&&(b[i]=+!!a),l[r]=(l[r+1]<<1|1)&a,t&&(l[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),l[r]&j&&(k=p(t,i))<=x){if(x=k,(g=i)<=m)break;n=Math.max(1,2*m-g)}}if(p(t+1,m)>x)break;y=l}let A={isMatch:g>=0,score:Math.max(.001,k)};if(v){let e=function(e=[],t=f.minMatchCharLength){let s=[],r=-1,i=-1,n=0;for(let a=e.length;n<a;n+=1){let a=e[n];a&&-1===r?r=n:a||-1===r||((i=n-1)-r+1>=t&&s.push([r,i]),r=-1)}return e[n-1]&&n-r>=t&&s.push([r,n-1]),s}(b,o);e.length?l&&(A.indices=e):A.isMatch=!1}return A}(e,t,s,{location:i+m,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,includeMatches:r,ignoreLocation:u});x&&(h=!0),d+=g,x&&p&&c.push(...p)});let m={isMatch:h,score:h?d/this.chunks.length:1};return h&&r&&(m.indices=v(c)),m}}class j{constructor(e){this.pattern=e}static isMultiMatch(e){return A(e,this.multiRegex)}static isSingleMatch(e){return A(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function A(e,t){let s=e.match(t);return s?s[1]:null}class w extends j{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:u=f.ignoreLocation}={}){super(e),this._bitapSearch=new C(e,{location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class S extends j{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,s=0,r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,s))>-1;)s=t+i,r.push([t,s-1]);let n=!!r.length;return{isMatch:n,score:+!n,indices:r}}}let N=[class extends j{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},S,class extends j{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},w],E=N.length,I=new Set([w.type,S.type]),M=[];function D(...e){M.push(...e)}function B(e,t){for(let s=0,r=M.length;s<r;s+=1){let r=M[s];if(r.condition(e,t))return new r(e,t)}return new C(e,t)}let R="$and",_="$path",F=e=>!!(e[R]||e.$or),T=e=>({[R]:Object.keys(e).map(t=>({[t]:e[t]}))});function L(e,s,{auto:i=!0}={}){let a=e=>{if(r(e)){let t={keyId:null,pattern:e};return i&&(t.searcher=B(e,s)),t}let o=Object.keys(e),l=!!e[_];if(!l&&o.length>1&&!F(e))return a(T(e));if(!t(e)&&n(e)&&!F(e)){let t=l?e[_]:o[0],n=l?e.$val:e[t];if(!r(n))throw Error(`Invalid value for key ${t}`);let a={keyId:m(t),pattern:n};return i&&(a.searcher=B(n,s)),a}let u={children:[],operator:o[0]};return o.forEach(s=>{let r=e[s];t(r)&&r.forEach(e=>{u.children.push(a(e))})}),u};return F(e)||(e=T(e)),a(e)}function $(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){let s=1;return e.forEach(({key:e,norm:r,score:i})=>{let n=e?e.weight:null;s*=Math.pow(0===i&&n?Number.EPSILON:i,(n||1)*(t?1:r))}),s}class O{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let s=e-1>>1;if(t[e].score<=t[s].score)break;let r=t[e];t[e]=t[s],t[s]=r,e=s}}_sinkDown(e){let t=this.heap,s=t.length,r=e;do{let i=2*(e=r)+1,n=2*e+2;if(i<s&&t[i].score>t[r].score&&(r=i),n<s&&t[n].score>t[r].score&&(r=n),r!==e){let s=t[e];t[e]=t[r],t[r]=s}}while(r!==e)}}function P(e,t){let s=e.matches;t.matches=[],a(s)&&s.forEach(e=>{if(!a(e.indices)||!e.indices.length)return;let{indices:s,value:r}=e,i={indices:s,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function z(e,t){t.score=e.score}let W=/\b\w+\b/g;function H({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize:s=>(e||(s=s.toLowerCase()),t&&(s=k(s)),s.match(W)||[])}}function V(e,t){for(let[s,r]of e.terms){let i=r.filter(e=>e.docIdx!==t),n=r.length-i.length;n>0&&(e.fieldCount-=n,e.df.set(s,(e.df.get(s)||0)-n),0===i.length?(e.terms.delete(s),e.df.delete(s)):e.terms.set(s,i))}}class U{constructor(e,t,s){this.options={...f,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new c(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,s),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=B(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof g))throw Error("Incorrect 'index' type");if(this._myIndex=t||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(e,t,s){let r=new Map,i=new Map,n=0;function a(e,t,a,o){let l=s.tokenize(e);if(!l.length)return;n++;let u=new Map;for(let e of l)u.set(e,(u.get(e)||0)+1);for(let[e,s]of u){let n={docIdx:t,keyIdx:a,subIdx:o,tf:s},l=r.get(e);l||(l=[],r.set(e,l)),l.push(n),i.set(e,(i.get(e)||0)+1)}}for(let s of e){let{i:e,v:r,$:i}=s;if(void 0!==r){a(r,e,-1,-1);continue}if(i)for(let s=0;s<t;s++){let t=i[s];if(t)if(Array.isArray(t))for(let r of t)a(r.v,e,s,r.i??-1);else a(t.v,e,s,-1)}}return{terms:r,fieldCount:n,df:i}}(this._myIndex.records,this._myIndex.keys.length,e)}}add(e){if(a(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){let e=this._myIndex.records[this._myIndex.records.length-1],t=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});!function(e,t,s,r){let{i:i,v:n,$:a}=t;function o(t,s,n){let a=r.tokenize(t);if(!a.length)return;e.fieldCount++;let o=new Map;for(let e of a)o.set(e,(o.get(e)||0)+1);for(let[t,r]of o){let a={docIdx:i,keyIdx:s,subIdx:n,tf:r},o=e.terms.get(t);o||(o=[],e.terms.set(t,o)),o.push(a),e.df.set(t,(e.df.get(t)||0)+1)}}if(void 0!==n)return o(n,-1,-1);if(a)for(let e=0;e<s;e++){let t=a[e];if(t)if(Array.isArray(t))for(let s of t)o(s.v,e,s.i??-1);else o(t.v,e,-1)}}(this._invertedIndex,e,this._myIndex.keys.length,t)}}remove(e=()=>!1){let t=[],s=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),s.push(r));if(s.length){if(this._invertedIndex)for(let e of s)V(this._invertedIndex,e);for(let e=s.length-1;e>=0;e-=1)this._docs.splice(s[e],1);this._myIndex.removeAll(s)}return t}removeAt(e){this._invertedIndex&&V(this._invertedIndex,e);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),t}getIndex(){return this._myIndex}search(e,t){let s,{limit:n=-1}=t||{},{includeMatches:a,includeScore:o,shouldSort:l,sortFn:u,ignoreFieldNorm:c}=this.options;if(r(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return i(n)&&n>-1&&(e=e.slice(0,n)),e}if(i(n)&&n>0&&r(e)){let t=new O(n);r(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:c}),s=t.extractSorted(u)}else!function(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){e.forEach(e=>{e.score=$(e.matches,{ignoreFieldNorm:t})})}(s=r(e)?r(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:c}),l&&s.sort(u),i(n)&&n>-1&&(s=s.slice(0,n));return function(e,t,{includeMatches:s=f.includeMatches,includeScore:r=f.includeScore}={}){let i=[];return s&&i.push(P),r&&i.push(z),e.map(e=>{let{idx:s}=e,r={item:t[s],refIndex:s};return i.length&&i.forEach(t=>{t(e,r)}),r})}(s,this._docs,{includeMatches:a,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{records:i}=this._myIndex,n=t?null:[];return i.forEach(({v:e,i:i,n:o})=>{if(!a(e))return;let{isMatch:l,score:u,indices:c}=r.searchIn(e);if(l){let r={item:e,idx:i,matches:[{score:u,value:e,norm:o,indices:c}]};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):n.push(r)}}),n}_searchLogical(e){let t=L(e,this.options),s=(e,t,r)=>{if(!("children"in e)){let s,{keyId:i,searcher:n}=e;return(null===i?(s=[],this._myIndex.keys.forEach((e,r)=>{s.push(...this._findMatches({key:e,value:t[r],searcher:n}))})):s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:n}),s&&s.length)?[{idx:r,item:t,matches:s}]:[]}let{children:i,operator:n}=e,a=[];for(let e=0,o=i.length;e<o;e+=1){let o=s(i[e],t,r);if(o.length)a.push(...o);else if(n===R)return[]}return a},r=this._myIndex.records,i=new Map,n=[];return r.forEach(({$:e,i:r})=>{if(a(e)){let a=s(t,e,r);a.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),n.push(i.get(r))),a.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),n}_searchObjectList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{keys:i,records:n}=this._myIndex,o=t?null:[];return n.forEach(({$:e,i:n})=>{if(!a(e))return;let l=[],u=!1,c=!1;if(i.forEach((t,s)=>{let i=this._findMatches({key:t,value:e[s],searcher:r});i.length?(l.push(...i),i[0].hasInverse&&(c=!0)):u=!0}),(!c||!u)&&l.length){let r={idx:n,item:e,matches:l};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}),o}_findMatches({key:e,value:s,searcher:r}){if(!a(s))return[];let i=[];if(t(s))s.forEach(({v:t,i:s,n:n})=>{if(!a(t))return;let{isMatch:o,score:l,indices:u,hasInverse:c}=r.searchIn(t);o&&i.push({score:l,key:e,value:t,idx:s,norm:n,indices:u,hasInverse:c})});else{let{v:t,n:n}=s,{isMatch:a,score:o,indices:l,hasInverse:u}=r.searchIn(t);a&&i.push({score:o,key:e,value:t,norm:n,indices:l,hasInverse:u})}return i}}U.version="7.3.0",U.createIndex=p,U.parseIndex=function(e,{getFn:t=f.getFn,fieldNormWeight:s=f.fieldNormWeight}={}){let{keys:r,records:i}=e,n=new g({getFn:t,fieldNormWeight:s});return n.setKeys(r),n.setIndexRecords(i),n},U.config=f,U.match=function(e,t,s){return B(e,{...f,...s}).searchIn(t)},U.parseQuery=L,D(class{constructor(e,{isCaseSensitive:t=f.isCaseSensitive,ignoreDiacritics:s=f.ignoreDiacritics,includeMatches:r=f.includeMatches,minMatchCharLength:i=f.minMatchCharLength,ignoreLocation:n=f.ignoreLocation,findAllMatches:a=f.findAllMatches,location:o=f.location,threshold:l=f.threshold,distance:u=f.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:i,findAllMatches:a,ignoreLocation:n,location:o,threshold:l,distance:u},e=t?e:e.toLowerCase(),e=s?k(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{let s=(function(e){let t=[],s=e.length,r=0;for(;r<s;){for(;r<s&&" "===e[r];)r++;if(r>=s)break;let i=r;for(;i<s&&" "!==e[i]&&'"'!==e[i];)i++;if(i<s&&'"'===e[i]){for(i++;i<s;){if('"'===e[i]){let t=i+1;if(t>=s||" "===e[t]){i++;break}if("$"===e[t]&&(t+1>=s||" "===e[t+1])){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<s&&" "!==e[i];)i++;t.push(e.substring(r,i)),r=i}}return t})(e.replace(/\u0000/g,"|").trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=s.length;e<i;e+=1){let i=s[e],n=!1,a=-1;for(;!n&&++a<E;){let e=N[a],s=e.isMultiMatch(i);s&&(r.push(new e(s,t)),n=!0)}if(!n)for(a=-1;++a<E;){let e=N[a],s=e.isSingleMatch(i);if(s){r.push(new e(s,t));break}}}return r})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:s,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?k(e):e;let n=0,a=[],o=0,l=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];a.length=0,n=0,l=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:u,indices:c,score:d}=r.search(e);if(u){n+=1,o+=d;let e=r.constructor.type;e.startsWith("inverse")&&(l=!0),s&&(I.has(e)?a.push(...c):a.push(c))}else{o=0,n=0,a.length=0,l=!1;break}}if(n){let e={isMatch:!0,score:o/n};return l&&(e.hasInverse=!0),s&&(e.indices=v(a)),e}}return{isMatch:!1,score:1}}}),D(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=H({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics});const s=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;for(const e of(this.termSearchers=[],this.idfWeights=[],s)){this.termSearchers.push(new C(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const s=r.get(e)||0,n=Math.log(1+(i-s+.5)/(s+.5));this.idfWeights.push(n)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],s=0,r=0,i=0;for(let n=0;n<this.termSearchers.length;n++){let a=this.termSearchers[n].searchIn(e),o=this.idfWeights[n];r+=o,a.isMatch&&(i++,s+=o*(1-a.score),a.indices&&t.push(...a.indices))}if(0===i)return{isMatch:!1,score:1};let n={isMatch:!0,score:Math.max(.001,r>0?1-s/r:0)};return this.options.includeMatches&&t.length&&(n.indices=v(t)),n}}),U.use=function(...e){e.forEach(e=>D(e))},e.s(["default",0,U])},449636,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(533499),i=e.i(514798);let n=(0,i.createServerReference)("00d7c0f191ad90c5e8a540acb3e511f13d53f9d7b3",i.callServer,void 0,i.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var a=e.i(52741);let o=[{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 l=e.i(280027),u=e.i(519455),c=e.i(912505),d=e.i(572989);let h=(0,d.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 m=e.i(715443);function f({cols:e,rows:s,active:r}){let i=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:i.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 x="custom";function g({value:e,customValue:i,onChange:n}){let{t:a}=(0,r.useI18n)(),[l,c]=(0,s.useState)(!1),d=(0,s.useRef)(null),h=e===x,p=h?null:o.find(t=>t.id===e)??o[2],[v,b]=(0,s.useState)(i?.cols??2),[y,k]=(0,s.useState)(i?.rows??2),[C,j]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,s.useEffect)(()=>{(0,m.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{j({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)(()=>{i&&(b(i.cols),k(i.rows))},[i?.cols,i?.rows]),(0,s.useEffect)(()=>{if(l)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){d.current&&!d.current.contains(e.target)&&c(!1)}},[l]);let A=(e,t,s)=>Math.max(t,Math.min(s,e)),w=h?v:p?.cols??2,S=h?y:p?.rows??2,N=h?`${v}\xd7${y}`:p?.label??"";return(0,t.jsxs)("div",{ref:d,className:"relative",children:[(0,t.jsxs)(u.Button,{variant:"outline",onClick:()=>c(e=>!e),className:"gap-2",children:[(0,t.jsx)(f,{cols:w,rows:S,active:!1}),(0,t.jsx)("span",{children:N}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),l&&(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:a("missions.gridPreset")}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[o.map(s=>{let r=s.id===e;return(0,t.jsxs)("button",{onClick:()=>{n(s.id),c(!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:()=>{h||n(x,{cols:v,rows:y})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${h?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:v,rows:y,active:h}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${h?"text-primary":"text-foreground"}`,children:a("missions.gridCustom")}),(0,t.jsxs)("span",{className:`text-xs ${h?"text-primary/60":"text-muted-foreground"}`,children:[v,"×",y]})]}),h&&(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:a("missions.gridCols")}),(0,t.jsx)("input",{type:"number",min:C.minCols,max:C.maxCols,value:v,onChange:e=>{let t;b(t=A(Number(e.target.value),C.minCols,C.maxCols)),n(x,{cols:t,rows:y})},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:a("missions.gridRows")}),(0,t.jsx)("input",{type:"number",min:C.minRows,max:C.maxRows,value:y,onChange:e=>{let t;k(t=A(Number(e.target.value),C.minRows,C.maxRows)),n(x,{cols:v,rows:t})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var p=e.i(720247),v=e.i(775712),b=e.i(19578),y=e.i(538059),k=e.i(67013);let C=(0,d.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"}]]),j=(0,d.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var A=e.i(657153);let w=(0,d.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 S=e.i(746798),N=e.i(487486),E=e.i(613585),I=e.i(360112);let M=(0,b.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 D({execution:e,isRemoving:i,removeReason:n,onStop:a,onSessionEnd:o,index:l,mode:c,isSelected:d,onRegisterControls:h,onRequestFocus:m}){let{t:f}=(0,r.useI18n)(),x=(0,y.useRouter)(),{attributes:g,listeners:p,setNodeRef:b,transform:B,transition:R}=(0,v.useSortable)({id:e.executionId}),_={transform:k.CSS.Transform.toString(B),transition:R,opacity:+!i},[F,T]=(0,s.useState)(()=>e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0);(0,s.useEffect)(()=>{if(i)return;let t=setInterval(()=>{T(e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(t)},[e.startedAt,i]);let L=Math.floor(F/60),$=`${L}m ${F%60}s`;async function O(){let t=e.worktreePath??e.projectLocalPath;if(!t)return;let s=e.subPath?`${t}/${e.subPath}`:t;try{await (0,E.openInTerminal)(s)}catch{I.toast.error(f("preview.terminalError"))}}return(0,t.jsxs)("div",{ref:b,style:_,"data-pane-index":l,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...g,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":f("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,t.jsx)(C,{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})]}),i?(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===n?f("missions.statusStopped"):f("missions.statusCompleted")}):(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:f("missions.statusRunning")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:$}),e.projectLocalPath&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(u.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:O}),children:(0,t.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:f("missions.openInTerminal")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(u.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>x.push(`/workspaces/${e.workspaceId}/tasks/${e.taskId}`)}),children:(0,t.jsx)(j,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:f("missions.openFullView")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(u.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>a(e.taskId),disabled:i}),children:(0,t.jsx)(A.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:f("missions.stopTask")})]})]}),(0,t.jsxs)("div",{className:"relative flex-1 overflow-hidden",children:[(0,t.jsx)(M,{taskId:e.taskId,worktreePath:e.worktreePath??e.projectLocalPath,onSessionEnd:t=>o?.(e.taskId,t),useCanvasRenderer:!0,onReady:t=>h(e.taskId,t)}),"nav"===c&&(0,t.jsx)("button",{type:"button","aria-label":f("missions.hint.label"),onClick:()=>m(e.taskId),className:["absolute inset-0 z-20 flex items-center justify-center cursor-pointer transition-opacity bg-background/60 dark:bg-black/50",d?"ring-2 ring-inset ring-primary":""].join(" "),children:l<9&&(0,t.jsx)("span",{className:["flex h-14 w-14 items-center justify-center rounded-md text-2xl font-semibold tabular-nums border transition-colors",d?"bg-primary text-primary-foreground border-primary":"bg-muted/80 text-foreground border-border"].join(" "),children:l+1})})]})]})}var B=e.i(169751);let R=(0,i.createServerReference)("407237551552d0fef859f4e905efcf857d427eb57c",i.callServer,void 0,i.findSourceMapURL,"getWorkspacesWithRecentTasks"),_=(0,i.createServerReference)("40cf5e202a2eb11be7191582eebf0603aba621be26",i.callServer,void 0,i.findSourceMapURL,"getProjectTasks");var F=e.i(933318),T=e.i(711352),L=e.i(793479),$=e.i(776639),O=e.i(368490);let P=(0,d.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 z=e.i(922541),W=e.i(738690),H=e.i(759684);let V={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},U={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function q({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:V[e]??e})}function K({task:e,isRunning:s,launchingId:r,onLaunchNew:i,onResume:n,t:a}){let o=e.executions?.[0]?.sessionId,l=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)(q,{status:e.status}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:U[e.priority]??e.priority})]})]}),s?(0,t.jsx)("span",{className:"text-[10px] italic text-muted-foreground",children:a("missions.alreadyMonitored")}):(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity",children:[o&&(0,t.jsxs)(u.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>n(e.id,o),disabled:l,title:a("missions.continueSession"),children:[(0,t.jsx)(z.RotateCcw,{className:"h-3 w-3 mr-1"}),a("missions.continueLabel")]}),(0,t.jsxs)(u.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>i(e.id),disabled:l,title:a("missions.launchNew"),children:[(0,t.jsx)(P,{className:"h-3 w-3 mr-1"}),l?"...":a("missions.launchNewLabel")]})]})]})}function G({open:e,onOpenChange:i,onLaunchNew:n,onResume:a,runningTaskIds:o,launchingId:c}){let{t:d}=(0,r.useI18n)(),[h,m]=(0,s.useState)([]),[f,x]=(0,s.useState)(""),[g,p]=(0,s.useState)(""),[v,b]=(0,s.useState)([]),[y,k]=(0,s.useState)("");(0,s.useEffect)(()=>{e&&(x(""),p(""),b([]),k(""),R(100).then(m).catch(()=>I.toast.error(d("missions.error.launchFailed"))))},[e,d]),(0,s.useEffect)(()=>{g?_(g).then(e=>{b(e.filter(e=>"TODO"===e.status||"IN_PROGRESS"===e.status||"IN_REVIEW"===e.status))}).catch(()=>I.toast.error(d("missions.error.launchFailed"))):b([])},[g,d]);let C=(0,s.useMemo)(()=>{let e=[];for(let t of h)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},[h]),j=(0,s.useMemo)(()=>new B.default(C,{keys:["task.title"],threshold:.4,distance:200}),[C]),w=(0,s.useMemo)(()=>{let e=y.trim();return e?j.search(e,{limit:30}).map(e=>e.item):[]},[j,y]),S=y.trim().length>0,N=h.find(e=>e.id===f),E=N?.projects??[];return(0,t.jsx)($.Dialog,{open:e,onOpenChange:i,children:(0,t.jsxs)($.DialogContent,{className:"sm:max-w-2xl max-h-[80vh]",children:[(0,t.jsx)($.DialogHeader,{children:(0,t.jsx)($.DialogTitle,{children:d("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)(W.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(L.Input,{value:y,onChange:e=>k(e.target.value),placeholder:d("missions.fullPicker.searchPlaceholder"),className:"pl-8 pr-8 h-8"}),y&&(0,t.jsx)(u.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6",onClick:()=>k(""),"aria-label":d("missions.fullPicker.clearSearch"),children:(0,t.jsx)(A.X,{className:"h-3.5 w-3.5"})})]}),!S&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(l.Select,{value:f,onValueChange:e=>{x(e??""),p("")},children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:h.find(e=>e.id===f)?.name??d("missions.launcher.selectWorkspace")})}),(0,t.jsx)(l.SelectContent,{children:h.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)(l.Select,{value:g,onValueChange:e=>p(e??""),disabled:!f,children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:E.find(e=>e.id===g)?.name??d("missions.launcher.selectProject")})}),(0,t.jsx)(l.SelectContent,{children:E.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.alias??e.name},e.id))})]})]})]}),(0,t.jsx)(H.ScrollArea,{className:"max-h-[60vh] -mx-2",children:S?0===w.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPicker.noSearchResults")}):w.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)(K,{task:e.task,isRunning:o.has(e.task.id),launchingId:c,onLaunchNew:n,onResume:a,t:d})]},e.task.id)):0===v.length&&g?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.launcher.noTasks")}):0===v.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPickerHint")}):v.map(e=>(0,t.jsx)(K,{task:e,isRunning:o.has(e.id),launchingId:c,onLaunchNew:n,onResume:a,t:d},e.id))})]})})}function J({open:e,onOpenChange:i,onLaunched:n,runningTaskIds:a=new Set,anchorRef:o}){let{t:l}=(0,r.useI18n)(),c=(0,s.useRef)(null),[d,h]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),[p,v]=(0,s.useState)(!1),[b,y]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{e&&(f(!0),R(5).then(h).catch(()=>I.toast.error(l("missions.error.launchFailed"))).finally(()=>f(!1)))},[e,l]);let k=(0,s.useMemo)(()=>d.filter(e=>e.projects.some(e=>e._count.tasks>0)),[d]),C=(0,s.useCallback)(e=>{y(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(c.current&&!c.current.contains(t)){if(o?.current&&o.current.contains(t))return;i(!1)}}},[e,i,o]);let j=(0,s.useCallback)(async e=>{try{g(e),await (0,F.startPtyExecution)(e,""),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),A=(0,s.useCallback)(async(e,t)=>{try{g(e),await (0,T.resumePtyExecution)(e,t),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),w=(0,s.useCallback)(()=>{i(!1),v(!0)},[i]);return e||p?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{ref:c,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:l("missions.pickerTitle")})}),(0,t.jsx)(H.ScrollArea,{children:m?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===k.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:l("missions.noAvailableTasks")}):k.map(e=>{let s=b.has(e.id),r=e.projects.filter(e=>e._count.tasks>0);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(u.Button,{variant:"ghost",onClick:()=>C(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)(O.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)(K,{task:e,isRunning:a.has(e.id),launchingId:x,onLaunchNew:j,onResume:A,t:l},e.id))})]},e.id))})]},e.id)})}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsx)(u.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:w,children:l("missions.showMoreTasks")})})]}),(0,t.jsx)(G,{open:p,onOpenChange:v,onLaunchNew:j,onResume:A,runningTaskIds:a,launchingId:x})]}):null}e.i(508271);var Q=e.i(841359);function X(e,t,s){return t<=0?0:((e+s)%t+t)%t}e.s(["MissionsClient",0,function({initialExecutions:e}){let{t:i}=(0,r.useI18n)(),[d,m]=(0,s.useState)(e),[f,x]=(0,s.useState)(()=>localStorage.getItem("missions-grid-preset")??"3x2"),[b,y]=(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,C]=(0,s.useState)(!1),[j,A]=(0,s.useState)(""),w=(0,s.useRef)(null),[S,E]=(0,s.useState)("input"),[M,B]=(0,s.useState)(0),R=(0,s.useRef)(new Map),_=(0,s.useRef)([]),F=(0,s.useRef)(2),T=(0,s.useRef)(M);T.current=M;let L=(0,s.useRef)([]),$=(0,s.useCallback)((e,t)=>{t?R.current.set(e,t):R.current.delete(e)},[]),[O,P]=(0,s.useState)(new Map),z=(0,s.useRef)(O);(0,s.useEffect)(()=>{z.current=O},[O]);let W=(0,s.useRef)(new Map),H=o.find(e=>e.id===f)??o[2],V="custom"===f?b.cols:H.cols,U="custom"===f?b.rows:H.rows,q=(0,s.useRef)(null),[K,G]=(0,s.useState)("480px");(0,s.useEffect)(()=>{let e=q.current;if(!e)return;let t=()=>{let t=(e.clientHeight-32-16*(U-1))/U;G(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[U]);let Y=(0,s.useCallback)((e,t)=>{e&&(x(e),localStorage.setItem("missions-grid-preset",e),"custom"===e&&t&&(y(t),localStorage.setItem("missions-grid-custom",JSON.stringify(t))))},[]),Z=(0,p.useSensors)((0,p.useSensor)(p.PointerSensor,{activationConstraint:{distance:8}})),ee=(0,s.useCallback)(e=>{let{active:t,over:s}=e;s&&t.id!==s.id&&m(e=>{let r=e.findIndex(e=>e.executionId===t.id),i=e.findIndex(e=>e.executionId===s.id);return(0,v.arrayMove)(e,r,i)})},[]),et=(0,s.useCallback)((e,t)=>{if(z.current.has(e))return;P(s=>new Map([...s,[e,t]]));let s=setTimeout(()=>{m(t=>t.filter(t=>t.executionId!==e)),P(t=>{let s=new Map(t);return s.delete(e),s}),W.current.delete(e)},500);W.current.set(e,s)},[]);(0,s.useEffect)(()=>{let e=setInterval(async()=>{try{let e=await n();m(t=>{let s=z.current,{merged:r,goneIds:i}=function({prev:e,fresh:t,removingIds:s}){let r=new Set(t.map(e=>e.executionId)),i=[];e.forEach(e=>{r.has(e.executionId)||s.has(e.executionId)||i.push(e.executionId)});let n=e.filter(e=>r.has(e.executionId)||s.has(e.executionId)),a=new Set(e.map(e=>e.executionId));return{merged:[...n,...t.filter(e=>!a.has(e.executionId))],goneIds:i}}({prev:t,fresh:e,removingIds:new Set(s.keys())});return i.forEach(e=>et(e,"completed")),r})}catch{}},4e3);return()=>clearInterval(e)},[et]),(0,s.useEffect)(()=>{let e=W.current;return()=>{e.forEach(e=>clearTimeout(e))}},[]);let es=(0,s.useCallback)(async e=>{try{await (0,a.stopPtyExecution)(e),m(t=>{let s=t.find(t=>t.taskId===e);return s&&et(s.executionId,"stopped"),t})}catch{I.toast.error(i("missions.error.stopFailed"))}},[et,i]),er=(0,s.useCallback)((e,t)=>{m(t=>{let s=t.find(t=>t.taskId===e);return s&&et(s.executionId,"completed"),t})},[et]),ei=(0,s.useCallback)(e=>{n().then(e=>{m(t=>{let s=new Set(t.map(e=>e.executionId));return[...t,...e.filter(e=>!s.has(e.executionId))]})}).catch(()=>{})},[]),en=(0,s.useCallback)(e=>{let t=_.current;e<0||e>=t.length||(t[e]?.focus(),B(e),E("input"))},[]),ea=(0,s.useCallback)(()=>{_.current[T.current]?.blur(),E("nav")},[]),eo=(0,s.useCallback)(()=>{en(T.current)},[en]),el=(0,s.useCallback)(()=>{let e=_.current.length;0!==e&&en(X(T.current,e,1))},[en]),eu=(0,s.useCallback)(()=>{let e=_.current.length;0!==e&&en(X(T.current,e,-1))},[en]),ec=(0,s.useCallback)(e=>{let t=_.current.length;0!==t&&(E("nav"),B(s=>(function(e,t,s,r){if(s<=0)return 0;let i=Math.max(1,t);switch(r){case"left":return X(e,s,-1);case"right":return X(e,s,1);case"up":{let t=e-i;return t<0?e:t}case"down":{let t=e+i;return t>=s?e:t}default:return e}})(s,F.current,t,e)))},[]),ed=(0,s.useCallback)(e=>{let t=_.current.length;0!==t&&(E("nav"),B(s=>X(s,t,e)))},[]),eh=(0,s.useCallback)(e=>{let t=L.current.findIndex(t=>t.taskId===e);t>=0&&en(t)},[en]);(0,Q.useActionShortcut)("missions.jump",e=>{let t=Number(e.key);Number.isInteger(t)&&t>=1&&en(t-1)}),(0,Q.useActionShortcut)("missions.moveSelection",e=>{ec("ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":"ArrowLeft"===e.key?"left":"right")}),(0,Q.useActionShortcut)("missions.cycle",()=>ed(1)),(0,Q.useActionShortcut)("missions.cycleBack",()=>ed(-1)),(0,Q.useActionShortcut)("missions.focus",()=>eo()),(0,Q.useActionShortcut)("missions.next",()=>el()),(0,Q.useActionShortcut)("missions.prev",()=>eu()),(0,Q.useActionShortcut)("missions.exit",()=>ea()),(0,s.useEffect)(()=>{let e=q.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)&&(B(r),E("input"))};return e.addEventListener("focusin",t),()=>e.removeEventListener("focusin",t)},[]);let em=Array.from(new Map(d.map(e=>[e.workspaceId,e.workspaceName])).entries()).map(([e,t])=>({id:e,name:t})),ef=j?d.filter(e=>e.workspaceId===j):d;L.current=ef,_.current=ef.map(e=>R.current.get(e.taskId)).filter(e=>!!e),F.current=V,(0,s.useEffect)(()=>{B(e=>{let t=ef.length;return 0===t?0:Math.min(e,t-1)})},[ef.length]);let ex=new Set(d.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:i("missions.pageTitle")}),(0,t.jsx)(N.Badge,{variant:"input"===S?"default":"secondary",className:"input"===S?"shrink-0":"shrink-0 bg-muted text-muted-foreground",children:"input"===S?i("missions.mode.input"):i("missions.mode.nav")}),(0,t.jsxs)(l.Select,{value:j,onValueChange:e=>A(e??""),children:[(0,t.jsx)(l.SelectTrigger,{className:"w-36 h-8",children:(0,t.jsx)("span",{className:"truncate",children:j?em.find(e=>e.id===j)?.name??i("missions.filterAll"):i("missions.filterAll")})}),(0,t.jsxs)(l.SelectContent,{children:[(0,t.jsx)(l.SelectItem,{value:"",children:i("missions.filterAll")}),em.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(g,{value:f,customValue:b,onChange:Y}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(u.Button,{ref:w,onClick:()=>C(e=>!e),children:i("missions.launchTask")}),(0,t.jsx)(J,{open:k,onOpenChange:C,onLaunched:ei,runningTaskIds:ex,anchorRef:w})]})]}),(0,t.jsx)("div",{ref:q,className:"flex-1 overflow-auto min-h-0 p-4",children:0===ef.length&&0===O.size?(0,t.jsx)(c.EmptyState,{icon:h,title:i("missions.emptyTitle"),description:i("missions.emptyDesc"),className:"h-full",action:(0,t.jsx)(u.Button,{onClick:()=>C(!0),children:i("missions.launchTask")})}):(0,t.jsx)(p.DndContext,{id:"missions-dnd",sensors:Z,collisionDetection:p.closestCenter,onDragEnd:ee,children:(0,t.jsx)(v.SortableContext,{items:ef.map(e=>e.executionId),strategy:v.rectSortingStrategy,children:(0,t.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${V}, 1fr)`,gridAutoRows:K},children:ef.map((e,s)=>(0,t.jsx)(D,{execution:e,isRemoving:O.has(e.executionId),removeReason:O.get(e.executionId),onStop:es,onSessionEnd:er,index:s,mode:S,isSelected:M===s&&"nav"===S,onRegisterControls:$,onRequestFocus:eh},e.executionId))})})})})]})}],449636)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:a,description:r,action:n,className:l}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",l),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r}),n&&(0,t.jsx)("div",{className:"mt-2",children:n})]})}])},236967,e=>{"use strict";var t=e.i(289721),s=e.i(210702),a=e.i(538059),r=e.i(259846),n=e.i(645378),l=e.i(453889),i=e.i(487278),c=e.i(533499);let o=[{key:"notes",icon:n.FileText},{key:"assets",icon:l.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:n}=(0,c.useI18n)(),l=(0,a.usePathname)(),i=o.find(e=>l.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(s.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),o.map(a=>{let r=a.icon,l=i===a.key;return(0,t.jsxs)(s.default,{href:`/workspaces/${e}/${a.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${l?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n(`sidebar.${a.key}`)})]},a.key)})]})}])},695542,649574,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40089446e14dfccae4d9cfae25d87fe426f881796b",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,s],695542);let a=(0,t.createServerReference)("40eb2a344429aa574c7aa9c35c50ef2294b7e1f880",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,a],649574)},497732,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(232545),r=e.i(400355),n=e.i(738690),l=e.i(236967),i=e.i(533499),c=e.i(685149),o=e.i(695542),d=e.i(514798);let x=(0,d.createServerReference)("603a47abed710c0d42bb7866767beb055bdc0b79ba",d.callServer,void 0,d.findSourceMapURL,"updateNote");var u=e.i(649574);let m=(0,d.createServerReference)("60780b5248de0826b96d55da66341a45449290a472",d.callServer,void 0,d.findSourceMapURL,"getProjectNotes");var h=e.i(975157);function p({active:e,onSelect:s}){let{t:a}=(0,i.useI18n)();return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>s("all"),className:(0,h.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===e?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a("notes.allCategories")}),c.NOTE_CATEGORIES_PRESET.map(a=>(0,t.jsx)("button",{onClick:()=>s(a),className:(0,h.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",e===a?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a},a))]})}var g=e.i(519455),f=e.i(280027),j=e.i(645378),v=e.i(912505),N=e.i(464249),b=e.i(998626);let y=(0,e.i(572989).default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);e.i(254826);var S=e.i(309735);function w({note:e,onEdit:s,onDelete:a,onPreview:r,onTaskClick:n}){let{t:l}=(0,i.useI18n)(),c=e.content.slice(0,300);return(0,t.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,t.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>s(e),className:"text-muted-foreground","aria-label":l("notes.edit"),children:(0,t.jsx)(N.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>a(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":l("notes.delete"),children:(0,t.jsx)(b.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"mb-2 pr-16",children:(0,t.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:e.title})}),(0,t.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("span",{className:"inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:e.category}),e.taskId&&e.taskTitle&&(0,t.jsxs)("button",{type:"button",onClick:()=>e.taskId&&n?.(e.taskId),disabled:!n,className:`inline-flex max-w-[160px] items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary ${n?"cursor-pointer hover:bg-primary/15":"cursor-default"}`,title:e.taskTitle,children:[(0,t.jsx)(y,{className:"h-2.5 w-2.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.taskTitle})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>r?.(e),disabled:!r,className:`block w-full text-left ${r?"cursor-pointer":"cursor-default"}`,title:r?l("notes.previewNote"):void 0,children:(0,t.jsx)("div",{className:"max-h-24 overflow-hidden text-sm leading-relaxed text-muted-foreground",children:(0,t.jsx)(S.Streamdown,{children:c})})})]})}function k({notes:e,onEdit:s,onDelete:a,onPreview:r,onTaskClick:n}){let{t:l}=(0,i.useI18n)();return 0===e.length?(0,t.jsx)(v.EmptyState,{icon:j.FileText,title:l("notes.empty"),description:l("notes.emptyHint")}):(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,t.jsx)(w,{note:e,onEdit:s,onDelete:a,onPreview:r,onTaskClick:n},e.id))})}var C=e.i(624687);function T({value:e,onChange:s}){return(0,t.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,t.jsx)(C.Textarea,{value:e,onChange:e=>s(e.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,t.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,t.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border text-sm leading-relaxed",children:(0,t.jsx)(S.Streamdown,{children:e})})})]})}var E=e.i(997025),I=e.i(759684),P=e.i(605005);e.s(["NotesPageClient",0,function({allWorkspaces:e,initialWorkspaceId:d,initialProjectId:h,initialNotes:j}){let v,N,{t:b}=(0,i.useI18n)(),[y,S]=(0,s.useTransition)(),[w,C]=(0,s.useState)(d),[R,$]=(0,s.useState)(h),[O,A]=(0,s.useState)(j),[_,L]=(0,s.useState)("all"),[B,z]=(0,s.useState)(""),[M,U]=(0,s.useState)(null),[D,V]=(0,s.useState)(null),[F,G]=(0,s.useState)(null),[H,K]=(0,s.useState)(!1),[q,W]=(0,s.useState)(""),[J,Q]=(0,s.useState)(""),[X,Y]=(0,s.useState)(c.NOTE_CATEGORIES_PRESET[3]),[Z,ee]=(0,s.useState)(d),[et,es]=(0,s.useState)(h),ea=e.find(e=>e.id===w),er=ea?.projects??[],en=e.find(e=>e.id===Z),el=en?.projects??[],ei=(0,s.useCallback)(e=>{e?S(async()=>{A(await m(e))}):A([])},[S]),ec=async()=>{et&&q.trim()&&(await (0,o.createNote)({title:q.trim(),content:J,category:X,projectId:et}),K(!1),et===R&&ei(R))},eo=async()=>{F&&q.trim()&&(await x(F.id,{title:q.trim(),content:J,category:X}),G(null),ei(R))},ed=async e=>{let t=O.find(t=>t.id===e);!t||confirm(b("notes.deleteConfirm",{title:t.title}))&&(await (0,u.deleteNote)(e),ei(R))},ex=B.trim().toLowerCase(),eu=O.filter(e=>"all"===_||e.category===_).filter(e=>!ex||e.title.toLowerCase().includes(ex)).map(e=>({id:e.id,title:e.title,content:e.content,category:e.category,updatedAt:new Date(e.updatedAt),taskId:e.taskId,taskTitle:e.task?.title??null})),em=H||null!==F;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(l.SubPageNav,{workspaceId:w}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(f.Select,{value:w,onValueChange:t=>t&&(t=>{if(t===w)return;C(t);let s=e.find(e=>e.id===t),a=s?.projects[0]??null;$(a?.id??null),L("all"),ei(a?.id??null)})(t),children:[(0,t.jsx)(f.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===w)?.name??w})}),(0,t.jsx)(f.SelectContent,{children:e.map(e=>(0,t.jsx)(f.SelectItem,{value:e.id,children:e.name},e.id))})]}),er.length>0&&(0,t.jsxs)(f.Select,{value:R??"",onValueChange:e=>e&&void(e!==R&&($(e),L("all"),ei(e))),children:[(0,t.jsx)(f.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(v=er.find(e=>e.id===R))?v.alias?`${v.name} (${v.alias})`:v.name:""})}),(0,t.jsx)(f.SelectContent,{children:er.map(e=>(0,t.jsxs)(f.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),!em&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative ml-auto",children:[(0,t.jsx)(n.Search,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)("input",{type:"text",value:B,onChange:e=>z(e.target.value),placeholder:b("notes.searchPlaceholder"),className:"h-8 w-48 rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),(0,t.jsxs)(g.Button,{onClick:()=>{W(""),Q(""),Y(c.NOTE_CATEGORIES_PRESET[3]),ee(w),es(R),G(null),K(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:b("notes.newNote")})]})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:em?(0,t.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!F&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.workspace")}),(0,t.jsxs)(f.Select,{value:Z,onValueChange:t=>t&&(t=>{if(t===Z)return;ee(t);let s=e.find(e=>e.id===t),a=s?.projects[0]??null;es(a?.id??null)})(t),children:[(0,t.jsx)(f.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===Z)?.name??Z})}),(0,t.jsx)(f.SelectContent,{children:e.map(e=>(0,t.jsx)(f.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),!F&&el.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.project")}),(0,t.jsxs)(f.Select,{value:et??"",onValueChange:e=>e&&es(e),children:[(0,t.jsx)(f.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(N=el.find(e=>e.id===et))?N.alias?`${N.name} (${N.alias})`:N.name:""})}),(0,t.jsx)(f.SelectContent,{children:el.map(e=>(0,t.jsxs)(f.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.categoryLabel")}),(0,t.jsxs)(f.Select,{value:X,onValueChange:e=>e&&Y(e),children:[(0,t.jsx)(f.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:X})}),(0,t.jsx)(f.SelectContent,{children:c.NOTE_CATEGORIES_PRESET.map(e=>(0,t.jsx)(f.SelectItem,{value:e,children:e},e))})]})]})]}),(0,t.jsx)("input",{type:"text",value:q,onChange:e=>W(e.target.value),placeholder:b("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,t.jsx)(T,{value:J,onChange:Q}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,t.jsx)(g.Button,{variant:"outline",onClick:()=>{K(!1),G(null)},children:b("notes.cancel")}),(0,t.jsx)(g.Button,{onClick:F?eo:ec,disabled:!q.trim()||!F&&!et,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:b("notes.save")})]})]}):(0,t.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 gap-4",children:[(0,t.jsx)(p,{active:_,onSelect:L}),(0,t.jsx)(I.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:`relative ${y?"opacity-40 pointer-events-none":""} transition-opacity`,children:[y&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(r.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===er.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:b("notes.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:b("notes.noProjectHint")})]}):(0,t.jsx)(k,{notes:eu,onEdit:e=>{W(e.title),Q(e.content),Y(e.category),G(e),K(!1)},onDelete:ed,onPreview:U,onTaskClick:V})]})})]})}),(0,t.jsx)(E.NotePreviewDialog,{note:M,open:null!==M,onOpenChange:e=>{e||U(null)}}),(0,t.jsx)(P.TaskOverviewDrawer,{open:null!==D,onOpenChange:e=>{e||V(null)},taskId:D})]})}],497732)},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,645119,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(538059),n=e.i(210702),a=e.i(232545),i=e.i(487278),l=e.i(368490),o=e.i(259846),d=e.i(572989);let c=(0,d.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var x=e.i(519455),m=e.i(759684),u=e.i(606393),p=e.i(226145),h=e.i(340873),f=e.i(263938),g=e.i(960518),v=e.i(453889),j=e.i(645378);let b=(0,d.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var N=e.i(464249);let y=(0,d.default)("package-check",[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]),w=(0,d.default)("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);var C=e.i(746798),S=e.i(685149),k=e.i(35967),D=e.i(533499);function T(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${s}-${r}`}let B=Object.fromEntries(S.BOARD_COLUMNS.map(e=>[e.id,e.color]));function E({children:e,className:s}){return(0,t.jsx)("span",{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs text-muted-foreground ${s??""}`,children:e})}function I({task:e,onOpenDetail:r}){let{t:n}=(0,D.useI18n)(),[a,i]=(0,s.useState)(!1),o="CANCELLED"===e.status?"text-muted-foreground line-through decoration-muted-foreground/40":"DONE"===e.status?"text-muted-foreground":"text-foreground";return(0,t.jsxs)("div",{className:"rounded-[10px]",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center gap-2.5 rounded-[10px] px-2.5 py-2.5 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${a?"rotate-90":""}`}),(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${B[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:`text-[13.5px] font-medium ${o}`,children:e.title}),e.labels.map(({label:e})=>(0,t.jsx)("span",{className:"rounded-full border border-border px-1.5 py-px text-[10.5px] text-muted-foreground",style:e.color?{borderColor:e.color+"55",color:e.color}:void 0,children:e.name},e.id)),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("span",{className:"flex w-16 flex-none justify-center",children:(0,t.jsx)("span",{className:`rounded-[5px] px-1.5 py-px text-[10.5px] font-bold ${S.PRIORITY_CONFIG[e.priority]?.color??S.PRIORITY_CONFIG.LOW.color}`,children:e.priority})}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsxs)("span",{className:"flex w-[72px] flex-none items-center gap-1.5",children:[(0,t.jsx)("span",{className:`h-1.5 w-1.5 flex-none rounded-full ${B[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:"truncate text-[10.5px] text-muted-foreground",children:n(`version.taskStatus.${e.status}`)})]}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsx)("span",{className:"flex w-6 flex-none justify-center",children:r&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground",onClick:t=>{t.stopPropagation(),r(e.id)}}),children:(0,t.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:n("version.detail")})]})})]}),a&&(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 pb-3 pl-[30px] pr-3 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(v.FolderOpen,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.resources")})]}),0===e.assets.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.resources")}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.assets.map(e=>{var s;let r=e.mimeType?.startsWith("image/");return(0,t.jsxs)("span",{className:"inline-flex cursor-pointer items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground shadow-sm transition-colors hover:border-primary/50",children:[r?(0,t.jsx)(b,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(j.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{children:e.filename}),null!=e.size&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/60",children:(s=e.size)<1024?`${s} B`:s<1048576?`${Math.round(s/1024)} KB`:`${(s/1048576).toFixed(1)} MB`})]},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(j.FileText,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.notes")})]}),0===e.notes.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.notes")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:e.notes.map(e=>(0,t.jsx)("div",{className:"rounded-lg border border-border border-l-violet-500/50 bg-background px-2.5 py-2 shadow-sm [border-left-width:3px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[12.5px] font-semibold text-foreground",children:e.title}),e.category&&(0,t.jsx)("span",{className:"rounded-[5px] border border-violet-500/30 bg-violet-500/15 px-1.5 py-px text-[10px] font-bold text-violet-300",children:e.category})]})},e.id))})]})]})]})}function L({version:e,diffStat:r,onEdit:n,onRelease:a,onViewDiff:i,onOpenTaskDetail:o}){var d;let c,{t:m}=(0,D.useI18n)(),[v,j]=(0,s.useState)(e.isCurrent),b="RELEASED"===e.status,w="ACTIVE"===e.status,S=e.tasks.length,B=e.tasks.filter(e=>"DONE"===e.status).length,R=!!(e.releaseCommit||r),_=(c=`${S} ${m("version.tasksCount")}`,B>0&&B<S?`${c} \xb7 ${B} ${m("version.doneCount")}`:B>0&&B===S?`${c} \xb7 ${m("version.allDone")}`:c);return(0,t.jsxs)("div",{className:["overflow-hidden rounded-[14px] border bg-card shadow-sm transition-shadow duration-150 hover:shadow-md",e.isCurrent?"border-border border-l-2 border-l-primary ring-1 ring-primary/20":"border-border",b?"opacity-[.96]":""].filter(Boolean).join(" "),children:[(0,t.jsx)("button",{type:"button",onClick:()=>j(e=>!e),className:"w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsxs)("div",{className:"px-4 py-3.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(l.ChevronRight,{className:`h-4 w-4 flex-none text-muted-foreground/60 transition-transform duration-150 ${v?"rotate-90":""}`}),(0,t.jsx)("span",{className:"font-mono text-[14.5px] font-bold text-foreground",children:e.number}),(0,t.jsx)("span",{className:"text-[14.5px] font-semibold text-foreground",children:e.name}),(0,t.jsx)(k.VersionTypeBadge,{name:e.type?.name??null}),(0,t.jsx)(k.VersionStatusBadge,{status:e.status}),e.isCurrent&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/15 px-2.5 py-0.5 text-[11px] font-bold text-primary shadow-sm",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-primary opacity-90"}),m("version.current")]}),(0,t.jsx)("span",{className:"flex-1"}),S>0&&(0,t.jsx)("span",{className:"text-[11.5px] text-muted-foreground",children:_}),(0,t.jsxs)("span",{className:"flex items-center gap-1",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[n&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>n(e.id)}),children:(0,t.jsx)(N.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:m("version.edit")})]}),w&&a&&(0,t.jsxs)(x.Button,{variant:"outline",className:"h-7 px-2 text-xs font-semibold",onClick:()=>a(e.id),children:[(0,t.jsx)(y,{className:"h-3.5 w-3.5"}),m("version.release")]})]})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[b&&e.releasedAt?(0,t.jsxs)(E,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),m("version.releasedAt"),(0,t.jsx)("strong",{className:"text-foreground",children:T(e.releasedAt)})]}):e.startDate||e.targetDate?(0,t.jsxs)(E,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),e.startDate?T(e.startDate):"—"," → ",e.targetDate?(0,t.jsx)("strong",{className:"text-foreground",children:T(e.targetDate)}):"—"]}):null,e.baseBranch&&(0,t.jsxs)(E,{children:[(0,t.jsx)(p.GitBranch,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.baseBranch})]}),e.baseCommit&&(0,t.jsxs)(E,{children:[(0,t.jsx)(h.GitCommitHorizontal,{className:"h-3 w-3"}),m("version.field.baseCommit"),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:(d=e.baseCommit)?d.slice(0,7):""})]}),b&&(0,t.jsxs)(E,{children:[(0,t.jsx)(f.Tag,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.number})]}),r&&(0,t.jsxs)(E,{children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),!b&&(0,t.jsx)("span",{className:"text-muted-foreground",children:m("version.diff.live")}),(0,t.jsxs)("span",{className:"font-bold text-emerald-400",children:["+",r.additions.toLocaleString()]}),(0,t.jsxs)("span",{className:"font-bold text-rose-400",children:["−",r.deletions.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["· ",r.files," ",m("version.diff.files")]})]}),R&&i&&(0,t.jsxs)(x.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground",onClick:t=>{t.stopPropagation(),i(e.id)},children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),m("version.diff.view")," →"]})]}),e.description&&(0,t.jsx)("p",{className:"mt-2 text-[13px] text-muted-foreground",children:e.description})]})}),v&&S>0&&(0,t.jsx)("div",{className:"border-t border-dashed border-border bg-muted/40 px-2 pb-2 pt-1.5",children:e.tasks.map(e=>(0,t.jsx)(I,{task:e,onOpenDetail:o},e.id))})]})}var R=e.i(360112),_=e.i(597746),$=e.i(456346),O=e.i(776639),A=e.i(793479),V=e.i(110204),P=e.i(280027),M=e.i(337822),F=e.i(317056),z=e.i(699375),U=e.i(624687),H=e.i(514798);let G=(0,H.createServerReference)("4048c2b4b5a9df7f8fb0f4ef668ed63935e413bf85",H.callServer,void 0,H.findSourceMapURL,"createVersion"),K=(0,H.createServerReference)("6091b91f5ad1c3294ad2654da2eead4418a1f5f120",H.callServer,void 0,H.findSourceMapURL,"updateVersion"),W=(0,H.createServerReference)("405d315c87ee680f381f70d83254081d0da41fbb32",H.callServer,void 0,H.findSourceMapURL,"getVersionTypes");var Y=e.i(75896),q=e.i(72609),J=e.i(998626);let Q=(0,H.createServerReference)("4087317e795a10ed3022ba891e426dda07da50ff76",H.callServer,void 0,H.findSourceMapURL,"createVersionType"),X=(0,H.createServerReference)("6043e9b04218e672638e933191fc313c03eefad6d9",H.callServer,void 0,H.findSourceMapURL,"updateVersionType"),Z=(0,H.createServerReference)("40ddb5a3ffd848dfbc540e418e832b220707486dc7",H.callServer,void 0,H.findSourceMapURL,"deleteVersionType");function ee({open:e,onOpenChange:r,workspaceId:n,onChanged:a}){let{t:i}=(0,D.useI18n)(),[l,o]=(0,s.useState)([]),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)({}),[p,h]=(0,s.useTransition)(),f=async()=>{let e=await W(n);o(e),u(t=>{let s={};return e.forEach(e=>{s[e.id]=e.id in t?t[e.id]:e.name}),s})};(0,s.useEffect)(()=>{e&&(f(),c(""))},[e,n]);let g=()=>{let e=d.trim();e&&h(async()=>{try{await Q({workspaceId:n,name:e}),c(""),await f(),a?.(),R.toast.success(i("version.type.add"))}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})};return(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:i("version.manageTypes")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(A.Input,{value:d,onChange:e=>c(e.target.value),placeholder:i("version.type.namePlaceholder"),disabled:p,onKeyDown:e=>{"Enter"===e.key&&g()},className:"flex-1"}),(0,t.jsx)(x.Button,{onClick:g,disabled:p||!d.trim(),children:i("version.type.add")})]}),0===l.length?(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground py-4",children:i("version.type.empty")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:l.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsx)("span",{className:`inline-flex h-2.5 w-2.5 flex-none rounded-full ${(0,k.typeBadgeColor)(m[e.id]??e.name).split(" ").filter(e=>e.startsWith("bg-"))[0]??"bg-muted"}`}),(0,t.jsx)(A.Input,{value:m[e.id]??e.name,onChange:t=>u(s=>({...s,[e.id]:t.target.value})),onBlur:()=>(e=>{let t=(m[e]??"").trim();if(!t)return;let s=l.find(t=>t.id===e);s?.name!==t&&h(async()=>{try{await X(e,{name:t}),await f(),a?.()}catch(t){R.toast.error(t instanceof Error?t.message:String(t)),u(t=>({...t,[e]:s?.name??""}))}})})(e.id),onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},disabled:p,className:"h-7 flex-1 border-transparent bg-transparent shadow-none focus-visible:border-input focus-visible:bg-background focus-visible:shadow-sm"}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-none text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void(window.confirm(i("version.type.deleteConfirm"))&&h(async()=>{try{await Z(t),await f(),a?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}}))},disabled:p,children:(0,t.jsx)(J.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))})]})]})})}function et(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${r}-${n}`}function es(e){if(!e)return;let t=new Date(e);return isNaN(t.getTime())?void 0:t}function er({open:e,onOpenChange:r,projectId:n,workspaceId:a,editVersion:i,defaultBaseBranch:l,projectLocalPath:o,onSuccess:d}){let{t:c}=(0,D.useI18n)(),m=!!i,[u,h]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[v,j]=(0,s.useState)(""),[b,N]=(0,s.useState)([]),[y,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),[k,T]=(0,s.useState)(""),[B,E]=(0,s.useState)(""),[I,L]=(0,s.useState)(""),[H,J]=(0,s.useState)(!1),[Q,X]=(0,s.useState)([]),[Z,en]=(0,s.useState)(!1),[ea,ei]=(0,s.useState)(!1),el=!!o,[eo,ed]=(0,s.useTransition)();return(0,s.useEffect)(()=>{e&&(i?(h(i.number),g(i.name),j(i.typeId??""),S(i.baseBranch??""),T(et(i.startDate)),E(et(i.targetDate)),L(i.description??"")):(h(""),g(""),j(""),S(l??""),T(""),E(""),L("")),J(!1))},[e,i,l]),(0,s.useEffect)(()=>{e&&W(a).then(N).catch(()=>N([]))},[e,a]),(0,s.useEffect)(()=>{e&&el?(en(!0),(0,Y.getProjectBranches)(o).then(X).catch(()=>X([])).finally(()=>en(!1)),(0,q.fetchRemoteBranches)(o).then(()=>(0,Y.getProjectBranches)(o).then(X)).catch(()=>{})):X([])},[e,el,o]),(0,t.jsxs)(O.Dialog,{open:e,onOpenChange:r,children:[(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:m?c("version.edit"):c("version.new")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(V.Label,{htmlFor:"version-number",children:[c("version.field.number"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(A.Input,{id:"version-number",value:u,onChange:e=>h(e.target.value),placeholder:c("version.placeholder.number"),disabled:eo})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(V.Label,{htmlFor:"version-name",children:[c("version.field.name"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(A.Input,{id:"version-name",value:f,onChange:e=>g(e.target.value),placeholder:c("version.placeholder.name"),disabled:eo})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{children:c("version.field.type")}),(0,t.jsxs)(P.Select,{value:v||"__none__",onValueChange:e=>{j(e&&"__none__"!==e?e:"")},children:[(0,t.jsx)(P.SelectTrigger,{className:"w-full",disabled:eo,children:(0,t.jsx)("span",{className:"truncate",children:v?b.find(e=>e.id===v)?.name??c("version.type.uncategorized"):c("version.type.uncategorized")})}),(0,t.jsxs)(P.SelectContent,{children:[(0,t.jsx)(P.SelectItem,{value:"__none__",children:c("version.type.uncategorized")}),b.map(e=>(0,t.jsx)(P.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)(x.Button,{type:"button",variant:"ghost",size:"sm",className:"h-auto justify-start px-0 py-0.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>w(!0),disabled:eo,children:["+ ",c("version.manageTypes")]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{children:c("version.field.baseBranch")}),Z?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:c("task.branchLoading")}):el&&Q.length>0?(0,t.jsxs)(M.Popover,{open:ea,onOpenChange:ei,children:[(0,t.jsxs)(M.PopoverTrigger,{className:"flex h-8 w-full items-center gap-2 rounded-lg border border-input bg-transparent px-3 text-sm transition-colors hover:bg-accent focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",disabled:eo,"data-testid":"version-branch-selector",children:[(0,t.jsx)(p.GitBranch,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:`flex-1 truncate text-left text-xs ${C?"font-mono":"text-muted-foreground"}`,title:C||void 0,children:C||c("version.field.noBranch")}),(0,t.jsx)($.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(M.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(F.Command,{children:[(0,t.jsx)(F.CommandInput,{placeholder:c("task.branchSearch")}),(0,t.jsxs)(F.CommandList,{children:[(0,t.jsx)(F.CommandEmpty,{children:c("task.branchNone")}),(0,t.jsxs)(F.CommandGroup,{children:[(0,t.jsxs)(F.CommandItem,{value:"__none__",onSelect:()=>{S(""),ei(!1)},children:[(0,t.jsx)("span",{className:"flex-1 truncate text-muted-foreground",children:c("version.field.noBranch")}),!C&&(0,t.jsx)(_.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]}),Q.map(e=>(0,t.jsxs)(F.CommandItem,{value:e,onSelect:()=>{S(e),ei(!1)},children:[(0,t.jsx)(p.GitBranch,{className:"mr-2 h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===C&&(0,t.jsx)(_.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]},e))]})]})]})})]}):(0,t.jsx)(A.Input,{id:"version-base-branch",value:C,onChange:e=>S(e.target.value),placeholder:"main",disabled:eo})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-start-date",children:c("version.field.startDate")}),(0,t.jsx)("input",{id:"version-start-date",type:"date",value:k,onChange:e=>T(e.target.value),disabled:eo,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-target-date",children:c("version.field.targetDate")}),(0,t.jsx)("input",{id:"version-target-date",type:"date",value:B,onChange:e=>E(e.target.value),disabled:eo,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(V.Label,{htmlFor:"version-description",children:c("version.field.description")}),(0,t.jsx)(U.Textarea,{id:"version-description",value:I,onChange:e=>L(e.target.value),rows:3,disabled:eo})]}),!m&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(z.Switch,{id:"version-set-current",checked:H,onCheckedChange:J,disabled:eo}),(0,t.jsx)(V.Label,{htmlFor:"version-set-current",className:"cursor-pointer",children:c("version.field.setCurrent")})]})]}),(0,t.jsxs)(O.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:eo,children:c("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{u.trim()&&f.trim()&&ed(async()=>{try{m&&i?await K(i.id,{number:u.trim(),name:f.trim(),typeId:v||null,baseBranch:C.trim()||null,startDate:es(k)??null,targetDate:es(B)??null,description:I.trim()||null}):await G({projectId:n,number:u.trim(),name:f.trim(),typeId:v||void 0,baseBranch:C.trim()||void 0,startDate:es(k),targetDate:es(B),description:I.trim()||void 0,setCurrent:H}),R.toast.success(m?c("version.edit"):c("version.new")),r(!1),d?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})},disabled:eo||!u.trim()||!f.trim(),children:m?c("common.save"):c("common.create")})]})]}),(0,t.jsx)(ee,{open:y,onOpenChange:w,workspaceId:a,onChanged:()=>W(a).then(N)})]})}let en=(0,H.createServerReference)("600bccba3309dc4aadecd4964b76e13494192c6705",H.callServer,void 0,H.findSourceMapURL,"releaseVersion");function ea({open:e,onOpenChange:r,version:n,candidates:a,onSuccess:i}){let{t:l}=(0,D.useI18n)(),[o,d]=(0,s.useState)(""),[c,m]=(0,s.useTransition)();(0,s.useEffect)(()=>{e&&d("")},[e,n]);let u=a.find(e=>e.id===o),p=a.length>0,h=p&&!!o&&!c;return(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsx)(O.DialogTitle,{children:l("version.releaseAction")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[n&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[n.number," · ",n.name]}),(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{children:l("version.release.rolloverHint")}),n?.unfinishedCount!==void 0&&n.unfinishedCount>0&&(0,t.jsxs)("span",{className:"ml-1 font-medium text-foreground",children:["(",n.unfinishedCount,")"]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:l("version.release.nextVersion")}),p?(0,t.jsxs)(P.Select,{value:o,onValueChange:e=>{e&&d(e)},disabled:c,children:[(0,t.jsx)(P.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:u?`${u.number} \xb7 ${u.name}`:""})}),(0,t.jsx)(P.SelectContent,{children:a.map(e=>(0,t.jsxs)(P.SelectItem,{value:e.id,children:[e.number," · ",e.name]},e.id))})]}):(0,t.jsx)("p",{className:"text-xs text-destructive",children:l("version.release.noCandidates")})]})]}),(0,t.jsxs)(O.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:c,children:l("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{n&&o&&m(async()=>{try{await en(n.id,o),R.toast.success(l("version.release")),r(!1),i?.()}catch(e){R.toast.error(e instanceof Error?e.message:String(e))}})},disabled:!h,children:l("version.release")})]})]})})}var ei=e.i(400355);let el=(0,H.createServerReference)("40c5a17567f413c69a102c1aa4426d0d2c22e92efa",H.callServer,void 0,H.findSourceMapURL,"getVersionDiff");var eo=e.i(196199);function ed({file:e}){let{t:r}=(0,D.useI18n)(),[n,a]=(0,s.useState)(!0),i=e.to&&"/dev/null"!==e.to?e.to:e.from??"",o=e.additions??0,d=e.deletions??0,c=[];for(let t of e.chunks)for(let e of(c.push({type:"normal",content:t.content,chunkHeader:t.content}),t.changes))c.push({type:e.type,content:e.content});let x=c.length>500,m=x?c.slice(0,500):c;return(0,t.jsxs)("div",{className:"overflow-hidden rounded-[10px] border border-border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),className:"flex w-full items-center gap-2 bg-muted/40 px-3 py-2 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${n?"rotate-90":""}`}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono text-[12px] font-medium text-foreground",children:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-emerald-400",children:["+",o]}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-rose-400",children:["−",d]})]}),n&&(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsx)("pre",{className:"m-0 p-0",children:m.map((e,s)=>void 0!==e.chunkHeader?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground bg-muted/40",children:e.content},s):"add"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-emerald-300 bg-emerald-500/10",children:e.content},s):"del"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-rose-300 bg-rose-500/10",children:e.content},s):(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground",children:e.content},s))}),x&&(0,t.jsx)("p",{className:"border-t border-border px-3 py-2 text-[11px] text-muted-foreground/70 italic",children:r("version.diff.truncated")})]})]})}function ec({open:e,onOpenChange:r,versionId:n,versionLabel:a}){let{t:i}=(0,D.useI18n)(),[l,o]=(0,s.useTransition)(),[d,c]=(0,s.useState)(null),[x,m]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e&&n&&(c(null),m(!1),o(async()=>{let e=await el(n);if(!e)return void m(!0);let t=(0,eo.parseUnifiedDiff)(e.patch);0===t.length||""===e.patch?m(!0):c(t)}))},[e,n]),(0,t.jsx)(O.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(O.DialogContent,{className:"sm:max-w-3xl max-h-[80vh] overflow-auto",children:[(0,t.jsx)(O.DialogHeader,{children:(0,t.jsxs)(O.DialogTitle,{children:[i("version.diff.title"),a?` — ${a}`:""]})}),l&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 text-muted-foreground",children:[(0,t.jsx)(ei.Loader2,{className:"h-5 w-5 animate-spin"}),(0,t.jsx)("span",{className:"text-sm",children:i("version.diff.loading")})]}),!l&&x&&(0,t.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:i("version.diff.empty")}),!l&&d&&d.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:d.map((e,s)=>(0,t.jsx)(ed,{file:e},s))})]})})}var ex=e.i(605005);function em({version:e,isFirst:s,isLast:r,dashed:n=!1,diffStat:a,onEdit:i,onRelease:l,onViewDiff:o,onOpenTaskDetail:d}){return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:["w-px flex-none",s?"h-0":"h-6",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].filter(Boolean).join(" ")}),(0,t.jsx)("div",{className:["z-10 h-3.5 w-3.5 flex-none rounded-full border-2",e.isCurrent?"border-primary bg-primary ring-2 ring-primary/30":"ACTIVE"===e.status?"border-emerald-400 bg-emerald-400":"RELEASED"===e.status?"border-zinc-500 bg-zinc-500":"border-muted-foreground/40 bg-transparent border-dashed"].join(" ")}),!r&&(0,t.jsx)("div",{className:["w-px flex-1",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].join(" ")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsx)(L,{version:e,diffStat:a??null,onEdit:i,onRelease:l,onViewDiff:o,onOpenTaskDetail:d})})]})}e.s(["VersionTimelineClient",0,function({project:e,workspaceId:d,versions:u,diffStats:p,backlog:h}){let f,{t:g}=(0,D.useI18n)(),v=(0,r.useRouter)(),[j,b]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[S,k]=(0,s.useState)(!1),[T,B]=(0,s.useState)(null),[E,L]=(0,s.useState)(null),[R,_]=(0,s.useState)(null),[$,O]=(0,s.useState)(!1),A=[...[...u.filter(e=>"RELEASED"!==e.status)].sort((e,t)=>{if(!e.targetDate&&!t.targetDate)return 0;if(!e.targetDate)return 1;if(!t.targetDate)return -1;let s=new Date(t.targetDate).getTime()-new Date(e.targetDate).getTime();return 0!==s?s:new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}),...[...u.filter(e=>"RELEASED"===e.status)].sort((e,t)=>e.releasedAt||t.releasedAt?e.releasedAt?t.releasedAt?new Date(t.releasedAt).getTime()-new Date(e.releasedAt).getTime():-1:1:0)],V=e=>{let t=u.find(t=>t.id===e);t&&(y({id:t.id,number:t.number,name:t.name,typeId:t.typeId??null,baseBranch:t.baseBranch,startDate:t.startDate,targetDate:t.targetDate,description:t.description}),b(!0))},P=e=>{let t=u.find(t=>t.id===e);t&&(B(t),k(!0))},M=e=>{L(e)},F=()=>{y(null),b(!0)},z=()=>{v.refresh()},U=T?u.filter(e=>e.id!==T.id&&("PLANNED"===e.status||"ACTIVE"===e.status)).map(e=>({id:e.id,number:e.number,name:e.name})):[],H=T?T.tasks.filter(e=>"DONE"!==e.status&&"CANCELLED"!==e.status).length:void 0;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-xl flex shrink-0 items-center gap-4 border-b px-6",children:[(0,t.jsxs)(n.default,{href:`/workspaces/${d}`,className:"flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(o.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:g("archive.backToBoard")})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("span",{children:g("version.timeline")})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:()=>C(!0),children:[(0,t.jsx)(c,{className:"h-4 w-4"}),g("version.manageTypes")]}),(0,t.jsxs)(x.Button,{onClick:F,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),(0,t.jsx)(m.ScrollArea,{className:"min-h-0 flex-1",children:(0,t.jsx)("div",{className:"px-6 py-6",children:(0,t.jsxs)("div",{className:"mx-auto max-w-3xl",children:[0===u.length&&0===h.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 py-20 text-center text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:g("version.empty.list")}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:F,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),A.length>0&&(0,t.jsx)("div",{className:"relative",children:A.map((e,s)=>(0,t.jsx)(em,{version:e,isFirst:0===s,isLast:s===A.length-1&&0===h.length,diffStat:p[e.id],onEdit:V,onRelease:P,onViewDiff:M,onOpenTaskDetail:_},e.id))}),h.length>0&&(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:"h-6 w-px bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]"}),(0,t.jsx)("div",{className:"z-10 h-3.5 w-3.5 flex-none rounded-full border-2 border-dashed border-muted-foreground/40 bg-transparent"})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-[14px] border border-dashed bg-muted/40 shadow-sm",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>O(e=>!e),className:"w-full px-4 py-3 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(l.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${$?"rotate-90":""}`}),(0,t.jsx)(i.Archive,{className:"h-4 w-4 flex-none text-muted-foreground/70"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:g("version.history")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:g("version.historySub")}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsxs)("span",{className:"text-[11.5px] text-muted-foreground",children:[h.length," ",g("version.tasksCount")]})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),$&&(0,t.jsx)("div",{className:"border-t border-dashed border-border px-2 pb-2 pt-1.5",children:h.map(e=>(0,t.jsx)(I,{task:e,onOpenDetail:_},e.id))})]})})]})]})})}),(0,t.jsx)(er,{open:j,onOpenChange:e=>{b(e),e||y(null)},projectId:e.id,workspaceId:d,editVersion:N,defaultBaseBranch:null,projectLocalPath:e.localPath,onSuccess:z}),(0,t.jsx)(ee,{open:w,onOpenChange:C,workspaceId:d,onChanged:()=>v.refresh()}),(0,t.jsx)(ea,{open:S,onOpenChange:e=>{k(e),e||B(null)},version:T?{id:T.id,number:T.number,name:T.name,unfinishedCount:H}:null,candidates:U,onSuccess:z}),(0,t.jsx)(ec,{open:!!E,onOpenChange:e=>{e||L(null)},versionId:E,versionLabel:E&&(f=u.find(e=>e.id===E))?`${f.number} ${f.name}`:void 0}),(0,t.jsx)(ex.TaskOverviewDrawer,{open:!!R,onOpenChange:e=>{e||_(null)},taskId:R})]})}],645119)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},732179,246025,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40744ed3c17602f30e1df64a1ea0d8368af7bd224c",t.callServer,void 0,t.findSourceMapURL,"openInFileManager");e.s(["openInFileManager",0,a],732179);let r=(0,t.createServerReference)("40effa36b2c8877c59eaceb39025dce4844df564de",t.callServer,void 0,t.findSourceMapURL,"openInEditor");e.s(["openInEditor",0,r],246025)},12659,e=>{"use strict";let t=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,t],12659)},736061,460707,e=>{"use strict";var t=e.i(572989);let a=(0,t.default)("folder-search",[["path",{d:"M10.7 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 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);e.s(["FolderSearch",0,a],736061);let r=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,r],460707)},35967,e=>{"use strict";var t=e.i(289721);let a=(0,e.i(572989).default)("milestone",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",key:"8gz4t4"}]]);var r=e.i(533499);let s=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function n(e){return s[function(e){let t=0;for(let a=0;a<e.length;a++)t=31*t+e.charCodeAt(a)>>>0;return t}(e)%s.length]}let l={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};e.s(["TaskVersionTag",0,function({number:e,name:r,showName:s=!1,className:n="",title:l}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground ${n}`,title:l??(r?`${e} \xb7 ${r}`:e),children:[(0,t.jsx)(a,{className:"h-2.5 w-2.5 shrink-0"}),(0,t.jsx)("span",{className:"font-mono",children:e}),s&&r?(0,t.jsx)("span",{className:"max-w-[140px] truncate",children:r}):null]})},"VersionStatusBadge",0,function({status:e}){let{t:a}=(0,r.useI18n)();return(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${l[e]}`,children:a(`version.status.${e}`)})},"VersionTypeBadge",0,function({name:e}){let{t:a}=(0,r.useI18n)();return e?(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${n(e)}`,children:e}):(0,t.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:a("version.type.uncategorized")})},"typeBadgeColor",0,n],35967)},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},715443,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("4044480c2820912250aa5e72984e1e2006506180c4",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,a])},110204,e=>{"use strict";var t=e.i(289721),a=e.i(975157);e.s(["Label",0,function({className:e,...r}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,a.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}])},875840,e=>{"use strict";let t=(0,e.i(572989).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],875840)},254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},937304,e=>{"use strict";let t=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif","apng"]);e.s(["isImageAsset",0,function(e,a){if(a?.startsWith("image/"))return!0;let r=e.split(".").pop()?.toLowerCase();return!!r&&t.has(r)},"localPathToApiUrl",0,function(e){let t=e.replace(/\\/g,"/").match(/\/assets\/([^/]+)\/([^/]+)$/);return t?`/api/files/assets/${t[1]}/${t[2]}`:e}])},235357,144640,e=>{"use strict";var t=e.i(289721),a=e.i(965652),r=e.i(585012),s=e.i(657153),n=e.i(19671),l=e.i(368490),i=e.i(902539);let o=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var c=e.i(922541),d=e.i(533499);function u({children:e,onClick:a,title:r,disabled:s,...n}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),s||a()},title:r,disabled:s,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...n,children:e})}e.s(["ImageLightbox",0,function({imageUrl:e,filename:x,open:m,onOpenChange:h,assets:p,currentIndex:g,onIndexChange:f}){let{t:b}=(0,d.useI18n)(),[v,y]=(0,a.useState)(1),[j,k]=(0,a.useState)({x:0,y:0}),[w,N]=(0,a.useState)(!1),C=(0,a.useRef)(null),[S,I]=(0,a.useState)(!1),D=!!p&&p.length>1&&"number"==typeof g&&!!f,T=D&&g>0,P=D&&g<p.length-1,M=D?p.length:0,E=M>0?Math.ceil(M/10):0,L=D?Math.floor(g/10):0,R=10*L,O=Math.min(R+10,M),$=E>1,B=D&&L>0,A=D&&L<E-1;(0,a.useEffect)(()=>{I(!0)},[]),(0,a.useEffect)(()=>{y(1),k({x:0,y:0})},[e]),(0,a.useEffect)(()=>{if(!m)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[m]);let F=(0,a.useCallback)(()=>h(!1),[h]),U=(0,a.useCallback)(()=>{D&&T&&f(g-1)},[D,T,f,g]),_=(0,a.useCallback)(()=>{D&&P&&f(g+1)},[D,P,f,g]),z=(0,a.useCallback)(()=>{D&&B&&f((L-1)*10)},[D,B,f,L]),H=(0,a.useCallback)(()=>{D&&A&&f(Math.min((L+1)*10,M-1))},[D,A,f,L,M]),V=(0,a.useCallback)(()=>{y(e=>Math.min(8,1.25*e))},[]),G=(0,a.useCallback)(()=>{y(e=>{let t=Math.max(.1,e/1.25);return t<=1&&k({x:0,y:0}),t})},[]),W=(0,a.useCallback)(()=>{y(1),k({x:0,y:0})},[]);(0,a.useEffect)(()=>{if(!m)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),F();break;case"ArrowLeft":D&&(e.preventDefault(),U());break;case"ArrowRight":D&&(e.preventDefault(),_());break;case"+":case"=":e.preventDefault(),V();break;case"-":case"_":e.preventDefault(),G();break;case"0":e.preventDefault(),W()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[m,D,F,U,_,V,G,W]);let Y=(0,a.useRef)(!1),X=()=>{w&&N(!1),C.current=null},J=w?"cursor-grabbing":"cursor-grab";if(!m||!S)return null;let K=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":b("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[x,D?` \xb7 ${g+1} / ${p.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${J}`,onClick:e=>{e.target===e.currentTarget&&F()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;y(e=>{let a=Math.min(8,Math.max(.1,e*t));return a<=1&&k({x:0,y:0}),a})},children:e&&(0,t.jsx)("img",{src:e,alt:x,onClick:e=>{e.stopPropagation(),Y.current&&(Y.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),Y.current=!1,e.target.setPointerCapture?.(e.pointerId),C.current={x:e.clientX,y:e.clientY,panX:j.x,panY:j.y},N(!0))},onPointerMove:e=>{if(!C.current)return;let t=e.clientX-C.current.x,a=e.clientY-C.current.y;Math.abs(t)+Math.abs(a)>5&&(Y.current=!0),w&&k({x:C.current.panX+t,y:C.current.panY+a})},onPointerUp:X,onPointerLeave:X,onPointerCancel:X,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${j.x}px, ${j.y}px, 0) scale(${v})`,transformOrigin:"center center",transition:w?"none":"transform 120ms ease-out",willChange:w?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[D&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[$&&(0,t.jsx)(u,{onClick:z,title:`${b("assets.lightbox.prev")} (-10)`,"aria-label":`${b("assets.lightbox.prev")} (-10)`,disabled:!B,children:(0,t.jsx)(i.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(u,{onClick:U,title:b("assets.lightbox.prev"),"aria-label":b("assets.lightbox.prev"),disabled:!T,children:(0,t.jsx)(n.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:p.slice(R,O).map((e,a)=>{let r=R+a,s=r===g;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),s||f(r)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${s?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+r)})}),(0,t.jsx)(u,{onClick:_,title:b("assets.lightbox.next"),"aria-label":b("assets.lightbox.next"),disabled:!P,children:(0,t.jsx)(l.ChevronRight,{className:"h-4 w-4"})}),$&&(0,t.jsx)(u,{onClick:H,title:`${b("assets.lightbox.next")} (+10)`,"aria-label":`${b("assets.lightbox.next")} (+10)`,disabled:!A,children:(0,t.jsx)(o,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*v),"%"]}),(0,t.jsx)(u,{onClick:W,title:b("assets.lightbox.reset"),"aria-label":b("assets.lightbox.reset"),disabled:1===v&&0===j.x&&0===j.y,children:(0,t.jsx)(c.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(u,{onClick:F,title:b("assets.lightbox.close"),"aria-label":b("assets.lightbox.close"),children:(0,t.jsx)(s.X,{className:"h-4 w-4"})})]})]})]});return(0,r.createPortal)(K,document.body)}],235357);var x=e.i(400355);e.i(254826);var m=e.i(309735),h=e.i(776639);e.s(["TextPreviewDialog",0,function({url:e,filename:r,open:s,onOpenChange:n}){let{t:l}=(0,d.useI18n)(),[i,o]=(0,a.useState)(null),[c,u]=(0,a.useState)(!1),[p,g]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!s||!e){o(null),g(null);return}let t=!1;return u(!0),g(null),o(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(o(e),u(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?g(l("assets.fileTooLarge")):g(l("assets.previewError")),u(!1))}),()=>{t=!0}},[s,e,l]);let f=r.split(".").pop()?.toLowerCase();return(0,t.jsx)(h.Dialog,{open:s,onOpenChange:n,children:(0,t.jsxs)(h.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:r}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(c)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(x.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l("assets.loadingPreview")})]});if(p)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:p});if(null===i)return null;if("md"===f)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(m.Streamdown,{children:i})});if("json"===f){let e;try{e=JSON.stringify(JSON.parse(i),null,2)}catch{e=i}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:i})})()})]})})}],144640)},623706,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40df13f09c67846d69939bdf708fb29fea1275139b",t.callServer,void 0,t.findSourceMapURL,"createTask");e.s(["createTask",0,a])},192551,802380,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("404268743695e9bb2522c2739b49209f98a0e6c410",t.callServer,void 0,t.findSourceMapURL,"getTaskNotes");e.s(["getTaskNotes",0,a],192551);let r=(0,t.createServerReference)("40bc08544885636f5a33a149f2ca4aa39d638cd7ad",t.callServer,void 0,t.findSourceMapURL,"getTaskAssets");e.s(["getTaskAssets",0,r],802380)},456346,75896,72609,e=>{"use strict";let t=(0,e.i(572989).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,t],456346);var a=e.i(514798);let r=(0,a.createServerReference)("405dda82de054a22fa6f48d7a303a6399f1f1ea165",a.callServer,void 0,a.findSourceMapURL,"getProjectBranches");e.s(["getProjectBranches",0,r],75896);let s=(0,a.createServerReference)("40445148acbf903a1eb13a7785977e49ed766bb8bb",a.callServer,void 0,a.findSourceMapURL,"fetchRemoteBranches");e.s(["fetchRemoteBranches",0,s],72609)},744798,e=>{"use strict";var t=e.i(289721),a=e.i(965652),r=e.i(776639),s=e.i(519455),n=e.i(793479),l=e.i(624687),i=e.i(110204),o=e.i(226145),c=e.i(597746),d=e.i(456346),u=e.i(280027),x=e.i(337822),m=e.i(317056),h=e.i(533499),p=e.i(75896),g=e.i(72609),f=e.i(514798);let b=(0,f.createServerReference)("40fddb22bbbfdcde5c0c57a5ab4aea8886d8cebef8",f.callServer,void 0,f.findSourceMapURL,"getCurrentBranch");var v=e.i(715443);e.s(["CreateTaskDialog",0,function({open:e,onOpenChange:f,onSubmit:y,onUpdate:j,defaultStatus:k="TODO",editTask:w,editTaskLabelIds:N,prefillFromTask:C,labels:S,projectType:I,projectLocalPath:D,versions:T,defaultVersionId:P}){let M,[E,L]=(0,a.useState)(""),[R,O]=(0,a.useState)(""),[$,B]=(0,a.useState)("MEDIUM"),[A,F]=(0,a.useState)(""),[U,_]=(0,a.useState)([]),[z,H]=(0,a.useState)([]),[V,G]=(0,a.useState)(!1),[W,Y]=(0,a.useState)(""),[X,J]=(0,a.useState)(!1),[K,q]=(0,a.useState)(!0),[Q,Z]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(null),{t:ea}=(0,h.useI18n)();(0,a.useEffect)(()=>{if(!e||w)return;let t=!1;return(0,v.getConfigValues)(["task.defaultUseWorktree","task.defaultAutoStart"]).then(e=>{if(t)return;let a=e["task.defaultUseWorktree"],r=e["task.defaultAutoStart"];"boolean"==typeof a&&q(a),"boolean"==typeof r&&Z(r)}).catch(()=>{}),()=>{t=!0}},[e,w]);let er=!!w,es=!!D;return(0,a.useEffect)(()=>{w?(L(w.title),O(w.description??""),B(w.priority),F(w.subPath??""),_(N??[]),et(w.versionId??null)):(C?(L(C.title??""),O(C.description??""),B(C.priority??"MEDIUM"),F(C.subPath??""),_(C.labelIds??[])):(L(""),O(""),B("MEDIUM"),F(""),_([])),et(P??null))},[w,N,C,P]),(0,a.useEffect)(()=>{e||w||(L(""),O(""),B("MEDIUM"),F(""),_([]),H([]),Y(""),J(!1),et(P??null))},[e,w,P]),(0,a.useEffect)(()=>{e&&es&&!w&&(G(!0),Promise.all([(0,p.getProjectBranches)(D),b(D)]).then(([e,t])=>{H(e);let a=C?.baseBranch??null;a&&e.includes(a)?Y(a):Y(t&&e.includes(t)?t:e[0]??""),G(!1),(0,g.fetchRemoteBranches)(D).then(()=>{setTimeout(()=>{(0,p.getProjectBranches)(D).then(e=>{H(e),Y(t=>e.includes(t)?t:e[0]??"")}).catch(()=>{})},3e3)})}).catch(()=>{H([]),Y(""),G(!1)}))},[e,es,D,w,C]),(0,t.jsx)(r.Dialog,{open:e,onOpenChange:f,disablePointerDismissal:!0,children:(0,t.jsxs)(r.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(r.DialogHeader,{children:(0,t.jsx)(r.DialogTitle,{children:er?ea("task.edit"):ea("task.create")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{htmlFor:"title",children:ea("task.title")}),(0,t.jsx)(n.Input,{id:"title","data-testid":"task-title",placeholder:ea("task.titlePlaceholder"),value:E,onChange:e=>L(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{htmlFor:"description",children:ea("task.description")}),(0,t.jsx)(l.Textarea,{id:"description",placeholder:ea("task.descPlaceholder"),rows:4,value:R,onChange:e=>O(e.target.value),className:"max-h-[200px] overflow-y-auto"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{htmlFor:"subPath",children:ea("task.subPath")}),(0,t.jsx)(n.Input,{id:"subPath",placeholder:ea("task.subPathPlaceholder"),value:A,onChange:e=>F(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:ea("task.subPathHint")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{children:ea("task.priority")}),(0,t.jsx)("div",{className:"flex gap-1.5",children:["LOW","MEDIUM","HIGH","CRITICAL"].map(e=>{let a={LOW:{label:ea("task.priorityLow"),style:"text-slate-300 border-slate-500/30 bg-slate-500/10"},MEDIUM:{label:ea("task.priorityMedium"),style:"text-amber-300 border-amber-500/30 bg-amber-500/10"},HIGH:{label:ea("task.priorityHigh"),style:"text-orange-300 border-orange-500/30 bg-orange-500/10"},CRITICAL:{label:ea("task.priorityCritical"),style:"text-rose-300 border-rose-500/30 bg-rose-500/10"}}[e];return(0,t.jsx)("button",{type:"button",onClick:()=>B(e),className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition-all ${$===e?`${a.style} ring-1 ring-current/20`:"border-border text-muted-foreground hover:bg-accent"}`,children:a.label},e)})})]}),es&&!er&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{children:ea("task.baseBranch")}),V?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:ea("task.branchLoading")}):z.length>0?(0,t.jsxs)(x.Popover,{open:X,onOpenChange:J,children:[(0,t.jsxs)(x.PopoverTrigger,{className:"flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-mono transition-colors hover:bg-accent focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"branch-selector",children:[(0,t.jsx)(o.GitBranch,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"flex-1 truncate text-left text-xs",title:W||void 0,children:W||ea("task.branchNone")}),(0,t.jsx)(d.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(x.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(m.Command,{children:[(0,t.jsx)(m.CommandInput,{placeholder:ea("task.branchSearch")}),(0,t.jsxs)(m.CommandList,{children:[(0,t.jsx)(m.CommandEmpty,{children:ea("task.branchNone")}),(0,t.jsx)(m.CommandGroup,{children:z.map(e=>(0,t.jsxs)(m.CommandItem,{value:e,onSelect:()=>{Y(e),J(!1)},children:[(0,t.jsx)(o.GitBranch,{className:"h-3 w-3 text-muted-foreground shrink-0 mr-2"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===W&&(0,t.jsx)(c.Check,{className:"h-3 w-3 text-primary shrink-0 ml-auto"})]},e))})]})]})})]}):(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:ea("task.branchNone")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,t.jsx)(i.Label,{className:"text-xs text-muted-foreground",children:ea("task.worktreeLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>q(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${K===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?ea("task.worktreeYes"):ea("task.worktreeNo")},String(e)))})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)(i.Label,{className:"text-xs text-muted-foreground",children:ea("task.autoStartLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>Z(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${Q===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?ea("task.autoStartYes"):ea("task.autoStartNo")},String(e)))})]})]}),S.length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{children:ea("task.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:S.map(e=>{let a=U.includes(e.id);return(0,t.jsx)("button",{type:"button",onClick:()=>{_(t=>a?t.filter(t=>t!==e.id):[...t,e.id])},className:`rounded-full px-2.5 py-1 text-xs font-medium transition-all ${a?"ring-1 ring-current/30":"opacity-50 hover:opacity-80"}`,style:{backgroundColor:e.color+"20",color:e.color,borderColor:a?e.color+"40":"transparent",borderWidth:"1px"},children:e.name},e.id)})})]}),(!er||T&&T.length>0)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{children:ea("version.picker.label")}),T&&T.length>0?(0,t.jsxs)(u.Select,{value:ee??"__none__",onValueChange:e=>et("__none__"===e?null:e),children:[(0,t.jsx)(u.SelectTrigger,{children:(0,t.jsx)("span",{className:"truncate text-sm",children:ee&&(M=T.find(e=>e.id===ee))?M.isCurrent?`${M.number} \xb7 ${M.name} \xb7 ${ea("version.currentShort")}`:`${M.number} \xb7 ${M.name}`:ea("version.picker.none")})}),(0,t.jsxs)(u.SelectContent,{children:[(0,t.jsx)(u.SelectItem,{value:"__none__",children:ea("version.picker.none")}),T.map(e=>(0,t.jsx)(u.SelectItem,{value:e.id,children:e.isCurrent?`${e.number} \xb7 ${e.name} \xb7 ${ea("version.currentShort")}`:`${e.number} \xb7 ${e.name}`},e.id))]})]}):(0,t.jsx)("p",{className:"rounded-md border border-dashed border-border px-3 py-2 text-xs text-muted-foreground",children:ea("version.picker.empty")})]})]}),(0,t.jsxs)(r.DialogFooter,{children:[(0,t.jsx)(s.Button,{variant:"outline",onClick:()=>f(!1),children:ea("common.cancel")}),(0,t.jsx)(s.Button,{onClick:()=>{E.trim()&&(er&&j?j(w.id,{title:E,description:R,priority:$,labelIds:U,subPath:A.trim()||"",versionId:ee}):y({title:E,description:R,priority:$,status:k,labelIds:U,...es&&K&&W?{baseBranch:W}:{},...A.trim()?{subPath:A.trim()}:{},versionId:ee,autoStart:Q}),L(""),O(""),B("MEDIUM"),F(""),_([]),H([]),Y(""),q(!0),et(null),f(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:er?ea("common.save"):ea("common.create")})]})]})})}],744798)},997025,e=>{"use strict";var t=e.i(289721);e.i(254826);var a=e.i(309735),r=e.i(776639),s=e.i(533499);e.s(["NotePreviewDialog",0,function({note:e,open:n,onOpenChange:l}){let{t:i}=(0,s.useI18n)();return(0,t.jsx)(r.Dialog,{open:n,onOpenChange:l,children:(0,t.jsxs)(r.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:e?.title}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:e&&e.content.trim()?(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(a.Streamdown,{children:e.content})}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.noteEmpty")})})]})})}])},685149,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘","任务笔记","经验洞见"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},297338,e=>{"use strict";let t=(0,e.i(572989).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,t],297338)},980376,552961,e=>{"use strict";var t=e.i(289721),a=e.i(225061),r=e.i(975157),s=e.i(519455),n=e.i(670123);function l({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function i({className:e,...s}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,r.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...s})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:o,side:c="right",showCloseButton:d=!0,...u}){return(0,t.jsxs)(l,{children:[(0,t.jsx)(i,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":c,className:(0,r.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...u,children:[o,d&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(s.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(n.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...s})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,r.cn)("flex flex-col gap-0.5 p-4",e),...a})},"SheetTitle",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,r.cn)("font-heading text-base font-medium text-foreground",e),...s})}],980376);var o=e.i(514798);let c=(0,o.createServerReference)("40d4947da4af538751a36db357c67231410622b977",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,c],552961)},606393,e=>{"use strict";let t=(0,e.i(572989).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],606393)},605005,e=>{"use strict";var t=e.i(289721),a=e.i(965652),r=e.i(980376),s=e.i(759684),n=e.i(487486),l=e.i(519455),i=e.i(533499),o=e.i(623706),c=e.i(552961),d=e.i(119063),u=e.i(192551),x=e.i(802380),m=e.i(732179),h=e.i(246025),p=e.i(613585),g=e.i(744798),f=e.i(997025),b=e.i(235357),v=e.i(144640),y=e.i(937304),j=e.i(685149),k=e.i(606393),w=e.i(875840),N=e.i(245697),C=e.i(12659),S=e.i(736061),I=e.i(460707),D=e.i(567860),T=e.i(645378),P=e.i(867533),M=e.i(297338),E=e.i(453889);function L({added:e,removed:a}){let{t:r}=(0,i.useI18n)();return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,t.jsx)("span",{children:r("diff.filesChanged",{count:String(e+a)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),a>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",a]})]})}var R=e.i(35967),O=e.i(360112);let $=/\.(txt|md|json)$/i;e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:B,taskId:A}){let{t:F}=(0,i.useI18n)(),[U,_]=(0,a.useState)(null),[z,H]=(0,a.useTransition)(),[V,G]=(0,a.useState)(!1),[W,Y]=(0,a.useState)([]),[X,J]=(0,a.useState)([]),[K,q]=(0,a.useState)(null),[Q,Z]=(0,a.useState)([]),[ee,et]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!A||!e){_(null),J([]),Z([]);return}(0,u.getTaskNotes)(A).then(e=>J(e.map(e=>({id:e.id,title:e.title,content:e.content,category:e.category})))).catch(()=>J([])),(0,x.getTaskAssets)(A).then(e=>Z(e.map(e=>({id:e.id,filename:e.filename,path:e.path,mimeType:e.mimeType,size:e.size})))).catch(()=>Z([])),H(async()=>{let e=await (0,c.getTaskOverview)(A);e&&(_(e),e.project?.workspaceId&&(0,d.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{Y(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>Y([])))})},[A,e]);let ea=U?j.BOARD_COLUMNS.find(e=>e.id===U.status):null,er=U?j.PRIORITY_CONFIG[U.priority]:null,es=U?.executions?.[0]??null,en=(()=>{if(es?.worktreePath)return es.worktreePath;let e=U?.project?.localPath;return e?U?.subPath?`${e}/${U.subPath}`:e:null})(),el=(()=>{let e=es?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),ei=e=>(0,y.isImageAsset)(e.filename,e.mimeType)||$.test(e.filename),eo=e=>{ei(e)?et(e):O.toast.info(F("assets.previewNotSupported"))},ec=async e=>{try{let t=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path})});if(!t.ok){let e=await t.json().catch(()=>({}));O.toast.error(e.error||F("git.openInFileManagerFailed"))}}catch{O.toast.error(F("git.openInFileManagerFailed"))}},ed=ee?(0,y.isImageAsset)(ee.filename,ee.mimeType)?"image":$.test(ee.filename)?"text":null:null,eu=Q.filter(e=>(0,y.isImageAsset)(e.filename,e.mimeType)).map(e=>({id:e.id,url:(0,y.localPathToApiUrl)(e.path),filename:e.filename})),ex=ee?eu.findIndex(e=>e.id===ee.id):-1,em=async e=>{if(U?.project)try{let{autoStart:t,...a}=e;await (0,o.createTask)({...a,projectId:U.project.id}),O.toast.success(F("taskDrawer.duplicateSuccess")),G(!1),B(!1)}catch{O.toast.error(F("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(r.Sheet,{open:e,onOpenChange:B,children:[(0,t.jsxs)(r.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(r.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(r.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:U?.title??""}),(0,t.jsx)(r.SheetDescription,{className:"sr-only",children:F("taskDrawer.title")}),U&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[ea&&(0,t.jsxs)(n.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${ea.color}`}),ea.label]}),er&&(0,t.jsx)(n.Badge,{variant:"secondary",className:`text-xs ${er.color}`,children:er.label}),U.version&&(0,t.jsx)(R.TaskVersionTag,{number:U.version.number,name:U.version.name,showName:!0})]})]}),(0,t.jsx)(s.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:z&&!U?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:F("assets.loading")}):U?(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:F("taskDrawer.description")}),(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:U.description||F("taskDrawer.noDescription")})]}),U.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:F("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:U.labels.map(e=>(0,t.jsx)(n.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:F("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(U.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(N.Package,{className:"h-3.5 w-3.5"}),F("taskDrawer.resources"),(0,t.jsx)("span",{className:"text-foreground",children:U._count.assets})]}),Q.length>0?(0,t.jsx)("div",{className:"space-y-1.5",children:Q.map(e=>{var a;let r=ei(e);return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-2 py-1.5",children:[(0,t.jsx)(M.Paperclip,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("button",{type:"button",onClick:()=>eo(e),disabled:!r,className:`min-w-0 flex-1 truncate text-left text-sm ${r?"cursor-pointer hover:underline":"cursor-default"}`,title:r?F("assets.preview"):e.filename,children:e.filename}),(0,t.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(a=e.size)?a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1024/1024).toFixed(1)} MB`:""}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[r&&(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-xs",onClick:()=>eo(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:F("assets.preview"),children:(0,t.jsx)(P.Eye,{className:"h-3 w-3"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-xs",onClick:()=>ec(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:F("assets.revealInFinder"),children:(0,t.jsx)(E.FolderOpen,{className:"h-3 w-3"})})]})]},e.id)})}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:F("taskDrawer.noResources")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(T.FileText,{className:"h-3.5 w-3.5"}),F("taskDrawer.notes")]}),X.length>0?(0,t.jsx)("div",{className:"space-y-1.5",children:X.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>q(e),className:"group/note flex w-full items-start gap-2 rounded-md border border-border p-2 text-left transition-colors hover:bg-accent/40",title:F("taskDrawer.previewNote"),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium",children:e.title}),e.content&&(0,t.jsx)("p",{className:"mt-0.5 line-clamp-2 whitespace-pre-wrap text-xs text-muted-foreground",children:e.content})]}),(0,t.jsx)(P.Eye,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/note:opacity-100"})]},e.id))}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:F("taskDrawer.noNotes")})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:F("taskDrawer.fileChanges")}),el?(0,t.jsx)(L,{added:el.added,removed:el.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:F("taskDrawer.noFileChanges")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(C.PlayCircle,{className:"h-3.5 w-3.5"}),F("taskDrawer.lastExecution")]}),es?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(n.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:es.status}),es.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:es.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:F("taskDrawer.noExecution")})]}),en&&(0,t.jsxs)("section",{className:"flex flex-col",children:[(0,t.jsxs)(l.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,m.openInFileManager)(en)}catch(e){console.error("openInFileManager failed:",e),O.toast.error(F("git.openInFileManagerFailed"))}},children:[(0,t.jsx)(S.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),F("git.openInFileManager")]}),(0,t.jsxs)(l.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,h.openInEditor)(en)}catch(e){console.error("openInEditor failed:",e),O.toast.error(F("git.openInEditorFailed"))}},children:[(0,t.jsx)(I.Code,{className:"h-3.5 w-3.5 shrink-0"}),F("git.openInEditor")]}),(0,t.jsxs)(l.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,p.openInTerminal)(en)}catch(e){console.error("openInTerminal failed:",e),O.toast.error(F("git.openInTerminalFailed"))}},children:[(0,t.jsx)(D.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),F("git.openInTerminal")]})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(l.Button,{variant:"default",className:"w-full",onClick:()=>{U&&G(!0)},disabled:!U,children:[(0,t.jsx)(w.Copy,{className:"h-4 w-4"}),F("taskDrawer.duplicate")]})})]}):null})]}),U?.project&&(0,t.jsx)(g.CreateTaskDialog,{open:V,onOpenChange:G,onSubmit:em,labels:W,projectType:U.project.type,projectLocalPath:U.project.localPath,prefillFromTask:{title:U.title,description:U.description,priority:U.priority,subPath:U.subPath,labelIds:U.labels.map(e=>e.label.id),baseBranch:U.baseBranch}}),(0,t.jsx)(f.NotePreviewDialog,{note:K,open:null!==K,onOpenChange:e=>{e||q(null)}}),(0,t.jsx)(b.ImageLightbox,{imageUrl:"image"===ed&&ex>=0?eu[ex].url:null,filename:"image"===ed&&ex>=0?eu[ex].filename:"",open:"image"===ed,onOpenChange:e=>{e||et(null)},assets:eu.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:ex>=0?ex:void 0,onIndexChange:e=>{let t=eu[e];if(!t)return;let a=Q.find(e=>e.id===t.id);a&&et(a)}}),(0,t.jsx)(v.TextPreviewDialog,{url:"text"===ed&&ee?(0,y.localPathToApiUrl)(ee.path):null,filename:ee?.filename??"",open:"text"===ed,onOpenChange:e=>{e||et(null)}})]})}],605005)}]);