tower-studio 0.2.46 → 0.2.47

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 (290) 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 +3 -3
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +82 -70
  13. package/.next/standalone/.next/server/app/_not-found/page.js +2 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +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/git/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/harness/page/react-loadable-manifest.json +3 -3
  20. package/.next/standalone/.next/server/app/harness/page/server-reference-manifest.json +92 -80
  21. package/.next/standalone/.next/server/app/harness/page.js +2 -1
  22. package/.next/standalone/.next/server/app/harness/page.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/harness/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +3 -3
  25. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +150 -138
  26. package/.next/standalone/.next/server/app/missions/page.js +5 -4
  27. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +3 -3
  30. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +82 -70
  31. package/.next/standalone/.next/server/app/onboarding/page.js +2 -1
  32. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +3 -3
  35. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +82 -70
  36. package/.next/standalone/.next/server/app/page.js +2 -1
  37. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +3 -3
  40. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +128 -116
  41. package/.next/standalone/.next/server/app/settings/page.js +4 -3
  42. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +3 -3
  45. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +190 -178
  46. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +3 -2
  47. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +3 -3
  50. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +166 -154
  51. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +3 -2
  52. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/react-loadable-manifest.json +3 -3
  55. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/server-reference-manifest.json +86 -74
  56. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js +2 -1
  57. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +3 -3
  60. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +150 -138
  61. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +3 -2
  62. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +3 -3
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +162 -162
  66. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +4 -3
  67. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +3 -3
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +82 -70
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +3 -2
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +3 -3
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +140 -140
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +3 -2
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +4 -4
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +182 -170
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +6 -5
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +3 -3
  85. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +108 -96
  86. package/.next/standalone/.next/server/app/workspaces/page.js +2 -1
  87. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +7 -7
  90. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +1 -1
  91. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esywxf._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kkrbn-._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/_0_w835g._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/src_05balzk._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/src_0gif-f5._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/src_0pg9w-x._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/src_0vp6.co._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/src_11k6i~l._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +3 -3
  100. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00qdvw7._.js +3 -0
  102. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07rk6ic._.js → [root-of-the-server]__0282989._.js} +1 -1
  103. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0hzwoy5._.js → [root-of-the-server]__03jikql._.js} +1 -1
  104. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0trmndk._.js → [root-of-the-server]__04dod9d._.js} +1 -1
  105. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05tx27l._.js +3 -0
  106. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m8m7vc._.js → [root-of-the-server]__07ha-7q._.js} +1 -1
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07~giyb._.js +3 -0
  108. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0bx_h2u._.js → [root-of-the-server]__0872sqe._.js} +2 -2
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090y_.y._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b6hugs._.js → [root-of-the-server]__09qoc8v._.js} +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.0m12b._.js → [root-of-the-server]__0bl842b._.js} +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0br5e7w._.js → [root-of-the-server]__0c81jqz._.js} +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dh0alq._.js +3 -0
  114. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0u3~-.g._.js → [root-of-the-server]__0fy8mj6._.js} +1 -1
  115. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kqp70x._.js → [root-of-the-server]__0gsk~9d._.js} +1 -1
  116. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h4ltpn._.js +5 -0
  117. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hx2p17._.js +3 -0
  118. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ie8~g5._.js +3 -0
  119. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n02kfa._.js → [root-of-the-server]__0j1w7ro._.js} +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0esg88l._.js → [root-of-the-server]__0jxfeb6._.js} +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00qzvly._.js → [root-of-the-server]__0mi.v4q._.js} +1 -1
  123. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__06sew6r._.js → [root-of-the-server]__0nell0t._.js} +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0odoa97._.js +30 -0
  125. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12viys4._.js → [root-of-the-server]__0q8o5us._.js} +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b6fbjv._.js → [root-of-the-server]__0qjjy1r._.js} +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rg73f.._.js +3 -0
  128. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t3q30a._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tpho3f._.js +3 -0
  130. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dhq_gl._.js → [root-of-the-server]__0tusyj0._.js} +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~edc3d._.js → [root-of-the-server]__0x6eyvj._.js} +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n3uc.v._.js → [root-of-the-server]__0xftcya._.js} +2 -2
  133. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xiiocg._.js +30 -0
  134. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0x7br99._.js → [root-of-the-server]__0znl9us._.js} +2 -2
  135. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zsnp~d._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~fdua7._.js +3 -0
  137. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11fp64w._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vyl8to._.js → [root-of-the-server]__1290yo~._.js} +2 -2
  139. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12s3kky._.js +3 -0
  140. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0s_q09t._.js → [root-of-the-server]__136sh9u._.js} +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/_0.-.0zk._.js +3 -0
  143. package/.next/standalone/.next/server/chunks/ssr/_0..h3hk._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/{_0b660g4._.js → _0111pr2._.js} +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/{_0czsddm._.js → _029yl-g._.js} +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/{_0q2pep_._.js → _02mcoex._.js} +2 -2
  147. package/.next/standalone/.next/server/chunks/ssr/_02t7f2_._.js +3 -0
  148. package/.next/standalone/.next/server/chunks/ssr/{_0gomvsp._.js → _04brhyt._.js} +2 -2
  149. package/.next/standalone/.next/server/chunks/ssr/{_1118hto._.js → _08b3kyv._.js} +1 -1
  150. package/.next/standalone/.next/server/chunks/ssr/{_0-5.hgb._.js → _0a___34._.js} +2 -2
  151. package/.next/standalone/.next/server/chunks/ssr/{_0ami9yt._.js → _0b4v~ls._.js} +2 -2
  152. package/.next/standalone/.next/server/chunks/ssr/_0bdyusg._.js +6 -0
  153. package/.next/standalone/.next/server/chunks/ssr/{_0hsuip_._.js → _0c8-9m9._.js} +2 -2
  154. package/.next/standalone/.next/server/chunks/ssr/{_0j7m~u6._.js → _0gcox_6._.js} +1 -1
  155. package/.next/standalone/.next/server/chunks/ssr/{_0snv7nt._.js → _0gte_c4._.js} +1 -1
  156. package/.next/standalone/.next/server/chunks/ssr/{_0g~p9_x._.js → _0hyn4md._.js} +2 -2
  157. package/.next/standalone/.next/server/chunks/ssr/{_0l6byg1._.js → _0lqjtwo._.js} +1 -1
  158. package/.next/standalone/.next/server/chunks/ssr/_0noar.v._.js +3 -0
  159. package/.next/standalone/.next/server/chunks/ssr/_0os43sb._.js +1 -1
  160. package/.next/standalone/.next/server/chunks/ssr/{_0o_c3b2._.js → _0rilhs1._.js} +2 -2
  161. package/.next/standalone/.next/server/chunks/ssr/{_0ak77.u._.js → _0sbkase._.js} +1 -1
  162. package/.next/standalone/.next/server/chunks/ssr/{_00_h2nx._.js → _0t-0.1o._.js} +2 -2
  163. package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
  164. package/.next/standalone/.next/server/chunks/ssr/{_0mmy~98._.js → _0w~~xn0._.js} +2 -2
  165. package/.next/standalone/.next/server/chunks/ssr/{_0awn2mm._.js → _0xexuoi._.js} +2 -2
  166. package/.next/standalone/.next/server/chunks/ssr/_0xu906p._.js +4 -0
  167. package/.next/standalone/.next/server/chunks/ssr/_0z-z415._.js +3 -0
  168. package/.next/standalone/.next/server/chunks/ssr/_0zx1ubq._.js +3 -0
  169. package/.next/standalone/.next/server/chunks/ssr/{_0ty4xe6._.js → _0~2k74h._.js} +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/{_0hx2o_8._.js → _0~rpgs_._.js} +2 -2
  171. package/.next/standalone/.next/server/chunks/ssr/_10a_vqn._.js +3 -0
  172. package/.next/standalone/.next/server/chunks/ssr/{_0p5ft59._.js → _10or.ne._.js} +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/_11.knhq._.js +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/{_12s8n8g._.js → _124j7aj._.js} +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/_13yv8at._.js +3 -0
  176. package/.next/standalone/.next/server/chunks/ssr/src_11j0qlp._.js +1 -1
  177. package/.next/standalone/.next/server/chunks/ssr/src_actions_07_wts6._.js +47 -0
  178. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  179. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  180. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  181. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  182. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  183. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  184. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  185. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
  186. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  187. package/.next/standalone/.next/server/chunks/ssr/src_components_0rowjw~._.js +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0cld9rt._.js → src_lib_0-3zx.v._.js} +1 -1
  189. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0_px2pz._.js → src_lib_00ial55._.js} +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0a.zy31._.js → src_lib_01-0ix1._.js} +1 -1
  191. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0b73q0a._.js → src_lib_01d~ml9._.js} +1 -1
  192. package/.next/standalone/.next/server/chunks/ssr/{src_lib_04nzvfd._.js → src_lib_0278czx._.js} +1 -1
  193. package/.next/standalone/.next/server/chunks/ssr/src_lib_07o.0r6._.js +3 -0
  194. package/.next/standalone/.next/server/chunks/ssr/src_lib_09jpiip._.js +3 -0
  195. package/.next/standalone/.next/server/chunks/ssr/src_lib_0bmg7ix._.js +3 -0
  196. package/.next/standalone/.next/server/chunks/ssr/src_lib_0cb~2g1._.js +3 -0
  197. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fdsvpu._.js +3 -0
  198. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fyrfen._.js +3 -0
  199. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0dbf2qa._.js → src_lib_0gqe-g3._.js} +1 -1
  200. package/.next/standalone/.next/server/chunks/ssr/src_lib_0ixnmd0._.js +3 -0
  201. package/.next/standalone/.next/server/chunks/ssr/src_lib_0lpxsj~._.js +1 -1
  202. package/.next/standalone/.next/server/chunks/ssr/src_lib_0pgz5n6._.js +3 -0
  203. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0h2u7a0._.js → src_lib_0tq69ek._.js} +1 -1
  204. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  205. package/.next/standalone/.next/server/pages/500.html +1 -1
  206. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  207. package/.next/standalone/.next/server/server-reference-manifest.json +1146 -1068
  208. package/.next/standalone/.next/static/chunks/{0oyskd~8~j.j7.js → 00agq5_c-.llc.js} +1 -1
  209. package/.next/standalone/.next/static/chunks/015i97g3voot2.js +2 -0
  210. package/.next/standalone/.next/static/chunks/{02v-9v~885t9c.js → 01wvj~s3skc-5.js} +1 -1
  211. package/.next/standalone/.next/static/chunks/{0.gedys.tq.~k.js → 031br6.h-zycv.js} +1 -1
  212. package/.next/standalone/.next/static/chunks/{07qijq9o5jccu.js → 054ztat09k8d8.js} +1 -1
  213. package/.next/standalone/.next/static/chunks/07f592yv~pptf.js +1 -0
  214. package/.next/standalone/.next/static/chunks/{06x7oq8_iu~9d.js → 08j4ettv1zbmn.js} +1 -1
  215. package/.next/standalone/.next/static/chunks/{03uix~1ru.ovv.js → 08kc0~d-bpqxd.js} +1 -1
  216. package/.next/standalone/.next/static/chunks/{0j5olwb~d3~3j.js → 08s_oyki61yjf.js} +1 -1
  217. package/.next/standalone/.next/static/chunks/09bc_~h466~tj.js +1 -0
  218. package/.next/standalone/.next/static/chunks/{0q1872yhybt55.js → 0_hj_1l73v-on.js} +1 -1
  219. package/.next/standalone/.next/static/chunks/{00o_eiv12t~.1.js → 0a54zbhpg7-ql.js} +1 -1
  220. package/.next/standalone/.next/static/chunks/0c2po53wqe-op.js +1 -0
  221. package/.next/standalone/.next/static/chunks/0clhvl~13pwv2.js +1 -0
  222. package/.next/standalone/.next/static/chunks/0fi1kdxrc9m~d.js +1 -0
  223. package/.next/standalone/.next/static/chunks/0j56_.0_wup.m.js +1 -0
  224. package/.next/standalone/.next/static/chunks/{17z9uivez~kp3.js → 0lokkque~1fox.js} +1 -1
  225. package/.next/standalone/.next/static/chunks/0m5k~sgt78d8a.js +1 -0
  226. package/.next/standalone/.next/static/chunks/{0d9u2xspag~4h.js → 0mzzaly9-cwhd.js} +1 -1
  227. package/.next/standalone/.next/static/chunks/0pg~fc3o64-u0.js +1 -0
  228. package/.next/standalone/.next/static/chunks/{0-kkc.ibted8y.js → 0pvc93qomwhkq.js} +1 -1
  229. package/.next/standalone/.next/static/chunks/0smoiulyzysrc.js +2 -0
  230. package/.next/standalone/.next/static/chunks/0ufatfbq87c84.js +1 -0
  231. package/.next/standalone/.next/static/chunks/{09om2gfwimh7k.js → 0ujznvfinjpzn.js} +1 -1
  232. package/.next/standalone/.next/static/chunks/{0cf7e1scao3zk.js → 0ux~8zee88x-j.js} +1 -1
  233. package/.next/standalone/.next/static/chunks/0vy01_a6xhhrr.js +1 -0
  234. package/.next/standalone/.next/static/chunks/0xd_tk4asn0qj.js +1 -0
  235. package/.next/standalone/.next/static/chunks/{12-mlz2vukuga.js → 0~l470bpaoz9f.js} +1 -1
  236. package/.next/standalone/.next/static/chunks/118j.0w2pbdea.js +1 -0
  237. package/.next/standalone/.next/static/chunks/13yfli6~6o4z~.js +1 -0
  238. package/.next/standalone/.next/static/chunks/{0t1awv68pnn-e.js → 15rlbf5rw1dd..js} +1 -1
  239. package/.next/standalone/package.json +1 -1
  240. package/dist/mcp-server.cjs +6 -0
  241. package/package.json +1 -1
  242. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-geq20._.js +0 -3
  243. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~hdzx._.js +0 -3
  244. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h_pt4a._.js +0 -3
  245. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0idkp76._.js +0 -3
  246. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4m.1s._.js +0 -3
  247. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kmonje._.js +0 -3
  248. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lh3mlq._.js +0 -3
  249. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0muf4wq._.js +0 -49
  250. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o5ohqy._.js +0 -47
  251. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta_mpj._.js +0 -30
  252. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ws0_c1._.js +0 -3
  253. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~mhv4m._.js +0 -3
  254. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1013v_g._.js +0 -47
  255. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmn-._.js +0 -30
  256. package/.next/standalone/.next/server/chunks/ssr/_05~lqg-._.js +0 -4
  257. package/.next/standalone/.next/server/chunks/ssr/_0771b4a._.js +0 -47
  258. package/.next/standalone/.next/server/chunks/ssr/_0fmko25._.js +0 -3
  259. package/.next/standalone/.next/server/chunks/ssr/_0hg~.4w._.js +0 -6
  260. package/.next/standalone/.next/server/chunks/ssr/_0nrxhfb._.js +0 -47
  261. package/.next/standalone/.next/server/chunks/ssr/_0vkl7.h._.js +0 -47
  262. package/.next/standalone/.next/server/chunks/ssr/_0x09t_o._.js +0 -47
  263. package/.next/standalone/.next/server/chunks/ssr/_0zn.4bi._.js +0 -47
  264. package/.next/standalone/.next/server/chunks/ssr/_1086w4p._.js +0 -47
  265. package/.next/standalone/.next/server/chunks/ssr/src_lib_0er7rzd._.js +0 -3
  266. package/.next/standalone/.next/server/chunks/ssr/src_lib_0f0v8_~._.js +0 -3
  267. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fr6fzy._.js +0 -3
  268. package/.next/standalone/.next/server/chunks/ssr/src_lib_0k04rl3._.js +0 -3
  269. package/.next/standalone/.next/server/chunks/ssr/src_lib_0sq6aqm._.js +0 -3
  270. package/.next/standalone/.next/server/chunks/ssr/src_lib_0ui-~7g._.js +0 -3
  271. package/.next/standalone/.next/server/chunks/ssr/src_lib_0z-gn78._.js +0 -3
  272. package/.next/standalone/.next/server/chunks/ssr/src_lib_13c4a4g._.js +0 -3
  273. package/.next/standalone/.next/static/chunks/00g58.es_hxli.js +0 -1
  274. package/.next/standalone/.next/static/chunks/01qtgj0xv1fsm.js +0 -2
  275. package/.next/standalone/.next/static/chunks/024euw7po0d0w.js +0 -1
  276. package/.next/standalone/.next/static/chunks/03ct4d8znb7tp.js +0 -1
  277. package/.next/standalone/.next/static/chunks/0alhq.h4~iogi.js +0 -1
  278. package/.next/standalone/.next/static/chunks/0ck~sr0nkabl~.js +0 -1
  279. package/.next/standalone/.next/static/chunks/0d1ok-v-u-xe~.js +0 -1
  280. package/.next/standalone/.next/static/chunks/0ftptcpntzaux.js +0 -1
  281. package/.next/standalone/.next/static/chunks/0gk~m5bwgoafi.js +0 -1
  282. package/.next/standalone/.next/static/chunks/0in_7s8n4lmfr.js +0 -1
  283. package/.next/standalone/.next/static/chunks/0mtrtl-jl46in.js +0 -2
  284. package/.next/standalone/.next/static/chunks/0~2l3wz-gxs2j.js +0 -1
  285. package/.next/standalone/.next/static/chunks/0~7h_a_dofg-4.js +0 -1
  286. package/.next/standalone/.next/static/chunks/15gztq9f12uhe.js +0 -1
  287. package/.next/standalone/.next/static/chunks/15ue90qe1sh-9.js +0 -1
  288. /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_buildManifest.js +0 -0
  289. /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_clientMiddlewareManifest.js +0 -0
  290. /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_ssgManifest.js +0 -0
@@ -63,4 +63,4 @@ out vec4 outColor;
63
63
 
64
64
  void main() {
65
65
  outColor = v_color;
66
- }`,tu=8*Float32Array.BYTES_PER_ELEMENT,t_=class{constructor(){this.attributes=new Float32Array(160),this.count=0}},tf=0,tg=0,tv=0,tp=0,tm=0,tx=0,tw=0,tC=class extends R{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new t_,this._verticesCursor=new t_;let r=this._gl;this._program=ee(e7(r,tc,td)),this._register(S(()=>r.deleteProgram(this._program))),this._projectionLocation=ee(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(S(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(S(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=ee(r.createBuffer()),this._register(S(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,tu,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,tu,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,tu,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,e6),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,h,l,c,d,u,_,f;for(r=0;r<t.rows;r++){for(o=-1,a=0,h=0,l=!1,n=0;n<t.cols;n++)c=(r*t.cols+n)*4,d=e.cells[c+1],_=!!(0x4000000&(u=e.cells[c+2])),(d!==a||u!==h&&(l||_))&&((0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,n,r)),o=n,a=d,h=u,l=_);(0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||"block"===i.style){t.count=0;return}let s,r=0;("bar"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,"bar"===i.style?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),("underline"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),"outline"===i.style&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=8*r++,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(0x4000000&i)switch(0x3000000&i){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&i].rgba;break;case 0x3000000:tf=(0xffffff&i)<<8;break;default:tf=this._themeService.colors.foreground.rgba}else switch(0x3000000&s){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&s].rgba;break;case 0x3000000:tf=(0xffffff&s)<<8;break;default:tf=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=function(e,t){let i=new Float32Array(Math.min(2*e.length,t));for(let t=0;t<e.length;t++)i[t]=e[t];return i}(e.attributes,this._terminal.rows*this._terminal.cols*8)),tg=r*this._dimensions.device.cell.width,tv=o*this._dimensions.device.cell.height,tp=(tf>>24&255)/255,tm=(tf>>16&255)/255,tx=(tf>>8&255)/255,tw=1,this._addRectangle(e.attributes,t,tg,tv,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,tp,tm,tx,tw)}_addRectangle(e,t,i,s,r,n,o,a,h,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=h,e[t+7]=l}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}},tb=class extends R{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(S(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ee(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=e1(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=ep,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},tL=class extends tb{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(s.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){var t;if(257===e.fg?this._ctx.fillStyle=this._themeService.colors.background.css:void 0!==e.fg&&((0x3000000&(t=e.fg))==0x1000000||(0x3000000&t)==0x2000000)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},ty="object"==typeof window?window:globalThis,tM=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new eV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new eV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(i,e),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToFullScreen.set(i,e),this._onDidChangeFullscreen.fire(i)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};tM.INSTANCE=new tM,tM.INSTANCE.onDidChangeZoomLevel,tM.INSTANCE.onDidChangeFullscreen;var tS="object"==typeof navigator?navigator.userAgent:"";tS.indexOf("Firefox"),tS.indexOf("AppleWebKit"),tS.indexOf("Chrome")>=0||tS.indexOf("Safari"),tS.indexOf("Electron/"),tS.indexOf("Android");var tA=!1;if("function"==typeof ty.matchMedia){let e=ty.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ty.matchMedia("(display-mode: fullscreen)");tA=e.matches,tR=e,"string"==typeof tR&&(tR=ty.matchMedia(tR)),tR.addEventListener("change",({matches:e})=>{tA&&t.matches||(tA=e)})}var tR,tT,tk,tE=!1,tB=!1,tP="en",t$=globalThis;"u">typeof t$.vscode&&"u">typeof t$.vscode.process?tk=t$.vscode.process:"u">typeof _.default&&"string"==typeof _.default?.versions?.node&&(tk=_.default);var tD="string"==typeof tk?.versions?.electron&&tk?.type==="renderer";if("object"==typeof tk){tk.platform,tk.platform,"linux"===tk.platform&&tk.env.SNAP&&tk.env.SNAP_REVISION,tk.env.CI||tk.env.BUILD_ARTIFACTSTAGINGDIRECTORY,tP="en";let e=tk.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,tP=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}tE=!0}else"object"!=typeof navigator||tD?console.error("Unable to resolve platform."):((tT=navigator.userAgent).indexOf("Windows"),tT.indexOf("Macintosh"),(tT.indexOf("Macintosh")>=0||tT.indexOf("iPad")>=0||tT.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,tT.indexOf("Linux"),tT?.indexOf("Mobi"),tB=!0,tP=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());var tF=tE;tB&&"function"==typeof t$.importScripts&&t$.origin;var tW,tI=tT,tO=tP;(tY=tW||={}).value=function(){return tO},tY.isDefaultVariant=function(){return 2===tO.length?"en"===tO:tO.length>=3&&"e"===tO[0]&&"n"===tO[1]&&"-"===tO[2]},tY.isDefault=function(){return"en"===tO};var tz="function"==typeof t$.postMessage&&!t$.importScripts,tU=(()=>{if(tz){let e=[];t$.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),t$.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),tN=!!(tI&&tI.indexOf("Chrome")>=0);tI&&tI.indexOf("Firefox"),!tN&&tI&&tI.indexOf("Safari"),tI&&tI.indexOf("Edg/"),tI&&tI.indexOf("Android");var tq="object"==typeof navigator?navigator:{};tF||document.queryCommandSupported&&document.queryCommandSupported("copy")||tq&&tq.clipboard&&tq.clipboard.writeText,tF||tq&&tq.clipboard&&tq.clipboard.readText,tF||tA||tq.keyboard,"ontouchstart"in ty||tq.maxTouchPoints,ty.PointerEvent&&("ontouchstart"in ty||navigator.maxTouchPoints);var tG=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},tH=new tG,tj=new tG,tV=new tG;(tX=tZ||={}).toString=function(e){return tH.keyCodeToStr(e)},tX.fromString=function(e){return tH.strToKeyCode(e)},tX.toUserSettingsUS=function(e){return tj.keyCodeToStr(e)},tX.toUserSettingsGeneral=function(e){return tV.keyCodeToStr(e)},tX.fromUserSettings=function(e){return tj.strToKeyCode(e)||tV.strToKeyCode(e)},tX.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return tH.keyCodeToStr(e)};var tY,tX,tZ,tQ,tK=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(o=tQ||={}).isCancellationToken=function(e){return e===o.None||e===o.Cancelled||e instanceof tJ||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eO.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tK});var tJ=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tK:(this._emitter||(this._emitter=new eV),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};Symbol("MicrotaskDelay"),(a=h||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},a.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var t0=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new eV,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await eO.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};t0.EMPTY=t0.fromArray([]);function t5(e,t){return(t<<5)-t+e|0}function t1(e,t){t=t5(149417,t);for(let i=0,s=e.length;i<s;i++)t=t5(e.charCodeAt(i),t);return t}new DataView(new ArrayBuffer(320));var{registerWindow:t2,getWindow:t3,getDocument:t4,getWindows:t8,getWindowsCount:t6,getWindowId:t7,getWindowById:t9,hasWindow:ie,onDidRegisterWindow:it,onWillUnregisterWindow:ii,onDidUnregisterWindow:is}=(t=new Map,i={window:ty,disposables:new A},t.set(ty.vscodeWindowId,i),s=new eV,r=new eV,n=new eV,{onDidRegisterWindow:s.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:r.event,registerWindow(e){var i,o;if(t.has(e.vscodeWindowId))return R.None;let a=new A,h={window:e,disposables:a.add(new A)};return t.set(e.vscodeWindowId,h),a.add(S(()=>{t.delete(e.vscodeWindowId),r.fire(e)})),a.add((i=e,o=ia.BEFORE_UNLOAD,new ir(i,o,()=>{n.fire(e)},void 0))),s.fire(h),a},getWindows:()=>t.values(),getWindowsCount:()=>t.size,getWindowId:e=>e.vscodeWindowId,hasWindow:e=>t.has(e),getWindowById:function(e,s){return("number"==typeof e?t.get(e):void 0)??(s?i:void 0)},getWindow:e=>e?.ownerDocument?.defaultView?e.ownerDocument.defaultView.window:e?.view?e.view.window:ty,getDocument:e=>t3(e).document}),ir=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}},io=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new e(t,i):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t||!!e&&!!t&&e.width===t.width&&e.height===t.height}};io.None=new io(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=function e(t,i){switch(typeof t){case"object":var s,r,n,o;return null===t?t5(349,i):Array.isArray(t)?(s=t,r=t5(104579,r=i),s.reduce((t,i)=>e(i,t),r)):(n=t,o=t5(181387,o=i),Object.keys(n).sort().reduce((t,i)=>(t=t1(i,t),e(n[i],t)),o));case"string":return t1(t,i);case"boolean":return t5(t?433:863,i);case"number":return t5(t,i);case"undefined":return t5(937,i);default:return t5(617,i)}}(i,0),n=s.get(r);if(n)n.users+=1;else{let o=new eV,a=new MutationObserver(e=>o.fire(e));a.observe(e,i);let h=n={users:1,observer:a,onDidMutate:o.event};t.add(S(()=>{h.users-=1,0===h.users&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}};var ia={BEFORE_UNLOAD:"beforeunload"},ih=class extends R{constructor(e,t,i,s,r,n,o,a,h){if(super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new T,this._charAtlasDisposable=this._register(new T),this._observerDisposable=this._register(new T),this._model=new tl,this._workCell=new e8,this._workCell2=new e8,this._rectangleRenderer=this._register(new T),this._glyphRenderer=this._register(new T),this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new eV),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._gl=this._canvas.getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:h}),!this._gl)throw Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ev(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new tL(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions={css:{canvas:es(),cell:es()},device:{canvas:es(),cell:es(),char:{width:0,height:0,left:0,top:0}}},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextlost",e=>{console.log("webglcontextlost event received"),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(e)},3e3)})),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextrestored",e=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,e2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=e4(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=e4(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(S(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),e2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){for(let e of(this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows),this._renderLayers))e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new tC(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new ta(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=e1(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=M(eO.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),eO.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){for(let e of(this._clearModel(!0),this._renderLayers))e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(!this._core.screenElement?.isConnected||!this._charSizeService.width||!this._charSizeService.height)return;else this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new e3(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,h,l,c=0,d=!0,u,_,f,g,v,p,m,x,w;e=ic(e,i.rows-1,0),t=ic(t,i.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",b=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,L=b-i.buffer.ydisp,y=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),M=-1,S=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let A=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,f=b===o,c=0,h=this._characterJoinerService.getJoinedCharacters(o),x=0;x<i.cols;x++){if(r=this._cellColorResolver.result.bg,a.loadCell(x,s),0===x&&(r=this._cellColorResolver.result.bg),l=!1,d=x>=c,u=x,h.length>0&&x===h[0][0]&&d){_=h.shift();let e=this._model.selection.isCellSelected(this._terminal,_[0],o);for(m=_[0]+1;m<_[1];m++)d&&=e===this._model.selection.isCellSelected(this._terminal,m,o);(d&&=!f||y<_[0]||y>=_[1])?(l=!0,s=new il(s,a.translateToString(!0,_[0],_[1]),_[1]-_[0]),u=_[1]-1):c=_[1]}if(g=s.getChars(),v=s.getCode(),m=(n*i.cols+x)*4,this._cellColorResolver.resolve(s,x,o,this.dimensions.device.cell.width),S&&o===b&&(x===y&&(this._model.cursor={x:y,y:L,width:s.getWidth(),style:this._coreBrowserService.isFocused?C:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},M=y+s.getWidth()-1),x>=y&&x<=M&&(this._coreBrowserService.isFocused&&"block"===C||!1===this._coreBrowserService.isFocused&&"block"===i.options.cursorInactiveStyle)&&(this._cellColorResolver.result.fg=0x3000000|this._themeService.colors.cursorAccent.rgba>>8&0xffffff,this._cellColorResolver.result.bg=0x3000000|this._themeService.colors.cursor.rgba>>8&0xffffff)),0!==v&&(this._model.lineLengths[n]=x+1),(this._model.cells[m]!==v||this._model.cells[m+1]!==this._cellColorResolver.result.bg||this._model.cells[m+2]!==this._cellColorResolver.result.fg||this._model.cells[m+3]!==this._cellColorResolver.result.ext)&&(A=!0,g.length>1&&(v|=0x80000000),this._model.cells[m]=v,this._model.cells[m+1]=this._cellColorResolver.result.bg,this._model.cells[m+2]=this._cellColorResolver.result.fg,this._model.cells[m+3]=this._cellColorResolver.result.ext,p=s.getWidth(),this._glyphRenderer.value.updateCell(x,n,v,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,g,p,r),l)){for(s=this._workCell,x++;x<=u;x++)w=(n*i.cols+x)*4,this._glyphRenderer.value.updateCell(x,n,0,0,0,0,"",0,0),this._model.cells[w]=0,this._model.cells[w+1]=this._cellColorResolver.result.bg,this._model.cells[w+2]=this._cellColorResolver.result.fg,this._model.cells[w+3]=this._cellColorResolver.result.ext;x--}}A&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},il=class extends eB{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function ic(e,t,i=0){return Math.max(Math.min(e,t),i)}var id="di$target",iu="di$dependencies",i_=new Map;function ig(e){if(i_.has(e))return i_.get(e);let t=function(e,i,s){var r,n,o;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");r=t,n=e,o=s,n[id]===n?n[iu].push({id:r,index:o}):(n[iu]=[{id:r,index:o}],n[id]=n)};return t._id=e,i_.set(e,t),t}ig("BufferService"),ig("CoreMouseService"),ig("CoreService"),ig("CharsetService"),ig("InstantiationService"),ig("LogService");var iv=ig("OptionsService");ig("OscLinkService"),ig("UnicodeService"),ig("DecorationService");var ip={trace:0,debug:1,info:2,warn:3,error:4,off:5},im=class extends R{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ip[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};im=((e,t,i,s)=>{for(var r,n=s>1?void 0:s?g(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&f(t,i,n),n})([(e,t)=>iv(e,t,0)],im);var ix=class extends R{constructor(e){if(D&&16>function(){if(!D)return 0;let e=E.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])}()&&!document.createElement("canvas").getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element)return void this._register(t.onWillOpen(()=>this.activate(e)));this._terminal=e;let i=t.coreService,s=t.optionsService,r=t._renderService,n=t._characterJoinerService,o=t._charSizeService,a=t._coreBrowserService,h=t._decorationService,l=t._logService,c=t._themeService;this._renderer=this._register(new ih(e,n,o,a,i,h,s,c,this._preserveDrawingBuffer)),this._register(eO.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(eO.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(eO.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(eO.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this._register(S(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},iw=e.i(821957),iC=e.i(360112),ib=e.i(533499),iL=e.i(729739),iy=e.i(404122);function iM(e,t,i,s,r){if(!e||!t||!i||0===e.offsetWidth||0===e.offsetHeight)return;try{t.fit()}catch{return}if(s?.readyState!==WebSocket.OPEN)return;let{cols:n,rows:o}=i;(r.current?.cols!==n||r.current?.rows!==o)&&(r.current={cols:n,rows:o},s.send(JSON.stringify({type:"resize",cols:n,rows:o})))}e.s(["TaskTerminal",0,function({taskId:e,worktreePath:t,onSessionEnd:i,useCanvasRenderer:s=!1,onReady:r}){let{t:n}=(0,ib.useI18n)(),{resolvedTheme:o}=(0,iw.useTheme)(),a=(0,c.useRef)(null),h=(0,c.useRef)(null),_=(0,c.useRef)(null),f=(0,c.useRef)(null),g=(0,c.useRef)(null),v=(0,c.useRef)(i);v.current=i;let p=(0,c.useRef)(r);p.current=r;let[m,x]=(0,c.useState)("connecting"),[w,C]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{if(!t||!a.current)return;let i="light"!==o,r=new d.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:13,scrollback:2e3,cursorBlink:!0,allowTransparency:!1,rescaleOverlappingGlyphs:!0,theme:i?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),l=new u.FitAddon;r.loadAddon(l),r.open(a.current);let c=a.current.querySelector(".xterm-helper-textarea");c&&(c.style.opacity="0");let m=a.current,w=e=>{let t=e.clipboardData?.items;if(!t)return;let i=null;for(let e=0;e<t.length;e++){let s=t[e];if("file"===s.kind&&s.type.startsWith("image/")){i=s.getAsFile();break}}i&&(e.preventDefault(),e.stopPropagation(),b(i))};async function b(t){let i=iC.toast.loading(n("terminal.pasteImageUploading"));try{var s;let r=(await new Promise((e,i)=>{let s=new FileReader;s.onload=()=>e(s.result),s.onerror=()=>i(s.error),s.readAsDataURL(t)})).split(",")[1]??"",o=await fetch(`/api/internal/terminal/${encodeURIComponent(e)}/paste-image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mime:t.type,base64:r,name:t.name})}),a=await o.json().catch(()=>null);if(!o.ok||!a?.path)return void iC.toast.error(n("terminal.pasteImageFailed"),{id:i});let l=_.current;if(l?.readyState!==WebSocket.OPEN)return void iC.toast.error(n("terminal.pasteImageFailed"),{id:i});l.send((s=a.path,/\s/.test(s)?`"${s}" `:`${s} `)),h.current?.focus(),iC.toast.success(n("terminal.pasteImageInserted"),{id:i})}catch{iC.toast.error(n("terminal.pasteImageFailed"),{id:i})}}m.addEventListener("paste",w,!0);let L=null;if(!s)try{(L=new ix).onContextLoss(()=>{L?.dispose(),L=null}),r.loadAddon(L)}catch{}iM(a.current,l,r,null,g),r.focus();let y=null,M=null,S=!1,A=null,R=!1;return(0,iy.getConfigValues)(["terminal.fontSize","terminal.fontFamily"]).then(e=>{if(S)return;let t=Number(e["terminal.fontSize"]),i=e["terminal.fontFamily"];Number.isFinite(t)&&t>0&&(r.options.fontSize=t),"string"==typeof i&&i.trim()&&(r.options.fontFamily=i),iM(a.current,l,r,_.current,g)}).catch(()=>{}),(0,iL.getActualWsPort)().then(t=>{S||function t(i){if(S||R)return;x("connecting");let s=new WebSocket(`ws://localhost:${i}/terminal?taskId=${encodeURIComponent(e)}`);y=s,s.addEventListener("open",()=>{iM(a.current,l,r,s,g),r.focus(),x("connected"),C(!0),setTimeout(()=>C(!1),2e3)}),s.addEventListener("message",e=>{let t=e.data;"string"==typeof t?r.write(t):t instanceof Blob?t.text().then(e=>r.write(e)):t instanceof ArrayBuffer&&r.write(new Uint8Array(t))}),M?.dispose(),M=r.onData(e=>{s.readyState===WebSocket.OPEN&&s.send(e)}),s.addEventListener("close",e=>{if(e.code>=4e3){R=!0,x("disconnected"),v.current?.(e.code-4e3);return}x("disconnected"),S||R||(A=setTimeout(()=>t(i),3e3))}),s.addEventListener("error",()=>{}),_.current=s}(t)}),h.current=r,f.current=l,p.current?.({focus:()=>r.focus(),blur:()=>r.blur()}),()=>{S=!0,p.current?.(null),m.removeEventListener("paste",w,!0),A&&clearTimeout(A),M?.dispose(),L?.dispose(),l.dispose(),r.dispose(),y?.close(),h.current=null,_.current=null,f.current=null}},[e,t]),(0,c.useEffect)(()=>{if(!t||!a.current)return;requestAnimationFrame(()=>{iM(a.current,f.current,h.current,_.current,g)});let e=null,i=a.current,s=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{iM(a.current,f.current,h.current,_.current,g)},100)});return s.observe(i),()=>{e&&clearTimeout(e),s.disconnect()}},[e,t]),(0,c.useEffect)(()=>{let e=h.current;if(!e)return;let t="light"!==o;e.options.theme=t?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}},[o]),!t)return(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center bg-[#fafafa] dark:bg-[#0a0a0a] text-center",children:[(0,l.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:n("terminal.noWorktree")}),(0,l.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-600 mt-1",children:n("terminal.noWorktreeDesc")})]});let b="connected"===m?n("terminal.connected"):"connecting"===m?n("terminal.connecting"):n("terminal.disconnected");return(0,l.jsxs)("div",{className:"relative h-full w-full bg-[#fafafa] dark:bg-[#0a0a0a]",children:[(0,l.jsxs)("div",{className:["absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded px-2 py-0.5 text-xs transition-opacity duration-500","connected"===m&&!w?"opacity-0 pointer-events-none":"opacity-100","bg-white/60 dark:bg-black/40 backdrop-blur-sm"].join(" "),title:b,children:[(0,l.jsx)("span",{className:`h-2 w-2 rounded-full ${"connected"===m?"bg-green-500":"connecting"===m?"bg-yellow-500":"bg-red-500"}`}),(0,l.jsx)("span",{className:"text-neutral-600 dark:text-neutral-300",children:b})]}),(0,l.jsx)("div",{ref:a,className:"h-full w-full overflow-hidden"})]})}],85890)},346069,e=>{e.n(e.i(85890))}]);
66
+ }`,tu=8*Float32Array.BYTES_PER_ELEMENT,t_=class{constructor(){this.attributes=new Float32Array(160),this.count=0}},tf=0,tg=0,tv=0,tp=0,tm=0,tx=0,tw=0,tC=class extends R{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new t_,this._verticesCursor=new t_;let r=this._gl;this._program=ee(e7(r,tc,td)),this._register(S(()=>r.deleteProgram(this._program))),this._projectionLocation=ee(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(S(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(S(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=ee(r.createBuffer()),this._register(S(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,tu,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,tu,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,tu,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,e6),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,h,l,c,d,u,_,f;for(r=0;r<t.rows;r++){for(o=-1,a=0,h=0,l=!1,n=0;n<t.cols;n++)c=(r*t.cols+n)*4,d=e.cells[c+1],_=!!(0x4000000&(u=e.cells[c+2])),(d!==a||u!==h&&(l||_))&&((0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,n,r)),o=n,a=d,h=u,l=_);(0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||"block"===i.style){t.count=0;return}let s,r=0;("bar"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,"bar"===i.style?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),("underline"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),"outline"===i.style&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=8*r++,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(0x4000000&i)switch(0x3000000&i){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&i].rgba;break;case 0x3000000:tf=(0xffffff&i)<<8;break;default:tf=this._themeService.colors.foreground.rgba}else switch(0x3000000&s){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&s].rgba;break;case 0x3000000:tf=(0xffffff&s)<<8;break;default:tf=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=function(e,t){let i=new Float32Array(Math.min(2*e.length,t));for(let t=0;t<e.length;t++)i[t]=e[t];return i}(e.attributes,this._terminal.rows*this._terminal.cols*8)),tg=r*this._dimensions.device.cell.width,tv=o*this._dimensions.device.cell.height,tp=(tf>>24&255)/255,tm=(tf>>16&255)/255,tx=(tf>>8&255)/255,tw=1,this._addRectangle(e.attributes,t,tg,tv,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,tp,tm,tx,tw)}_addRectangle(e,t,i,s,r,n,o,a,h,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=h,e[t+7]=l}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}},tb=class extends R{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(S(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ee(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=e1(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=ep,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},tL=class extends tb{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(s.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){var t;if(257===e.fg?this._ctx.fillStyle=this._themeService.colors.background.css:void 0!==e.fg&&((0x3000000&(t=e.fg))==0x1000000||(0x3000000&t)==0x2000000)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},ty="object"==typeof window?window:globalThis,tM=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new eV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new eV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(i,e),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToFullScreen.set(i,e),this._onDidChangeFullscreen.fire(i)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};tM.INSTANCE=new tM,tM.INSTANCE.onDidChangeZoomLevel,tM.INSTANCE.onDidChangeFullscreen;var tS="object"==typeof navigator?navigator.userAgent:"";tS.indexOf("Firefox"),tS.indexOf("AppleWebKit"),tS.indexOf("Chrome")>=0||tS.indexOf("Safari"),tS.indexOf("Electron/"),tS.indexOf("Android");var tA=!1;if("function"==typeof ty.matchMedia){let e=ty.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ty.matchMedia("(display-mode: fullscreen)");tA=e.matches,tR=e,"string"==typeof tR&&(tR=ty.matchMedia(tR)),tR.addEventListener("change",({matches:e})=>{tA&&t.matches||(tA=e)})}var tR,tT,tk,tE=!1,tB=!1,tP="en",t$=globalThis;"u">typeof t$.vscode&&"u">typeof t$.vscode.process?tk=t$.vscode.process:"u">typeof _.default&&"string"==typeof _.default?.versions?.node&&(tk=_.default);var tD="string"==typeof tk?.versions?.electron&&tk?.type==="renderer";if("object"==typeof tk){tk.platform,tk.platform,"linux"===tk.platform&&tk.env.SNAP&&tk.env.SNAP_REVISION,tk.env.CI||tk.env.BUILD_ARTIFACTSTAGINGDIRECTORY,tP="en";let e=tk.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,tP=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}tE=!0}else"object"!=typeof navigator||tD?console.error("Unable to resolve platform."):((tT=navigator.userAgent).indexOf("Windows"),tT.indexOf("Macintosh"),(tT.indexOf("Macintosh")>=0||tT.indexOf("iPad")>=0||tT.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,tT.indexOf("Linux"),tT?.indexOf("Mobi"),tB=!0,tP=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());var tF=tE;tB&&"function"==typeof t$.importScripts&&t$.origin;var tW,tI=tT,tO=tP;(tY=tW||={}).value=function(){return tO},tY.isDefaultVariant=function(){return 2===tO.length?"en"===tO:tO.length>=3&&"e"===tO[0]&&"n"===tO[1]&&"-"===tO[2]},tY.isDefault=function(){return"en"===tO};var tz="function"==typeof t$.postMessage&&!t$.importScripts,tU=(()=>{if(tz){let e=[];t$.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),t$.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),tN=!!(tI&&tI.indexOf("Chrome")>=0);tI&&tI.indexOf("Firefox"),!tN&&tI&&tI.indexOf("Safari"),tI&&tI.indexOf("Edg/"),tI&&tI.indexOf("Android");var tq="object"==typeof navigator?navigator:{};tF||document.queryCommandSupported&&document.queryCommandSupported("copy")||tq&&tq.clipboard&&tq.clipboard.writeText,tF||tq&&tq.clipboard&&tq.clipboard.readText,tF||tA||tq.keyboard,"ontouchstart"in ty||tq.maxTouchPoints,ty.PointerEvent&&("ontouchstart"in ty||navigator.maxTouchPoints);var tG=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},tH=new tG,tj=new tG,tV=new tG;(tX=tZ||={}).toString=function(e){return tH.keyCodeToStr(e)},tX.fromString=function(e){return tH.strToKeyCode(e)},tX.toUserSettingsUS=function(e){return tj.keyCodeToStr(e)},tX.toUserSettingsGeneral=function(e){return tV.keyCodeToStr(e)},tX.fromUserSettings=function(e){return tj.strToKeyCode(e)||tV.strToKeyCode(e)},tX.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return tH.keyCodeToStr(e)};var tY,tX,tZ,tQ,tK=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(o=tQ||={}).isCancellationToken=function(e){return e===o.None||e===o.Cancelled||e instanceof tJ||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eO.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tK});var tJ=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tK:(this._emitter||(this._emitter=new eV),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};Symbol("MicrotaskDelay"),(a=h||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},a.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var t0=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new eV,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await eO.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};t0.EMPTY=t0.fromArray([]);function t5(e,t){return(t<<5)-t+e|0}function t1(e,t){t=t5(149417,t);for(let i=0,s=e.length;i<s;i++)t=t5(e.charCodeAt(i),t);return t}new DataView(new ArrayBuffer(320));var{registerWindow:t2,getWindow:t3,getDocument:t4,getWindows:t8,getWindowsCount:t6,getWindowId:t7,getWindowById:t9,hasWindow:ie,onDidRegisterWindow:it,onWillUnregisterWindow:ii,onDidUnregisterWindow:is}=(t=new Map,i={window:ty,disposables:new A},t.set(ty.vscodeWindowId,i),s=new eV,r=new eV,n=new eV,{onDidRegisterWindow:s.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:r.event,registerWindow(e){var i,o;if(t.has(e.vscodeWindowId))return R.None;let a=new A,h={window:e,disposables:a.add(new A)};return t.set(e.vscodeWindowId,h),a.add(S(()=>{t.delete(e.vscodeWindowId),r.fire(e)})),a.add((i=e,o=ia.BEFORE_UNLOAD,new ir(i,o,()=>{n.fire(e)},void 0))),s.fire(h),a},getWindows:()=>t.values(),getWindowsCount:()=>t.size,getWindowId:e=>e.vscodeWindowId,hasWindow:e=>t.has(e),getWindowById:function(e,s){return("number"==typeof e?t.get(e):void 0)??(s?i:void 0)},getWindow:e=>e?.ownerDocument?.defaultView?e.ownerDocument.defaultView.window:e?.view?e.view.window:ty,getDocument:e=>t3(e).document}),ir=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}},io=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new e(t,i):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t||!!e&&!!t&&e.width===t.width&&e.height===t.height}};io.None=new io(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=function e(t,i){switch(typeof t){case"object":var s,r,n,o;return null===t?t5(349,i):Array.isArray(t)?(s=t,r=t5(104579,r=i),s.reduce((t,i)=>e(i,t),r)):(n=t,o=t5(181387,o=i),Object.keys(n).sort().reduce((t,i)=>(t=t1(i,t),e(n[i],t)),o));case"string":return t1(t,i);case"boolean":return t5(t?433:863,i);case"number":return t5(t,i);case"undefined":return t5(937,i);default:return t5(617,i)}}(i,0),n=s.get(r);if(n)n.users+=1;else{let o=new eV,a=new MutationObserver(e=>o.fire(e));a.observe(e,i);let h=n={users:1,observer:a,onDidMutate:o.event};t.add(S(()=>{h.users-=1,0===h.users&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}};var ia={BEFORE_UNLOAD:"beforeunload"},ih=class extends R{constructor(e,t,i,s,r,n,o,a,h){if(super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new T,this._charAtlasDisposable=this._register(new T),this._observerDisposable=this._register(new T),this._model=new tl,this._workCell=new e8,this._workCell2=new e8,this._rectangleRenderer=this._register(new T),this._glyphRenderer=this._register(new T),this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new eV),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._gl=this._canvas.getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:h}),!this._gl)throw Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ev(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new tL(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions={css:{canvas:es(),cell:es()},device:{canvas:es(),cell:es(),char:{width:0,height:0,left:0,top:0}}},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextlost",e=>{console.log("webglcontextlost event received"),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(e)},3e3)})),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextrestored",e=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,e2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=e4(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=e4(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(S(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),e2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){for(let e of(this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows),this._renderLayers))e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new tC(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new ta(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=e1(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=M(eO.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),eO.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){for(let e of(this._clearModel(!0),this._renderLayers))e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(!this._core.screenElement?.isConnected||!this._charSizeService.width||!this._charSizeService.height)return;else this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new e3(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,h,l,c=0,d=!0,u,_,f,g,v,p,m,x,w;e=ic(e,i.rows-1,0),t=ic(t,i.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",b=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,L=b-i.buffer.ydisp,y=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),M=-1,S=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let A=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,f=b===o,c=0,h=this._characterJoinerService.getJoinedCharacters(o),x=0;x<i.cols;x++){if(r=this._cellColorResolver.result.bg,a.loadCell(x,s),0===x&&(r=this._cellColorResolver.result.bg),l=!1,d=x>=c,u=x,h.length>0&&x===h[0][0]&&d){_=h.shift();let e=this._model.selection.isCellSelected(this._terminal,_[0],o);for(m=_[0]+1;m<_[1];m++)d&&=e===this._model.selection.isCellSelected(this._terminal,m,o);(d&&=!f||y<_[0]||y>=_[1])?(l=!0,s=new il(s,a.translateToString(!0,_[0],_[1]),_[1]-_[0]),u=_[1]-1):c=_[1]}if(g=s.getChars(),v=s.getCode(),m=(n*i.cols+x)*4,this._cellColorResolver.resolve(s,x,o,this.dimensions.device.cell.width),S&&o===b&&(x===y&&(this._model.cursor={x:y,y:L,width:s.getWidth(),style:this._coreBrowserService.isFocused?C:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},M=y+s.getWidth()-1),x>=y&&x<=M&&(this._coreBrowserService.isFocused&&"block"===C||!1===this._coreBrowserService.isFocused&&"block"===i.options.cursorInactiveStyle)&&(this._cellColorResolver.result.fg=0x3000000|this._themeService.colors.cursorAccent.rgba>>8&0xffffff,this._cellColorResolver.result.bg=0x3000000|this._themeService.colors.cursor.rgba>>8&0xffffff)),0!==v&&(this._model.lineLengths[n]=x+1),(this._model.cells[m]!==v||this._model.cells[m+1]!==this._cellColorResolver.result.bg||this._model.cells[m+2]!==this._cellColorResolver.result.fg||this._model.cells[m+3]!==this._cellColorResolver.result.ext)&&(A=!0,g.length>1&&(v|=0x80000000),this._model.cells[m]=v,this._model.cells[m+1]=this._cellColorResolver.result.bg,this._model.cells[m+2]=this._cellColorResolver.result.fg,this._model.cells[m+3]=this._cellColorResolver.result.ext,p=s.getWidth(),this._glyphRenderer.value.updateCell(x,n,v,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,g,p,r),l)){for(s=this._workCell,x++;x<=u;x++)w=(n*i.cols+x)*4,this._glyphRenderer.value.updateCell(x,n,0,0,0,0,"",0,0),this._model.cells[w]=0,this._model.cells[w+1]=this._cellColorResolver.result.bg,this._model.cells[w+2]=this._cellColorResolver.result.fg,this._model.cells[w+3]=this._cellColorResolver.result.ext;x--}}A&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},il=class extends eB{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function ic(e,t,i=0){return Math.max(Math.min(e,t),i)}var id="di$target",iu="di$dependencies",i_=new Map;function ig(e){if(i_.has(e))return i_.get(e);let t=function(e,i,s){var r,n,o;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");r=t,n=e,o=s,n[id]===n?n[iu].push({id:r,index:o}):(n[iu]=[{id:r,index:o}],n[id]=n)};return t._id=e,i_.set(e,t),t}ig("BufferService"),ig("CoreMouseService"),ig("CoreService"),ig("CharsetService"),ig("InstantiationService"),ig("LogService");var iv=ig("OptionsService");ig("OscLinkService"),ig("UnicodeService"),ig("DecorationService");var ip={trace:0,debug:1,info:2,warn:3,error:4,off:5},im=class extends R{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ip[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};im=((e,t,i,s)=>{for(var r,n=s>1?void 0:s?g(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&f(t,i,n),n})([(e,t)=>iv(e,t,0)],im);var ix=class extends R{constructor(e){if(D&&16>function(){if(!D)return 0;let e=E.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])}()&&!document.createElement("canvas").getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element)return void this._register(t.onWillOpen(()=>this.activate(e)));this._terminal=e;let i=t.coreService,s=t.optionsService,r=t._renderService,n=t._characterJoinerService,o=t._charSizeService,a=t._coreBrowserService,h=t._decorationService,l=t._logService,c=t._themeService;this._renderer=this._register(new ih(e,n,o,a,i,h,s,c,this._preserveDrawingBuffer)),this._register(eO.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(eO.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(eO.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(eO.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this._register(S(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},iw=e.i(821957),iC=e.i(360112),ib=e.i(533499),iL=e.i(639709),iy=e.i(912078);function iM(e,t,i,s,r){if(!e||!t||!i||0===e.offsetWidth||0===e.offsetHeight)return;try{t.fit()}catch{return}if(s?.readyState!==WebSocket.OPEN)return;let{cols:n,rows:o}=i;(r.current?.cols!==n||r.current?.rows!==o)&&(r.current={cols:n,rows:o},s.send(JSON.stringify({type:"resize",cols:n,rows:o})))}e.s(["TaskTerminal",0,function({taskId:e,worktreePath:t,onSessionEnd:i,useCanvasRenderer:s=!1,onReady:r}){let{t:n}=(0,ib.useI18n)(),{resolvedTheme:o}=(0,iw.useTheme)(),a=(0,c.useRef)(null),h=(0,c.useRef)(null),_=(0,c.useRef)(null),f=(0,c.useRef)(null),g=(0,c.useRef)(null),v=(0,c.useRef)(i);v.current=i;let p=(0,c.useRef)(r);p.current=r;let[m,x]=(0,c.useState)("connecting"),[w,C]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{if(!t||!a.current)return;let i="light"!==o,r=new d.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:13,scrollback:2e3,cursorBlink:!0,allowTransparency:!1,rescaleOverlappingGlyphs:!0,theme:i?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),l=new u.FitAddon;r.loadAddon(l),r.open(a.current);let c=a.current.querySelector(".xterm-helper-textarea");c&&(c.style.opacity="0");let m=a.current,w=e=>{let t=e.clipboardData?.items;if(!t)return;let i=null;for(let e=0;e<t.length;e++){let s=t[e];if("file"===s.kind&&s.type.startsWith("image/")){i=s.getAsFile();break}}i&&(e.preventDefault(),e.stopPropagation(),b(i))};async function b(t){let i=iC.toast.loading(n("terminal.pasteImageUploading"));try{var s;let r=(await new Promise((e,i)=>{let s=new FileReader;s.onload=()=>e(s.result),s.onerror=()=>i(s.error),s.readAsDataURL(t)})).split(",")[1]??"",o=await fetch(`/api/internal/terminal/${encodeURIComponent(e)}/paste-image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mime:t.type,base64:r,name:t.name})}),a=await o.json().catch(()=>null);if(!o.ok||!a?.path)return void iC.toast.error(n("terminal.pasteImageFailed"),{id:i});let l=_.current;if(l?.readyState!==WebSocket.OPEN)return void iC.toast.error(n("terminal.pasteImageFailed"),{id:i});l.send((s=a.path,/\s/.test(s)?`"${s}" `:`${s} `)),h.current?.focus(),iC.toast.success(n("terminal.pasteImageInserted"),{id:i})}catch{iC.toast.error(n("terminal.pasteImageFailed"),{id:i})}}m.addEventListener("paste",w,!0);let L=null;if(!s)try{(L=new ix).onContextLoss(()=>{L?.dispose(),L=null}),r.loadAddon(L)}catch{}iM(a.current,l,r,null,g),r.focus();let y=null,M=null,S=!1,A=null,R=!1;return(0,iy.getConfigValues)(["terminal.fontSize","terminal.fontFamily"]).then(e=>{if(S)return;let t=Number(e["terminal.fontSize"]),i=e["terminal.fontFamily"];Number.isFinite(t)&&t>0&&(r.options.fontSize=t),"string"==typeof i&&i.trim()&&(r.options.fontFamily=i),iM(a.current,l,r,_.current,g)}).catch(()=>{}),(0,iL.getActualWsPort)().then(t=>{S||function t(i){if(S||R)return;x("connecting");let s=new WebSocket(`ws://localhost:${i}/terminal?taskId=${encodeURIComponent(e)}`);y=s,s.addEventListener("open",()=>{iM(a.current,l,r,s,g),r.focus(),x("connected"),C(!0),setTimeout(()=>C(!1),2e3)}),s.addEventListener("message",e=>{let t=e.data;"string"==typeof t?r.write(t):t instanceof Blob?t.text().then(e=>r.write(e)):t instanceof ArrayBuffer&&r.write(new Uint8Array(t))}),M?.dispose(),M=r.onData(e=>{s.readyState===WebSocket.OPEN&&s.send(e)}),s.addEventListener("close",e=>{if(e.code>=4e3){R=!0,x("disconnected"),v.current?.(e.code-4e3);return}x("disconnected"),S||R||(A=setTimeout(()=>t(i),3e3))}),s.addEventListener("error",()=>{}),_.current=s}(t)}),h.current=r,f.current=l,p.current?.({focus:()=>r.focus(),blur:()=>r.blur()}),()=>{S=!0,p.current?.(null),m.removeEventListener("paste",w,!0),A&&clearTimeout(A),M?.dispose(),L?.dispose(),l.dispose(),r.dispose(),y?.close(),h.current=null,_.current=null,f.current=null}},[e,t]),(0,c.useEffect)(()=>{if(!t||!a.current)return;requestAnimationFrame(()=>{iM(a.current,f.current,h.current,_.current,g)});let e=null,i=a.current,s=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{iM(a.current,f.current,h.current,_.current,g)},100)});return s.observe(i),()=>{e&&clearTimeout(e),s.disconnect()}},[e,t]),(0,c.useEffect)(()=>{let e=h.current;if(!e)return;let t="light"!==o;e.options.theme=t?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}},[o]),!t)return(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center bg-[#fafafa] dark:bg-[#0a0a0a] text-center",children:[(0,l.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:n("terminal.noWorktree")}),(0,l.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-600 mt-1",children:n("terminal.noWorktreeDesc")})]});let b="connected"===m?n("terminal.connected"):"connecting"===m?n("terminal.connecting"):n("terminal.disconnected");return(0,l.jsxs)("div",{className:"relative h-full w-full bg-[#fafafa] dark:bg-[#0a0a0a]",children:[(0,l.jsxs)("div",{className:["absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded px-2 py-0.5 text-xs transition-opacity duration-500","connected"===m&&!w?"opacity-0 pointer-events-none":"opacity-100","bg-white/60 dark:bg-black/40 backdrop-blur-sm"].join(" "),title:b,children:[(0,l.jsx)("span",{className:`h-2 w-2 rounded-full ${"connected"===m?"bg-green-500":"connecting"===m?"bg-yellow-500":"bg-red-500"}`}),(0,l.jsx)("span",{className:"text-neutral-600 dark:text-neutral-300",children:b})]}),(0,l.jsx)("div",{ref:a,className:"h-full w-full overflow-hidden"})]})}],85890)},346069,e=>{e.n(e.i(85890))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,912505,e=>{"use strict";var t=e.i(289721),a=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:s,description:r,action:n,className:i}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",i),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:s}),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),a=e.i(210702),s=e.i(538059),r=e.i(259846),n=e.i(645378),i=e.i(453889),l=e.i(487278),o=e.i(911219),c=e.i(533499);let d=[{key:"notes",icon:n.FileText},{key:"assets",icon:i.FolderOpen},{key:"archive",icon:l.Archive},{key:"groups",icon:o.Boxes}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:n}=(0,c.useI18n)(),i=(0,s.usePathname)(),l=d.find(e=>i.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(a.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"}),d.map(s=>{let r=s.icon,i=l===s.key;return(0,t.jsxs)(a.default,{href:`/workspaces/${e}/${s.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${i?"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.${s.key}`)})]},s.key)})]})}])},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)},980376,82183,e=>{"use strict";var t=e.i(289721),a=e.i(225061),s=e.i(975157),r=e.i(519455),n=e.i(670123);function i({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function l({className:e,...r}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,s.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),...r})}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,...x}){return(0,t.jsxs)(i,{children:[(0,t.jsx)(l,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":c,className:(0,s.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),...x,children:[o,d&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.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,...r}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,s.cn)("text-sm text-muted-foreground",e),...r})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,s.cn)("flex flex-col gap-0.5 p-4",e),...a})},"SheetTitle",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,s.cn)("font-heading text-base font-medium text-foreground",e),...r})}],980376);var o=e.i(514798);let c=(0,o.createServerReference)("40ad76444bdce5a0f73e5fd0d5a73d883dcdf75708",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,c],82183)},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),s=e.i(980376),r=e.i(759684),n=e.i(487486),i=e.i(519455),l=e.i(533499),o=e.i(569634),c=e.i(82183),d=e.i(334023),x=e.i(706429),m=e.i(108131),u=e.i(690027),h=e.i(415601),p=e.i(405367),g=e.i(744798),f=e.i(997025),j=e.i(235357),v=e.i(144640),b=e.i(937304),N=e.i(685149),y=e.i(606393),w=e.i(875840),k=e.i(245697),S=e.i(12659),C=e.i(736061),T=e.i(460707),I=e.i(567860),D=e.i(645378),P=e.i(867533),E=e.i(297338),O=e.i(453889);function B({added:e,removed:a}){let{t:s}=(0,l.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:s("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 $=e.i(35967),F=e.i(360112);let R=/\.(txt|md|json)$/i;function A({text:e}){let{t:s}=(0,l.useI18n)(),[r,n]=(0,a.useState)(!1),[i,o]=(0,a.useState)(!1),c=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=c.current;e&&o(e.scrollHeight>e.clientHeight+1)},[]),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{ref:c,className:`text-sm text-foreground whitespace-pre-wrap ${r?"":"line-clamp-5"}`,children:e}),i&&(0,t.jsx)("button",{type:"button",onClick:()=>n(e=>!e),className:"mt-1 text-xs font-medium text-sky-600 hover:underline dark:text-sky-400",children:s(r?"taskDrawer.collapseDescription":"taskDrawer.expandDescription")})]})}e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:M,taskId:z,hideEnvActions:L=!1}){let{t:_}=(0,l.useI18n)(),[U,V]=(0,a.useState)(null),[H,G]=(0,a.useTransition)(),[K,q]=(0,a.useState)(!1),[J,W]=(0,a.useState)([]),[X,Y]=(0,a.useState)([]),[Q,Z]=(0,a.useState)(null),[ee,et]=(0,a.useState)([]),[ea,es]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!z||!e){V(null),Y([]),et([]);return}(0,x.getTaskNotes)(z).then(e=>Y(e.map(e=>({id:e.id,title:e.title,content:e.content,category:e.category})))).catch(()=>Y([])),(0,m.getTaskAssets)(z).then(e=>et(e.map(e=>({id:e.id,filename:e.filename,path:e.path,mimeType:e.mimeType,size:e.size})))).catch(()=>et([])),G(async()=>{let e=await (0,c.getTaskOverview)(z);e&&(V(e),e.project?.workspaceId&&(0,d.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{W(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>W([])))})},[z,e]);let er=U?N.BOARD_COLUMNS.find(e=>e.id===U.status):null,en=U?N.PRIORITY_CONFIG[U.priority]:null,ei=U?.executions?.[0]??null,el=(()=>{if(ei?.worktreePath)return ei.worktreePath;let e=U?.project?.localPath;return e?U?.subPath?`${e}/${U.subPath}`:e:null})(),eo=(()=>{let e=ei?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),ec=e=>(0,b.isImageAsset)(e.filename,e.mimeType)||R.test(e.filename),ed=e=>{ec(e)?es(e):F.toast.info(_("assets.previewNotSupported"))},ex=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(()=>({}));F.toast.error(e.error||_("git.openInFileManagerFailed"))}}catch{F.toast.error(_("git.openInFileManagerFailed"))}},em=ea?(0,b.isImageAsset)(ea.filename,ea.mimeType)?"image":R.test(ea.filename)?"text":null:null,eu=ee.filter(e=>(0,b.isImageAsset)(e.filename,e.mimeType)).map(e=>({id:e.id,url:(0,b.localPathToApiUrl)(e.path),filename:e.filename})),eh=ea?eu.findIndex(e=>e.id===ea.id):-1,ep=async e=>{if(U?.project)try{let{autoStart:t,...a}=e;await (0,o.createTask)({...a,projectId:U.project.id}),F.toast.success(_("taskDrawer.duplicateSuccess")),q(!1),M(!1)}catch{F.toast.error(_("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(s.Sheet,{open:e,onOpenChange:M,children:[(0,t.jsxs)(s.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(s.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(s.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:U?.title??""}),(0,t.jsx)(s.SheetDescription,{className:"sr-only",children:_("taskDrawer.title")}),U&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[er&&(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 ${er.color}`}),er.label]}),en&&(0,t.jsx)(n.Badge,{variant:"secondary",className:`text-xs ${en.color}`,children:en.label}),U.version&&(0,t.jsx)($.TaskVersionTag,{number:U.version.number,name:U.version.name,showName:!0})]})]}),(0,t.jsx)(r.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:H&&!U?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:_("assets.loading")}):U?(0,t.jsxs)("div",{className:"p-4 pb-8 space-y-4",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:_("taskDrawer.description")}),U.description?(0,t.jsx)(A,{text:U.description},U.id):(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:_("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:_("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)(y.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:_("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)(k.Package,{className:"h-3.5 w-3.5"}),_("taskDrawer.resources"),(0,t.jsx)("span",{className:"text-foreground",children:U._count.assets})]}),ee.length>0?(0,t.jsx)("div",{className:"space-y-1.5",children:ee.map(e=>{var a;let s=ec(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)(E.Paperclip,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("button",{type:"button",onClick:()=>ed(e),disabled:!s,className:`min-w-0 flex-1 truncate text-left text-sm ${s?"cursor-pointer hover:underline":"cursor-default"}`,title:s?_("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:[s&&(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-xs",onClick:()=>ed(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:_("assets.preview"),children:(0,t.jsx)(P.Eye,{className:"h-3 w-3"})}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon-xs",onClick:()=>ex(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:_("assets.revealInFinder"),children:(0,t.jsx)(O.FolderOpen,{className:"h-3 w-3"})})]})]},e.id)})}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:_("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)(D.FileText,{className:"h-3.5 w-3.5"}),_("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:()=>Z(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:_("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:_("taskDrawer.noNotes")})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:_("taskDrawer.fileChanges")}),eo?(0,t.jsx)(B,{added:eo.added,removed:eo.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:_("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)(S.PlayCircle,{className:"h-3.5 w-3.5"}),_("taskDrawer.lastExecution")]}),ei?(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:ei.status}),ei.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:ei.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:_("taskDrawer.noExecution")})]}),el&&!L&&(0,t.jsxs)("section",{className:"flex flex-col",children:[(0,t.jsxs)(i.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,u.openInFileManager)(el)}catch(e){console.error("openInFileManager failed:",e),F.toast.error(_("git.openInFileManagerFailed"))}},children:[(0,t.jsx)(C.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),_("git.openInFileManager")]}),(0,t.jsxs)(i.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)(el)}catch(e){console.error("openInEditor failed:",e),F.toast.error(_("git.openInEditorFailed"))}},children:[(0,t.jsx)(T.Code,{className:"h-3.5 w-3.5 shrink-0"}),_("git.openInEditor")]}),(0,t.jsxs)(i.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)(el)}catch(e){console.error("openInTerminal failed:",e),F.toast.error(_("git.openInTerminalFailed"))}},children:[(0,t.jsx)(I.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),_("git.openInTerminal")]})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(i.Button,{variant:"default",className:"w-full",onClick:()=>{U&&q(!0)},disabled:!U,children:[(0,t.jsx)(w.Copy,{className:"h-4 w-4"}),_("taskDrawer.duplicate")]})})]}):null})]}),U?.project&&(0,t.jsx)(g.CreateTaskDialog,{open:K,onOpenChange:q,onSubmit:ep,labels:J,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:Q,open:null!==Q,onOpenChange:e=>{e||Z(null)}}),(0,t.jsx)(j.ImageLightbox,{imageUrl:"image"===em&&eh>=0?eu[eh].url:null,filename:"image"===em&&eh>=0?eu[eh].filename:"",open:"image"===em,onOpenChange:e=>{e||es(null)},assets:eu.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:eh>=0?eh:void 0,onIndexChange:e=>{let t=eu[e];if(!t)return;let a=ee.find(e=>e.id===t.id);a&&es(a)}}),(0,t.jsx)(v.TextPreviewDialog,{url:"text"===em&&ea?(0,b.localPathToApiUrl)(ea.path):null,filename:ea?.filename??"",open:"text"===em,onOpenChange:e=>{e||es(null)}})]})}],605005)},120171,365716,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40d6c6b7d95fe3905c24e94b37954dbc69fc6cf8da",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,a],120171);let s=(0,t.createServerReference)("405518e39a11271b0abe810f2c6ec61f395194c397",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,s],365716)},497732,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(232545),r=e.i(400355),n=e.i(738690),i=e.i(236967),l=e.i(533499),o=e.i(685149),c=e.i(120171),d=e.i(514798);let x=(0,d.createServerReference)("606180bdd30a23f969335b364e825d552bca9dd877",d.callServer,void 0,d.findSourceMapURL,"updateNote");var m=e.i(365716);let u=(0,d.createServerReference)("6063a2735a1ea25b33b9393ffd2ec3f6caa0435c38",d.callServer,void 0,d.findSourceMapURL,"getProjectNotes");var h=e.i(975157);function p({active:e,onSelect:a}){let{t:s}=(0,l.useI18n)();return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>a("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:s("notes.allCategories")}),o.NOTE_CATEGORIES_PRESET.map(s=>(0,t.jsx)("button",{onClick:()=>a(s),className:(0,h.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",e===s?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:s},s))]})}var g=e.i(519455),f=e.i(967489),j=e.i(645378),v=e.i(912505),b=e.i(464249),N=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 w=e.i(309735);function k({note:e,onEdit:a,onDelete:s,onPreview:r,onTaskClick:n}){let{t:i}=(0,l.useI18n)(),o=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:()=>a(e),className:"text-muted-foreground","aria-label":i("notes.edit"),children:(0,t.jsx)(b.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>s(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":i("notes.delete"),children:(0,t.jsx)(N.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?i("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)(w.Streamdown,{children:o})})})]})}function S({notes:e,onEdit:a,onDelete:s,onPreview:r,onTaskClick:n}){let{t:i}=(0,l.useI18n)();return 0===e.length?(0,t.jsx)(v.EmptyState,{icon:j.FileText,title:i("notes.empty"),description:i("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)(k,{note:e,onEdit:a,onDelete:s,onPreview:r,onTaskClick:n},e.id))})}var C=e.i(624687);function T({value:e,onChange:a}){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=>a(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)(w.Streamdown,{children:e})})})]})}var I=e.i(997025),D=e.i(759684),P=e.i(605005);e.s(["NotesPageClient",0,function({allWorkspaces:e,initialWorkspaceId:d,initialProjectId:h,initialNotes:j}){let v,b,{t:N}=(0,l.useI18n)(),[y,w]=(0,a.useTransition)(),[k,C]=(0,a.useState)(d),[E,O]=(0,a.useState)(h),[B,$]=(0,a.useState)(j),[F,R]=(0,a.useState)("all"),[A,M]=(0,a.useState)(""),[z,L]=(0,a.useState)(null),[_,U]=(0,a.useState)(null),[V,H]=(0,a.useState)(null),[G,K]=(0,a.useState)(!1),[q,J]=(0,a.useState)(""),[W,X]=(0,a.useState)(""),[Y,Q]=(0,a.useState)(o.NOTE_CATEGORIES_PRESET[3]),[Z,ee]=(0,a.useState)(d),[et,ea]=(0,a.useState)(h),es=e.find(e=>e.id===k),er=es?.projects??[],en=e.find(e=>e.id===Z),ei=en?.projects??[],el=(0,a.useCallback)(e=>{e?w(async()=>{$(await u(e))}):$([])},[w]),eo=async()=>{et&&q.trim()&&(await (0,c.createNote)({title:q.trim(),content:W,category:Y,projectId:et}),K(!1),et===E&&el(E))},ec=async()=>{V&&q.trim()&&(await x(V.id,{title:q.trim(),content:W,category:Y}),H(null),el(E))},ed=async e=>{let t=B.find(t=>t.id===e);!t||confirm(N("notes.deleteConfirm",{title:t.title}))&&(await (0,m.deleteNote)(e),el(E))},ex=A.trim().toLowerCase(),em=B.filter(e=>"all"===F||e.category===F).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})),eu=G||null!==V;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(i.SubPageNav,{workspaceId:k}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(f.Select,{value:k,onValueChange:t=>t&&(t=>{if(t===k)return;C(t);let a=e.find(e=>e.id===t),s=a?.projects[0]??null;O(s?.id??null),R("all"),el(s?.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===k)?.name??k})}),(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:E??"",onValueChange:e=>e&&void(e!==E&&(O(e),R("all"),el(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===E))?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))})]}),!eu&&(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:A,onChange:e=>M(e.target.value),placeholder:N("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:()=>{J(""),X(""),Q(o.NOTE_CATEGORIES_PRESET[3]),ee(k),ea(E),H(null),K(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(s.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("notes.newNote")})]})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:eu?(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:[!V&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:N("notes.workspace")}),(0,t.jsxs)(f.Select,{value:Z,onValueChange:t=>t&&(t=>{if(t===Z)return;ee(t);let a=e.find(e=>e.id===t),s=a?.projects[0]??null;ea(s?.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))})]})]}),!V&&ei.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:N("notes.project")}),(0,t.jsxs)(f.Select,{value:et??"",onValueChange:e=>e&&ea(e),children:[(0,t.jsx)(f.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(b=ei.find(e=>e.id===et))?b.alias?`${b.name} (${b.alias})`:b.name:""})}),(0,t.jsx)(f.SelectContent,{children:ei.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:N("notes.categoryLabel")}),(0,t.jsxs)(f.Select,{value:Y,onValueChange:e=>e&&Q(e),children:[(0,t.jsx)(f.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:Y})}),(0,t.jsx)(f.SelectContent,{children:o.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=>J(e.target.value),placeholder:N("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:W,onChange:X}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,t.jsx)(g.Button,{variant:"outline",onClick:()=>{K(!1),H(null)},children:N("notes.cancel")}),(0,t.jsx)(g.Button,{onClick:V?ec:eo,disabled:!q.trim()||!V&&!et,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:N("notes.save")})]})]}):(0,t.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 gap-4",children:[(0,t.jsx)(p,{active:F,onSelect:R}),(0,t.jsx)(D.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:N("notes.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:N("notes.noProjectHint")})]}):(0,t.jsx)(S,{notes:em,onEdit:e=>{J(e.title),X(e.content),Q(e.category),H(e),K(!1)},onDelete:ed,onPreview:L,onTaskClick:U})]})})]})}),(0,t.jsx)(I.NotePreviewDialog,{note:z,open:null!==z,onOpenChange:e=>{e||L(null)}}),(0,t.jsx)(P.TaskOverviewDrawer,{open:null!==_,onOpenChange:e=>{e||U(null)},taskId:_})]})}],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)))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},960518,e=>{"use strict";let t=(0,e.i(572989).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);e.s(["GitCompare",0,t],960518)},340873,e=>{"use strict";let t=(0,e.i(572989).default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);e.s(["GitCommitHorizontal",0,t],340873)},120171,365716,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40d6c6b7d95fe3905c24e94b37954dbc69fc6cf8da",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],120171);let s=(0,t.createServerReference)("405518e39a11271b0abe810f2c6ec61f395194c397",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,s],365716)},313029,e=>{"use strict";let t=(0,e.i(572989).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],313029)},213714,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40679167b977a899bb5e92182c20234d20acfa9786",t.callServer,void 0,t.findSourceMapURL,"getVersionsForPicker");e.s(["getVersionsForPicker",0,r])},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},237842,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("408e28964e855b7940574a52de6b1ebbe3b9a57795",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,r])},903024,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40d2094f068b02f8aae5f379b4a3b82ef6fd0a0918",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,r])},882651,960995,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],882651);let r=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",0,r],960995),e.s(["XCircle",0,r],181209)},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},574378,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("409ca1c6b55313919ac08fa17a459e37f90236f264",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},591540,e=>{"use strict";var t=e.i(965652);e.s(["useScrollOverflow",0,function(e,r=[]){let[s,a]=(0,t.useState)({canScrollLeft:!1,canScrollRight:!1}),c=(0,t.useCallback)(()=>{let t=e.current;t&&a({canScrollLeft:t.scrollLeft>0,canScrollRight:t.scrollLeft<t.scrollWidth-t.clientWidth-1})},[e]);return(0,t.useEffect)(()=>{let t=e.current;if(!t)return;c(),t.addEventListener("scroll",c);let r=new ResizeObserver(c);return r.observe(t),window.addEventListener("resize",c),()=>{t.removeEventListener("scroll",c),r.disconnect(),window.removeEventListener("resize",c)}},[c,...r]),s}])},912505,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:s,description:a,action:c,className:i}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",i),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:s}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),c&&(0,t.jsx)("div",{className:"mt-2",children:c})]})}])},865514,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(776639),c=e.i(519455);let i=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var l=e.i(400355);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:d,taskId:n,taskTitle:o,baseBranch:u,fileCount:f,commitCount:x,commitLog:m=[],onMergeComplete:h}){let p=(0,s.useRouter)(),[v,g]=(0,r.useState)(!1),[b,y]=(0,r.useState)(null),k=async()=>{g(!0),y(null);try{let e=await fetch(`/api/tasks/${n}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){d(!1),h(),p.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?y(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):y(t.error??"Merge failed")}catch{y("Network error — merge failed")}finally{g(!1)}};return(0,t.jsx)(a.Dialog,{open:e,onOpenChange:d,children:(0,t.jsxs)(a.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(a.DialogHeader,{children:(0,t.jsxs)(a.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(i,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:u})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:f})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:x})]})]}),m.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:m.map((e,r)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},r))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>d(!1),disabled:v,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:k,disabled:v,className:"gap-2",children:v?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},743067,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40cc116fdbafda50a73d43dc99883a0b2575d177c1",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r])},335578,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("602c786af9fab79fbafd04b467da0b832dc9e41d15",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,r])},82192,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("6042ec18c48616a634f1ac5f6735201d6b1328062a",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,r])},907059,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40e995770f40d331eb50e4f3328bc90825b88448f0",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,r])},208228,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60e3b1cc6c297b47e9f430860e96636110f7d5415e",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,r])},720580,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("7cac708ed3bb7d685da2c7f993d03b00b9ca296045",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,r])},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 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14842,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),n=e.i(232280),a=e.i(759686),i=e.i(960518),o=e.i(340873),l=e.i(400355),c=e.i(519455),d=e.i(912505),h=e.i(487486),m=e.i(776639),u=e.i(624687),x=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:n}=(0,x.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:n("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:n("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:n("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:n("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:n("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:n("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(l.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,x.useI18n)(),r=e.split("\n"),n=r.length>500,a=n?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:a.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),n&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:l,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,x.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[D,M]=(0,s.useState)(!1),[A,L]=(0,s.useState)(""),[B,F]=(0,s.useState)(!1),T=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[l.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>M(!0),className:"gap-2",children:[(0,t.jsx)(o.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(a.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===l.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:l.map(e=>{let s=v.has(e.filename),a=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&T(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(n.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(h.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:a,isLargeFold:!a&&i>200,onLoad:()=>T(e.filename)})})]},e.filename)})})}),(0,t.jsx)(m.Dialog,{open:D,onOpenChange:M,children:(0,t.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsx)(m.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(u.Textarea,{value:A,onChange:e=>L(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>M(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(A.trim()&&w){F(!0);try{await w(A.trim()),L(""),M(!1)}finally{F(!1)}}},disabled:!A.trim()||B,children:B?"...":y("diff.commit")})]})]})})]})}])},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},244354,e=>{"use strict";async function t(e,s,r={}){let n=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!n.ok)throw Error((await n.json()).error||`${s} failed`);return n.json()}e.s(["gitAction",0,t])},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let n=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,n],755696);let a=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,a],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let o=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,o],719493);let l=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,l],436539)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),n=e.i(48019),a=e.i(782516),i=e.i(755696),o=e.i(886156),l=e.i(400355),c=e.i(586564),d=e.i(719493),h=e.i(597746),m=e.i(368490),u=e.i(232280),x=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),D=e.i(755146),M=e.i(759684),A=e.i(337822),L=e.i(746798),B=e.i(776639),F=e.i(793479),T=e.i(624687),I=e.i(533499);function E({open:e,onOpenChange:r,branches:n,currentBranch:a,localPath:i,onCreated:o,onError:c}){let{t:d}=(0,I.useI18n)(),[m,x]=(0,s.useState)(""),[f,p]=(0,s.useState)(a),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,D]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(x(""),p(a),j(""),k(""))},[e,a]);let M=[...new Set(n)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),A=async()=>{if(m.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:m.trim(),baseBranch:f})});if(e.ok)r(!1),o();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(B.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(B.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(B.DialogHeader,{children:(0,t.jsx)(B.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(F.Input,{value:m,onChange:e=>x(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&A()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>D(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:M.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),D(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(T.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(B.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:A,disabled:!m.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var $=e.i(360112),P=e.i(244354);let z={modified:o.FileEdit,added:n.FilePlus,deleted:a.FileMinus,untracked:i.FileQuestion,renamed:o.FileEdit},R={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},U={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function G(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/").filter(Boolean);if(0===e.length)continue;let r=t;for(let t=0;t<e.length;t++){let n=e[t],a=t===e.length-1,i=e.slice(0,t+1).join("/");if(a)r.children.push({name:n,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===n);e||(e={name:n,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function O({scroll:e,children:s}){return e?(0,t.jsx)(M.ScrollArea,{className:"flex-1 min-h-0",children:s}):(0,t.jsx)("div",{children:s})}function H({label:e,count:r,labelColor:n,tree:a,batchAction:i,batchLabel:o,batchIcon:l,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${n}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":o,children:l})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:a.map(e=>(0,t.jsx)(V,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function V({node:e,depth:n,onFileClick:a,onFileAction:i,fileActionIcon:o,fileActionLabel:l,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${n} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(x.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(V,{node:e,depth:n+1,onFileClick:a,onFileAction:i,fileActionIcon:o,fileActionLabel:l,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h},e.path))]});let j=e.file,b=z[j.status]||r.File,w=R[j.status]||"text-muted-foreground",N=U[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>a(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":h??"",children:d}),h&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:h})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":l??"",children:o}),l&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:l})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:n="project"}){let a="task"===n,{t:i}=(0,I.useI18n)(),[o,m]=(0,s.useState)(null),[x,M]=(0,s.useState)(!0),[B,F]=(0,s.useState)(""),[T,z]=(0,s.useState)(!1),[R,U]=(0,s.useState)(!1),[V,K]=(0,s.useState)(!1),[W,q]=(0,s.useState)(!1),[J,Q]=(0,s.useState)(!1),[X,Y]=(0,s.useState)(""),[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();m({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{M(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,P.gitAction)(e,"stage",{files:t}),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,P.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(B.trim()){z(!0);try{await (0,P.gitAction)(e,"commit",{message:B}),F(""),$.toast.success(i("git.commitSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{z(!1)}}},en=async t=>{U(!0);try{await (0,P.gitAction)(e,"pull",t?{branch:t}:{}),$.toast.success(i("git.pullSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{U(!1)}},ea=async t=>{K(!0);try{await (0,P.gitAction)(e,"push",t?{branch:t}:{}),$.toast.success(i("git.pushSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{K(!1)}},ei=async()=>{q(!0);try{await (0,P.gitAction)(e,"fetch"),$.toast.success(i("git.fetchSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{q(!1)}},eo=async t=>{try{await (0,P.gitAction)(e,"checkout",{branch:t}),Q(!1),$.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},el=async()=>{try{await (0,P.gitAction)(e,"stash-save",{message:B||void 0}),F(""),$.toast.success(i("git.stashSaved")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,P.gitAction)(e,"stash-pop",{index:0}),$.toast.success(i("git.stashApplied")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,P.gitAction)(e,"discard-file",{file:t}),$.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},eh=async()=>{try{await (0,P.gitAction)(e,"discard-all"),$.toast.success(i("git.discardSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},em=async t=>{if("deleted"===t.status)return;let s=o?.topLevel??e;try{let n=await (0,P.gitAction)(e,"show",{file:t.file});r?.(t.file,n.content??"",s)}catch{r?.(t.file,"",s)}},eu=o?.changedFiles.filter(e=>e.staged)??[],ex=o?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>G(eu),[eu]),ep=(0,s.useMemo)(()=>G(ex),[ex]);if(x)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(l.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!o)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...o?.branches??[],...(o?.remoteBranches??[]).filter(e=>!o?.branches?.includes(e))],eb=X?ej.filter(e=>e.toLowerCase().includes(X.toLowerCase())):ej;return(0,t.jsxs)("div",{className:a?"flex flex-col h-full overflow-hidden":"flex flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[a?(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:o?.currentBranch||"—"})]})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:o?.currentBranch||"—"})]}):(0,t.jsxs)(A.Popover,{open:J,onOpenChange:e=>{Q(e),e&&Y("")},children:[(0,t.jsxs)(A.PopoverTrigger,{className:"flex flex-1 min-w-0 items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:o?.currentBranch||void 0,children:o?.currentBranch||"—"})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${J?"rotate-180":""}`})]}),(0,t.jsxs)(A.PopoverContent,{align:"start",sideOffset:4,className:"w-max min-w-[var(--anchor-width)] max-w-[320px] gap-0 overflow-hidden p-0",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:X,onChange:e=>Y(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(o?.branches??[]).filter(e=>e.toLowerCase().includes(X.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(o?.branches??[]).filter(e=>e.toLowerCase().includes(X.toLowerCase())).map(e=>{let s=e===o?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?Q(!1):eo(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(o?.remoteBranches??[]).filter(e=>!o?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(X.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(o?.remoteBranches??[]).filter(e=>!o?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(X.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>eo(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:ei,disabled:W,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${W?"animate-spin":""}`})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:()=>{Q(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:B,onChange:e=>F(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:T||!B.trim()||0===eu.length,children:[T?(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(h.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(D.DropdownMenu,{children:[(0,t.jsx)(D.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(D.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(D.DropdownMenuGroup,{children:[(0,t.jsx)(D.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:er,disabled:!B.trim()||0===eu.length,children:[(0,t.jsx)(h.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(D.DropdownMenuSeparator,{}),(0,t.jsxs)(D.DropdownMenuGroup,{children:[(0,t.jsx)(D.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===ex.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===eu.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:eh,disabled:0===ex.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.DropdownMenuSeparator,{}),(0,t.jsxs)(D.DropdownMenuGroup,{children:[(0,t.jsx)(D.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>en(),disabled:R,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>ea(),disabled:V,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(D.DropdownMenuSub,{children:[(0,t.jsxs)(D.DropdownMenuSubTrigger,{disabled:R,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(D.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),o.currentBranch,o.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",o.behind]})]}),o.remoteBranches.filter(e=>e!==o.currentBranch).map(e=>(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(D.DropdownMenuSub,{children:[(0,t.jsxs)(D.DropdownMenuSubTrigger,{disabled:V,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(D.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),o.currentBranch,o.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",o.ahead]})]}),o.remoteBranches.filter(e=>e!==o.currentBranch).map(e=>(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:ei,disabled:W,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${W?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(D.DropdownMenuSeparator,{}),(0,t.jsxs)(D.DropdownMenuGroup,{children:[(0,t.jsx)(D.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:el,disabled:0===o.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(D.DropdownMenuSeparator,{}),(0,t.jsxs)(D.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),o.currentBranch]})]})]})]})]}),(0,t.jsxs)(O,{scroll:a,children:[(0,t.jsx)(H,{label:i("git.stagedChanges"),count:eu.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(H,{label:i("git.unstagedChanges"),count:ex.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===o.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(h.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...o?.branches??[],...o?.remoteBranches??[]],currentBranch:o?.currentBranch??"",localPath:e,onCreated:async()=>{$.toast.success(i("git.createSuccess")),await ee()},onError:e=>$.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},272132,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("6076bcc79f9958bb057ccdd60911f9d7b735d7a931",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])},571703,666301,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c636a9922893aeb4dcf2cea81b0a4c429bef4146e",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],571703);let r=(0,t.createServerReference)("4044d6c5c594edca1f2190b98b13690c7930ebe6fb",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],666301)},412745,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("403c35c2389d293cdefc8a0b3788a1215ad7f93c68",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),n=e.i(472074),a=e.i(882651),i=e.i(181209),o=e.i(400355),l=e.i(989383),c=e.i(12659),d=e.i(922541),h=e.i(486077),m=e.i(769824),u=e.i(519455),x=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(a.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(o.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(l.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:a,onContinueLatest:i}){let{t:o,locale:l}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(x.EmptyState,{icon:m.History,title:o("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("execution.history")}),e.map(s=>{let m=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),x=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let n=Math.floor(r/60);if(n<60)return`${n}m ${r%60}s`;let a=Math.floor(n/60);return`${a}h ${n%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,o)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),n="zh"===t?"zh-CN":"en-US",a=s.toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit"});return 0===r?a:1===r?"zh"===t?`昨天 ${a}`:`Yesterday ${a}`:r<7?"zh"===t?`${r}天前 ${a}`:`${r}d ago ${a}`:s.toLocaleDateString(n,{month:"2-digit",day:"2-digit"})+" "+a}(s.startedAt??null,l)}),x&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",x,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||o("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,t.jsxs)("span",{children:[m.commits," ",o("execution.commits")]}):null,m.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[m.filesChanged," ",o("execution.files")]})]}):null,m.insertions||m.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),m.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(h.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[o("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(n.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&a?(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>a(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),o("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(u.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),o("execution.tryRecover")]}):null,(0,t.jsxs)(u.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(n.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?o("execution.collapse"):o("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14842,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),n=e.i(232280),a=e.i(759686),i=e.i(960518),o=e.i(340873),l=e.i(400355),c=e.i(519455),d=e.i(912505),h=e.i(487486),m=e.i(776639),u=e.i(624687),x=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:n}=(0,x.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:n("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:n("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:n("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:n("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:n("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:n("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(l.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,x.useI18n)(),r=e.split("\n"),n=r.length>500,a=n?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:a.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),n&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:l,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,x.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[D,M]=(0,s.useState)(!1),[A,L]=(0,s.useState)(""),[B,F]=(0,s.useState)(!1),T=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[l.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>M(!0),className:"gap-2",children:[(0,t.jsx)(o.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(a.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===l.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:l.map(e=>{let s=v.has(e.filename),a=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&T(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(n.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(h.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:a,isLargeFold:!a&&i>200,onLoad:()=>T(e.filename)})})]},e.filename)})})}),(0,t.jsx)(m.Dialog,{open:D,onOpenChange:M,children:(0,t.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsx)(m.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(u.Textarea,{value:A,onChange:e=>L(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>M(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(A.trim()&&w){F(!0);try{await w(A.trim()),L(""),M(!1)}finally{F(!1)}}},disabled:!A.trim()||B,children:B?"...":y("diff.commit")})]})]})})]})}])},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},244354,e=>{"use strict";async function t(e,s,r={}){let n=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!n.ok)throw Error((await n.json()).error||`${s} failed`);return n.json()}e.s(["gitAction",0,t])},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let n=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,n],755696);let a=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,a],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let o=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,o],719493);let l=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,l],436539)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),n=e.i(48019),a=e.i(782516),i=e.i(755696),o=e.i(886156),l=e.i(400355),c=e.i(586564),d=e.i(719493),h=e.i(597746),m=e.i(368490),u=e.i(232280),x=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),D=e.i(755146),M=e.i(759684),A=e.i(337822),L=e.i(746798),B=e.i(776639),F=e.i(793479),T=e.i(624687),I=e.i(533499);function E({open:e,onOpenChange:r,branches:n,currentBranch:a,localPath:i,onCreated:o,onError:c}){let{t:d}=(0,I.useI18n)(),[m,x]=(0,s.useState)(""),[f,p]=(0,s.useState)(a),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,D]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(x(""),p(a),j(""),k(""))},[e,a]);let M=[...new Set(n)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),A=async()=>{if(m.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:m.trim(),baseBranch:f})});if(e.ok)r(!1),o();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(B.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(B.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(B.DialogHeader,{children:(0,t.jsx)(B.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(F.Input,{value:m,onChange:e=>x(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&A()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>D(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:M.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),D(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(T.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(B.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:A,disabled:!m.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var $=e.i(360112),P=e.i(244354);let z={modified:o.FileEdit,added:n.FilePlus,deleted:a.FileMinus,untracked:i.FileQuestion,renamed:o.FileEdit},R={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},U={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function G(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/").filter(Boolean);if(0===e.length)continue;let r=t;for(let t=0;t<e.length;t++){let n=e[t],a=t===e.length-1,i=e.slice(0,t+1).join("/");if(a)r.children.push({name:n,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===n);e||(e={name:n,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function O({scroll:e,children:s}){return e?(0,t.jsx)(M.ScrollArea,{className:"flex-1 min-h-0",children:s}):(0,t.jsx)("div",{children:s})}function H({label:e,count:r,labelColor:n,tree:a,batchAction:i,batchLabel:o,batchIcon:l,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${n}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":o,children:l})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:a.map(e=>(0,t.jsx)(V,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function V({node:e,depth:n,onFileClick:a,onFileAction:i,fileActionIcon:o,fileActionLabel:l,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${n} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(x.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(V,{node:e,depth:n+1,onFileClick:a,onFileAction:i,fileActionIcon:o,fileActionLabel:l,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h},e.path))]});let j=e.file,b=z[j.status]||r.File,w=R[j.status]||"text-muted-foreground",N=U[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>a(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":h??"",children:d}),h&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:h})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":l??"",children:o}),l&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:l})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:n="project"}){let a="task"===n,{t:i}=(0,I.useI18n)(),[o,m]=(0,s.useState)(null),[x,M]=(0,s.useState)(!0),[B,F]=(0,s.useState)(""),[T,z]=(0,s.useState)(!1),[R,U]=(0,s.useState)(!1),[V,K]=(0,s.useState)(!1),[W,q]=(0,s.useState)(!1),[J,Q]=(0,s.useState)(!1),[X,Y]=(0,s.useState)(""),[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();m({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{M(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,P.gitAction)(e,"stage",{files:t}),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,P.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(B.trim()){z(!0);try{await (0,P.gitAction)(e,"commit",{message:B}),F(""),$.toast.success(i("git.commitSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{z(!1)}}},en=async t=>{U(!0);try{await (0,P.gitAction)(e,"pull",t?{branch:t}:{}),$.toast.success(i("git.pullSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{U(!1)}},ea=async t=>{K(!0);try{await (0,P.gitAction)(e,"push",t?{branch:t}:{}),$.toast.success(i("git.pushSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{K(!1)}},ei=async()=>{q(!0);try{await (0,P.gitAction)(e,"fetch"),$.toast.success(i("git.fetchSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{q(!1)}},eo=async t=>{try{await (0,P.gitAction)(e,"checkout",{branch:t}),Q(!1),$.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},el=async()=>{try{await (0,P.gitAction)(e,"stash-save",{message:B||void 0}),F(""),$.toast.success(i("git.stashSaved")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,P.gitAction)(e,"stash-pop",{index:0}),$.toast.success(i("git.stashApplied")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,P.gitAction)(e,"discard-file",{file:t}),$.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},eh=async()=>{try{await (0,P.gitAction)(e,"discard-all"),$.toast.success(i("git.discardSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},em=async t=>{if("deleted"===t.status)return;let s=o?.topLevel??e;try{let n=await (0,P.gitAction)(e,"show",{file:t.file});r?.(t.file,n.content??"",s)}catch{r?.(t.file,"",s)}},eu=o?.changedFiles.filter(e=>e.staged)??[],ex=o?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>G(eu),[eu]),ep=(0,s.useMemo)(()=>G(ex),[ex]);if(x)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(l.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!o)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...o?.branches??[],...(o?.remoteBranches??[]).filter(e=>!o?.branches?.includes(e))],eb=X?ej.filter(e=>e.toLowerCase().includes(X.toLowerCase())):ej;return(0,t.jsxs)("div",{className:a?"flex flex-col h-full overflow-hidden":"flex flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[a?(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:o?.currentBranch||"—"})]})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:o?.currentBranch||"—"})]}):(0,t.jsxs)(A.Popover,{open:J,onOpenChange:e=>{Q(e),e&&Y("")},children:[(0,t.jsxs)(A.PopoverTrigger,{className:"flex flex-1 min-w-0 items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:o?.currentBranch||void 0,children:o?.currentBranch||"—"})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${J?"rotate-180":""}`})]}),(0,t.jsxs)(A.PopoverContent,{align:"start",sideOffset:4,className:"w-max min-w-[var(--anchor-width)] max-w-[320px] gap-0 overflow-hidden p-0",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:X,onChange:e=>Y(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(o?.branches??[]).filter(e=>e.toLowerCase().includes(X.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(o?.branches??[]).filter(e=>e.toLowerCase().includes(X.toLowerCase())).map(e=>{let s=e===o?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?Q(!1):eo(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(o?.remoteBranches??[]).filter(e=>!o?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(X.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(o?.remoteBranches??[]).filter(e=>!o?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(X.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>eo(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:ei,disabled:W,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${W?"animate-spin":""}`})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:()=>{Q(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:B,onChange:e=>F(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:T||!B.trim()||0===eu.length,children:[T?(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(h.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(D.DropdownMenu,{children:[(0,t.jsx)(D.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(D.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(D.DropdownMenuGroup,{children:[(0,t.jsx)(D.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:er,disabled:!B.trim()||0===eu.length,children:[(0,t.jsx)(h.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(D.DropdownMenuSeparator,{}),(0,t.jsxs)(D.DropdownMenuGroup,{children:[(0,t.jsx)(D.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===ex.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===eu.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:eh,disabled:0===ex.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.DropdownMenuSeparator,{}),(0,t.jsxs)(D.DropdownMenuGroup,{children:[(0,t.jsx)(D.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>en(),disabled:R,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>ea(),disabled:V,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(D.DropdownMenuSub,{children:[(0,t.jsxs)(D.DropdownMenuSubTrigger,{disabled:R,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(D.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),o.currentBranch,o.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",o.behind]})]}),o.remoteBranches.filter(e=>e!==o.currentBranch).map(e=>(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(D.DropdownMenuSub,{children:[(0,t.jsxs)(D.DropdownMenuSubTrigger,{disabled:V,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(D.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),o.currentBranch,o.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",o.ahead]})]}),o.remoteBranches.filter(e=>e!==o.currentBranch).map(e=>(0,t.jsxs)(D.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:ei,disabled:W,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${W?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(D.DropdownMenuSeparator,{}),(0,t.jsxs)(D.DropdownMenuGroup,{children:[(0,t.jsx)(D.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:el,disabled:0===o.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(D.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(D.DropdownMenuSeparator,{}),(0,t.jsxs)(D.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),o.currentBranch]})]})]})]})]}),(0,t.jsxs)(O,{scroll:a,children:[(0,t.jsx)(H,{label:i("git.stagedChanges"),count:eu.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(H,{label:i("git.unstagedChanges"),count:ex.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===o.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(h.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...o?.branches??[],...o?.remoteBranches??[]],currentBranch:o?.currentBranch??"",localPath:e,onCreated:async()=>{$.toast.success(i("git.createSuccess")),await ee()},onError:e=>$.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},769620,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("6071378a52322d69d1d855a654f44350019f55ad75",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])},666752,889541,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c561eb8a34485679a353d7aa9c6c93b55caf3c279",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],666752);let r=(0,t.createServerReference)("40ebcb2acc9d7ae9814881df6334f2e4042bd07ff1",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],889541)},810258,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40fcbdd25f7ffbf65ef1e764bec9f7555bc5224ee8",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),n=e.i(472074),a=e.i(882651),i=e.i(181209),o=e.i(400355),l=e.i(989383),c=e.i(12659),d=e.i(922541),h=e.i(486077),m=e.i(769824),u=e.i(519455),x=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(a.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(o.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(l.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:a,onContinueLatest:i}){let{t:o,locale:l}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(x.EmptyState,{icon:m.History,title:o("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("execution.history")}),e.map(s=>{let m=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),x=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let n=Math.floor(r/60);if(n<60)return`${n}m ${r%60}s`;let a=Math.floor(n/60);return`${a}h ${n%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,o)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),n="zh"===t?"zh-CN":"en-US",a=s.toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit"});return 0===r?a:1===r?"zh"===t?`昨天 ${a}`:`Yesterday ${a}`:r<7?"zh"===t?`${r}天前 ${a}`:`${r}d ago ${a}`:s.toLocaleDateString(n,{month:"2-digit",day:"2-digit"})+" "+a}(s.startedAt??null,l)}),x&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",x,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||o("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,t.jsxs)("span",{children:[m.commits," ",o("execution.commits")]}):null,m.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[m.filesChanged," ",o("execution.files")]})]}):null,m.insertions||m.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),m.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(h.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[o("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(n.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&a?(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>a(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),o("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(u.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),o("execution.tryRecover")]}):null,(0,t.jsxs)(u.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(n.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?o("execution.collapse"):o("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,912078,e=>{"use strict";var r=e.i(514798);let t=(0,r.createServerReference)("40d83973e43b58905a590e6e82361b1dd9c6de3fe9",r.callServer,void 0,r.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,t])}]);