tower-studio 0.2.43 → 0.2.44

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 (249) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +2 -2
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +35 -35
  13. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/api/adapters/test/route.js +2 -2
  16. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/git/route.js +1 -1
  20. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +1 -1
  33. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js +3 -4
  39. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +4 -5
  41. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js +3 -4
  43. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +3 -2
  47. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  49. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +72 -72
  50. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +2 -2
  53. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +35 -35
  54. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +2 -2
  57. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +35 -35
  58. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +2 -2
  61. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +52 -52
  62. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +2 -2
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +103 -103
  66. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +2 -2
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +90 -90
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +2 -2
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +69 -69
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +2 -2
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +83 -83
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +2 -2
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +35 -35
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +2 -2
  85. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +71 -71
  86. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  87. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +3 -3
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +91 -91
  90. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +2 -2
  93. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +48 -48
  94. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/chunks/{_0keginv._.js → 0se9_next_0cuhhky._.js} +3 -3
  97. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_03qwlhl.js +1 -1
  98. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_09pca3o.js +1 -1
  99. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +1 -1
  100. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +3 -0
  101. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
  102. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0m8aavq.js +1 -1
  103. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yp430z.js +1 -1
  104. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yzw48x.js +1 -1
  105. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-z_a1d._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.zmhk-._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04--bs7._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04m2l8a._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04r193~._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06ndn7a._.js +4 -0
  111. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08yqoti._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/[root-of-the-server]__09arklv._.js +3 -0
  113. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_d.s7s._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0ajay8_._.js → [root-of-the-server]__0_zfnj0._.js} +1 -1
  115. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clptds._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g.k9o~._.js +1 -1
  117. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gn0ubd._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gwztza._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i34gbs._.js +4 -0
  120. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i~3dwq._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k-5ag7._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l1-djp._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pl.c5.._.js +3 -0
  124. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0r~9.7c._.js +4 -0
  125. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t31ba_._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t_weyi._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uptkzd._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xot7fu._.js +1 -1
  129. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y8w5di._.js +1 -1
  130. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__075a0hk._.js → [root-of-the-server]__0zi3~a8._.js} +2 -2
  131. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~g6-c~._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/[root-of-the-server]__1189rd1._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/_0qk_esg._.js +2 -2
  134. package/.next/standalone/.next/server/chunks/_0t31z6q._.js +1 -1
  135. package/.next/standalone/.next/server/chunks/src_0fq3zjg._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/src_0wlyw0g._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/src_0~ey84y._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +2 -2
  139. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/0se9_next_11h0sx_._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0xr45lx._.js → [root-of-the-server]__01fmnse._.js} +2 -2
  142. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01vm_46._.js +3 -3
  143. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__025ol9g._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__08k-xb7._.js → [root-of-the-server]__049n47u._.js} +2 -2
  145. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07xkj1s._.js +3 -3
  148. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12ko8p6._.js → [root-of-the-server]__081e5n~._.js} +2 -2
  149. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ecd_1d._.js +3 -3
  150. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0iln7n_._.js +3 -3
  151. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  152. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lws68d._.js +3 -3
  153. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oamph.._.js +3 -3
  154. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00dh103._.js → [root-of-the-server]__0ugledi._.js} +2 -2
  155. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0stlq2_._.js → [root-of-the-server]__0vxlsec._.js} +2 -2
  156. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__065f3ii._.js → [root-of-the-server]__0w0.sdz._.js} +2 -2
  157. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xwzk2.._.js +3 -3
  158. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yby8pl._.js +3 -3
  159. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  160. package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
  161. package/.next/standalone/.next/server/chunks/ssr/{_0gkid_a._.js → _02vz78l._.js} +2 -2
  162. package/.next/standalone/.next/server/chunks/ssr/{_00odlgv._.js → _04~mjmb._.js} +2 -2
  163. package/.next/standalone/.next/server/chunks/ssr/_05a2u03._.js +3 -3
  164. package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
  165. package/.next/standalone/.next/server/chunks/ssr/_07q06~v._.js +3 -3
  166. package/.next/standalone/.next/server/chunks/ssr/_08bq4g8._.js +1 -1
  167. package/.next/standalone/.next/server/chunks/ssr/{_0rrs.-d._.js → _0_nhdgs._.js} +2 -2
  168. package/.next/standalone/.next/server/chunks/ssr/_0_q41~z._.js +3 -3
  169. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/_0dxbp89._.js +3 -3
  171. package/.next/standalone/.next/server/chunks/ssr/{_047dh-f._.js → _0foto06._.js} +2 -2
  172. package/.next/standalone/.next/server/chunks/ssr/{_05k76ur._.js → _0i4xdso._.js} +2 -2
  173. package/.next/standalone/.next/server/chunks/ssr/{_0uryq~z._.js → _0kojxno._.js} +2 -2
  174. package/.next/standalone/.next/server/chunks/ssr/{_0oeih09._.js → _0r4_qn~._.js} +2 -2
  175. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  176. package/.next/standalone/.next/server/chunks/ssr/{_00l85fp._.js → _0u3yt.5._.js} +3 -3
  177. package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
  178. package/.next/standalone/.next/server/chunks/ssr/_0wqcz3w._.js +3 -3
  179. package/.next/standalone/.next/server/chunks/ssr/{_0463zy~._.js → _0ye1-r-._.js} +2 -2
  180. package/.next/standalone/.next/server/chunks/ssr/{_0syb503._.js → _0zr81mw._.js} +2 -2
  181. package/.next/standalone/.next/server/chunks/ssr/{_0b7smy6._.js → _11osha9._.js} +2 -2
  182. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  183. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  184. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  185. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  186. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  187. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  189. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  191. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
  192. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  193. package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +1 -1
  194. package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
  195. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  196. package/.next/standalone/.next/server/pages/500.html +1 -1
  197. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  198. package/.next/standalone/.next/server/server-reference-manifest.json +290 -290
  199. package/.next/standalone/.next/static/chunks/{0~prx0ure_1i6.js → 0-tuek2jqf0el.js} +1 -1
  200. package/.next/standalone/.next/static/chunks/{0evfu1ozaw5ak.js → 0.-.jc~0b~hy0.js} +1 -1
  201. package/.next/standalone/.next/static/chunks/{0rnitheqdpd1..js → 0.~03w.uxge40.js} +1 -1
  202. package/.next/standalone/.next/static/chunks/01hdj_kw4z2zq.js +2 -0
  203. package/.next/standalone/.next/static/chunks/{08i9.47-_mxro.js → 0346xrw6i2bwo.js} +1 -1
  204. package/.next/standalone/.next/static/chunks/041o.dh2lc-k3.js +1 -0
  205. package/.next/standalone/.next/static/chunks/{070fs6rmafi.i.js → 08ooaq~-.8fzu.js} +1 -1
  206. package/.next/standalone/.next/static/chunks/{05v-c3ir3ik_1.js → 0bylodlncwfpb.js} +1 -1
  207. package/.next/standalone/.next/static/chunks/{00z.kuqsfrxq5.js → 0clewc5ifaruu.js} +2 -2
  208. package/.next/standalone/.next/static/chunks/0cpwtqzrjdgvs.js +1 -0
  209. package/.next/standalone/.next/static/chunks/0c~e1-nst-ze-.js +1 -0
  210. package/.next/standalone/.next/static/chunks/{0_yp-y9l0upp~.js → 0dv4anj-j523o.js} +1 -1
  211. package/.next/standalone/.next/static/chunks/{04op7bjge~n4l.js → 0gvfb.b8m_i8t.js} +1 -1
  212. package/.next/standalone/.next/static/chunks/{0hk3lmsij2x1c.js → 0h77-u2vvr-a1.js} +1 -1
  213. package/.next/standalone/.next/static/chunks/{0rfq8fy71hj7c.js → 0lqp~-dlfenad.js} +1 -1
  214. package/.next/standalone/.next/static/chunks/0qkr26yz3bocs.js +1 -0
  215. package/.next/standalone/.next/static/chunks/{0sr-m2t6vck14.js → 0rcuiuax31_uh.js} +1 -1
  216. package/.next/standalone/.next/static/chunks/0uf~7eqel0zra.js +1 -0
  217. package/.next/standalone/.next/static/chunks/{0ts___1ygewqp.js → 0uj-3ckujwaiy.js} +1 -1
  218. package/.next/standalone/.next/static/chunks/0w71r_sj_fibx.js +1 -0
  219. package/.next/standalone/.next/static/chunks/{0rjt_ddd~6t8r.js → 0xg6rcq6g4bbh.js} +1 -1
  220. package/.next/standalone/.next/static/chunks/0yff8rwmrl5m4.js +1 -0
  221. package/.next/standalone/.next/static/chunks/{0gq65t6au55oa.js → 0ymipmkk2uqby.js} +1 -1
  222. package/.next/standalone/.next/static/chunks/0znfclapbniaa.js +1 -0
  223. package/.next/standalone/.next/static/chunks/{0-vgfstmpuwnx.js → 11pe3kpxuj33f.js} +1 -1
  224. package/.next/standalone/.next/static/chunks/172s9cg35qt7i.js +1 -0
  225. package/.next/standalone/.next/static/chunks/{11p.r-9wyh7_2.js → 17m4o~gdsvuo3.js} +1 -1
  226. package/.next/standalone/.next/static/chunks/184-zu89wwa4u.js +1 -0
  227. package/.next/standalone/package.json +1 -1
  228. package/dist/mcp-server.cjs +21 -2
  229. package/package.json +1 -1
  230. package/.next/standalone/.next/server/chunks/[externals]__0m6hc.0._.js +0 -3
  231. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05abzth._.js +0 -3
  232. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b25v3p._.js +0 -4
  233. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h6bl6t._.js +0 -3
  234. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q~uf3u._.js +0 -3
  235. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wkjqrd._.js +0 -3
  236. package/.next/standalone/.next/static/chunks/0.lyp-cx3zt9..js +0 -2
  237. package/.next/standalone/.next/static/chunks/01rbl6a8z.tuw.js +0 -1
  238. package/.next/standalone/.next/static/chunks/0gz71w_~yw2iu.js +0 -1
  239. package/.next/standalone/.next/static/chunks/0j1hqwmeaqnn2.js +0 -1
  240. package/.next/standalone/.next/static/chunks/0prrt_bws8ml6.js +0 -1
  241. package/.next/standalone/.next/static/chunks/0qgqjy.9.-qpi.js +0 -1
  242. package/.next/standalone/.next/static/chunks/0vmy6tsqy.xf4.js +0 -1
  243. package/.next/standalone/.next/static/chunks/0wbq-_8jyxjxm.js +0 -1
  244. package/.next/standalone/.next/static/chunks/1107zshxaajt9.js +0 -1
  245. package/.next/standalone/.next/static/chunks/11x3_612u8w~9.js +0 -1
  246. package/.next/standalone/.next/static/chunks/14mk_a0k99wbg.js +0 -1
  247. /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_buildManifest.js +0 -0
  248. /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_clientMiddlewareManifest.js +0 -0
  249. /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_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(243572),iy=e.i(725111);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)(i);g.current=i;let v=(0,c.useRef)(r);v.current=r;let[p,m]=(0,c.useState)("connecting"),[x,w]=(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 p=a.current,x=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(),C(i))};async function C(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})}}p.addEventListener("paste",x,!0);let b=null;if(!s)try{(b=new ix).onContextLoss(()=>{b?.dispose(),b=null}),r.loadAddon(b)}catch{}l.fit(),r.focus();let L=null,y=null,M=!1,S=null,A=!1;return(0,iy.getConfigValues)(["terminal.fontSize","terminal.fontFamily"]).then(e=>{if(M)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);try{l.fit()}catch{}}).catch(()=>{}),(0,iL.getActualWsPort)().then(t=>{M||function t(i){if(M||A)return;m("connecting");let s=new WebSocket(`ws://localhost:${i}/terminal?taskId=${encodeURIComponent(e)}`);L=s,s.addEventListener("open",()=>{s.send(JSON.stringify({type:"resize",cols:r.cols,rows:r.rows})),r.focus(),m("connected"),w(!0),setTimeout(()=>w(!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))}),y?.dispose(),y=r.onData(e=>{s.readyState===WebSocket.OPEN&&s.send(e)}),s.addEventListener("close",e=>{if(e.code>=4e3){A=!0,m("disconnected"),g.current?.(e.code-4e3);return}m("disconnected"),M||A||(S=setTimeout(()=>t(i),3e3))}),s.addEventListener("error",()=>{}),_.current=s}(t)}),h.current=r,f.current=l,v.current?.({focus:()=>r.focus(),blur:()=>r.blur()}),()=>{M=!0,v.current?.(null),p.removeEventListener("paste",x,!0),S&&clearTimeout(S),y?.dispose(),b?.dispose(),l.dispose(),r.dispose(),L?.close(),h.current=null,_.current=null,f.current=null}},[e,t]),(0,c.useEffect)(()=>{if(!t||!a.current)return;let e=f.current,i=_.current,s=h.current;e&&s&&requestAnimationFrame(()=>{e.fit(),i?.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"resize",cols:s.cols,rows:s.rows}))});let r=null,n=a.current,o=new ResizeObserver(()=>{r&&clearTimeout(r),r=setTimeout(()=>{let e=f.current,t=_.current,i=h.current;e&&i&&(e.fit(),t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"resize",cols:i.cols,rows:i.rows})))},100)});return o.observe(n),()=>{r&&clearTimeout(r),o.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 C="connected"===p?n("terminal.connected"):"connecting"===p?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"===p&&!x?"opacity-0 pointer-events-none":"opacity-100","bg-white/60 dark:bg-black/40 backdrop-blur-sm"].join(" "),title:C,children:[(0,l.jsx)("span",{className:`h-2 w-2 rounded-full ${"connected"===p?"bg-green-500":"connecting"===p?"bg-yellow-500":"bg-red-500"}`}),(0,l.jsx)("span",{className:"text-neutral-600 dark:text-neutral-300",children:C})]}),(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(138261),iy=e.i(540405);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)(i);g.current=i;let v=(0,c.useRef)(r);v.current=r;let[p,m]=(0,c.useState)("connecting"),[x,w]=(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 p=a.current,x=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(),C(i))};async function C(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})}}p.addEventListener("paste",x,!0);let b=null;if(!s)try{(b=new ix).onContextLoss(()=>{b?.dispose(),b=null}),r.loadAddon(b)}catch{}l.fit(),r.focus();let L=null,y=null,M=!1,S=null,A=!1;return(0,iy.getConfigValues)(["terminal.fontSize","terminal.fontFamily"]).then(e=>{if(M)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);try{l.fit()}catch{}}).catch(()=>{}),(0,iL.getActualWsPort)().then(t=>{M||function t(i){if(M||A)return;m("connecting");let s=new WebSocket(`ws://localhost:${i}/terminal?taskId=${encodeURIComponent(e)}`);L=s,s.addEventListener("open",()=>{s.send(JSON.stringify({type:"resize",cols:r.cols,rows:r.rows})),r.focus(),m("connected"),w(!0),setTimeout(()=>w(!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))}),y?.dispose(),y=r.onData(e=>{s.readyState===WebSocket.OPEN&&s.send(e)}),s.addEventListener("close",e=>{if(e.code>=4e3){A=!0,m("disconnected"),g.current?.(e.code-4e3);return}m("disconnected"),M||A||(S=setTimeout(()=>t(i),3e3))}),s.addEventListener("error",()=>{}),_.current=s}(t)}),h.current=r,f.current=l,v.current?.({focus:()=>r.focus(),blur:()=>r.blur()}),()=>{M=!0,v.current?.(null),p.removeEventListener("paste",x,!0),S&&clearTimeout(S),y?.dispose(),b?.dispose(),l.dispose(),r.dispose(),L?.close(),h.current=null,_.current=null,f.current=null}},[e,t]),(0,c.useEffect)(()=>{if(!t||!a.current)return;let e=f.current,i=_.current,s=h.current;e&&s&&requestAnimationFrame(()=>{e.fit(),i?.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"resize",cols:s.cols,rows:s.rows}))});let r=null,n=a.current,o=new ResizeObserver(()=>{r&&clearTimeout(r),r=setTimeout(()=>{let e=f.current,t=_.current,i=h.current;e&&i&&(e.fit(),t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"resize",cols:i.cols,rows:i.rows})))},100)});return o.observe(n),()=>{r&&clearTimeout(r),o.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 C="connected"===p?n("terminal.connected"):"connecting"===p?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"===p&&!x?"opacity-0 pointer-events-none":"opacity-100","bg-white/60 dark:bg-black/40 backdrop-blur-sm"].join(" "),title:C,children:[(0,l.jsx)("span",{className:`h-2 w-2 rounded-full ${"connected"===p?"bg-green-500":"connecting"===p?"bg-yellow-500":"bg-red-500"}`}),(0,l.jsx)("span",{className:"text-neutral-600 dark:text-neutral-300",children:C})]}),(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,368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},35967,e=>{"use strict";var t=e.i(289721);let r=(0,e.i(572989).default)("milestone",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",key:"8gz4t4"}]]);var a=e.i(533499);let s=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function l(e){return s[function(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)>>>0;return t}(e)%s.length]}let n={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};e.s(["TaskVersionTag",0,function({number:e,name:a,showName:s=!1,className:l="",title:n}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground ${l}`,title:n??(a?`${e} \xb7 ${a}`:e),children:[(0,t.jsx)(r,{className:"h-2.5 w-2.5 shrink-0"}),(0,t.jsx)("span",{className:"font-mono",children:e}),s&&a?(0,t.jsx)("span",{className:"max-w-[140px] truncate",children:a}):null]})},"VersionStatusBadge",0,function({status:e}){let{t:r}=(0,a.useI18n)();return(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${n[e]}`,children:r(`version.status.${e}`)})},"VersionTypeBadge",0,function({name:e}){let{t:r}=(0,a.useI18n)();return e?(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${l(e)}`,children:e}):(0,t.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:r("version.type.uncategorized")})},"typeBadgeColor",0,l],35967)},736061,460707,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);e.s(["FolderSearch",0,r],736061);let a=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,a],460707)},910119,344083,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("401a0b53b020a460f0aed044a7c1bf9ac975a217b1",t.callServer,void 0,t.findSourceMapURL,"openInFileManager");e.s(["openInFileManager",0,r],910119);let a=(0,t.createServerReference)("4004a88ffb826fc2973f7a4e6d046ea21a468a9e8f",t.callServer,void 0,t.findSourceMapURL,"openInEditor");e.s(["openInEditor",0,a],344083)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},12659,e=>{"use strict";let t=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,t],12659)},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},540405,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("403fb9aba477474068caa46d6c3fa942de05b4edb6",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,r])},110204,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["Label",0,function({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}])},875840,e=>{"use strict";let t=(0,e.i(572989).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],875840)},254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},685149,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘","任务笔记","经验洞见"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},456346,419355,51517,e=>{"use strict";let t=(0,e.i(572989).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,t],456346);var r=e.i(514798);let a=(0,r.createServerReference)("400d6f299d957c2738b8385cf76acfa613b4e40c23",r.callServer,void 0,r.findSourceMapURL,"getProjectBranches");e.s(["getProjectBranches",0,a],419355);let s=(0,r.createServerReference)("405ea1a33bdc8d4de8dd77a7658e251d0c5ea666da",r.callServer,void 0,r.findSourceMapURL,"fetchRemoteBranches");e.s(["fetchRemoteBranches",0,s],51517)},744798,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(776639),s=e.i(519455),l=e.i(793479),n=e.i(624687),i=e.i(110204),o=e.i(226145),c=e.i(597746),d=e.i(456346),u=e.i(967489),x=e.i(337822),m=e.i(317056),h=e.i(533499),p=e.i(419355),b=e.i(51517),f=e.i(514798);let g=(0,f.createServerReference)("4004455e994abc095eb423df357e843bc62b614720",f.callServer,void 0,f.findSourceMapURL,"getCurrentBranch");var v=e.i(540405);e.s(["CreateTaskDialog",0,function({open:e,onOpenChange:f,onSubmit:y,onUpdate:k,defaultStatus:j="TODO",editTask:w,editTaskLabelIds:N,prefillFromTask:S,labels:C,projectType:M,projectLocalPath:L,versions:E,defaultVersionId:R}){let P,[I,D]=(0,r.useState)(""),[T,U]=(0,r.useState)(""),[$,A]=(0,r.useState)("MEDIUM"),[O,_]=(0,r.useState)(""),[z,B]=(0,r.useState)([]),[H,G]=(0,r.useState)([]),[V,F]=(0,r.useState)(!1),[W,q]=(0,r.useState)(""),[Y,X]=(0,r.useState)(!1),[K,J]=(0,r.useState)(!0),[Q,Z]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(null),{t:er}=(0,h.useI18n)();(0,r.useEffect)(()=>{if(!e||w)return;let t=!1;return(0,v.getConfigValues)(["task.defaultUseWorktree","task.defaultAutoStart"]).then(e=>{if(t)return;let r=e["task.defaultUseWorktree"],a=e["task.defaultAutoStart"];"boolean"==typeof r&&J(r),"boolean"==typeof a&&Z(a)}).catch(()=>{}),()=>{t=!0}},[e,w]);let ea=!!w,es=!!L;return(0,r.useEffect)(()=>{w?(D(w.title),U(w.description??""),A(w.priority),_(w.subPath??""),B(N??[]),et(w.versionId??null)):(S?(D(S.title??""),U(S.description??""),A(S.priority??"MEDIUM"),_(S.subPath??""),B(S.labelIds??[])):(D(""),U(""),A("MEDIUM"),_(""),B([])),et(R??null))},[w,N,S,R]),(0,r.useEffect)(()=>{e||w||(D(""),U(""),A("MEDIUM"),_(""),B([]),G([]),q(""),X(!1),et(R??null))},[e,w,R]),(0,r.useEffect)(()=>{e&&es&&!w&&(F(!0),Promise.all([(0,p.getProjectBranches)(L),g(L)]).then(([e,t])=>{G(e);let r=S?.baseBranch??null;r&&e.includes(r)?q(r):q(t&&e.includes(t)?t:e[0]??""),F(!1),(0,b.fetchRemoteBranches)(L).then(()=>{setTimeout(()=>{(0,p.getProjectBranches)(L).then(e=>{G(e),q(t=>e.includes(t)?t:e[0]??"")}).catch(()=>{})},3e3)})}).catch(()=>{G([]),q(""),F(!1)}))},[e,es,L,w,S]),(0,t.jsx)(a.Dialog,{open:e,onOpenChange:f,disablePointerDismissal:!0,children:(0,t.jsxs)(a.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(a.DialogHeader,{children:(0,t.jsx)(a.DialogTitle,{children:ea?er("task.edit"):er("task.create")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{htmlFor:"title",children:er("task.title")}),(0,t.jsx)(l.Input,{id:"title","data-testid":"task-title",placeholder:er("task.titlePlaceholder"),value:I,onChange:e=>D(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{htmlFor:"description",children:er("task.description")}),(0,t.jsx)(n.Textarea,{id:"description",placeholder:er("task.descPlaceholder"),rows:4,value:T,onChange:e=>U(e.target.value),className:"max-h-[200px] overflow-y-auto"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{htmlFor:"subPath",children:er("task.subPath")}),(0,t.jsx)(l.Input,{id:"subPath",placeholder:er("task.subPathPlaceholder"),value:O,onChange:e=>_(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:er("task.subPathHint")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{children:er("task.priority")}),(0,t.jsx)("div",{className:"flex gap-1.5",children:["LOW","MEDIUM","HIGH","CRITICAL"].map(e=>{let r={LOW:{label:er("task.priorityLow"),style:"text-slate-300 border-slate-500/30 bg-slate-500/10"},MEDIUM:{label:er("task.priorityMedium"),style:"text-amber-300 border-amber-500/30 bg-amber-500/10"},HIGH:{label:er("task.priorityHigh"),style:"text-orange-300 border-orange-500/30 bg-orange-500/10"},CRITICAL:{label:er("task.priorityCritical"),style:"text-rose-300 border-rose-500/30 bg-rose-500/10"}}[e];return(0,t.jsx)("button",{type:"button",onClick:()=>A(e),className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition-all ${$===e?`${r.style} ring-1 ring-current/20`:"border-border text-muted-foreground hover:bg-accent"}`,children:r.label},e)})})]}),es&&!ea&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{children:er("task.baseBranch")}),V?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:er("task.branchLoading")}):H.length>0?(0,t.jsxs)(x.Popover,{open:Y,onOpenChange:X,children:[(0,t.jsxs)(x.PopoverTrigger,{className:"flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-mono transition-colors hover:bg-accent focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"branch-selector",children:[(0,t.jsx)(o.GitBranch,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"flex-1 truncate text-left text-xs",title:W||void 0,children:W||er("task.branchNone")}),(0,t.jsx)(d.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(x.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(m.Command,{children:[(0,t.jsx)(m.CommandInput,{placeholder:er("task.branchSearch")}),(0,t.jsxs)(m.CommandList,{children:[(0,t.jsx)(m.CommandEmpty,{children:er("task.branchNone")}),(0,t.jsx)(m.CommandGroup,{children:H.map(e=>(0,t.jsxs)(m.CommandItem,{value:e,onSelect:()=>{q(e),X(!1)},children:[(0,t.jsx)(o.GitBranch,{className:"h-3 w-3 text-muted-foreground shrink-0 mr-2"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===W&&(0,t.jsx)(c.Check,{className:"h-3 w-3 text-primary shrink-0 ml-auto"})]},e))})]})]})})]}):(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:er("task.branchNone")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,t.jsx)(i.Label,{className:"text-xs text-muted-foreground",children:er("task.worktreeLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>J(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${K===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?er("task.worktreeYes"):er("task.worktreeNo")},String(e)))})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)(i.Label,{className:"text-xs text-muted-foreground",children:er("task.autoStartLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>Z(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${Q===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?er("task.autoStartYes"):er("task.autoStartNo")},String(e)))})]})]}),C.length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{children:er("task.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:C.map(e=>{let r=z.includes(e.id);return(0,t.jsx)("button",{type:"button",onClick:()=>{B(t=>r?t.filter(t=>t!==e.id):[...t,e.id])},className:`rounded-full px-2.5 py-1 text-xs font-medium transition-all ${r?"ring-1 ring-current/30":"opacity-50 hover:opacity-80"}`,style:{backgroundColor:e.color+"20",color:e.color,borderColor:r?e.color+"40":"transparent",borderWidth:"1px"},children:e.name},e.id)})})]}),(!ea||E&&E.length>0)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(i.Label,{children:er("version.picker.label")}),E&&E.length>0?(0,t.jsxs)(u.Select,{value:ee??"__none__",onValueChange:e=>et("__none__"===e?null:e),children:[(0,t.jsx)(u.SelectTrigger,{children:(0,t.jsx)("span",{className:"truncate text-sm",children:ee&&(P=E.find(e=>e.id===ee))?P.isCurrent?`${P.number} \xb7 ${P.name} \xb7 ${er("version.currentShort")}`:`${P.number} \xb7 ${P.name}`:er("version.picker.none")})}),(0,t.jsxs)(u.SelectContent,{children:[(0,t.jsx)(u.SelectItem,{value:"__none__",children:er("version.picker.none")}),E.map(e=>(0,t.jsx)(u.SelectItem,{value:e.id,children:e.isCurrent?`${e.number} \xb7 ${e.name} \xb7 ${er("version.currentShort")}`:`${e.number} \xb7 ${e.name}`},e.id))]})]}):(0,t.jsx)("p",{className:"rounded-md border border-dashed border-border px-3 py-2 text-xs text-muted-foreground",children:er("version.picker.empty")})]})]}),(0,t.jsxs)(a.DialogFooter,{children:[(0,t.jsx)(s.Button,{variant:"outline",onClick:()=>f(!1),children:er("common.cancel")}),(0,t.jsx)(s.Button,{onClick:()=>{I.trim()&&(ea&&k?k(w.id,{title:I,description:T,priority:$,labelIds:z,subPath:O.trim()||"",versionId:ee}):y({title:I,description:T,priority:$,status:j,labelIds:z,...es&&K&&W?{baseBranch:W}:{},...O.trim()?{subPath:O.trim()}:{},versionId:ee,autoStart:Q}),D(""),U(""),A("MEDIUM"),_(""),B([]),G([]),q(""),J(!0),et(null),f(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:ea?er("common.save"):er("common.create")})]})]})})}],744798)},297338,e=>{"use strict";let t=(0,e.i(572989).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["Paperclip",0,t],297338)},13517,727188,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40ca267cfc9bea6b8e39ed9929c2f6155c72a52450",t.callServer,void 0,t.findSourceMapURL,"getTaskNotes");e.s(["getTaskNotes",0,r],13517);let a=(0,t.createServerReference)("4044de41c35107216ec541819870d98be7659bd39c",t.callServer,void 0,t.findSourceMapURL,"getTaskAssets");e.s(["getTaskAssets",0,a],727188)},235357,144640,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(585012),s=e.i(657153),l=e.i(19671),n=e.i(368490),i=e.i(902539);let o=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var c=e.i(922541),d=e.i(533499);function u({children:e,onClick:r,title:a,disabled:s,...l}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),s||r()},title:a,disabled:s,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...l,children:e})}e.s(["ImageLightbox",0,function({imageUrl:e,filename:x,open:m,onOpenChange:h,assets:p,currentIndex:b,onIndexChange:f}){let{t:g}=(0,d.useI18n)(),[v,y]=(0,r.useState)(1),[k,j]=(0,r.useState)({x:0,y:0}),[w,N]=(0,r.useState)(!1),S=(0,r.useRef)(null),[C,M]=(0,r.useState)(!1),L=!!p&&p.length>1&&"number"==typeof b&&!!f,E=L&&b>0,R=L&&b<p.length-1,P=L?p.length:0,I=P>0?Math.ceil(P/10):0,D=L?Math.floor(b/10):0,T=10*D,U=Math.min(T+10,P),$=I>1,A=L&&D>0,O=L&&D<I-1;(0,r.useEffect)(()=>{M(!0)},[]),(0,r.useEffect)(()=>{y(1),j({x:0,y:0})},[e]),(0,r.useEffect)(()=>{if(!m)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[m]);let _=(0,r.useCallback)(()=>h(!1),[h]),z=(0,r.useCallback)(()=>{L&&E&&f(b-1)},[L,E,f,b]),B=(0,r.useCallback)(()=>{L&&R&&f(b+1)},[L,R,f,b]),H=(0,r.useCallback)(()=>{L&&A&&f((D-1)*10)},[L,A,f,D]),G=(0,r.useCallback)(()=>{L&&O&&f(Math.min((D+1)*10,P-1))},[L,O,f,D,P]),V=(0,r.useCallback)(()=>{y(e=>Math.min(8,1.25*e))},[]),F=(0,r.useCallback)(()=>{y(e=>{let t=Math.max(.1,e/1.25);return t<=1&&j({x:0,y:0}),t})},[]),W=(0,r.useCallback)(()=>{y(1),j({x:0,y:0})},[]);(0,r.useEffect)(()=>{if(!m)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),_();break;case"ArrowLeft":L&&(e.preventDefault(),z());break;case"ArrowRight":L&&(e.preventDefault(),B());break;case"+":case"=":e.preventDefault(),V();break;case"-":case"_":e.preventDefault(),F();break;case"0":e.preventDefault(),W()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[m,L,_,z,B,V,F,W]);let q=(0,r.useRef)(!1),Y=()=>{w&&N(!1),S.current=null},X=w?"cursor-grabbing":"cursor-grab";if(!m||!C)return null;let K=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":g("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[x,L?` \xb7 ${b+1} / ${p.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${X}`,onClick:e=>{e.target===e.currentTarget&&_()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;y(e=>{let r=Math.min(8,Math.max(.1,e*t));return r<=1&&j({x:0,y:0}),r})},children:e&&(0,t.jsx)("img",{src:e,alt:x,onClick:e=>{e.stopPropagation(),q.current&&(q.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),q.current=!1,e.target.setPointerCapture?.(e.pointerId),S.current={x:e.clientX,y:e.clientY,panX:k.x,panY:k.y},N(!0))},onPointerMove:e=>{if(!S.current)return;let t=e.clientX-S.current.x,r=e.clientY-S.current.y;Math.abs(t)+Math.abs(r)>5&&(q.current=!0),w&&j({x:S.current.panX+t,y:S.current.panY+r})},onPointerUp:Y,onPointerLeave:Y,onPointerCancel:Y,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${k.x}px, ${k.y}px, 0) scale(${v})`,transformOrigin:"center center",transition:w?"none":"transform 120ms ease-out",willChange:w?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[L&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[$&&(0,t.jsx)(u,{onClick:H,title:`${g("assets.lightbox.prev")} (-10)`,"aria-label":`${g("assets.lightbox.prev")} (-10)`,disabled:!A,children:(0,t.jsx)(i.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(u,{onClick:z,title:g("assets.lightbox.prev"),"aria-label":g("assets.lightbox.prev"),disabled:!E,children:(0,t.jsx)(l.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:p.slice(T,U).map((e,r)=>{let a=T+r,s=a===b;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),s||f(a)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${s?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+a)})}),(0,t.jsx)(u,{onClick:B,title:g("assets.lightbox.next"),"aria-label":g("assets.lightbox.next"),disabled:!R,children:(0,t.jsx)(n.ChevronRight,{className:"h-4 w-4"})}),$&&(0,t.jsx)(u,{onClick:G,title:`${g("assets.lightbox.next")} (+10)`,"aria-label":`${g("assets.lightbox.next")} (+10)`,disabled:!O,children:(0,t.jsx)(o,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*v),"%"]}),(0,t.jsx)(u,{onClick:W,title:g("assets.lightbox.reset"),"aria-label":g("assets.lightbox.reset"),disabled:1===v&&0===k.x&&0===k.y,children:(0,t.jsx)(c.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(u,{onClick:_,title:g("assets.lightbox.close"),"aria-label":g("assets.lightbox.close"),children:(0,t.jsx)(s.X,{className:"h-4 w-4"})})]})]})]});return(0,a.createPortal)(K,document.body)}],235357);var x=e.i(400355);e.i(254826);var m=e.i(309735),h=e.i(776639);e.s(["TextPreviewDialog",0,function({url:e,filename:a,open:s,onOpenChange:l}){let{t:n}=(0,d.useI18n)(),[i,o]=(0,r.useState)(null),[c,u]=(0,r.useState)(!1),[p,b]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!s||!e){o(null),b(null);return}let t=!1;return u(!0),b(null),o(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(o(e),u(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?b(n("assets.fileTooLarge")):b(n("assets.previewError")),u(!1))}),()=>{t=!0}},[s,e,n]);let f=a.split(".").pop()?.toLowerCase();return(0,t.jsx)(h.Dialog,{open:s,onOpenChange:l,children:(0,t.jsxs)(h.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:a}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(c)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(x.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:n("assets.loadingPreview")})]});if(p)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:p});if(null===i)return null;if("md"===f)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(m.Streamdown,{children:i})});if("json"===f){let e;try{e=JSON.stringify(JSON.parse(i),null,2)}catch{e=i}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:i})})()})]})})}],144640)},997025,e=>{"use strict";var t=e.i(289721);e.i(254826);var r=e.i(309735),a=e.i(776639),s=e.i(533499);e.s(["NotePreviewDialog",0,function({note:e,open:l,onOpenChange:n}){let{t:i}=(0,s.useI18n)();return(0,t.jsx)(a.Dialog,{open:l,onOpenChange:n,children:(0,t.jsxs)(a.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:e?.title}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:e&&e.content.trim()?(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(r.Streamdown,{children:e.content})}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.noteEmpty")})})]})})}])},937304,e=>{"use strict";let t=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif","apng"]);e.s(["isImageAsset",0,function(e,r){if(r?.startsWith("image/"))return!0;let a=e.split(".").pop()?.toLowerCase();return!!a&&t.has(a)},"localPathToApiUrl",0,function(e){let t=e.replace(/\\/g,"/").match(/\/assets\/([^/]+)\/([^/]+)$/);return t?`/api/files/assets/${t[1]}/${t[2]}`:e}])},788147,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("401a8edde46c5000efe8ad48c7362805f155b29000",t.callServer,void 0,t.findSourceMapURL,"createTask");e.s(["createTask",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)},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)},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)},882651,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(["XCircle",0,r],181209)},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},527691,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40cbc9a90bd2cab84d944236a390d052673456329c",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},625463,281394,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40808e939d61b3b4c422357a6b8a5b3252b0aba477",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],625463);let a=(0,t.createServerReference)("40ee93a435dd29994896bf09f8c012a48e677ebb69",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,a],281394)},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)},701837,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40394a0413f0d5dec52a3df5c1f308c14f8e7e37bd",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,r])},673667,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("400b9827f2168457cf77a8cafb21e39e0530ea01ff",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,r])},912505,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:a,description:s,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:s}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},532970,648542,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40829b5233ef6d9c038265e2c0cf031611b19ce0c1",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r],532970);let a=(0,t.createServerReference)("60a458c91694bd9ea4bf4808cb9fc0b7057cf2adb1",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,a],648542)},305049,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("7c3ecbc1dac60ca7f7626b27efdf00297a98c2b5f3",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,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)},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},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)},673984,e=>{"use strict";let t=(0,e.i(572989).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],673984)},566606,e=>{"use strict";var t,a=e.i(289721),s=e.i(965652),i=e.i(538059),n=e.i(821957),r=e.i(519455),l=e.i(793479),o=e.i(905455),d=e.i(746798),c=e.i(224277),u=e.i(400355),m=e.i(597746),h=e.i(657153),x=e.i(567860),p=e.i(572989);let g=(0,p.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var f=e.i(533499),b=e.i(975157);let v=[{adapterType:"claude_code",provider:"claude",label:"Claude CLI"},{adapterType:"codex_cli",provider:"codex",label:"Codex CLI"}];function j({results:e,onResult:t}){let{t:i}=(0,f.useI18n)(),[n,l]=(0,s.useState)({}),o=v.some(e=>n[e.provider]);async function c(e){if(!n[e.provider]){l(t=>({...t,[e.provider]:!0}));try{let a=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:e.adapterType,provider:e.provider})}),s=await a.json();t(e.provider,s)}catch{t(e.provider,{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]})}finally{l(t=>({...t,[e.provider]:!1}))}}}async function p(){await Promise.all(v.map(e=>c(e)))}return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:i("onboarding.step2.passHint")}),(0,a.jsxs)(r.Button,{variant:"outline",onClick:p,disabled:o,children:[o?(0,a.jsx)(u.Loader2,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(x.Terminal,{className:"h-4 w-4"}),i("onboarding.step2.testAll")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:v.map(t=>{let s=!!n[t.provider],l=e[t.provider],o=l?.ok===!0,x=null!=l&&!l.ok,p=l?.checks.find(e=>!e.passed)?.message,f=s?i("settings.aiTools.testing"):o?i("settings.aiTools.testPassed"):x?p??i("settings.aiTools.testFailed"):i("onboarding.step2.notTested"),v=x?l.checks.filter(e=>!e.passed).map(e=>e.message).join("\n"):void 0;return(0,a.jsxs)("div",{className:(0,b.cn)("flex items-center gap-2.5 rounded-lg border px-3 py-2.5 transition-colors",o?"border-green-200 bg-green-50 dark:border-green-800 dark:bg-green-950/20":x?"border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950/20":"border-border bg-muted/30"),children:[(0,a.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:s?(0,a.jsx)(u.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):o?(0,a.jsx)(m.Check,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):x?(0,a.jsx)(h.X,{className:"h-4 w-4 text-red-600 dark:text-red-400"}):(0,a.jsx)("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/40"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium",children:t.label}),(0,a.jsx)("p",{className:(0,b.cn)("truncate text-xs",o?"text-green-700 dark:text-green-300":x?"text-red-700 dark:text-red-300":"text-muted-foreground"),title:v,children:f})]}),(0,a.jsxs)(d.Tooltip,{children:[(0,a.jsx)(d.TooltipTrigger,{render:(0,a.jsx)(r.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground",onClick:()=>c(t),disabled:s,children:(0,a.jsx)(g,{className:"h-4 w-4"})})}),(0,a.jsx)(d.TooltipContent,{children:i("settings.aiTools.testConnection")})]})]},t.provider)})})]})}var y=e.i(623258),N=e.i(673984),k=e.i(226145),w=e.i(245697),C=e.i(19671),T=e.i(368490),S=e.i(387091),P=e.i(15299);let L=(0,p.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var R=e.i(769757),M=e.i(232545),B=e.i(998626),I=e.i(453889),E=e.i(475958);e.s([],342627),e.i(342627),e.i(708878);var $=e.i(954588),O=e.i(314757),F=e.i(887642),U=e.i(804849),V=e.i(362891),H=e.i(903224),z=e.i(416369);let q=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.indeterminate="data-indeterminate",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t);var K=e.i(551974);function A(e){return s.useMemo(()=>({checked:t=>e.indeterminate?{}:t?{[q.checked]:""}:{[q.unchecked]:""},...K.fieldValidityMapping}),[e.indeterminate])}var D=e.i(581263),W=e.i(207516),_=e.i(565455),G=e.i(282109),J=e.i(890514),Z=e.i(971667),X=e.i(421689),Y=e.i(571870),Q=e.i(179279),ee=e.i(689401),et=e.i(756499),ea=e.i(462902);let es=s.createContext(void 0);var ei=e.i(67077),en=e.i(586622),er=e.i(271993);let el=s.forwardRef(function(e,t){let{checked:i,className:n,defaultChecked:r=!1,"aria-labelledby":l,disabled:o=!1,id:d,indeterminate:c=!1,inputRef:u,name:m,onCheckedChange:h,parent:x=!1,readOnly:p=!1,render:g,required:f=!1,uncheckedValue:b,value:v,nativeButton:j=!1,...y}=e,{clearErrors:N}=(0,Y.useFormContext)(),{disabled:k,name:w,setDirty:C,setFilled:T,setFocused:S,setTouched:P,state:L,validationMode:R,validityData:M,shouldValidateOnChange:B,validation:I}=(0,J.useFieldRootContext)(),E=(0,Z.useFieldItemContext)(),{labelId:q,controlId:K,registerControlId:ea,getDescriptionProps:el}=(0,Q.useLabelableContext)(),eo=(0,et.useCheckboxGroupContext)(),ed=eo?.parent,ec=ed&&eo.allValues,eu=k||E.disabled||eo?.disabled||o,em=w??m,eh=v??em,ex=(0,W.useBaseUiId)(),ep=(0,W.useBaseUiId)(),eg=K;ec?eg=x?ep:`${ed.id}-${eh}`:d&&(eg=d);let ef={};ec&&(x?ef=eo.parent.getParentProps():eh&&(ef=eo.parent.getChildProps(eh)));let eb=(0,F.useStableCallback)(h),{checked:ev=i,indeterminate:ej=c,onCheckedChange:ey,...eN}=ef,ek=eo?.value,ew=eo?.setValue,eC=eo?.defaultValue,eT=s.useRef(null),eS=(0,H.useRefWithInit)(()=>Symbol("checkbox-control")),eP=s.useRef(!1),{getButtonProps:eL,buttonRef:eR}=(0,G.useButton)({disabled:eu,native:j}),eM=eo?.validation??I,[eB,eI]=(0,O.useControlled)({controlled:eh&&ek&&!x?ek.includes(eh):ev,default:eh&&eC&&!x?eC.includes(eh):r,name:"Checkbox",state:"checked"});(0,U.useIsoLayoutEffect)(()=>{ea!==$.NOOP&&(eP.current=!0,ea(eS.current,eg))},[eg,eo,ea,x,eS]),s.useEffect(()=>{let e=eS.current;return()=>{eP.current&&ea!==$.NOOP&&(eP.current=!1,ea(e,void 0))}},[ea,eS]),(0,X.useField)({enabled:!eo,id:ex,commit:eM.commit,value:eB,controlRef:eT,name:em,getValue:()=>eB});let eE=s.useRef(null),e$=(0,V.useMergedRefs)(u,eE,eM.inputRef),eO=(0,ee.useAriaLabelledBy)(l,q,eE,!j,eg??void 0);(0,U.useIsoLayoutEffect)(()=>{eE.current&&(eE.current.indeterminate=ej,eB&&T(!0))},[eB,ej,T]),(0,er.useValueChanged)(eB,()=>{(!eo||x)&&(N(em),T(eB),C(eB!==M.initialValue),B()?eM.commit(eB):eM.commit(eB,!0))});let eF=(0,_.mergeProps)({checked:eB,disabled:eu,name:x?void 0:em,id:j?void 0:eg??void 0,required:f,ref:e$,style:em?z.visuallyHiddenInput:z.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,a=(0,ei.createChangeEventDetails)(en.REASONS.none,e.nativeEvent);ey?.(t,a),eb(t,a),!a.isCanceled&&(eI(t),eh&&ek&&ew&&!x&&ew(t?[...ek,eh]:ek.filter(e=>e!==eh),a))},onFocus(){eT.current?.focus()}},void 0!==v?{value:(eo?eB&&v:v)||""}:$.EMPTY_OBJECT,el,eo?eM.getValidationProps:eM.getInputValidationProps),eU=ec?!!ev:eB,eV=ec&&ej||c;s.useEffect(()=>{if(!ed||!eh)return;let e=ed.disabledStatesRef.current;return e.set(eh,eu),()=>{e.delete(eh)}},[ed,eu,eh]);let eH=s.useMemo(()=>({...L,checked:eU,disabled:eu,readOnly:p,required:f,indeterminate:eV}),[L,eU,eu,p,f,eV]),ez=A(eH),eq=(0,D.useRenderElement)("span",e,{state:eH,ref:[eR,eT,t,eo?.registerControlRef],props:[{id:j?eg??void 0:ex,role:"checkbox","aria-checked":ej?"mixed":eB,"aria-readonly":p||void 0,"aria-required":f||void 0,"aria-labelledby":eO,"data-parent":x?"":void 0,onFocus(){S(!0)},onBlur(){let e=eE.current;e&&(P(!0),S(!1),"onBlur"===R&&eM.commit(eo?ek:e.checked))},onClick(e){p||eu||(e.preventDefault(),eE.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},el,eM.getValidationProps,y,eN,eL],stateAttributesMapping:ez});return(0,a.jsxs)(es.Provider,{value:eH,children:[eq,!eB&&!eo&&em&&!x&&void 0!==b&&(0,a.jsx)("input",{type:"hidden",name:em,value:b}),(0,a.jsx)("input",{...eF})]})});var eo=e.i(504068),ed=e.i(193214),ec=e.i(809058);let eu=s.forwardRef(function(e,t){let{render:a,className:i,keepMounted:n=!1,...r}=e,l=function(){let e=s.useContext(es);if(void 0===e)throw Error((0,ea.default)(14));return e}(),o=l.checked||l.indeterminate,{mounted:d,transitionStatus:c,setMounted:u}=(0,ed.useTransitionStatus)(o),m=s.useRef(null),h={...l,transitionStatus:c};(0,eo.useOpenChangeComplete)({open:o,ref:m,onComplete(){o||u(!1)}});let x=A(l),p=s.useMemo(()=>({...x,...ec.transitionStatusMapping,...K.fieldValidityMapping}),[x]),g=(0,D.useRenderElement)("span",e,{ref:[t,m],state:h,stateAttributesMapping:p,props:r});return n||d?g:null});e.s(["Indicator",0,eu,"Root",0,el],606680);var em=e.i(606680),em=em,eh=e.i(533133);function ex({className:e,...t}){return(0,a.jsx)(em.Root,{"data-slot":"checkbox",className:(0,b.cn)("peer size-4 shrink-0 rounded-[4px] border border-input bg-background shadow-xs outline-none transition-[color,box-shadow] dark:bg-input/30","data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40","data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...t,children:(0,a.jsx)(em.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:(0,a.jsx)(eh.CheckIcon,{className:"size-3.5",strokeWidth:3})})})}var ep=e.i(887911),eg=e.i(550599),ef=e.i(514798);let eb=(0,ef.createServerReference)("60055c035170d24b736f46a94e3432ed3060e75fb0",ef.callServer,void 0,ef.findSourceMapURL,"completeOnboarding"),ev=(0,ef.createServerReference)("60bac43b8930ce1461a961a4aa62d3122b8ee95c7b",ef.callServer,void 0,ef.findSourceMapURL,"setOnboardingExtensions");function ej({username:e,onComplete:t}){let{t:i}=(0,f.useI18n)(),n=(0,ep.listExtensionMetadata)(),[l,o]=(0,s.useState)(()=>new Set(n.map(e=>e.id))),[d,c]=(0,s.useState)(!1),m=n.length,h=l.size;async function x(){c(!0);let a=Array.from(l),s=[];if(a.length>0)for(let e of(await Promise.all(a.map(async e=>{try{let t=await (0,eg.installExtension)(e);return{id:e,success:t.success}}catch{return{id:e,success:!1}}}))))e.success&&s.push(e.id);await ev(a,s),await eb(e),c(!1),t()}return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:i("onboarding.step4.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:i("onboarding.step4.desc")})]}),(0,a.jsx)("div",{className:"space-y-2",children:n.map(e=>{let t=e.icon,s=l.has(e.id);return(0,a.jsxs)("label",{className:`flex items-start gap-3 rounded-lg border p-3 cursor-pointer transition-colors ${s?"border-primary/40 bg-primary/5 hover:bg-primary/10":"border-border bg-background hover:bg-accent/50"}`,children:[(0,a.jsx)(ex,{checked:s,onCheckedChange:()=>{var t;return t=e.id,void o(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},disabled:d,className:"mt-0.5"}),(0,a.jsxs)("div",{className:"flex flex-1 items-start gap-3 min-w-0",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:(0,a.jsx)(t,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["~",e.sizeMB," MB"]})]}),(0,a.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description}),(0,a.jsxs)("a",{href:e.homepageUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[(0,a.jsx)(E.ExternalLink,{className:"h-3 w-3"}),i("settings.extensions.visitHomepage")]})]})]})]},e.id)})}),h<m&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground italic",children:i("onboarding.step4.skipHint")}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(r.Button,{onClick:x,disabled:d,children:d?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),i("onboarding.step4.installing")]}):0===h?i("onboarding.step4.continueWithoutInstall"):i("onboarding.step4.continue")})})]})}function ey({step:e}){let t=[N.User,x.Terminal,k.GitBranch,w.Package][e-1]??N.User,s=["Profile","Connect","Configure","Extensions"][e-1]??"";return(0,a.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[(0,a.jsx)("div",{className:"absolute inset-0 opacity-[0.07] text-white",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{width:"380px",height:"380px",background:"radial-gradient(circle, oklch(0.80 0.14 75 / 0.25) 0%, oklch(0.80 0.14 75 / 0.08) 45%, transparent 70%)",animation:"ob-pulse 6s ease-in-out infinite"}}),(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/25",style:{width:"260px",height:"260px",animation:"ob-spin 20s linear infinite"},children:(0,a.jsx)("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 h-3 w-3 rounded-full bg-amber-400",style:{boxShadow:"0 0 16px oklch(0.80 0.14 75 / 0.7)"}})}),(0,a.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/15",style:{width:"380px",height:"380px",animation:"ob-spin 30s linear infinite reverse"},children:[(0,a.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 h-2 w-2 rounded-full bg-amber-400/70"}),(0,a.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 h-1.5 w-1.5 rounded-full bg-amber-400/50"})]}),(0,a.jsx)("svg",{className:"absolute",style:{top:"18%",right:"22%",animation:"ob-float 8s ease-in-out infinite"},width:"44",height:"50",viewBox:"0 0 40 46",fill:"none",children:(0,a.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.4)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.06)"})}),(0,a.jsx)("svg",{className:"absolute",style:{bottom:"22%",left:"18%",animation:"ob-float 10s ease-in-out 2s infinite"},width:"32",height:"36",viewBox:"0 0 40 46",fill:"none",children:(0,a.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.3)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.05)"})}),(0,a.jsx)("div",{className:"absolute h-3.5 w-3.5 rounded-full bg-amber-400/40",style:{top:"30%",left:"28%",animation:"ob-float 7s ease-in-out 1s infinite"}}),(0,a.jsx)("div",{className:"absolute h-2.5 w-2.5 rounded-full bg-amber-400/30",style:{top:"65%",right:"30%",animation:"ob-float 9s ease-in-out 3s infinite"}}),(0,a.jsx)("div",{className:"absolute h-2 w-2 rounded-full bg-amber-400/20",style:{top:"45%",right:"15%",animation:"ob-float 6s ease-in-out 0.5s infinite"}}),(0,a.jsxs)("svg",{className:"absolute inset-0 h-full w-full text-white opacity-[0.12]",children:[(0,a.jsx)("line",{x1:"30%",y1:"25%",x2:"70%",y2:"45%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 12s linear infinite"}}),(0,a.jsx)("line",{x1:"65%",y1:"30%",x2:"35%",y2:"70%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 15s linear infinite reverse"}})]}),(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,a.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-400/35 bg-amber-500/10 backdrop-blur-sm transition-all duration-700",style:{boxShadow:"0 0 50px oklch(0.80 0.14 75 / 0.2)"},children:(0,a.jsx)(t,{className:"h-7 w-7 text-amber-400"})})}),(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 translate-y-12 text-center",children:(0,a.jsx)("p",{className:"text-[11px] font-medium tracking-widest uppercase text-amber-400/60",children:s})})]})}let eN={host:"",ownerMatch:"*",localPathTemplate:""};e.s(["default",0,function(){let e,t,u,h=(0,i.useRouter)(),{t:p,locale:g,setLocale:b}=(0,f.useI18n)(),{theme:v,setTheme:E}=(0,n.useTheme)(),[$,O]=(0,s.useState)(!1),[F,U]=(0,s.useState)(1),[V,H]=(0,s.useState)(""),[z,q]=(0,s.useState)({}),K=Object.values(z).some(e=>e.ok),[A,D]=(0,s.useState)([]),[W,_]=(0,s.useState)({...eN}),[G,J]=(0,s.useState)(!0),[Z,X]=(0,s.useState)(0),[Y,Q]=(0,s.useState)(!1),[ee,et]=(0,s.useState)(!1);(0,s.useEffect)(()=>O(!0),[]);let ea=[{value:"light",label:(0,a.jsx)(S.Sun,{className:"h-4 w-4"})},{value:"dark",label:(0,a.jsx)(P.Moon,{className:"h-4 w-4"})},{value:"system",label:(0,a.jsx)(L,{className:"h-4 w-4"})}];function es(){U(e=>e+1)}function ei(){U(e=>Math.max(1,e-1))}let en=[{icon:N.User,label:p("onboarding.step1.title")},{icon:x.Terminal,label:p("onboarding.step2.title")},{icon:k.GitBranch,label:p("onboarding.step3.title")},{icon:w.Package,label:p("onboarding.step4.title")}];return(0,a.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,a.jsx)("div",{className:"hidden xl:block xl:w-3/5 border-r border-border/50 bg-[oklch(0.13_0.006_260)]",children:(0,a.jsx)(ey,{step:F})}),(0,a.jsx)("div",{className:"flex w-full flex-col items-center px-8 pt-[10vh] pb-10 xl:w-2/5 xl:px-16 overflow-y-auto",children:(0,a.jsxs)("div",{className:"w-full max-w-lg space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-8 w-8 rounded-lg"}),(0,a.jsx)("span",{className:"text-lg font-semibold tracking-tight",children:"Tower"})]}),(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:en.map((e,t)=>{let s=t+1,i=s===F,n=s<F,r=e.icon;return(0,a.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[t>0&&(0,a.jsx)("div",{className:`h-px w-4 transition-colors duration-500 ${n?"bg-primary":"bg-border"}`}),(0,a.jsxs)("div",{className:`flex items-center gap-1 shrink-0 rounded-full px-2 py-1 text-[11px] font-medium whitespace-nowrap transition-all duration-500 ${i?"bg-primary text-primary-foreground shadow-sm":n?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:[n?(0,a.jsx)(m.Check,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(r,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{children:e.label})]})]},t)})})]}),(0,a.jsxs)("div",{children:[1===F&&(0,a.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:p("onboarding.step1.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p("onboarding.step1.desc")})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"onboarding-username",className:"text-sm font-medium",children:p("onboarding.step1.usernameLabel")}),(0,a.jsx)("input",{id:"onboarding-username",type:"text",value:V,onChange:e=>H(e.target.value),placeholder:p("onboarding.step1.usernamePlaceholder"),className:"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",maxLength:64,autoFocus:!0,autoComplete:"username"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{className:"space-y-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(R.Languages,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("label",{className:"text-sm font-medium",children:p("settings.language")})]}),(0,a.jsx)(o.SegmentedControl,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}].map(e=>({value:e.value,label:e.label})),value:g,onChange:e=>b(e)})]}),(0,a.jsxs)("div",{className:"space-y-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(S.Sun,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("label",{className:"text-sm font-medium",children:p("settings.theme")})]}),$?(0,a.jsx)(o.SegmentedControl,{options:ea.map(e=>({value:e.value,label:e.label})),value:v??"system",onChange:e=>E(e)}):(0,a.jsx)("div",{className:"inline-flex h-8 rounded-md border border-border bg-muted p-1 gap-1 w-[120px]"})]})]}),(0,a.jsx)("div",{className:"flex justify-end pt-3",children:(0,a.jsxs)(r.Button,{onClick:es,disabled:0===V.trim().length,className:"px-5",children:[p("onboarding.step1.next"),(0,a.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})})]}),2===F&&(0,a.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:p("onboarding.step2.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p("onboarding.step2.desc")})]}),(0,a.jsx)(j,{results:z,onResult:(e,t)=>q(a=>({...a,[e]:t}))}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,a.jsxs)(r.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ei,children:[(0,a.jsx)(C.ChevronLeft,{className:"h-4 w-4 mr-1"}),p("onboarding.back")]}),(0,a.jsxs)(r.Button,{onClick:es,disabled:!K,className:"px-5",children:[p("onboarding.step1.next"),(0,a.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),3===F&&(0,a.jsxs)("div",{className:"space-y-5 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:p("onboarding.step3.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p("onboarding.step3.desc")})]}),A.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:p("onboarding.step3.added").replace("{count}",String(A.length))}),A.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"text-sm font-medium truncate",children:[e.host,(0,a.jsx)("span",{className:"text-muted-foreground",children:"*"!==e.ownerMatch?` / ${e.ownerMatch}`:""})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:e.localPathTemplate})]}),(0,a.jsx)(r.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void D(e=>e.filter(e=>e.id!==t))},children:(0,a.jsx)(B.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))]}),G?(0,a.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:p("onboarding.step3.hostLabel")}),(0,a.jsx)(l.Input,{value:W.host,onChange:e=>_(t=>({...t,host:e.target.value})),placeholder:p("onboarding.step3.hostPlaceholder"),className:"h-9",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:p("onboarding.step3.ownerLabel")}),(0,a.jsx)(l.Input,{value:W.ownerMatch,onChange:e=>_(t=>({...t,ownerMatch:e.target.value})),placeholder:p("onboarding.step3.ownerPlaceholder"),className:"h-9"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"block text-xs font-medium",children:p("onboarding.step3.pathLabel")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.Input,{value:W.localPathTemplate,onChange:e=>_(t=>({...t,localPathTemplate:e.target.value})),placeholder:p("onboarding.step3.pathPlaceholder"),className:"h-9 font-mono text-xs flex-1"}),(0,a.jsxs)(d.Tooltip,{children:[(0,a.jsx)(d.TooltipTrigger,{render:(0,a.jsx)(r.Button,{variant:Y?"default":"outline",size:"sm",type:"button",onClick:()=>{Q(e=>(e||X(2),!e))},className:"shrink-0 font-mono",children:"{path}"})}),(0,a.jsx)(d.TooltipContent,{side:"top",className:"max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,a.jsx)("div",{className:"font-medium",children:p("settings.config.git.pathTooltipTitle")}),(0,a.jsx)("div",{className:"opacity-80",children:p("settings.config.git.pathTooltipDetail")})]})})]}),(0,a.jsxs)(d.Tooltip,{children:[(0,a.jsx)(d.TooltipTrigger,{render:(0,a.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>et(!0),children:(0,a.jsx)(I.FolderOpen,{className:"h-4 w-4"})})}),(0,a.jsx)(d.TooltipContent,{children:p("settings.config.git.pickFolder")})]})]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:p(Y?"onboarding.step3.pathHintFull":"onboarding.step3.pathHintRepo")})]}),W.localPathTemplate&&(e=W.localPathTemplate.trim().replace(/\/+$/,""),t=Y?`${e}/{path}`:e,u=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:p("onboarding.step3.previewLabel")}),(0,a.jsx)("div",{className:"flex gap-1 flex-wrap",children:u.map((e,t)=>(0,a.jsx)("button",{type:"button",onClick:()=>X(t),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${Z===t?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e.label},t))}),(0,a.jsxs)("div",{className:"rounded-md bg-muted/50 px-3 py-2 space-y-1",children:[(0,a.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:u[Z].url}),(0,a.jsxs)("p",{className:"font-mono text-xs",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,a.jsx)("span",{className:"text-primary",children:function(e,t){if(!e||!t)return"";let a=t.trim(),s=[],i=a.match(/^git@[^:]+:(.+)$/);if(i)s=i[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(a);s=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!s.length)return"";let n=s[0],r=s[s.length-1],l=s.join("/");if(e.includes("{path}"))return e.replace("{path}",l).replace("{owner}",n).replace("{repo}",r).replace(/\/+$/,"");let o=e.replace("{owner}",n).replace("{repo}","").replace(/\/+$/,"");return`${o}/${r}`}(t,u[Z].url)})]})]})]})),(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[A.length>0&&(0,a.jsx)(r.Button,{variant:"ghost",onClick:()=>J(!1),children:p("settings.config.git.cancel")}),(0,a.jsxs)(r.Button,{onClick:function(){if(!W.host.trim()||!W.localPathTemplate.trim())return;let e=W.localPathTemplate.trim().replace(/\/+$/,""),t=Y?`${e}/{path}`:e,a={id:crypto.randomUUID(),host:W.host.trim(),ownerMatch:W.ownerMatch.trim()||"*",localPathTemplate:t,priority:A.length};D(e=>[...e,a]),_({...eN}),Q(!1),J(!1)},disabled:!W.host.trim()||!W.localPathTemplate.trim(),children:[(0,a.jsx)(m.Check,{className:"h-4 w-4 mr-1"}),p("settings.config.git.save")]})]})]}):(0,a.jsxs)(r.Button,{variant:"outline",onClick:()=>{_({...eN}),J(!0)},children:[(0,a.jsx)(M.Plus,{className:"h-4 w-4 mr-1"}),p("settings.config.git.addRule")]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,a.jsxs)(r.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ei,children:[(0,a.jsx)(C.ChevronLeft,{className:"h-4 w-4 mr-1"}),p("onboarding.back")]}),(0,a.jsxs)(r.Button,{onClick:async()=>{A.length>0&&await (0,y.setConfigValue)("git.pathMappingRules",A),U(e=>e+1)},className:"px-5",children:[p("onboarding.step1.next"),(0,a.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),4===F&&(0,a.jsx)(ej,{username:V,onComplete:()=>h.replace("/workspaces")})]}),(0,a.jsx)("div",{className:"pt-6 text-xs text-muted-foreground",children:p("onboarding.stepIndicator").replace("{current}",String(F)).replace("{total}",String(4))})]})}),(0,a.jsx)(c.FolderBrowserDialog,{open:ee,onOpenChange:et,onSelect:e=>{_(t=>({...t,localPathTemplate:e})),et(!1)}})]})}],566606)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},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)},673984,e=>{"use strict";let t=(0,e.i(572989).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],673984)},566606,e=>{"use strict";var t,a=e.i(289721),s=e.i(965652),i=e.i(538059),n=e.i(821957),r=e.i(519455),l=e.i(793479),o=e.i(905455),d=e.i(746798),c=e.i(224277),u=e.i(400355),m=e.i(597746),h=e.i(657153),x=e.i(567860),p=e.i(572989);let g=(0,p.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var f=e.i(533499),b=e.i(975157);let v=[{adapterType:"claude_code",provider:"claude",label:"Claude CLI"},{adapterType:"codex_cli",provider:"codex",label:"Codex CLI"}];function j({results:e,onResult:t}){let{t:i}=(0,f.useI18n)(),[n,l]=(0,s.useState)({}),o=v.some(e=>n[e.provider]);async function c(e){if(!n[e.provider]){l(t=>({...t,[e.provider]:!0}));try{let a=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:e.adapterType,provider:e.provider})}),s=await a.json();t(e.provider,s)}catch{t(e.provider,{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]})}finally{l(t=>({...t,[e.provider]:!1}))}}}async function p(){await Promise.all(v.map(e=>c(e)))}return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:i("onboarding.step2.passHint")}),(0,a.jsxs)(r.Button,{variant:"outline",onClick:p,disabled:o,children:[o?(0,a.jsx)(u.Loader2,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(x.Terminal,{className:"h-4 w-4"}),i("onboarding.step2.testAll")]})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:v.map(t=>{let s=!!n[t.provider],l=e[t.provider],o=l?.ok===!0,x=null!=l&&!l.ok,p=l?.checks.find(e=>!e.passed)?.message,f=s?i("settings.aiTools.testing"):o?i("settings.aiTools.testPassed"):x?p??i("settings.aiTools.testFailed"):i("onboarding.step2.notTested"),v=x?l.checks.filter(e=>!e.passed).map(e=>e.message).join("\n"):void 0;return(0,a.jsxs)("div",{className:(0,b.cn)("flex items-center gap-2.5 rounded-lg border px-3 py-2.5 transition-colors",o?"border-green-200 bg-green-50 dark:border-green-800 dark:bg-green-950/20":x?"border-red-200 bg-red-50 dark:border-red-800 dark:bg-red-950/20":"border-border bg-muted/30"),children:[(0,a.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:s?(0,a.jsx)(u.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}):o?(0,a.jsx)(m.Check,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):x?(0,a.jsx)(h.X,{className:"h-4 w-4 text-red-600 dark:text-red-400"}):(0,a.jsx)("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/40"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium",children:t.label}),(0,a.jsx)("p",{className:(0,b.cn)("truncate text-xs",o?"text-green-700 dark:text-green-300":x?"text-red-700 dark:text-red-300":"text-muted-foreground"),title:v,children:f})]}),(0,a.jsxs)(d.Tooltip,{children:[(0,a.jsx)(d.TooltipTrigger,{render:(0,a.jsx)(r.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground",onClick:()=>c(t),disabled:s,children:(0,a.jsx)(g,{className:"h-4 w-4"})})}),(0,a.jsx)(d.TooltipContent,{children:i("settings.aiTools.testConnection")})]})]},t.provider)})})]})}var y=e.i(191210),N=e.i(673984),k=e.i(226145),w=e.i(245697),C=e.i(19671),T=e.i(368490),S=e.i(387091),P=e.i(15299);let L=(0,p.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var R=e.i(769757),M=e.i(232545),B=e.i(998626),I=e.i(453889),E=e.i(475958);e.s([],342627),e.i(342627),e.i(708878);var $=e.i(954588),O=e.i(314757),F=e.i(887642),U=e.i(804849),V=e.i(362891),H=e.i(903224),z=e.i(416369);let q=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.indeterminate="data-indeterminate",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t);var K=e.i(551974);function A(e){return s.useMemo(()=>({checked:t=>e.indeterminate?{}:t?{[q.checked]:""}:{[q.unchecked]:""},...K.fieldValidityMapping}),[e.indeterminate])}var D=e.i(581263),W=e.i(207516),_=e.i(565455),G=e.i(282109),J=e.i(890514),Z=e.i(971667),X=e.i(421689),Y=e.i(571870),Q=e.i(179279),ee=e.i(689401),et=e.i(756499),ea=e.i(462902);let es=s.createContext(void 0);var ei=e.i(67077),en=e.i(586622),er=e.i(353052);let el=s.forwardRef(function(e,t){let{checked:i,className:n,defaultChecked:r=!1,"aria-labelledby":l,disabled:o=!1,id:d,indeterminate:c=!1,inputRef:u,name:m,onCheckedChange:h,parent:x=!1,readOnly:p=!1,render:g,required:f=!1,uncheckedValue:b,value:v,nativeButton:j=!1,...y}=e,{clearErrors:N}=(0,Y.useFormContext)(),{disabled:k,name:w,setDirty:C,setFilled:T,setFocused:S,setTouched:P,state:L,validationMode:R,validityData:M,shouldValidateOnChange:B,validation:I}=(0,J.useFieldRootContext)(),E=(0,Z.useFieldItemContext)(),{labelId:q,controlId:K,registerControlId:ea,getDescriptionProps:el}=(0,Q.useLabelableContext)(),eo=(0,et.useCheckboxGroupContext)(),ed=eo?.parent,ec=ed&&eo.allValues,eu=k||E.disabled||eo?.disabled||o,em=w??m,eh=v??em,ex=(0,W.useBaseUiId)(),ep=(0,W.useBaseUiId)(),eg=K;ec?eg=x?ep:`${ed.id}-${eh}`:d&&(eg=d);let ef={};ec&&(x?ef=eo.parent.getParentProps():eh&&(ef=eo.parent.getChildProps(eh)));let eb=(0,F.useStableCallback)(h),{checked:ev=i,indeterminate:ej=c,onCheckedChange:ey,...eN}=ef,ek=eo?.value,ew=eo?.setValue,eC=eo?.defaultValue,eT=s.useRef(null),eS=(0,H.useRefWithInit)(()=>Symbol("checkbox-control")),eP=s.useRef(!1),{getButtonProps:eL,buttonRef:eR}=(0,G.useButton)({disabled:eu,native:j}),eM=eo?.validation??I,[eB,eI]=(0,O.useControlled)({controlled:eh&&ek&&!x?ek.includes(eh):ev,default:eh&&eC&&!x?eC.includes(eh):r,name:"Checkbox",state:"checked"});(0,U.useIsoLayoutEffect)(()=>{ea!==$.NOOP&&(eP.current=!0,ea(eS.current,eg))},[eg,eo,ea,x,eS]),s.useEffect(()=>{let e=eS.current;return()=>{eP.current&&ea!==$.NOOP&&(eP.current=!1,ea(e,void 0))}},[ea,eS]),(0,X.useField)({enabled:!eo,id:ex,commit:eM.commit,value:eB,controlRef:eT,name:em,getValue:()=>eB});let eE=s.useRef(null),e$=(0,V.useMergedRefs)(u,eE,eM.inputRef),eO=(0,ee.useAriaLabelledBy)(l,q,eE,!j,eg??void 0);(0,U.useIsoLayoutEffect)(()=>{eE.current&&(eE.current.indeterminate=ej,eB&&T(!0))},[eB,ej,T]),(0,er.useValueChanged)(eB,()=>{(!eo||x)&&(N(em),T(eB),C(eB!==M.initialValue),B()?eM.commit(eB):eM.commit(eB,!0))});let eF=(0,_.mergeProps)({checked:eB,disabled:eu,name:x?void 0:em,id:j?void 0:eg??void 0,required:f,ref:e$,style:em?z.visuallyHiddenInput:z.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,a=(0,ei.createChangeEventDetails)(en.REASONS.none,e.nativeEvent);ey?.(t,a),eb(t,a),!a.isCanceled&&(eI(t),eh&&ek&&ew&&!x&&ew(t?[...ek,eh]:ek.filter(e=>e!==eh),a))},onFocus(){eT.current?.focus()}},void 0!==v?{value:(eo?eB&&v:v)||""}:$.EMPTY_OBJECT,el,eo?eM.getValidationProps:eM.getInputValidationProps),eU=ec?!!ev:eB,eV=ec&&ej||c;s.useEffect(()=>{if(!ed||!eh)return;let e=ed.disabledStatesRef.current;return e.set(eh,eu),()=>{e.delete(eh)}},[ed,eu,eh]);let eH=s.useMemo(()=>({...L,checked:eU,disabled:eu,readOnly:p,required:f,indeterminate:eV}),[L,eU,eu,p,f,eV]),ez=A(eH),eq=(0,D.useRenderElement)("span",e,{state:eH,ref:[eR,eT,t,eo?.registerControlRef],props:[{id:j?eg??void 0:ex,role:"checkbox","aria-checked":ej?"mixed":eB,"aria-readonly":p||void 0,"aria-required":f||void 0,"aria-labelledby":eO,"data-parent":x?"":void 0,onFocus(){S(!0)},onBlur(){let e=eE.current;e&&(P(!0),S(!1),"onBlur"===R&&eM.commit(eo?ek:e.checked))},onClick(e){p||eu||(e.preventDefault(),eE.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},el,eM.getValidationProps,y,eN,eL],stateAttributesMapping:ez});return(0,a.jsxs)(es.Provider,{value:eH,children:[eq,!eB&&!eo&&em&&!x&&void 0!==b&&(0,a.jsx)("input",{type:"hidden",name:em,value:b}),(0,a.jsx)("input",{...eF})]})});var eo=e.i(504068),ed=e.i(193214),ec=e.i(809058);let eu=s.forwardRef(function(e,t){let{render:a,className:i,keepMounted:n=!1,...r}=e,l=function(){let e=s.useContext(es);if(void 0===e)throw Error((0,ea.default)(14));return e}(),o=l.checked||l.indeterminate,{mounted:d,transitionStatus:c,setMounted:u}=(0,ed.useTransitionStatus)(o),m=s.useRef(null),h={...l,transitionStatus:c};(0,eo.useOpenChangeComplete)({open:o,ref:m,onComplete(){o||u(!1)}});let x=A(l),p=s.useMemo(()=>({...x,...ec.transitionStatusMapping,...K.fieldValidityMapping}),[x]),g=(0,D.useRenderElement)("span",e,{ref:[t,m],state:h,stateAttributesMapping:p,props:r});return n||d?g:null});e.s(["Indicator",0,eu,"Root",0,el],606680);var em=e.i(606680),em=em,eh=e.i(533133);function ex({className:e,...t}){return(0,a.jsx)(em.Root,{"data-slot":"checkbox",className:(0,b.cn)("peer size-4 shrink-0 rounded-[4px] border border-input bg-background shadow-xs outline-none transition-[color,box-shadow] dark:bg-input/30","data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40","data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...t,children:(0,a.jsx)(em.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:(0,a.jsx)(eh.CheckIcon,{className:"size-3.5",strokeWidth:3})})})}var ep=e.i(887911),eg=e.i(210404),ef=e.i(514798);let eb=(0,ef.createServerReference)("60ae2acf84914a1879cb08641eb58340d607175630",ef.callServer,void 0,ef.findSourceMapURL,"completeOnboarding"),ev=(0,ef.createServerReference)("608067b486f33e2002e74544371074d7538d75912e",ef.callServer,void 0,ef.findSourceMapURL,"setOnboardingExtensions");function ej({username:e,onComplete:t}){let{t:i}=(0,f.useI18n)(),n=(0,ep.listExtensionMetadata)(),[l,o]=(0,s.useState)(()=>new Set(n.map(e=>e.id))),[d,c]=(0,s.useState)(!1),m=n.length,h=l.size;async function x(){c(!0);let a=Array.from(l),s=[];if(a.length>0)for(let e of(await Promise.all(a.map(async e=>{try{let t=await (0,eg.installExtension)(e);return{id:e,success:t.success}}catch{return{id:e,success:!1}}}))))e.success&&s.push(e.id);await ev(a,s),await eb(e),c(!1),t()}return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold",children:i("onboarding.step4.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:i("onboarding.step4.desc")})]}),(0,a.jsx)("div",{className:"space-y-2",children:n.map(e=>{let t=e.icon,s=l.has(e.id);return(0,a.jsxs)("label",{className:`flex items-start gap-3 rounded-lg border p-3 cursor-pointer transition-colors ${s?"border-primary/40 bg-primary/5 hover:bg-primary/10":"border-border bg-background hover:bg-accent/50"}`,children:[(0,a.jsx)(ex,{checked:s,onCheckedChange:()=>{var t;return t=e.id,void o(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},disabled:d,className:"mt-0.5"}),(0,a.jsxs)("div",{className:"flex flex-1 items-start gap-3 min-w-0",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:(0,a.jsx)(t,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["~",e.sizeMB," MB"]})]}),(0,a.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description}),(0,a.jsxs)("a",{href:e.homepageUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[(0,a.jsx)(E.ExternalLink,{className:"h-3 w-3"}),i("settings.extensions.visitHomepage")]})]})]})]},e.id)})}),h<m&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground italic",children:i("onboarding.step4.skipHint")}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(r.Button,{onClick:x,disabled:d,children:d?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),i("onboarding.step4.installing")]}):0===h?i("onboarding.step4.continueWithoutInstall"):i("onboarding.step4.continue")})})]})}function ey({step:e}){let t=[N.User,x.Terminal,k.GitBranch,w.Package][e-1]??N.User,s=["Profile","Connect","Configure","Extensions"][e-1]??"";return(0,a.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[(0,a.jsx)("div",{className:"absolute inset-0 opacity-[0.07] text-white",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{width:"380px",height:"380px",background:"radial-gradient(circle, oklch(0.80 0.14 75 / 0.25) 0%, oklch(0.80 0.14 75 / 0.08) 45%, transparent 70%)",animation:"ob-pulse 6s ease-in-out infinite"}}),(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/25",style:{width:"260px",height:"260px",animation:"ob-spin 20s linear infinite"},children:(0,a.jsx)("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 h-3 w-3 rounded-full bg-amber-400",style:{boxShadow:"0 0 16px oklch(0.80 0.14 75 / 0.7)"}})}),(0,a.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/15",style:{width:"380px",height:"380px",animation:"ob-spin 30s linear infinite reverse"},children:[(0,a.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 h-2 w-2 rounded-full bg-amber-400/70"}),(0,a.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 h-1.5 w-1.5 rounded-full bg-amber-400/50"})]}),(0,a.jsx)("svg",{className:"absolute",style:{top:"18%",right:"22%",animation:"ob-float 8s ease-in-out infinite"},width:"44",height:"50",viewBox:"0 0 40 46",fill:"none",children:(0,a.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.4)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.06)"})}),(0,a.jsx)("svg",{className:"absolute",style:{bottom:"22%",left:"18%",animation:"ob-float 10s ease-in-out 2s infinite"},width:"32",height:"36",viewBox:"0 0 40 46",fill:"none",children:(0,a.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.3)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.05)"})}),(0,a.jsx)("div",{className:"absolute h-3.5 w-3.5 rounded-full bg-amber-400/40",style:{top:"30%",left:"28%",animation:"ob-float 7s ease-in-out 1s infinite"}}),(0,a.jsx)("div",{className:"absolute h-2.5 w-2.5 rounded-full bg-amber-400/30",style:{top:"65%",right:"30%",animation:"ob-float 9s ease-in-out 3s infinite"}}),(0,a.jsx)("div",{className:"absolute h-2 w-2 rounded-full bg-amber-400/20",style:{top:"45%",right:"15%",animation:"ob-float 6s ease-in-out 0.5s infinite"}}),(0,a.jsxs)("svg",{className:"absolute inset-0 h-full w-full text-white opacity-[0.12]",children:[(0,a.jsx)("line",{x1:"30%",y1:"25%",x2:"70%",y2:"45%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 12s linear infinite"}}),(0,a.jsx)("line",{x1:"65%",y1:"30%",x2:"35%",y2:"70%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 15s linear infinite reverse"}})]}),(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,a.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-400/35 bg-amber-500/10 backdrop-blur-sm transition-all duration-700",style:{boxShadow:"0 0 50px oklch(0.80 0.14 75 / 0.2)"},children:(0,a.jsx)(t,{className:"h-7 w-7 text-amber-400"})})}),(0,a.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 translate-y-12 text-center",children:(0,a.jsx)("p",{className:"text-[11px] font-medium tracking-widest uppercase text-amber-400/60",children:s})})]})}let eN={host:"",ownerMatch:"*",localPathTemplate:""};e.s(["default",0,function(){let e,t,u,h=(0,i.useRouter)(),{t:p,locale:g,setLocale:b}=(0,f.useI18n)(),{theme:v,setTheme:E}=(0,n.useTheme)(),[$,O]=(0,s.useState)(!1),[F,U]=(0,s.useState)(1),[V,H]=(0,s.useState)(""),[z,q]=(0,s.useState)({}),K=Object.values(z).some(e=>e.ok),[A,D]=(0,s.useState)([]),[W,_]=(0,s.useState)({...eN}),[G,J]=(0,s.useState)(!0),[Z,X]=(0,s.useState)(0),[Y,Q]=(0,s.useState)(!1),[ee,et]=(0,s.useState)(!1);(0,s.useEffect)(()=>O(!0),[]);let ea=[{value:"light",label:(0,a.jsx)(S.Sun,{className:"h-4 w-4"})},{value:"dark",label:(0,a.jsx)(P.Moon,{className:"h-4 w-4"})},{value:"system",label:(0,a.jsx)(L,{className:"h-4 w-4"})}];function es(){U(e=>e+1)}function ei(){U(e=>Math.max(1,e-1))}let en=[{icon:N.User,label:p("onboarding.step1.title")},{icon:x.Terminal,label:p("onboarding.step2.title")},{icon:k.GitBranch,label:p("onboarding.step3.title")},{icon:w.Package,label:p("onboarding.step4.title")}];return(0,a.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,a.jsx)("div",{className:"hidden xl:block xl:w-3/5 border-r border-border/50 bg-[oklch(0.13_0.006_260)]",children:(0,a.jsx)(ey,{step:F})}),(0,a.jsx)("div",{className:"flex w-full flex-col items-center px-8 pt-[10vh] pb-10 xl:w-2/5 xl:px-16 overflow-y-auto",children:(0,a.jsxs)("div",{className:"w-full max-w-lg space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-8 w-8 rounded-lg"}),(0,a.jsx)("span",{className:"text-lg font-semibold tracking-tight",children:"Tower"})]}),(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:en.map((e,t)=>{let s=t+1,i=s===F,n=s<F,r=e.icon;return(0,a.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[t>0&&(0,a.jsx)("div",{className:`h-px w-4 transition-colors duration-500 ${n?"bg-primary":"bg-border"}`}),(0,a.jsxs)("div",{className:`flex items-center gap-1 shrink-0 rounded-full px-2 py-1 text-[11px] font-medium whitespace-nowrap transition-all duration-500 ${i?"bg-primary text-primary-foreground shadow-sm":n?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:[n?(0,a.jsx)(m.Check,{className:"h-3 w-3 shrink-0"}):(0,a.jsx)(r,{className:"h-3 w-3 shrink-0"}),(0,a.jsx)("span",{children:e.label})]})]},t)})})]}),(0,a.jsxs)("div",{children:[1===F&&(0,a.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:p("onboarding.step1.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p("onboarding.step1.desc")})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"onboarding-username",className:"text-sm font-medium",children:p("onboarding.step1.usernameLabel")}),(0,a.jsx)("input",{id:"onboarding-username",type:"text",value:V,onChange:e=>H(e.target.value),placeholder:p("onboarding.step1.usernamePlaceholder"),className:"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",maxLength:64,autoFocus:!0,autoComplete:"username"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{className:"space-y-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(R.Languages,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("label",{className:"text-sm font-medium",children:p("settings.language")})]}),(0,a.jsx)(o.SegmentedControl,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}].map(e=>({value:e.value,label:e.label})),value:g,onChange:e=>b(e)})]}),(0,a.jsxs)("div",{className:"space-y-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(S.Sun,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("label",{className:"text-sm font-medium",children:p("settings.theme")})]}),$?(0,a.jsx)(o.SegmentedControl,{options:ea.map(e=>({value:e.value,label:e.label})),value:v??"system",onChange:e=>E(e)}):(0,a.jsx)("div",{className:"inline-flex h-8 rounded-md border border-border bg-muted p-1 gap-1 w-[120px]"})]})]}),(0,a.jsx)("div",{className:"flex justify-end pt-3",children:(0,a.jsxs)(r.Button,{onClick:es,disabled:0===V.trim().length,className:"px-5",children:[p("onboarding.step1.next"),(0,a.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})})]}),2===F&&(0,a.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:p("onboarding.step2.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p("onboarding.step2.desc")})]}),(0,a.jsx)(j,{results:z,onResult:(e,t)=>q(a=>({...a,[e]:t}))}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,a.jsxs)(r.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ei,children:[(0,a.jsx)(C.ChevronLeft,{className:"h-4 w-4 mr-1"}),p("onboarding.back")]}),(0,a.jsxs)(r.Button,{onClick:es,disabled:!K,className:"px-5",children:[p("onboarding.step1.next"),(0,a.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),3===F&&(0,a.jsxs)("div",{className:"space-y-5 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:p("onboarding.step3.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p("onboarding.step3.desc")})]}),A.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:p("onboarding.step3.added").replace("{count}",String(A.length))}),A.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"text-sm font-medium truncate",children:[e.host,(0,a.jsx)("span",{className:"text-muted-foreground",children:"*"!==e.ownerMatch?` / ${e.ownerMatch}`:""})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:e.localPathTemplate})]}),(0,a.jsx)(r.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void D(e=>e.filter(e=>e.id!==t))},children:(0,a.jsx)(B.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))]}),G?(0,a.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:p("onboarding.step3.hostLabel")}),(0,a.jsx)(l.Input,{value:W.host,onChange:e=>_(t=>({...t,host:e.target.value})),placeholder:p("onboarding.step3.hostPlaceholder"),className:"h-9",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:p("onboarding.step3.ownerLabel")}),(0,a.jsx)(l.Input,{value:W.ownerMatch,onChange:e=>_(t=>({...t,ownerMatch:e.target.value})),placeholder:p("onboarding.step3.ownerPlaceholder"),className:"h-9"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("label",{className:"block text-xs font-medium",children:p("onboarding.step3.pathLabel")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.Input,{value:W.localPathTemplate,onChange:e=>_(t=>({...t,localPathTemplate:e.target.value})),placeholder:p("onboarding.step3.pathPlaceholder"),className:"h-9 font-mono text-xs flex-1"}),(0,a.jsxs)(d.Tooltip,{children:[(0,a.jsx)(d.TooltipTrigger,{render:(0,a.jsx)(r.Button,{variant:Y?"default":"outline",size:"sm",type:"button",onClick:()=>{Q(e=>(e||X(2),!e))},className:"shrink-0 font-mono",children:"{path}"})}),(0,a.jsx)(d.TooltipContent,{side:"top",className:"max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,a.jsx)("div",{className:"font-medium",children:p("settings.config.git.pathTooltipTitle")}),(0,a.jsx)("div",{className:"opacity-80",children:p("settings.config.git.pathTooltipDetail")})]})})]}),(0,a.jsxs)(d.Tooltip,{children:[(0,a.jsx)(d.TooltipTrigger,{render:(0,a.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>et(!0),children:(0,a.jsx)(I.FolderOpen,{className:"h-4 w-4"})})}),(0,a.jsx)(d.TooltipContent,{children:p("settings.config.git.pickFolder")})]})]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:p(Y?"onboarding.step3.pathHintFull":"onboarding.step3.pathHintRepo")})]}),W.localPathTemplate&&(e=W.localPathTemplate.trim().replace(/\/+$/,""),t=Y?`${e}/{path}`:e,u=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-xs font-medium",children:p("onboarding.step3.previewLabel")}),(0,a.jsx)("div",{className:"flex gap-1 flex-wrap",children:u.map((e,t)=>(0,a.jsx)("button",{type:"button",onClick:()=>X(t),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${Z===t?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e.label},t))}),(0,a.jsxs)("div",{className:"rounded-md bg-muted/50 px-3 py-2 space-y-1",children:[(0,a.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:u[Z].url}),(0,a.jsxs)("p",{className:"font-mono text-xs",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,a.jsx)("span",{className:"text-primary",children:function(e,t){if(!e||!t)return"";let a=t.trim(),s=[],i=a.match(/^git@[^:]+:(.+)$/);if(i)s=i[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(a);s=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!s.length)return"";let n=s[0],r=s[s.length-1],l=s.join("/");if(e.includes("{path}"))return e.replace("{path}",l).replace("{owner}",n).replace("{repo}",r).replace(/\/+$/,"");let o=e.replace("{owner}",n).replace("{repo}","").replace(/\/+$/,"");return`${o}/${r}`}(t,u[Z].url)})]})]})]})),(0,a.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[A.length>0&&(0,a.jsx)(r.Button,{variant:"ghost",onClick:()=>J(!1),children:p("settings.config.git.cancel")}),(0,a.jsxs)(r.Button,{onClick:function(){if(!W.host.trim()||!W.localPathTemplate.trim())return;let e=W.localPathTemplate.trim().replace(/\/+$/,""),t=Y?`${e}/{path}`:e,a={id:crypto.randomUUID(),host:W.host.trim(),ownerMatch:W.ownerMatch.trim()||"*",localPathTemplate:t,priority:A.length};D(e=>[...e,a]),_({...eN}),Q(!1),J(!1)},disabled:!W.host.trim()||!W.localPathTemplate.trim(),children:[(0,a.jsx)(m.Check,{className:"h-4 w-4 mr-1"}),p("settings.config.git.save")]})]})]}):(0,a.jsxs)(r.Button,{variant:"outline",onClick:()=>{_({...eN}),J(!0)},children:[(0,a.jsx)(M.Plus,{className:"h-4 w-4 mr-1"}),p("settings.config.git.addRule")]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,a.jsxs)(r.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ei,children:[(0,a.jsx)(C.ChevronLeft,{className:"h-4 w-4 mr-1"}),p("onboarding.back")]}),(0,a.jsxs)(r.Button,{onClick:async()=>{A.length>0&&await (0,y.setConfigValue)("git.pathMappingRules",A),U(e=>e+1)},className:"px-5",children:[p("onboarding.step1.next"),(0,a.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),4===F&&(0,a.jsx)(ej,{username:V,onComplete:()=>h.replace("/workspaces")})]}),(0,a.jsx)("div",{className:"pt-6 text-xs text-muted-foreground",children:p("onboarding.stepIndicator").replace("{current}",String(F)).replace("{total}",String(4))})]})}),(0,a.jsx)(c.FolderBrowserDialog,{open:ee,onOpenChange:et,onSelect:e=>{_(t=>({...t,localPathTemplate:e})),et(!1)}})]})}],566606)}]);