tower-studio 0.2.8 → 0.2.9

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 (198) 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 +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +43 -43
  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/_not-found.html +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  18. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  19. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  20. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  22. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/index.html +1 -1
  26. package/.next/standalone/.next/server/app/index.rsc +14 -14
  27. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  28. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
  29. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  30. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
  31. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  32. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  33. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +75 -75
  34. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  37. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +43 -43
  38. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  41. package/.next/standalone/.next/server/app/onboarding.rsc +16 -16
  42. package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  43. package/.next/standalone/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  44. package/.next/standalone/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  45. package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  46. package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  47. package/.next/standalone/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  48. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  49. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +43 -43
  50. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  53. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +56 -56
  54. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/settings.html +1 -1
  57. package/.next/standalone/.next/server/app/settings.rsc +16 -16
  58. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  59. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  60. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  61. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  62. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  63. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +104 -104
  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 +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +86 -86
  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 +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +75 -75
  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 +1 -1
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +72 -72
  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 +1 -1
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +43 -43
  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 +1 -1
  85. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +76 -76
  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 +2 -2
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +86 -86
  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 +1 -1
  93. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +63 -63
  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/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
  97. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
  98. package/.next/standalone/.next/server/chunks/[root-of-the-server]__028ucbo._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03gi3ue._.js +1 -1
  100. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07f7~6u._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d~z6xs._.js +2 -2
  102. package/.next/standalone/.next/server/chunks/_0_w835g._.js +1 -1
  103. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  104. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  105. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__006_qh0._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02px.0y._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03ebsif._.js +3 -3
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l43.5g._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ojv-d0._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ps55l6._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ribsk4._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0souuv~._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vwc25l._.js +3 -0
  114. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wjg_.n._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wvyks.._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__121lss.._.js → [root-of-the-server]__0z7q-_5._.js} +2 -2
  117. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zbmoit._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~03tpv._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0miur_1._.js → [root-of-the-server]__10o9il8._.js} +2 -2
  120. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vdw4w._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/{_0icu6m~._.js → _0-fpxu8._.js} +2 -2
  122. package/.next/standalone/.next/server/chunks/ssr/{_0fq4yrr._.js → _03zmko4._.js} +2 -2
  123. package/.next/standalone/.next/server/chunks/ssr/_04b71ua._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/{_0.knmg-._.js → _0568hf5._.js} +2 -2
  125. package/.next/standalone/.next/server/chunks/ssr/_05h.8a~._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/_07k_7zo._.js +7 -0
  127. package/.next/standalone/.next/server/chunks/ssr/{_0pu8x.f._.js → _0999z~z._.js} +2 -2
  128. package/.next/standalone/.next/server/chunks/ssr/_0_l8.dg._.js +1 -1
  129. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  130. package/.next/standalone/.next/server/chunks/ssr/_0ds6nk2._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/_0gkxdta._.js +7 -0
  132. package/.next/standalone/.next/server/chunks/ssr/_0i4__mf._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/_0ihq._v._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/{_0.oe3b8._.js → _0jxhs~u._.js} +2 -2
  135. package/.next/standalone/.next/server/chunks/ssr/{_0d2cdox._.js → _0r8ftmo._.js} +2 -2
  136. package/.next/standalone/.next/server/chunks/ssr/_0r9w-k8._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/_0rbctq7._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/_0rt8hus._.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/{_0kx.c-s._.js → _0zcog8w._.js} +2 -2
  140. package/.next/standalone/.next/server/chunks/ssr/_0~80adm._.js +3 -3
  141. package/.next/standalone/.next/server/chunks/ssr/{_0xvsyc0._.js → _11uabrg._.js} +2 -2
  142. package/.next/standalone/.next/server/chunks/ssr/_13b~3az._.js +7 -0
  143. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/src_13jha60._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  150. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  151. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  152. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  153. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  154. package/.next/standalone/.next/server/pages/404.html +1 -1
  155. package/.next/standalone/.next/server/pages/500.html +1 -1
  156. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  157. package/.next/standalone/.next/server/server-reference-manifest.json +312 -312
  158. package/.next/standalone/.next/static/chunks/{09m-rcwwlggjy.js → 0-9-c__gfaxpa.js} +1 -1
  159. package/.next/standalone/.next/static/chunks/{0hueiuk3kjujl.js → 04djo-eed_8rf.js} +2 -2
  160. package/.next/standalone/.next/static/chunks/{0h1-tehkx05kz.js → 05fy_a4boi~ym.js} +1 -1
  161. package/.next/standalone/.next/static/chunks/05mg~bkdmeovq.js +1 -0
  162. package/.next/standalone/.next/static/chunks/08o3st.fn2~6x.js +1 -0
  163. package/.next/standalone/.next/static/chunks/{0ynbql~9oq0av.js → 0d5wyd0-zzb94.js} +1 -1
  164. package/.next/standalone/.next/static/chunks/0e6c~o_iuvycp.js +1 -0
  165. package/.next/standalone/.next/static/chunks/{0szduy0e92e5g.js → 0h3jzfwt-f9o7.js} +1 -1
  166. package/.next/standalone/.next/static/chunks/0igfu0uxcf238.js +1 -0
  167. package/.next/standalone/.next/static/chunks/{0lx08u-wp-gt6.js → 0jd4uhx~x74ox.js} +2 -2
  168. package/.next/standalone/.next/static/chunks/{0ur-499l_2jrc.js → 0obdotk~5x07o.js} +1 -1
  169. package/.next/standalone/.next/static/chunks/0o~dk86gtjq-..js +1 -0
  170. package/.next/standalone/.next/static/chunks/{087l367c1psb6.js → 0p_vnqgdse218.js} +1 -1
  171. package/.next/standalone/.next/static/chunks/{156si6w7d-_ct.js → 0sbpshsch~ak2.js} +2 -2
  172. package/.next/standalone/.next/static/chunks/{0xs0yzxjkoeas.js → 0t.7i1ltlf~rt.js} +1 -1
  173. package/.next/standalone/.next/static/chunks/0v--ko.s9zeij.js +1 -0
  174. package/.next/standalone/.next/static/chunks/{07vas3ezrfrjg.js → 0v-8_9de2o32z.js} +1 -1
  175. package/.next/standalone/.next/static/chunks/{0ikej72py2xo3.js → 0x~sbju1g3fjh.js} +1 -1
  176. package/.next/standalone/.next/static/chunks/{000k30wpair3e.js → 0y1m4k4hrzl33.js} +2 -2
  177. package/.next/standalone/.next/static/chunks/0ztm6whl93nyg.js +1 -0
  178. package/.next/standalone/.next/static/chunks/136efy8zbqp13.js +1 -0
  179. package/.next/standalone/package.json +1 -1
  180. package/package.json +1 -1
  181. package/scripts/post-tool-hook.js +24 -39
  182. package/scripts/session-start-hook.js +21 -19
  183. package/scripts/stop-hook.js +21 -19
  184. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08901f9._.js +0 -3
  185. package/.next/standalone/.next/server/chunks/ssr/_05unqgy._.js +0 -7
  186. package/.next/standalone/.next/server/chunks/ssr/_0a2m~cj._.js +0 -7
  187. package/.next/standalone/.next/server/chunks/ssr/_0vnfnib._.js +0 -7
  188. package/.next/standalone/.next/static/chunks/005169or2nxlh.js +0 -1
  189. package/.next/standalone/.next/static/chunks/04uepvk5f~_a-.js +0 -1
  190. package/.next/standalone/.next/static/chunks/0mu8uzvw4gvpf.js +0 -1
  191. package/.next/standalone/.next/static/chunks/0ow7ynd7g7ptv.js +0 -1
  192. package/.next/standalone/.next/static/chunks/0szie_5oyakv1.js +0 -1
  193. package/.next/standalone/.next/static/chunks/0~88n47ys3due.js +0 -1
  194. package/.next/standalone/.next/static/chunks/10nil20v3q7~..js +0 -1
  195. package/.next/standalone/.next/static/chunks/12rh72_2o79jv.js +0 -1
  196. /package/.next/standalone/.next/static/{7DBkEq_6oXffs_C5TFLBR → 7iWXcI7IK1tpJQ-itTcOk}/_buildManifest.js +0 -0
  197. /package/.next/standalone/.next/static/{7DBkEq_6oXffs_C5TFLBR → 7iWXcI7IK1tpJQ-itTcOk}/_clientMiddlewareManifest.js +0 -0
  198. /package/.next/standalone/.next/static/{7DBkEq_6oXffs_C5TFLBR → 7iWXcI7IK1tpJQ-itTcOk}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,565893,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={assign:function(){return o},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return l}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});function s(e){let t={};for(let[r,a]of e.entries()){let e=t[r];void 0===e?t[r]=a:Array.isArray(e)?e.push(a):t[r]=[e,a]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(r,i(e));else t.set(r,i(a));return t}function o(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,a]of r.entries())e.append(t,a)}return e}},204575,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return k},MissingStaticPage:function(){return x},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return p},ST:function(){return g},WEB_VITALS:function(){return s},execOnce:function(){return i},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return o},isResSent:function(){return f},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return S}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...a)=>(r||(r=!0,t=e(...a)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>l.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(r&&f(r))return a;if(!a)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${a}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return a}let p="u">typeof performance,g=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class k extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function S(e){return JSON.stringify({message:e.message,stack:e.stack})}},619172,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},464249,e=>{"use strict";let t=(0,e.i(572989).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],464249)},837312,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40470d150030f441633924f28eede8e9db2d9d5c3a",t.callServer,void 0,t.findSourceMapURL,"getLabelsForWorkspace");e.s(["getLabelsForWorkspace",0,r])},821957,e=>{"use strict";var t=e.i(965652),r=(e,t,r,a,n,s,i,l)=>{let o=document.documentElement,c=["light","dark"];function d(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,a=r&&s?n.map(e=>s[e]||e):n;r?(o.classList.remove(...a),o.classList.add(s&&s[t]?s[t]:t)):o.setAttribute(e,t)}),r=t,l&&c.includes(r)&&(o.style.colorScheme=r)}if(a)d(a);else try{let e=localStorage.getItem(t)||r,a=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(a)}catch(e){}},a=["light","dark"],n="(prefers-color-scheme: dark)",s="u"<typeof window,i=t.createContext(void 0),l={setTheme:e=>{},themes:[]},o=["light","dark"],c=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:l=!0,storageKey:c="theme",themes:m=o,defaultTheme:p=s?"system":"light",attribute:g="data-theme",value:v,children:y,nonce:b,scriptProps:x})=>{let[k,S]=t.useState(()=>u(c,p)),[w,C]=t.useState(()=>"system"===k?h():k),j=v?Object.values(v):m,E=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&s&&(t=h());let n=v?v[t]:t,i=r?f(b):null,o=document.documentElement,c=e=>{"class"===e?(o.classList.remove(...j),n&&o.classList.add(n)):e.startsWith("data-")&&(n?o.setAttribute(e,n):o.removeAttribute(e))};if(Array.isArray(g)?g.forEach(c):c(g),l){let e=a.includes(p)?p:null,r=a.includes(t)?t:e;o.style.colorScheme=r}null==i||i()},[b]),N=t.useCallback(e=>{let t="function"==typeof e?e(k):e;S(t);try{localStorage.setItem(c,t)}catch(e){}},[k]),M=t.useCallback(t=>{C(h(t)),"system"===k&&s&&!e&&E("system")},[k,e]);t.useEffect(()=>{let e=window.matchMedia(n);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),t.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?S(e.newValue):N(p))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),t.useEffect(()=>{E(null!=e?e:k)},[e,k]);let P=t.useMemo(()=>({theme:k,setTheme:N,forcedTheme:e,resolvedTheme:"system"===k?w:k,themes:s?[...m,"system"]:m,systemTheme:s?w:void 0}),[k,N,e,w,s,m]);return t.createElement(i.Provider,{value:P},t.createElement(d,{forcedTheme:e,storageKey:c,attribute:g,enableSystem:s,enableColorScheme:l,defaultTheme:p,value:v,themes:m,nonce:b,scriptProps:x}),y)},d=t.memo(({forcedTheme:e,storageKey:a,attribute:n,enableSystem:s,enableColorScheme:i,defaultTheme:l,value:o,themes:c,nonce:d,scriptProps:u})=>{let f=JSON.stringify([n,a,l,e,c,o,s,i]).slice(1,-1);return t.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"u"<typeof window?d:"",dangerouslySetInnerHTML:{__html:`(${r.toString()})(${f})`}})}),u=(e,t)=>{let r;if(!s){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(n)),e.matches?"dark":"light");e.s(["ThemeProvider",0,e=>t.useContext(i)?t.createElement(t.Fragment,null,e.children):t.createElement(c,{...e}),"useTheme",0,()=>{var e;return null!=(e=t.useContext(i))?e:l}])},113217,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("002c27894d8d914d1e6f188ccac937a9f129a18db6",t.callServer,void 0,t.findSourceMapURL,"getActualWsPort");e.s(["getActualWsPort",0,r])},902539,e=>{"use strict";let t=(0,e.i(572989).default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);e.s(["ChevronsLeft",0,t],902539)},966001,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(938499),n=e.i(194358),s=e.i(519455);class i extends r.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(a.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,t.jsxs)(s.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,t.jsx)(n.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}e.s(["ErrorBoundary",0,i])},640547,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40be3f9ea3898d15e60aac4e4ab00d5772d0976ccd",t.callServer,void 0,t.findSourceMapURL,"installExtension");e.s(["installExtension",0,r])},812983,e=>{"use strict";let t=(0,e.i(572989).default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]);e.s(["FileCode",0,t],812983)},887911,e=>{"use strict";var t=e.i(738690),r=e.i(812983);let a={rg:{id:"rg",name:"代码搜索 (ripgrep)",description:"基于 rg 的全文代码搜索",icon:t.Search,sizeMB:5,homepageUrl:"https://github.com/BurntSushi/ripgrep#installation"},monaco:{id:"monaco",name:"代码编辑器 (Monaco)",description:"VS Code 同款 Web 编辑器",icon:r.FileCode,sizeMB:15,homepageUrl:"https://microsoft.github.io/monaco-editor/"}},n=[a.rg,a.monaco];e.s(["listExtensionMetadata",0,function(){return n}])},706938,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60342b9df974bdc696460942c842291ae4c3911e0e",t.callServer,void 0,t.findSourceMapURL,"setConfigValue");e.s(["setConfigValue",0,r])},387091,15299,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,r],387091);let a=(0,t.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,a],15299)},699375,e=>{"use strict";var t,r=e.i(289721);e.s([],159880),e.i(159880),e.i(708878);var a=e.i(965652),n=e.i(314757),s=e.i(887642),i=e.i(362891),l=e.i(804849),o=e.i(416369),c=e.i(954588),d=e.i(581263),u=e.i(565455),f=e.i(207516),h=e.i(282109),m=e.i(462902);let p=a.createContext(void 0);var g=e.i(551974);let v=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),y={...g.fieldValidityMapping,checked:e=>e?{[v.checked]:""}:{[v.unchecked]:""}};var b=e.i(421689),x=e.i(890514),k=e.i(571870),S=e.i(179279),w=e.i(103353),C=e.i(67077),j=e.i(586622),E=e.i(353052);let N=a.forwardRef(function(e,t){let{checked:m,className:g,defaultChecked:v,"aria-labelledby":N,id:M,inputRef:P,name:T,nativeButton:O=!1,onCheckedChange:I,readOnly:R=!1,required:L=!1,disabled:F=!1,render:A,uncheckedValue:z,value:D,...V}=e,{clearErrors:B}=(0,k.useFormContext)(),{state:U,setTouched:_,setDirty:H,validityData:$,setFilled:K,setFocused:J,shouldValidateOnChange:q,validationMode:W,disabled:G,name:Y,validation:Z}=(0,x.useFieldRootContext)(),{labelId:Q}=(0,S.useLabelableContext)(),X=G||F,ee=Y??T,et=(0,s.useStableCallback)(I),er=a.useRef(null),ea=(0,i.useMergedRefs)(er,P,Z.inputRef),en=a.useRef(null),es=(0,f.useBaseUiId)(),ei=(0,w.useLabelableId)({id:M,implicit:!1,controlRef:en}),el=O?void 0:ei,[eo,ec]=(0,n.useControlled)({controlled:m,default:!!v,name:"Switch",state:"checked"});(0,b.useField)({id:es,commit:Z.commit,value:eo,controlRef:en,name:ee,getValue:()=>eo}),(0,l.useIsoLayoutEffect)(()=>{er.current&&K(er.current.checked)},[er,K]),(0,E.useValueChanged)(eo,()=>{B(ee),H(eo!==$.initialValue),K(eo),q()?Z.commit(eo):Z.commit(eo,!0)});let{getButtonProps:ed,buttonRef:eu}=(0,h.useButton)({disabled:X,native:O}),ef=function(e,t,r,n=!0,s){let[i,o]=a.useState(),c=(0,f.useBaseUiId)(s?`${s}-label`:void 0),d=e??t??i;return(0,l.useIsoLayoutEffect)(()=>{let a=e||t||!n?void 0:function(e,t){let r=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let r=e.id;if(r){let t=e.nextElementSibling;if(t&&t.htmlFor===r)return t}let a=e.labels;return a&&a[0]}(e);if(r)return!r.id&&t&&(r.id=t),r.id||void 0}(r.current,c);i!==a&&o(a)}),d}(N,Q,er,!O,el),eh=a.useMemo(()=>(0,u.mergeProps)({checked:eo,disabled:X,id:el,name:ee,required:L,style:ee?o.visuallyHiddenInput:o.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:ea,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,r=(0,C.createChangeEventDetails)(j.REASONS.none,e.nativeEvent);et?.(t,r),r.isCanceled||ec(t)},onFocus(){en.current?.focus()}},Z.getInputValidationProps,void 0!==D?{value:D}:c.EMPTY_OBJECT),[eo,X,ea,el,ee,et,L,ec,Z,D]),em=a.useMemo(()=>({...U,checked:eo,disabled:X,readOnly:R,required:L}),[U,eo,X,R,L]),ep=(0,d.useRenderElement)("span",e,{state:em,ref:[t,en,eu],props:[{id:O?ei:es,role:"switch","aria-checked":eo,"aria-readonly":R||void 0,"aria-required":L||void 0,"aria-labelledby":ef,onFocus(){X||J(!0)},onBlur(){let e=er.current;e&&!X&&(_(!0),J(!1),"onBlur"===W&&Z.commit(e.checked))},onClick(e){R||X||(e.preventDefault(),er.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},Z.getValidationProps,V,ed],stateAttributesMapping:y});return(0,r.jsxs)(p.Provider,{value:em,children:[ep,!eo&&ee&&void 0!==z&&(0,r.jsx)("input",{type:"hidden",name:ee,value:z}),(0,r.jsx)("input",{...eh})]})}),M=a.forwardRef(function(e,t){let{render:r,className:n,...s}=e,{state:i}=(0,x.useFieldRootContext)(),l=function(){let e=a.useContext(p);if(void 0===e)throw Error((0,m.default)(63));return e}(),o={...i,...l};return(0,d.useRenderElement)("span",e,{state:o,ref:t,stateAttributesMapping:y,props:s})});e.s(["Root",0,N,"Thumb",0,M],803205);var P=e.i(803205),P=P,T=e.i(975157);e.s(["Switch",0,function({className:e,size:t="default",...a}){return(0,r.jsx)(P.Root,{"data-slot":"switch","data-size":t,className:(0,T.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...a,children:(0,r.jsx)(P.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],699375)},263938,e=>{"use strict";let t=(0,e.i(572989).default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);e.s(["Tag",0,t],263938)},989548,338187,e=>{"use strict";let t=(0,e.i(572989).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,t],989548);var r=e.i(289721),a=e.i(965652),n=e.i(864964);let s="tower-assistant-sessions",i="tower-assistant-active-session";function l(){try{let e=localStorage.getItem(s);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t}catch{return[]}}function o(){return localStorage.getItem(i)}function c(e){null===e?localStorage.removeItem(i):localStorage.setItem(i,e)}let d=(0,a.createContext)(null);function u(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let f="assistant-attachment-cache";function h(e,t,r){try{let a=sessionStorage.getItem(f),n=a?JSON.parse(a):{};n[e]||(n[e]={}),n[e][t]=r,sessionStorage.setItem(f,JSON.stringify(n))}catch{}}e.s(["AssistantProvider",0,function({children:e}){let[t,i]=(0,a.useState)(!1),[m,p]=(0,a.useState)(!1),[g,v]=(0,a.useState)("sidebar"),[y,b]=(0,a.useState)(null),[x,k]=(0,a.useState)([]),[S,w]=(0,a.useState)("idle"),[C,j]=(0,a.useState)(!1),E=(0,a.useRef)([]),N=(0,a.useRef)(null),M=(0,a.useRef)(null),[P,T]=(0,a.useState)([]),[O,I]=(0,a.useState)(null),R=(0,a.useRef)(!1),L=(0,a.useCallback)(()=>{k([...E.current])},[]),F=(0,a.useCallback)(async()=>{v("dialog"===await (0,n.getConfigValue)("assistant.displayMode","sidebar")?"dialog":"sidebar")},[]);(0,a.useEffect)(()=>{F()},[F]);let A=(0,a.useCallback)(async()=>{T(l())},[]),z=(0,a.useCallback)(async e=>{j(!0);try{let t=await fetch(`/api/internal/assistant/sessions?sessionId=${encodeURIComponent(e)}`);if(!t.ok)return;let r=await t.json();if(Array.isArray(r.messages)){E.current=r.messages;let t=function(e){try{let t=sessionStorage.getItem(f);if(!t)return{};return JSON.parse(t)[e]??{}}catch{return{}}}(e);if(Object.keys(t).length>0){let e=0;E.current=E.current.map(r=>{if("user"===r.role){let a=t[e];if(e++,a?.length)return{...r,attachmentFilenames:a}}return r})}k([...E.current])}}catch{}finally{j(!1)}},[]);(0,a.useEffect)(()=>{A();let e=o();e&&(I(e),N.current=e,z(e))},[A,z]);let D=(0,a.useCallback)(()=>{M.current?.abort(),N.current=null,R.current=!1,I(null),c(null),E.current=[],k([]),w("idle")},[]),V=(0,a.useCallback)(e=>{M.current?.abort(),N.current=e,R.current=!0,I(e),c(e),E.current=[],k([]),w("idle"),z(e)},[z]),B=(0,a.useCallback)(e=>{let t;t=l().filter(t=>t.id!==e),localStorage.setItem(s,JSON.stringify(t)),o()===e&&c(null),T(l()),O===e&&D()},[O,D]),U=(0,a.useCallback)(async()=>{p(!0);try{await F(),i(!0)}finally{p(!1)}},[F]),_=(0,a.useCallback)(()=>{i(!1),M.current?.abort()},[]),H=(0,a.useCallback)(()=>{t||m?_():U()},[t,m,_,U]);(0,a.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"l"===e.key&&(e.preventDefault(),H())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[H]);let $=(0,a.useCallback)(async(e,t)=>{if(!e.trim()&&!t?.attachmentFilenames?.length)return;M.current?.abort();let r=new AbortController;M.current=r;let a=0!==E.current.length||R.current?null:e,n=u();if(E.current=[...E.current,{id:u(),role:"user",content:e,attachmentFilenames:t?.attachmentFilenames?.length?t.attachmentFilenames:void 0},{id:n,role:"thinking",content:"",isStreaming:!0}],L(),t?.attachmentFilenames?.length&&N.current){let e=E.current.filter(e=>"user"===e.role).length-1;h(N.current,e,t.attachmentFilenames)}w("connecting");let i=null;try{let o=await fetch("/api/internal/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e,sessionId:N.current,attachmentFilenames:t?.attachmentFilenames??[]}),signal:r.signal});if(!o.ok||!o.body)throw Error(`HTTP ${o.status}`);w("streaming");let d=o.body.getReader(),f=new TextDecoder,m="";for(;;){let{done:e,value:r}=await d.read();if(e)break;let o=(m+=f.decode(r,{stream:!0})).split("\n");for(let e of(m=o.pop()??"",o)){let r;if(e.startsWith("data: ")){try{r=JSON.parse(e.slice(6).trim())}catch{continue}if(r.sessionId){let e=N.current;if(N.current=r.sessionId,a&&!R.current&&r.sessionId!==e){R.current=!0;let e=new Date().toISOString(),n={id:r.sessionId,title:function(e){let t=e.trim();return t?t.length>30?t.slice(0,30):t:"New Session"}(a),createdAt:e,updatedAt:e};!function(e){let t=[e,...l().filter(t=>t.id!==e.id)].slice(0,10);localStorage.setItem(s,JSON.stringify(t))}(n),T(l()),I(r.sessionId),c(r.sessionId),t?.attachmentFilenames?.length&&h(r.sessionId,0,t.attachmentFilenames)}}switch(r.type){case"text_delta":{let e=E.current.filter(e=>e.id!==n);i?E.current=e.map(e=>e.id===i?{...e,content:e.content+(r.content??""),isStreaming:!0}:e):(i=u(),E.current=[...e,{id:i,role:"assistant",content:r.content??"",isStreaming:!0}]),L();break}case"text":{let e=E.current.filter(e=>e.id!==n);i?E.current=e.map(e=>e.id===i?{...e,content:r.content??e.content,isStreaming:!0}:e):(i=u(),E.current=[...e,{id:i,role:"assistant",content:r.content??"",isStreaming:!0}]),L();break}case"tool_start":{let e=E.current.filter(e=>e.id!==n);i?(E.current=e.map(e=>e.id===i?{...e,isStreaming:!1}:e),i=null):E.current=e,E.current=[...E.current,{id:u(),role:"tool",content:`Calling ${r.content??"tool"}...`,toolName:r.content,isStreaming:!0}],L();break}case"tool_use":{let e=E.current.filter(e=>e.id!==n),t=i?e.map(e=>e.id===i?{...e,isStreaming:!1}:e):e;i=null,E.current=[...t,{id:u(),role:"tool",content:JSON.stringify(r.toolInput??{},null,2),toolName:r.content}],L();break}case"tool_result":E.current=[...E.current,{id:u(),role:"tool",content:String(r.toolOutput??""),toolName:`${r.content??"tool"} (result)`}],L();break;case"error":E.current=[...E.current.filter(e=>e.id!==n),{id:u(),role:"assistant",content:`Error: ${r.content??"Unknown error"}`}],L(),w("error");break;case"done":i&&(E.current=E.current.map(e=>e.id===i?{...e,isStreaming:!1}:e)),E.current=E.current.filter(e=>e.id!==n),L(),w("idle")}}}}E.current=E.current.filter(e=>e.id!==n),L(),w(e=>"streaming"===e?"idle":e),A()}catch(e){if("AbortError"===e.name)return;E.current=[...E.current.filter(e=>e.id!==n),{id:u(),role:"assistant",content:`Connection error: ${e.message??"Unknown error"}`}],L(),w("error")}},[L,A]),K=(0,a.useCallback)(()=>{M.current?.abort(),M.current=null;let e=[...E.current].reverse().find(e=>"user"===e.role),t=e?.content??null;if(e){let t=E.current.lastIndexOf(e);E.current=E.current.slice(0,t),k([...E.current])}return w("idle"),t},[]),J=x[x.length-1],q="connecting"===S||"streaming"===S||J?.role==="thinking"&&!0===J.isStreaming;return(0,r.jsx)(d.Provider,{value:{isOpen:t,isStarting:m,displayMode:g,worktreePath:y,toggleAssistant:H,closeAssistant:_,chatMessages:x,chatStatus:S,isChatThinking:q,isLoadingHistory:C,sendChatMessage:$,cancelChat:K,sessions:P,activeSessionId:O,createNewSession:D,switchSession:V,removeSession:B,refreshSessions:A},children:e})},"useAssistant",0,function(){let e=(0,a.useContext)(d);if(!e)throw Error("useAssistant must be used within an AssistantProvider");return e}],338187)},275360,e=>{"use strict";let t=(0,e.i(572989).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",0,t],275360)},431828,763131,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);e.s(["FolderGit2",0,r],431828);let a=(0,t.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",0,a],763131)},256753,e=>{"use strict";let t=(0,e.i(572989).default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,t],256753)},224277,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(977982),n=e.i(431828),s=e.i(763131),i=e.i(472074),l=e.i(738690),o=e.i(256753),c=e.i(275360),d=e.i(597746),u=e.i(657153),f=e.i(776639),h=e.i(519455),m=e.i(793479),p=e.i(746798),g=e.i(533499),v=e.i(759684);e.s(["FolderBrowserDialog",0,function({open:e,onOpenChange:y,onSelect:b,gitOnly:x=!1}){let{t:k}=(0,g.useI18n)(),[S,w]=(0,r.useState)(null),[C,j]=(0,r.useState)(!1),[E,N]=(0,r.useState)(null),[M,P]=(0,r.useState)(""),[T,O]=(0,r.useState)(""),[I,R]=(0,r.useState)(!1),L=(0,r.useRef)(null),[F,A]=(0,r.useState)(!1),[z,D]=(0,r.useState)(""),V=(0,r.useRef)(null),B=(0,r.useCallback)(async e=>{j(!0),N(null),O(""),R(!1);try{let t=e?`/api/browse-fs?path=${encodeURIComponent(e)}`:"/api/browse-fs",r=await fetch(t);if(!r.ok){let e=await r.json();N(e.error||"Failed");return}let a=await r.json();w(a),P(a.currentPath)}catch{N("Failed to browse filesystem")}finally{j(!1)}},[]);(0,r.useEffect)(()=>{e&&(B(),setTimeout(()=>L.current?.focus(),200))},[e,B]);let U=()=>{M.trim()&&B(M.trim())},_=async()=>{let e=z.trim();if(e&&S?.currentPath)try{let t=await fetch("/api/browse-fs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentPath:S.currentPath,name:e})});if(!t.ok){let e=await t.json();N(e.error||k("folder.newFolderError"));return}A(!1),D(""),B(S.currentPath)}catch{N(k("folder.newFolderError"))}},H=()=>{A(!1),D("")},$=S?.folders.filter(e=>e.name.toLowerCase().includes(T.toLowerCase()))??[];return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:y,children:(0,t.jsx)(f.DialogContent,{className:"p-0 gap-0",style:{maxWidth:"36rem",overflow:"hidden"},children:(0,t.jsxs)("div",{className:"flex flex-col max-h-[60vh] overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-5 pt-5 pb-3 shrink-0",children:[(0,t.jsx)(f.DialogTitle,{children:x?k("folder.selectGitRepo"):k("folder.selectFolder")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:k("folder.hint")})]}),(0,t.jsxs)("div",{className:"border-t border-border px-4 pt-3 pb-2 shrink-0",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("folder.manualInput")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(m.Input,{ref:L,value:M,onChange:e=>P(e.target.value),onKeyDown:e=>"Enter"===e.key&&U(),placeholder:"/path/to/your/project",title:M,className:"flex-1 min-w-0"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:U,className:"h-8 px-3 shrink-0",children:k("folder.goTo")})]})]}),(0,t.jsxs)("div",{className:"px-4 py-2 shrink-0",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("folder.searchDir")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsx)(l.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("input",{value:T,onChange:e=>O(e.target.value),placeholder:"Filter folders and files...",className:"h-8 w-full rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 border-y border-border px-4 py-2 shrink-0 min-w-0",children:[(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>S?.homePath&&B(S.homePath),className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(s.Home,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Home"})]}),(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{S&&("__DRIVES__"===S.parentPath?R(!0):(R(!1),B(S.parentPath)))},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(i.ChevronUp,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Parent"})]}),S?.drives&&S.drives.length>0&&(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:I?"default":"outline",size:"icon-sm",onClick:()=>R(e=>!e),className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(o.HardDrive,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Drives"})]}),(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{A(!0),D(""),setTimeout(()=>V.current?.focus(),50)},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(c.FolderPlus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:k("folder.newFolder")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground font-mono",title:S?.currentPath??"",children:S?.currentPath??"..."})]}),(0,t.jsxs)(v.ScrollArea,{className:"min-h-0 flex-1",children:[F&&(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/30 px-4 py-2",children:[(0,t.jsx)(a.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,t.jsx)("input",{ref:V,value:z,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&_(),"Escape"===e.key&&H()},placeholder:k("folder.newFolderPlaceholder"),className:"h-7 flex-1 rounded-md border border-border bg-background px-2 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:_,disabled:!z.trim(),className:"text-emerald-400 hover:text-emerald-300",children:(0,t.jsx)(d.Check,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:H,className:"text-muted-foreground",children:(0,t.jsx)(u.X,{className:"h-3.5 w-3.5"})})]}),C&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}),E&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-rose-400",children:E}),I&&S?.drives&&S.drives.map(e=>(0,t.jsxs)("button",{onClick:()=>{var t;return t=e.path,void(R(!1),B(t))},className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)(o.HardDrive,{className:"h-4 w-4 text-blue-400 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:e.name}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.path})]},e.path)),!I&&!C&&!E&&0===$.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:k("folder.empty")}),!I&&!C&&!E&&$.map(e=>(0,t.jsxs)("button",{onClick:()=>{e.isGit||x?(b(e.path),y(!1)):B(e.path)},onDoubleClick:()=>B(e.path),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[e.isGit?(0,t.jsx)(n.FolderGit2,{className:"h-4 w-4 text-emerald-400 shrink-0"}):(0,t.jsx)(a.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:e.name}),e.isGit&&(0,t.jsx)("span",{className:"shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 ring-1 ring-emerald-500/20",children:"git"})]},e.path))]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 shrink-0 border-t border-border",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>y(!1),children:k("common.cancel")}),(0,t.jsx)(h.Button,{onClick:()=>{S?.currentPath&&(b(S.currentPath),y(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:k("folder.selectPath")})]})]})})})}])},905455,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["SegmentedControl",0,function({options:e,value:a,onChange:n,className:s}){return(0,t.jsx)("div",{className:(0,r.cn)("inline-flex rounded-md border border-border bg-muted p-1 gap-1",s),children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>n(e.value),className:(0,r.cn)("rounded px-3 py-1 text-sm transition-colors",a===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}])},233274,e=>{"use strict";let t=(0,e.i(572989).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],233274)},875797,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("601730662a5951821787deda9c4395d8e55774d868",t.callServer,void 0,t.findSourceMapURL,"analyzeProjectDirectory");e.s(["analyzeProjectDirectory",0,r])},945888,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("4038ea2625de69697450b979ba1b41b654e4695cbf",t.callServer,void 0,t.findSourceMapURL,"createProject");e.s(["createProject",0,r])},232545,e=>{"use strict";let t=(0,e.i(572989).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],232545)},538059,(e,t,r)=>{t.exports=e.r(322195)},314757,e=>{"use strict";var t=e.i(965652);e.s(["useControlled",0,function({controlled:e,default:r,name:a,state:n="value"}){let{current:s}=t.useRef(void 0!==e),[i,l]=t.useState(r),o=t.useCallback(e=>{s||l(e)},[]);return[s?e:i,o]}])},890514,551974,e=>{"use strict";e.i(708878);var t,r=e.i(462902),a=e.i(965652),n=e.i(954588);let s=((t={}).disabled="data-disabled",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),i={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},l={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},o={disabled:!1,...l};e.s(["DEFAULT_FIELD_ROOT_STATE",0,o,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,l,"DEFAULT_VALIDITY_STATE",0,i,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{[s.valid]:""}:{[s.invalid]:""}}],551974);let c=a.createContext({invalid:void 0,name:void 0,validityData:{state:i,errors:[],error:"",value:"",initialValue:null},setValidityData:n.NOOP,disabled:void 0,touched:l.touched,setTouched:n.NOOP,dirty:l.dirty,setDirty:n.NOOP,filled:l.filled,setFilled:n.NOOP,focused:l.focused,setFocused:n.NOOP,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:o,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=n.EMPTY_OBJECT)=>e,getInputValidationProps:(e=n.EMPTY_OBJECT)=>e,inputRef:{current:null},commit:async()=>{}}});e.s(["FieldRootContext",0,c,"useFieldRootContext",0,function(e=!0){let t=a.useContext(c);if(t.setValidityData===n.NOOP&&!e)throw Error((0,r.default)(28));return t}],890514)},571870,e=>{"use strict";var t=e.i(965652),r=e.i(954588);let a=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:r.NOOP,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});e.s(["useFormContext",0,function(){return t.useContext(a)}])},179279,e=>{"use strict";var t=e.i(965652),r=e.i(954588);let a=t.createContext({controlId:void 0,registerControlId:r.NOOP,labelId:void 0,setLabelId:r.NOOP,messageIds:[],setMessageIds:r.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,a,"useLabelableContext",0,function(){return t.useContext(a)}])},956181,e=>{"use strict";e.s(["getCombinedFieldValidityData",0,function(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}])},397791,e=>{"use strict";var t=e.i(92615),r=e.i(102094),a=e.i(887642),n=e.i(682354),s=e.i(804849),i=e.i(207516),l=e.i(179279);e.s(["useLabel",0,function(e={}){let o,{id:c,fallbackControlId:d,native:u=!1,setLabelId:f,focusControl:h}=e,{controlId:m,setLabelId:p}=(0,l.useLabelableContext)(),g=(0,a.useStableCallback)(e=>{p(e),f?.(e)}),v=(o=(0,i.useBaseUiId)(c),(0,s.useIsoLayoutEffect)(()=>(g(o),()=>{g(void 0)}),[o,g]),o),y=m??d;function b(e){let a=(0,n.getTarget)(e.nativeEvent);a?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),u||function(e){if(h)return h(e,y);if(!y)return;let a=(0,r.ownerDocument)(e.currentTarget).getElementById(y);(0,t.isHTMLElement)(a)&&a.focus({focusVisible:!0})}(e))}return u?{id:v,htmlFor:y??void 0,onMouseDown:b}:{id:v,onClick:b,onPointerDown(e){e.preventDefault()}}}],397791)},103353,e=>{"use strict";var t=e.i(965652),r=e.i(804849),a=e.i(887642),n=e.i(903224),s=e.i(92615),i=e.i(954588),l=e.i(207516),o=e.i(179279);e.s(["useLabelableId",0,function(e={}){let{id:c,implicit:d=!1,controlRef:u}=e,{controlId:f,registerControlId:h}=(0,o.useLabelableContext)(),m=(0,l.useBaseUiId)(c),p=d?f:void 0,g=(0,n.useRefWithInit)(()=>Symbol("labelable-control")),v=t.useRef(!1),y=t.useRef(null!=c),b=(0,a.useStableCallback)(()=>{v.current&&h!==i.NOOP&&(v.current=!1,h(g.current,void 0))});return(0,r.useIsoLayoutEffect)(()=>{let e;if(h!==i.NOOP){if(d){let t=u?.current;e=(0,s.isElement)(t)&&null!=t.closest("label")?c??null:p??m}else if(null!=c)y.current=!0,e=c;else{if(!y.current)return void b();e=m}if(void 0===e)return void b();v.current=!0,h(g.current,e)}},[c,u,p,h,d,m,g,b]),t.useEffect(()=>b,[b]),f??m}])},421689,e=>{"use strict";var t=e.i(585012),r=e.i(804849),a=e.i(887642),n=e.i(956181),s=e.i(571870),i=e.i(890514);e.s(["useField",0,function(e){let{enabled:l=!0,value:o,id:c,name:d,controlRef:u,commit:f}=e,{formRef:h}=(0,s.useFormContext)(),{invalid:m,markedDirtyRef:p,validityData:g,setValidityData:v}=(0,i.useFieldRootContext)(),y=(0,a.useStableCallback)(e.getValue);(0,r.useIsoLayoutEffect)(()=>{if(!l)return;let e=o;void 0===e&&(e=y()),null===g.initialValue&&null!==e&&v(t=>({...t,initialValue:e}))},[l,v,o,g.initialValue,y]),(0,r.useIsoLayoutEffect)(()=>{l&&c&&h.current.fields.set(c,{getValue:y,name:d,controlRef:u,validityData:(0,n.getCombinedFieldValidityData)(g,m),validate(e=!0){let r=o;void 0===r&&(r=y()),p.current=!0,e?t.flushSync(()=>f(r)):f(r)}})},[f,u,l,h,y,c,m,p,d,g,o]),(0,r.useIsoLayoutEffect)(()=>{let e=h.current.fields;return()=>{c&&e.delete(c)}},[h,c])}])},792566,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["default",0,t])},453889,e=>{"use strict";let t=(0,e.i(572989).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 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.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],453889)},998626,e=>{"use strict";let t=(0,e.i(572989).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],998626)},59737,e=>{"use strict";let t=(0,e.i(572989).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",0,t])},977982,472074,e=>{"use strict";let t=(0,e.i(572989).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],977982);var r=e.i(792566);e.s(["ChevronUp",()=>r.default],472074)},194358,e=>{"use strict";let t=(0,e.i(572989).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],194358)},567098,e=>{"use strict";let t=(0,e.i(572989).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},770303,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(514798);let n=(0,a.createServerReference)("407c2f9abdbc986f6df84d8dda875845cb6b1538d2",a.callServer,void 0,a.findSourceMapURL,"checkExtension");var s=e.i(640547);let i=(0,a.createServerReference)("40865e451fc65a9c24550a063e70a592cd5bf448ef",a.callServer,void 0,a.findSourceMapURL,"uninstallExtension");var l=e.i(887911);let o={installed:!1},c=(0,r.createContext)(null);e.s(["ExtensionContext",0,c,"ExtensionProvider",0,function({children:e,initialStatus:a}){let[d,u]=(0,r.useState)(()=>a??Object.fromEntries((0,l.listExtensionMetadata)().map(e=>[e.id,o]))),[f,h]=(0,r.useState)(new Set),m=(0,r.useRef)(new Set),p=(0,r.useCallback)(async e=>{let t=await n(e);u(r=>({...r,[e]:t}))},[]),g=(0,r.useCallback)(async e=>{if(m.current.has(e))return{success:!1,error:"install already in progress"};m.current.add(e),h(t=>{let r=new Set(t);return r.add(e),r});try{let t=await (0,s.installExtension)(e);return t.success&&await p(e),t}finally{m.current.delete(e),h(t=>{let r=new Set(t);return r.delete(e),r})}},[p]),v=(0,r.useCallback)(async e=>{if(m.current.has(e))return{success:!1,error:"operation already in progress"};m.current.add(e),h(t=>{let r=new Set(t);return r.add(e),r});try{let t=await i(e);return t.success&&await p(e),t}finally{m.current.delete(e),h(t=>{let r=new Set(t);return r.delete(e),r})}},[p]),y=(0,r.useMemo)(()=>({statusMap:d,loading:!1,installing:f,refresh:p,install:g,uninstall:v}),[d,f,p,g,v]);return(0,t.jsx)(c.Provider,{value:y,children:e})}],770303)},864964,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60fec27b4ecd6c35573e4932e39fadb25bb46e1156",t.callServer,void 0,t.findSourceMapURL,"getConfigValue");e.s(["getConfigValue",0,r])},386343,125177,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,r],386343);let a=(0,t.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);e.s(["Bell",0,a],125177)},243288,e=>{e.v(t=>Promise.all(["static/chunks/087l367c1psb6.js","static/chunks/0ep-qrl_zzch8.js","static/chunks/17oc2l.ekcs8b.css"].map(t=>e.l(t))).then(()=>t(346069)))},427768,e=>{e.v(t=>Promise.all(["static/chunks/05lky664ou92k.js","static/chunks/0o6zqtzz_7ysr.js"].map(t=>e.l(t))).then(()=>t(103363)))}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,565893,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={assign:function(){return o},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return l}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});function s(e){let t={};for(let[r,a]of e.entries()){let e=t[r];void 0===e?t[r]=a:Array.isArray(e)?e.push(a):t[r]=[e,a]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(r,i(e));else t.set(r,i(a));return t}function o(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,a]of r.entries())e.append(t,a)}return e}},204575,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return k},MissingStaticPage:function(){return x},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return p},ST:function(){return g},WEB_VITALS:function(){return s},execOnce:function(){return i},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return o},isResSent:function(){return f},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return S}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...a)=>(r||(r=!0,t=e(...a)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>l.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(r&&f(r))return a;if(!a)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${a}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return a}let p="u">typeof performance,g=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class k extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function S(e){return JSON.stringify({message:e.message,stack:e.stack})}},619172,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},464249,e=>{"use strict";let t=(0,e.i(572989).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],464249)},191937,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40112f31b3d2e1606525dc0afb455b2f1bcb10053e",t.callServer,void 0,t.findSourceMapURL,"getLabelsForWorkspace");e.s(["getLabelsForWorkspace",0,r])},821957,e=>{"use strict";var t=e.i(965652),r=(e,t,r,a,n,s,i,l)=>{let o=document.documentElement,c=["light","dark"];function d(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,a=r&&s?n.map(e=>s[e]||e):n;r?(o.classList.remove(...a),o.classList.add(s&&s[t]?s[t]:t)):o.setAttribute(e,t)}),r=t,l&&c.includes(r)&&(o.style.colorScheme=r)}if(a)d(a);else try{let e=localStorage.getItem(t)||r,a=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(a)}catch(e){}},a=["light","dark"],n="(prefers-color-scheme: dark)",s="u"<typeof window,i=t.createContext(void 0),l={setTheme:e=>{},themes:[]},o=["light","dark"],c=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:l=!0,storageKey:c="theme",themes:m=o,defaultTheme:p=s?"system":"light",attribute:g="data-theme",value:v,children:y,nonce:b,scriptProps:x})=>{let[k,S]=t.useState(()=>u(c,p)),[w,C]=t.useState(()=>"system"===k?h():k),j=v?Object.values(v):m,E=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&s&&(t=h());let n=v?v[t]:t,i=r?f(b):null,o=document.documentElement,c=e=>{"class"===e?(o.classList.remove(...j),n&&o.classList.add(n)):e.startsWith("data-")&&(n?o.setAttribute(e,n):o.removeAttribute(e))};if(Array.isArray(g)?g.forEach(c):c(g),l){let e=a.includes(p)?p:null,r=a.includes(t)?t:e;o.style.colorScheme=r}null==i||i()},[b]),N=t.useCallback(e=>{let t="function"==typeof e?e(k):e;S(t);try{localStorage.setItem(c,t)}catch(e){}},[k]),M=t.useCallback(t=>{C(h(t)),"system"===k&&s&&!e&&E("system")},[k,e]);t.useEffect(()=>{let e=window.matchMedia(n);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),t.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?S(e.newValue):N(p))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),t.useEffect(()=>{E(null!=e?e:k)},[e,k]);let P=t.useMemo(()=>({theme:k,setTheme:N,forcedTheme:e,resolvedTheme:"system"===k?w:k,themes:s?[...m,"system"]:m,systemTheme:s?w:void 0}),[k,N,e,w,s,m]);return t.createElement(i.Provider,{value:P},t.createElement(d,{forcedTheme:e,storageKey:c,attribute:g,enableSystem:s,enableColorScheme:l,defaultTheme:p,value:v,themes:m,nonce:b,scriptProps:x}),y)},d=t.memo(({forcedTheme:e,storageKey:a,attribute:n,enableSystem:s,enableColorScheme:i,defaultTheme:l,value:o,themes:c,nonce:d,scriptProps:u})=>{let f=JSON.stringify([n,a,l,e,c,o,s,i]).slice(1,-1);return t.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"u"<typeof window?d:"",dangerouslySetInnerHTML:{__html:`(${r.toString()})(${f})`}})}),u=(e,t)=>{let r;if(!s){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(n)),e.matches?"dark":"light");e.s(["ThemeProvider",0,e=>t.useContext(i)?t.createElement(t.Fragment,null,e.children):t.createElement(c,{...e}),"useTheme",0,()=>{var e;return null!=(e=t.useContext(i))?e:l}])},949528,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("00a1c3944ebee4ec0cc8cdf24600f514e18f86abef",t.callServer,void 0,t.findSourceMapURL,"getActualWsPort");e.s(["getActualWsPort",0,r])},902539,e=>{"use strict";let t=(0,e.i(572989).default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);e.s(["ChevronsLeft",0,t],902539)},966001,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(938499),n=e.i(194358),s=e.i(519455);class i extends r.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(a.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,t.jsxs)(s.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,t.jsx)(n.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}e.s(["ErrorBoundary",0,i])},122161,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40d925923a1d79e4d935fa7776545f19ab4fc49e17",t.callServer,void 0,t.findSourceMapURL,"installExtension");e.s(["installExtension",0,r])},812983,e=>{"use strict";let t=(0,e.i(572989).default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]);e.s(["FileCode",0,t],812983)},887911,e=>{"use strict";var t=e.i(738690),r=e.i(812983);let a={rg:{id:"rg",name:"代码搜索 (ripgrep)",description:"基于 rg 的全文代码搜索",icon:t.Search,sizeMB:5,homepageUrl:"https://github.com/BurntSushi/ripgrep#installation"},monaco:{id:"monaco",name:"代码编辑器 (Monaco)",description:"VS Code 同款 Web 编辑器",icon:r.FileCode,sizeMB:15,homepageUrl:"https://microsoft.github.io/monaco-editor/"}},n=[a.rg,a.monaco];e.s(["listExtensionMetadata",0,function(){return n}])},934451,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60dcd9c388151c3e1974757b6ed257dca8cd9461bd",t.callServer,void 0,t.findSourceMapURL,"setConfigValue");e.s(["setConfigValue",0,r])},387091,15299,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,r],387091);let a=(0,t.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,a],15299)},699375,e=>{"use strict";var t,r=e.i(289721);e.s([],159880),e.i(159880),e.i(708878);var a=e.i(965652),n=e.i(314757),s=e.i(887642),i=e.i(362891),l=e.i(804849),o=e.i(416369),c=e.i(954588),d=e.i(581263),u=e.i(565455),f=e.i(207516),h=e.i(282109),m=e.i(462902);let p=a.createContext(void 0);var g=e.i(551974);let v=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),y={...g.fieldValidityMapping,checked:e=>e?{[v.checked]:""}:{[v.unchecked]:""}};var b=e.i(421689),x=e.i(890514),k=e.i(571870),S=e.i(179279),w=e.i(103353),C=e.i(67077),j=e.i(586622),E=e.i(353052);let N=a.forwardRef(function(e,t){let{checked:m,className:g,defaultChecked:v,"aria-labelledby":N,id:M,inputRef:P,name:T,nativeButton:O=!1,onCheckedChange:I,readOnly:R=!1,required:L=!1,disabled:F=!1,render:A,uncheckedValue:z,value:D,...V}=e,{clearErrors:B}=(0,k.useFormContext)(),{state:U,setTouched:_,setDirty:H,validityData:$,setFilled:K,setFocused:J,shouldValidateOnChange:q,validationMode:W,disabled:G,name:Y,validation:Z}=(0,x.useFieldRootContext)(),{labelId:Q}=(0,S.useLabelableContext)(),X=G||F,ee=Y??T,et=(0,s.useStableCallback)(I),er=a.useRef(null),ea=(0,i.useMergedRefs)(er,P,Z.inputRef),en=a.useRef(null),es=(0,f.useBaseUiId)(),ei=(0,w.useLabelableId)({id:M,implicit:!1,controlRef:en}),el=O?void 0:ei,[eo,ec]=(0,n.useControlled)({controlled:m,default:!!v,name:"Switch",state:"checked"});(0,b.useField)({id:es,commit:Z.commit,value:eo,controlRef:en,name:ee,getValue:()=>eo}),(0,l.useIsoLayoutEffect)(()=>{er.current&&K(er.current.checked)},[er,K]),(0,E.useValueChanged)(eo,()=>{B(ee),H(eo!==$.initialValue),K(eo),q()?Z.commit(eo):Z.commit(eo,!0)});let{getButtonProps:ed,buttonRef:eu}=(0,h.useButton)({disabled:X,native:O}),ef=function(e,t,r,n=!0,s){let[i,o]=a.useState(),c=(0,f.useBaseUiId)(s?`${s}-label`:void 0),d=e??t??i;return(0,l.useIsoLayoutEffect)(()=>{let a=e||t||!n?void 0:function(e,t){let r=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let r=e.id;if(r){let t=e.nextElementSibling;if(t&&t.htmlFor===r)return t}let a=e.labels;return a&&a[0]}(e);if(r)return!r.id&&t&&(r.id=t),r.id||void 0}(r.current,c);i!==a&&o(a)}),d}(N,Q,er,!O,el),eh=a.useMemo(()=>(0,u.mergeProps)({checked:eo,disabled:X,id:el,name:ee,required:L,style:ee?o.visuallyHiddenInput:o.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:ea,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,r=(0,C.createChangeEventDetails)(j.REASONS.none,e.nativeEvent);et?.(t,r),r.isCanceled||ec(t)},onFocus(){en.current?.focus()}},Z.getInputValidationProps,void 0!==D?{value:D}:c.EMPTY_OBJECT),[eo,X,ea,el,ee,et,L,ec,Z,D]),em=a.useMemo(()=>({...U,checked:eo,disabled:X,readOnly:R,required:L}),[U,eo,X,R,L]),ep=(0,d.useRenderElement)("span",e,{state:em,ref:[t,en,eu],props:[{id:O?ei:es,role:"switch","aria-checked":eo,"aria-readonly":R||void 0,"aria-required":L||void 0,"aria-labelledby":ef,onFocus(){X||J(!0)},onBlur(){let e=er.current;e&&!X&&(_(!0),J(!1),"onBlur"===W&&Z.commit(e.checked))},onClick(e){R||X||(e.preventDefault(),er.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},Z.getValidationProps,V,ed],stateAttributesMapping:y});return(0,r.jsxs)(p.Provider,{value:em,children:[ep,!eo&&ee&&void 0!==z&&(0,r.jsx)("input",{type:"hidden",name:ee,value:z}),(0,r.jsx)("input",{...eh})]})}),M=a.forwardRef(function(e,t){let{render:r,className:n,...s}=e,{state:i}=(0,x.useFieldRootContext)(),l=function(){let e=a.useContext(p);if(void 0===e)throw Error((0,m.default)(63));return e}(),o={...i,...l};return(0,d.useRenderElement)("span",e,{state:o,ref:t,stateAttributesMapping:y,props:s})});e.s(["Root",0,N,"Thumb",0,M],803205);var P=e.i(803205),P=P,T=e.i(975157);e.s(["Switch",0,function({className:e,size:t="default",...a}){return(0,r.jsx)(P.Root,{"data-slot":"switch","data-size":t,className:(0,T.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...a,children:(0,r.jsx)(P.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],699375)},263938,e=>{"use strict";let t=(0,e.i(572989).default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);e.s(["Tag",0,t],263938)},989548,338187,e=>{"use strict";let t=(0,e.i(572989).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,t],989548);var r=e.i(289721),a=e.i(965652),n=e.i(563772);let s="tower-assistant-sessions",i="tower-assistant-active-session";function l(){try{let e=localStorage.getItem(s);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t}catch{return[]}}function o(){return localStorage.getItem(i)}function c(e){null===e?localStorage.removeItem(i):localStorage.setItem(i,e)}let d=(0,a.createContext)(null);function u(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let f="assistant-attachment-cache";function h(e,t,r){try{let a=sessionStorage.getItem(f),n=a?JSON.parse(a):{};n[e]||(n[e]={}),n[e][t]=r,sessionStorage.setItem(f,JSON.stringify(n))}catch{}}e.s(["AssistantProvider",0,function({children:e}){let[t,i]=(0,a.useState)(!1),[m,p]=(0,a.useState)(!1),[g,v]=(0,a.useState)("sidebar"),[y,b]=(0,a.useState)(null),[x,k]=(0,a.useState)([]),[S,w]=(0,a.useState)("idle"),[C,j]=(0,a.useState)(!1),E=(0,a.useRef)([]),N=(0,a.useRef)(null),M=(0,a.useRef)(null),[P,T]=(0,a.useState)([]),[O,I]=(0,a.useState)(null),R=(0,a.useRef)(!1),L=(0,a.useCallback)(()=>{k([...E.current])},[]),F=(0,a.useCallback)(async()=>{v("dialog"===await (0,n.getConfigValue)("assistant.displayMode","sidebar")?"dialog":"sidebar")},[]);(0,a.useEffect)(()=>{F()},[F]);let A=(0,a.useCallback)(async()=>{T(l())},[]),z=(0,a.useCallback)(async e=>{j(!0);try{let t=await fetch(`/api/internal/assistant/sessions?sessionId=${encodeURIComponent(e)}`);if(!t.ok)return;let r=await t.json();if(Array.isArray(r.messages)){E.current=r.messages;let t=function(e){try{let t=sessionStorage.getItem(f);if(!t)return{};return JSON.parse(t)[e]??{}}catch{return{}}}(e);if(Object.keys(t).length>0){let e=0;E.current=E.current.map(r=>{if("user"===r.role){let a=t[e];if(e++,a?.length)return{...r,attachmentFilenames:a}}return r})}k([...E.current])}}catch{}finally{j(!1)}},[]);(0,a.useEffect)(()=>{A();let e=o();e&&(I(e),N.current=e,z(e))},[A,z]);let D=(0,a.useCallback)(()=>{M.current?.abort(),N.current=null,R.current=!1,I(null),c(null),E.current=[],k([]),w("idle")},[]),V=(0,a.useCallback)(e=>{M.current?.abort(),N.current=e,R.current=!0,I(e),c(e),E.current=[],k([]),w("idle"),z(e)},[z]),B=(0,a.useCallback)(e=>{let t;t=l().filter(t=>t.id!==e),localStorage.setItem(s,JSON.stringify(t)),o()===e&&c(null),T(l()),O===e&&D()},[O,D]),U=(0,a.useCallback)(async()=>{p(!0);try{await F(),i(!0)}finally{p(!1)}},[F]),_=(0,a.useCallback)(()=>{i(!1),M.current?.abort()},[]),H=(0,a.useCallback)(()=>{t||m?_():U()},[t,m,_,U]);(0,a.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"l"===e.key&&(e.preventDefault(),H())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[H]);let $=(0,a.useCallback)(async(e,t)=>{if(!e.trim()&&!t?.attachmentFilenames?.length)return;M.current?.abort();let r=new AbortController;M.current=r;let a=0!==E.current.length||R.current?null:e,n=u();if(E.current=[...E.current,{id:u(),role:"user",content:e,attachmentFilenames:t?.attachmentFilenames?.length?t.attachmentFilenames:void 0},{id:n,role:"thinking",content:"",isStreaming:!0}],L(),t?.attachmentFilenames?.length&&N.current){let e=E.current.filter(e=>"user"===e.role).length-1;h(N.current,e,t.attachmentFilenames)}w("connecting");let i=null;try{let o=await fetch("/api/internal/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e,sessionId:N.current,attachmentFilenames:t?.attachmentFilenames??[]}),signal:r.signal});if(!o.ok||!o.body)throw Error(`HTTP ${o.status}`);w("streaming");let d=o.body.getReader(),f=new TextDecoder,m="";for(;;){let{done:e,value:r}=await d.read();if(e)break;let o=(m+=f.decode(r,{stream:!0})).split("\n");for(let e of(m=o.pop()??"",o)){let r;if(e.startsWith("data: ")){try{r=JSON.parse(e.slice(6).trim())}catch{continue}if(r.sessionId){let e=N.current;if(N.current=r.sessionId,a&&!R.current&&r.sessionId!==e){R.current=!0;let e=new Date().toISOString(),n={id:r.sessionId,title:function(e){let t=e.trim();return t?t.length>30?t.slice(0,30):t:"New Session"}(a),createdAt:e,updatedAt:e};!function(e){let t=[e,...l().filter(t=>t.id!==e.id)].slice(0,10);localStorage.setItem(s,JSON.stringify(t))}(n),T(l()),I(r.sessionId),c(r.sessionId),t?.attachmentFilenames?.length&&h(r.sessionId,0,t.attachmentFilenames)}}switch(r.type){case"text_delta":{let e=E.current.filter(e=>e.id!==n);i?E.current=e.map(e=>e.id===i?{...e,content:e.content+(r.content??""),isStreaming:!0}:e):(i=u(),E.current=[...e,{id:i,role:"assistant",content:r.content??"",isStreaming:!0}]),L();break}case"text":{let e=E.current.filter(e=>e.id!==n);i?E.current=e.map(e=>e.id===i?{...e,content:r.content??e.content,isStreaming:!0}:e):(i=u(),E.current=[...e,{id:i,role:"assistant",content:r.content??"",isStreaming:!0}]),L();break}case"tool_start":{let e=E.current.filter(e=>e.id!==n);i?(E.current=e.map(e=>e.id===i?{...e,isStreaming:!1}:e),i=null):E.current=e,E.current=[...E.current,{id:u(),role:"tool",content:`Calling ${r.content??"tool"}...`,toolName:r.content,isStreaming:!0}],L();break}case"tool_use":{let e=E.current.filter(e=>e.id!==n),t=i?e.map(e=>e.id===i?{...e,isStreaming:!1}:e):e;i=null,E.current=[...t,{id:u(),role:"tool",content:JSON.stringify(r.toolInput??{},null,2),toolName:r.content}],L();break}case"tool_result":E.current=[...E.current,{id:u(),role:"tool",content:String(r.toolOutput??""),toolName:`${r.content??"tool"} (result)`}],L();break;case"error":E.current=[...E.current.filter(e=>e.id!==n),{id:u(),role:"assistant",content:`Error: ${r.content??"Unknown error"}`}],L(),w("error");break;case"done":i&&(E.current=E.current.map(e=>e.id===i?{...e,isStreaming:!1}:e)),E.current=E.current.filter(e=>e.id!==n),L(),w("idle")}}}}E.current=E.current.filter(e=>e.id!==n),L(),w(e=>"streaming"===e?"idle":e),A()}catch(e){if("AbortError"===e.name)return;E.current=[...E.current.filter(e=>e.id!==n),{id:u(),role:"assistant",content:`Connection error: ${e.message??"Unknown error"}`}],L(),w("error")}},[L,A]),K=(0,a.useCallback)(()=>{M.current?.abort(),M.current=null;let e=[...E.current].reverse().find(e=>"user"===e.role),t=e?.content??null;if(e){let t=E.current.lastIndexOf(e);E.current=E.current.slice(0,t),k([...E.current])}return w("idle"),t},[]),J=x[x.length-1],q="connecting"===S||"streaming"===S||J?.role==="thinking"&&!0===J.isStreaming;return(0,r.jsx)(d.Provider,{value:{isOpen:t,isStarting:m,displayMode:g,worktreePath:y,toggleAssistant:H,closeAssistant:_,chatMessages:x,chatStatus:S,isChatThinking:q,isLoadingHistory:C,sendChatMessage:$,cancelChat:K,sessions:P,activeSessionId:O,createNewSession:D,switchSession:V,removeSession:B,refreshSessions:A},children:e})},"useAssistant",0,function(){let e=(0,a.useContext)(d);if(!e)throw Error("useAssistant must be used within an AssistantProvider");return e}],338187)},275360,e=>{"use strict";let t=(0,e.i(572989).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",0,t],275360)},431828,763131,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);e.s(["FolderGit2",0,r],431828);let a=(0,t.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",0,a],763131)},256753,e=>{"use strict";let t=(0,e.i(572989).default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,t],256753)},224277,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(977982),n=e.i(431828),s=e.i(763131),i=e.i(472074),l=e.i(738690),o=e.i(256753),c=e.i(275360),d=e.i(597746),u=e.i(657153),f=e.i(776639),h=e.i(519455),m=e.i(793479),p=e.i(746798),g=e.i(533499),v=e.i(759684);e.s(["FolderBrowserDialog",0,function({open:e,onOpenChange:y,onSelect:b,gitOnly:x=!1}){let{t:k}=(0,g.useI18n)(),[S,w]=(0,r.useState)(null),[C,j]=(0,r.useState)(!1),[E,N]=(0,r.useState)(null),[M,P]=(0,r.useState)(""),[T,O]=(0,r.useState)(""),[I,R]=(0,r.useState)(!1),L=(0,r.useRef)(null),[F,A]=(0,r.useState)(!1),[z,D]=(0,r.useState)(""),V=(0,r.useRef)(null),B=(0,r.useCallback)(async e=>{j(!0),N(null),O(""),R(!1);try{let t=e?`/api/browse-fs?path=${encodeURIComponent(e)}`:"/api/browse-fs",r=await fetch(t);if(!r.ok){let e=await r.json();N(e.error||"Failed");return}let a=await r.json();w(a),P(a.currentPath)}catch{N("Failed to browse filesystem")}finally{j(!1)}},[]);(0,r.useEffect)(()=>{e&&(B(),setTimeout(()=>L.current?.focus(),200))},[e,B]);let U=()=>{M.trim()&&B(M.trim())},_=async()=>{let e=z.trim();if(e&&S?.currentPath)try{let t=await fetch("/api/browse-fs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentPath:S.currentPath,name:e})});if(!t.ok){let e=await t.json();N(e.error||k("folder.newFolderError"));return}A(!1),D(""),B(S.currentPath)}catch{N(k("folder.newFolderError"))}},H=()=>{A(!1),D("")},$=S?.folders.filter(e=>e.name.toLowerCase().includes(T.toLowerCase()))??[];return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:y,children:(0,t.jsx)(f.DialogContent,{className:"p-0 gap-0",style:{maxWidth:"36rem",overflow:"hidden"},children:(0,t.jsxs)("div",{className:"flex flex-col max-h-[60vh] overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-5 pt-5 pb-3 shrink-0",children:[(0,t.jsx)(f.DialogTitle,{children:x?k("folder.selectGitRepo"):k("folder.selectFolder")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:k("folder.hint")})]}),(0,t.jsxs)("div",{className:"border-t border-border px-4 pt-3 pb-2 shrink-0",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("folder.manualInput")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(m.Input,{ref:L,value:M,onChange:e=>P(e.target.value),onKeyDown:e=>"Enter"===e.key&&U(),placeholder:"/path/to/your/project",title:M,className:"flex-1 min-w-0"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:U,className:"h-8 px-3 shrink-0",children:k("folder.goTo")})]})]}),(0,t.jsxs)("div",{className:"px-4 py-2 shrink-0",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("folder.searchDir")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsx)(l.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("input",{value:T,onChange:e=>O(e.target.value),placeholder:"Filter folders and files...",className:"h-8 w-full rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 border-y border-border px-4 py-2 shrink-0 min-w-0",children:[(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>S?.homePath&&B(S.homePath),className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(s.Home,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Home"})]}),(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{S&&("__DRIVES__"===S.parentPath?R(!0):(R(!1),B(S.parentPath)))},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(i.ChevronUp,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Parent"})]}),S?.drives&&S.drives.length>0&&(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:I?"default":"outline",size:"icon-sm",onClick:()=>R(e=>!e),className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(o.HardDrive,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Drives"})]}),(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{A(!0),D(""),setTimeout(()=>V.current?.focus(),50)},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(c.FolderPlus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:k("folder.newFolder")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground font-mono",title:S?.currentPath??"",children:S?.currentPath??"..."})]}),(0,t.jsxs)(v.ScrollArea,{className:"min-h-0 flex-1",children:[F&&(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/30 px-4 py-2",children:[(0,t.jsx)(a.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,t.jsx)("input",{ref:V,value:z,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&_(),"Escape"===e.key&&H()},placeholder:k("folder.newFolderPlaceholder"),className:"h-7 flex-1 rounded-md border border-border bg-background px-2 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:_,disabled:!z.trim(),className:"text-emerald-400 hover:text-emerald-300",children:(0,t.jsx)(d.Check,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:H,className:"text-muted-foreground",children:(0,t.jsx)(u.X,{className:"h-3.5 w-3.5"})})]}),C&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}),E&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-rose-400",children:E}),I&&S?.drives&&S.drives.map(e=>(0,t.jsxs)("button",{onClick:()=>{var t;return t=e.path,void(R(!1),B(t))},className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)(o.HardDrive,{className:"h-4 w-4 text-blue-400 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:e.name}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.path})]},e.path)),!I&&!C&&!E&&0===$.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:k("folder.empty")}),!I&&!C&&!E&&$.map(e=>(0,t.jsxs)("button",{onClick:()=>{e.isGit||x?(b(e.path),y(!1)):B(e.path)},onDoubleClick:()=>B(e.path),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[e.isGit?(0,t.jsx)(n.FolderGit2,{className:"h-4 w-4 text-emerald-400 shrink-0"}):(0,t.jsx)(a.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:e.name}),e.isGit&&(0,t.jsx)("span",{className:"shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 ring-1 ring-emerald-500/20",children:"git"})]},e.path))]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 shrink-0 border-t border-border",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>y(!1),children:k("common.cancel")}),(0,t.jsx)(h.Button,{onClick:()=>{S?.currentPath&&(b(S.currentPath),y(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:k("folder.selectPath")})]})]})})})}])},905455,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["SegmentedControl",0,function({options:e,value:a,onChange:n,className:s}){return(0,t.jsx)("div",{className:(0,r.cn)("inline-flex rounded-md border border-border bg-muted p-1 gap-1",s),children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>n(e.value),className:(0,r.cn)("rounded px-3 py-1 text-sm transition-colors",a===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}])},233274,e=>{"use strict";let t=(0,e.i(572989).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],233274)},86768,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("601cbcd84cf9a562f8eeed4b64fbfe1a7e0d85a5c0",t.callServer,void 0,t.findSourceMapURL,"analyzeProjectDirectory");e.s(["analyzeProjectDirectory",0,r])},393208,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40934342416aeeeb2e0e218a887d52a8617e5e9cd2",t.callServer,void 0,t.findSourceMapURL,"createProject");e.s(["createProject",0,r])},232545,e=>{"use strict";let t=(0,e.i(572989).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],232545)},538059,(e,t,r)=>{t.exports=e.r(322195)},314757,e=>{"use strict";var t=e.i(965652);e.s(["useControlled",0,function({controlled:e,default:r,name:a,state:n="value"}){let{current:s}=t.useRef(void 0!==e),[i,l]=t.useState(r),o=t.useCallback(e=>{s||l(e)},[]);return[s?e:i,o]}])},890514,551974,e=>{"use strict";e.i(708878);var t,r=e.i(462902),a=e.i(965652),n=e.i(954588);let s=((t={}).disabled="data-disabled",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),i={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},l={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},o={disabled:!1,...l};e.s(["DEFAULT_FIELD_ROOT_STATE",0,o,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,l,"DEFAULT_VALIDITY_STATE",0,i,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{[s.valid]:""}:{[s.invalid]:""}}],551974);let c=a.createContext({invalid:void 0,name:void 0,validityData:{state:i,errors:[],error:"",value:"",initialValue:null},setValidityData:n.NOOP,disabled:void 0,touched:l.touched,setTouched:n.NOOP,dirty:l.dirty,setDirty:n.NOOP,filled:l.filled,setFilled:n.NOOP,focused:l.focused,setFocused:n.NOOP,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:o,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=n.EMPTY_OBJECT)=>e,getInputValidationProps:(e=n.EMPTY_OBJECT)=>e,inputRef:{current:null},commit:async()=>{}}});e.s(["FieldRootContext",0,c,"useFieldRootContext",0,function(e=!0){let t=a.useContext(c);if(t.setValidityData===n.NOOP&&!e)throw Error((0,r.default)(28));return t}],890514)},571870,e=>{"use strict";var t=e.i(965652),r=e.i(954588);let a=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:r.NOOP,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});e.s(["useFormContext",0,function(){return t.useContext(a)}])},179279,e=>{"use strict";var t=e.i(965652),r=e.i(954588);let a=t.createContext({controlId:void 0,registerControlId:r.NOOP,labelId:void 0,setLabelId:r.NOOP,messageIds:[],setMessageIds:r.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,a,"useLabelableContext",0,function(){return t.useContext(a)}])},956181,e=>{"use strict";e.s(["getCombinedFieldValidityData",0,function(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}])},397791,e=>{"use strict";var t=e.i(92615),r=e.i(102094),a=e.i(887642),n=e.i(682354),s=e.i(804849),i=e.i(207516),l=e.i(179279);e.s(["useLabel",0,function(e={}){let o,{id:c,fallbackControlId:d,native:u=!1,setLabelId:f,focusControl:h}=e,{controlId:m,setLabelId:p}=(0,l.useLabelableContext)(),g=(0,a.useStableCallback)(e=>{p(e),f?.(e)}),v=(o=(0,i.useBaseUiId)(c),(0,s.useIsoLayoutEffect)(()=>(g(o),()=>{g(void 0)}),[o,g]),o),y=m??d;function b(e){let a=(0,n.getTarget)(e.nativeEvent);a?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),u||function(e){if(h)return h(e,y);if(!y)return;let a=(0,r.ownerDocument)(e.currentTarget).getElementById(y);(0,t.isHTMLElement)(a)&&a.focus({focusVisible:!0})}(e))}return u?{id:v,htmlFor:y??void 0,onMouseDown:b}:{id:v,onClick:b,onPointerDown(e){e.preventDefault()}}}],397791)},103353,e=>{"use strict";var t=e.i(965652),r=e.i(804849),a=e.i(887642),n=e.i(903224),s=e.i(92615),i=e.i(954588),l=e.i(207516),o=e.i(179279);e.s(["useLabelableId",0,function(e={}){let{id:c,implicit:d=!1,controlRef:u}=e,{controlId:f,registerControlId:h}=(0,o.useLabelableContext)(),m=(0,l.useBaseUiId)(c),p=d?f:void 0,g=(0,n.useRefWithInit)(()=>Symbol("labelable-control")),v=t.useRef(!1),y=t.useRef(null!=c),b=(0,a.useStableCallback)(()=>{v.current&&h!==i.NOOP&&(v.current=!1,h(g.current,void 0))});return(0,r.useIsoLayoutEffect)(()=>{let e;if(h!==i.NOOP){if(d){let t=u?.current;e=(0,s.isElement)(t)&&null!=t.closest("label")?c??null:p??m}else if(null!=c)y.current=!0,e=c;else{if(!y.current)return void b();e=m}if(void 0===e)return void b();v.current=!0,h(g.current,e)}},[c,u,p,h,d,m,g,b]),t.useEffect(()=>b,[b]),f??m}])},421689,e=>{"use strict";var t=e.i(585012),r=e.i(804849),a=e.i(887642),n=e.i(956181),s=e.i(571870),i=e.i(890514);e.s(["useField",0,function(e){let{enabled:l=!0,value:o,id:c,name:d,controlRef:u,commit:f}=e,{formRef:h}=(0,s.useFormContext)(),{invalid:m,markedDirtyRef:p,validityData:g,setValidityData:v}=(0,i.useFieldRootContext)(),y=(0,a.useStableCallback)(e.getValue);(0,r.useIsoLayoutEffect)(()=>{if(!l)return;let e=o;void 0===e&&(e=y()),null===g.initialValue&&null!==e&&v(t=>({...t,initialValue:e}))},[l,v,o,g.initialValue,y]),(0,r.useIsoLayoutEffect)(()=>{l&&c&&h.current.fields.set(c,{getValue:y,name:d,controlRef:u,validityData:(0,n.getCombinedFieldValidityData)(g,m),validate(e=!0){let r=o;void 0===r&&(r=y()),p.current=!0,e?t.flushSync(()=>f(r)):f(r)}})},[f,u,l,h,y,c,m,p,d,g,o]),(0,r.useIsoLayoutEffect)(()=>{let e=h.current.fields;return()=>{c&&e.delete(c)}},[h,c])}])},792566,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["default",0,t])},453889,e=>{"use strict";let t=(0,e.i(572989).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 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.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],453889)},998626,e=>{"use strict";let t=(0,e.i(572989).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],998626)},59737,e=>{"use strict";let t=(0,e.i(572989).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",0,t])},977982,472074,e=>{"use strict";let t=(0,e.i(572989).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],977982);var r=e.i(792566);e.s(["ChevronUp",()=>r.default],472074)},194358,e=>{"use strict";let t=(0,e.i(572989).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],194358)},567098,e=>{"use strict";let t=(0,e.i(572989).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},770303,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(514798);let n=(0,a.createServerReference)("40dce9c332ff032338b67bcbc27b5a81f611b9590d",a.callServer,void 0,a.findSourceMapURL,"checkExtension");var s=e.i(122161);let i=(0,a.createServerReference)("4023f33471e6d805194513ee2369301411b97c0d6d",a.callServer,void 0,a.findSourceMapURL,"uninstallExtension");var l=e.i(887911);let o={installed:!1},c=(0,r.createContext)(null);e.s(["ExtensionContext",0,c,"ExtensionProvider",0,function({children:e,initialStatus:a}){let[d,u]=(0,r.useState)(()=>a??Object.fromEntries((0,l.listExtensionMetadata)().map(e=>[e.id,o]))),[f,h]=(0,r.useState)(new Set),m=(0,r.useRef)(new Set),p=(0,r.useCallback)(async e=>{let t=await n(e);u(r=>({...r,[e]:t}))},[]),g=(0,r.useCallback)(async e=>{if(m.current.has(e))return{success:!1,error:"install already in progress"};m.current.add(e),h(t=>{let r=new Set(t);return r.add(e),r});try{let t=await (0,s.installExtension)(e);return t.success&&await p(e),t}finally{m.current.delete(e),h(t=>{let r=new Set(t);return r.delete(e),r})}},[p]),v=(0,r.useCallback)(async e=>{if(m.current.has(e))return{success:!1,error:"operation already in progress"};m.current.add(e),h(t=>{let r=new Set(t);return r.add(e),r});try{let t=await i(e);return t.success&&await p(e),t}finally{m.current.delete(e),h(t=>{let r=new Set(t);return r.delete(e),r})}},[p]),y=(0,r.useMemo)(()=>({statusMap:d,loading:!1,installing:f,refresh:p,install:g,uninstall:v}),[d,f,p,g,v]);return(0,t.jsx)(c.Provider,{value:y,children:e})}],770303)},563772,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60032492f456c9c8fcc032fdeb1784777f69464a6a",t.callServer,void 0,t.findSourceMapURL,"getConfigValue");e.s(["getConfigValue",0,r])},386343,125177,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,r],386343);let a=(0,t.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);e.s(["Bell",0,a],125177)},243288,e=>{e.v(t=>Promise.all(["static/chunks/0p_vnqgdse218.js","static/chunks/0ep-qrl_zzch8.js","static/chunks/17oc2l.ekcs8b.css"].map(t=>e.l(t))).then(()=>t(346069)))},427768,e=>{e.v(t=>Promise.all(["static/chunks/05lky664ou92k.js","static/chunks/0o6zqtzz_7ysr.js"].map(t=>e.l(t))).then(()=>t(103363)))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,487486,e=>{"use strict";var t=e.i(565455),r=e.i(581263),s=e.i(294237),a=e.i(975157);let i=(0,s.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:s="default",render:n,...l}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,a.cn)(i({variant:s}),e)},l),render:n,state:{slot:"badge",variant:s}},(0,r.useRenderElement)(o.defaultTagName??"div",o,o)}],487486)},110204,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["Label",0,function({className:e,...s}){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),...s})}])},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)},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)},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"])},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);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)},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)},662955,3789,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("404887c17032e540f11dab275fc8b6ced55ad65c65",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],662955);let s=(0,t.createServerReference)("405f57b9e24ba09726ac2797026e48cfc7c4eafc54",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,s],3789)},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)},340966,e=>{"use strict";let t=(0,e.i(572989).default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);e.s(["ClipboardList",0,t],340966)},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)},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)},7688,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("4042c83abbad23459e61ebea3c6ee85d86590af8e1",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,r])},631399,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40f5910088d7a76d03180786ceb87a898579c6ff2c",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,r])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:s,description:a,action:i,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:s}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),i&&(0,t.jsx)("div",{className:"mt-2",children:i})]})}])},791618,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("7c6efd3ffe7760fcb04a00c6ff80e257144741dc8d",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,r])},229672,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40540ec85ab3e8e643c8cfc26a74e479c82d473478",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r])},845593,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("602530d647e3dfa4d7b7ef438a5bee430f90ad21af",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,r])},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)},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},101400,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("401567b6c8e7e306efc9b3deeb504c75ecfaa6b199",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},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)},486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},711554,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(226145),a=e.i(232280),i=e.i(738690),n=e.i(597746),l=e.i(400355),o=e.i(776639),c=e.i(519455),d=e.i(793479),u=e.i(624687),x=e.i(533499);e.s(["CreateBranchDialog",0,function({open:e,onOpenChange:m,branches:h,currentBranch:f,localPath:p,onCreated:g,onError:b}){let{t:v}=(0,x.useI18n)(),[y,j]=(0,r.useState)(""),[N,k]=(0,r.useState)(f),[w,C]=(0,r.useState)(""),[S,M]=(0,r.useState)(!1),[L,R]=(0,r.useState)(""),[T,E]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(j(""),k(f),C(""),R(""))},[e,f]);let D=[...new Set(h)].filter(e=>e.toLowerCase().includes(L.toLowerCase())),I=async()=>{if(y.trim()){M(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:p,branch:y.trim(),baseBranch:N})});if(e.ok)m(!1),g();else{let t=await e.json();b(t.error||"Unknown error")}}catch{b("Network error")}finally{M(!1)}}};return(0,t.jsx)(o.Dialog,{open:e,onOpenChange:m,children:(0,t.jsxs)(o.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(o.DialogHeader,{children:(0,t.jsx)(o.DialogTitle,{children:v("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.branchName")}),(0,t.jsx)(d.Input,{value:y,onChange:e=>j(e.target.value),placeholder:v("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&I()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>E(!T),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,t.jsx)("span",{className:"font-mono text-xs text-foreground",children:N})]}),(0,t.jsx)(a.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${T?"rotate-180":""}`})]}),T&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:L,onChange:e=>R(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:D.map(e=>(0,t.jsxs)("button",{onClick:()=>{k(e),E(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===N?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(s.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",children:e}),e===N&&(0,t.jsx)(n.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("git.branchDesc")}),(0,t.jsx)(u.Textarea,{value:w,onChange:e=>C(e.target.value),placeholder:v("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(o.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>m(!1),children:v("common.cancel")}),(0,t.jsxs)(c.Button,{onClick:I,disabled:!y.trim()||S,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[S?(0,t.jsx)(l.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,v("common.create")]})]})]})})}])},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},244354,e=>{"use strict";async function t(e,r,s={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r,path:e,...s})});if(!a.ok)throw Error((await a.json()).error||`${r} failed`);return a.json()}e.s(["gitAction",0,t])},14842,865514,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(368490),a=e.i(232280),i=e.i(759686),n=e.i(960518),l=e.i(340873),o=e.i(400355),c=e.i(519455),d=e.i(912505),u=e.i(487486),x=e.i(776639),m=e.i(624687),h=e.i(533499);function f({patchState:e,isLargeFold:r,onLoad:s}){let{t:a}=(0,h.useI18n)();return r?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:s,className:"h-auto p-0 text-sm",children:a("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:a("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:s,children:a("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:r}=(0,h.useI18n)(),s=e.split("\n"),a=s.length>500,i=a?s.slice(0,500):s;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:i.map((e,r)=>{let s=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:s,children:e||" "},r)})}),a&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:r("diff.patchTruncated",{n:String(500),total:String(s.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:o,totalAdded:p,totalRemoved:g,hasConflicts:b,conflictFiles:v,onCommit:y,hasUncommitted:j}){let{t:N}=(0,h.useI18n)(),[k,w]=(0,r.useState)(new Set),[C,S]=(0,r.useState)(new Map),[M,L]=(0,r.useState)(!1),[R,T]=(0,r.useState)(""),[E,D]=(0,r.useState)(!1),I=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(r=>{let s=new Map(r);return"binary"===e.kind?s.set(t,{kind:"binary"}):"empty"===e.kind?s.set(t,{kind:"empty"}):s.set(t,{kind:"ready",patch:e.patch??""}),s})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[o.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:j&&y&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>L(!0),className:"gap-2",children:[(0,t.jsx)(l.GitCommitHorizontal,{className:"h-4 w-4"}),N("diff.commit")]})})]}),b&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(i.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",v.length," conflicting file",1!==v.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:v.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===o.length?(0,t.jsx)(d.EmptyState,{icon:n.GitCompare,title:N("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:o.map(e=>{let r=k.has(e.filename),i=C.get(e.filename),n=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=k.has(e.filename),void(w(t=>{let r=new Set(t);return r.has(e.filename)?r.delete(e.filename):r.add(e.filename),r}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&I(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[r?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(s.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(u.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:N("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),r&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:i,isLargeFold:!i&&n>200,onLoad:()=>I(e.filename)})})]},e.filename)})})}),(0,t.jsx)(x.Dialog,{open:M,onOpenChange:L,children:(0,t.jsxs)(x.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(x.DialogHeader,{children:(0,t.jsx)(x.DialogTitle,{children:N("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(m.Textarea,{value:R,onChange:e=>T(e.target.value),placeholder:N("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>L(!1),children:N("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(R.trim()&&y){D(!0);try{await y(R.trim()),T(""),L(!1)}finally{D(!1)}}},disabled:!R.trim()||E,children:E?"...":N("diff.commit")})]})]})})]})}],14842);var g=e.i(538059);let b=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:s,taskId:a,taskTitle:i,baseBranch:n,fileCount:l,commitCount:d,commitLog:u=[],onMergeComplete:m}){let h=(0,g.useRouter)(),[f,p]=(0,r.useState)(!1),[v,y]=(0,r.useState)(null),j=async()=>{p(!0),y(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){s(!1),m(),h.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?y(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):y(t.error??"Merge failed")}catch{y("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(x.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(x.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(x.DialogHeader,{children:(0,t.jsxs)(x.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(b,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:n})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),u.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:u.map((e,r)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},r))})]}),v&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:v})})]}),(0,t.jsxs)(x.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>s(!1),disabled:f,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:j,disabled:f,className:"gap-2",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},296476,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40a589d9ba3b8097114fa051abd96b50b2889ef121",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,r])},533002,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40a96c37697b01caf6047d21e8b8705f9c51becfe3",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r])},944327,434710,631457,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60364aaabea62ad81d27f362155f2a118a9076ed88",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,r],944327);let s=(0,t.createServerReference)("405b55a40e4e436fb4f393436e274930cf84368a43",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,s],434710);let a=(0,t.createServerReference)("60057ffba0d6e86765d25aa7f862afd42cb2a7b198",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],631457)},989383,769824,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,r],989383);let s=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,s],769824)},326883,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(232280),a=e.i(472074),i=e.i(301348),n=e.i(181209),l=e.i(400355),o=e.i(989383),c=e.i(12659),d=e.i(922541),u=e.i(486077),x=e.i(769824),m=e.i(519455),h=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(i.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(n.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:i,onContinueLatest:n}){let{t:l,locale:o}=(0,f.useI18n)(),[g,b]=(0,r.useState)(null),[v,y]=(0,r.useState)(null);return 0===e.length?(0,t.jsx)(h.EmptyState,{icon:x.History,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(r=>{let x=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(r.gitStats??null),h=function(e,t){if(!e||!t)return"";let r=new Date(t).getTime()-new Date(e).getTime();if(r<0)return"";let s=Math.floor(r/1e3);if(s<60)return`${s}s`;let a=Math.floor(s/60);if(a<60)return`${a}m ${s%60}s`;let i=Math.floor(a/60);return`${i}h ${a%60}m`}(r.startedAt??null,r.endedAt??null),f=g===r.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:r.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(r.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(r.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let r=new Date(e),s=Math.floor((new Date().getTime()-r.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",i=r.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===s?i:1===s?"zh"===t?`昨天 ${i}`:`Yesterday ${i}`:s<7?"zh"===t?`${s}天前 ${i}`:`${s}d ago ${i}`:r.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+i}(r.startedAt??null,o)}),h&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",h,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:r.summary||l("execution.noSummary")}),x&&(x.commits||x.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[x.commits?(0,t.jsxs)("span",{children:[x.commits," ",l("execution.commits")]}):null,x.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[x.filesChanged," ",l("execution.files")]})]}):null,x.insertions||x.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),x.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",x.insertions]}):null,x.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",x.deletions]}):null]}):null]}),r.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>y(v===r.id?null:r.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(u.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:r.insightNote.title}),v===r.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(s.ChevronDown,{className:"h-3 w-3"})]}),v===r.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:r.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[r.sessionId&&i?(0,t.jsxs)(m.Button,{size:"sm",onClick:()=>i(r.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!r.sessionId&&"FAILED"===r.status&&r.id===e[0]?.id&&n?(0,t.jsxs)(m.Button,{size:"sm",onClick:n,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(m.Button,{variant:"ghost",size:"sm",onClick:()=>b(f?null:r.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(s.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[r.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:r.gitLog.split("\n").slice(0,3).join("\n")})]}),r.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:r.terminalLog})]}),"FAILED"===r.status&&null!=r.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",r.exitCode]})]})]},r.id)})]})}])},390409,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60b65223ac19282d326b0cb58e6d5215dbe2b58e78",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,r])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,188e3,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40530570a66aecec0e96f3807ec632598139384043",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,s])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:r,description:i,action:n,className:a}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",a),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:r}),i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:i}),n&&(0,t.jsx)("div",{className:"mt-2",children:n})]})}])},487486,e=>{"use strict";var t=e.i(565455),s=e.i(581263),r=e.i(294237),i=e.i(975157);let n=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:a,...o}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(n({variant:r}),e)},o),render:a,state:{slot:"badge",variant:r}},(0,s.useRenderElement)(l.defaultTagName??"div",l,l)}],487486)},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},229672,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40540ec85ab3e8e643c8cfc26a74e479c82d473478",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,s])},791618,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c6efd3ffe7760fcb04a00c6ff80e257144741dc8d",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,s])},845593,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("602530d647e3dfa4d7b7ef438a5bee430f90ad21af",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,s])},511557,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40b29e30ff33e953531924ea706be7f857f5f3c8db",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,s])},169751,e=>{"use strict";function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}function s(e){return null==e?"":function(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function r(e){return"string"==typeof e}function i(e){return"number"==typeof e}function n(e){return"object"==typeof e}function a(e){return null!=e}function o(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let c=Object.prototype.hasOwnProperty;class u{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let s=d(e);this._keys.push(s),this._keyMap[s.id]=s,t+=s.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(e){let s=null,i=null,n=null,a=1,o=null;if(r(e)||t(e))n=e,s=h(e),i=m(e);else{if(!c.call(e,"name"))throw Error("Missing name property in key");let t=e.name;if(n=t,c.call(e,"weight")&&(a=e.weight)<=0)throw Error(`Property 'weight' in key '${t}' must be a positive integer`);s=h(t),i=m(t),o=e.getFn}return{path:s,id:i,weight:a,src:n,getFn:o}}function h(e){return t(e)?e:e.split(".")}function m(e){return t(e)?e.join("."):e}let f=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,useTokenSearch:!1,getFn:function(e,o){let c=[],u=!1,d=(e,o,h,m)=>{if(a(e))if(o[h]){var f,x;let g=e[o[h]];if(!a(g))return;if(h===o.length-1&&(r(g)||i(g)||!0===(f=g)||!1===f||n(x=f)&&null!==x&&"[object Boolean]"==l(f)||"bigint"==typeof g))c.push(void 0!==m?{v:s(g),i:m}:s(g));else if(t(g)){u=!0;for(let e=0,t=g.length;e<t;e+=1)d(g[e],o,h+1,e)}else o.length&&d(g,o,h+1,m)}else c.push(void 0!==m?{v:e,i:m}:e)};return d(e,r(o)?o.split("."):o,0),u?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}),x=/[^ ]+/g;class g{constructor({getFn:e=f.getFn,fieldNormWeight:t=f.fieldNormWeight}={}){this.norm=function(e=1,t=3){let s=new Map,r=Math.pow(10,t);return{get(t){let i=t.match(x).length;if(s.has(i))return s.get(i);let n=parseFloat(Math.round(1/Math.pow(i,.5*e)*r)/r);return s.set(i,n),n},clear(){s.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,r(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();r(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t<s;t+=1)this.records[t].i-=1}removeAll(e){for(let t=e.length-1;t>=0;t-=1)this.records.splice(e[t],1);for(let e=0,t=this.records.length;e<t;e+=1)this.records[e].i=e}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!a(e)||o(e))return;let s={v:e,i:t,n:this.norm.get(e)};this.records.push(s)}_addObject(e,i){let n={i:i,$:{}};this.keys.forEach((i,l)=>{let c=i.getFn?i.getFn(e):this.getFn(e,i.path);if(a(c)){if(t(c)){let e=[];for(let t=0,i=c.length;t<i;t+=1){let i=c[t];if(a(i)){if(r(i)){if(!o(i)){let s={v:i,i:t,n:this.norm.get(i)};e.push(s)}}else if(a(i.v)){let t=r(i.v)?i.v:s(i.v);if(!o(t)){let s={v:t,i:i.i,n:this.norm.get(t)};e.push(s)}}}}n.$[l]=e}else if(r(c)&&!o(c)){let e={v:c,n:this.norm.get(c)};n.$[l]=e}}}),this.records.push(n)}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function p(e,t,{getFn:s=f.getFn,fieldNormWeight:r=f.fieldNormWeight}={}){let i=new g({getFn:s,fieldNormWeight:r});return i.setKeys(e.map(d)),i.setSources(t),i.create(),i}function v(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let s=1,r=e.length;s<r;s+=1){let r=t[t.length-1],i=e[s];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}let y={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},b=RegExp("["+Object.keys(y).join("")+"]","g"),C=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(b,e=>y[e]):e=>e;class k{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:c=f.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c},e=o?e:e.toLowerCase(),e=l?C(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const u=(e,t)=>{this.chunks.push({pattern:e,alphabet:function(e){let t={};for(let s=0,r=e.length;s<r;s+=1){let i=e.charAt(s);t[i]=(t[i]||0)|1<<r-s-1}return t}(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,s=d-t;for(;e<s;)u(this.pattern.substr(e,32),e),e+=32;if(t){const e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:s,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=s?C(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,ignoreLocation:c}=this.options,u=[],d=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:s,startIndex:m})=>{let{isMatch:x,score:g,indices:p}=function(e,t,s,{location:r=f.location,distance:i=f.distance,threshold:n=f.threshold,findAllMatches:a=f.findAllMatches,minMatchCharLength:o=f.minMatchCharLength,includeMatches:l=f.includeMatches,ignoreLocation:c=f.ignoreLocation}={}){let u;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let d=t.length,h=e.length,m=Math.max(0,Math.min(r,h)),x=n,g=m,p=(e,t)=>{let s=e/d;if(c)return s;let r=Math.abs(m-t);return i?s+r/i:r?1:s},v=o>1||l,y=v?Array(h):[];for(;(u=e.indexOf(t,g))>-1;)if(x=Math.min(p(0,u),x),g=u+d,v){let e=0;for(;e<d;)y[u+e]=1,e+=1}g=-1;let b=[],C=1,k=d+h,j=1<<d-1;for(let t=0;t<d;t+=1){let r=0,i=k;for(;r<i;)p(t,m+i)<=x?r=i:k=i,i=Math.floor((k-r)/2+r);k=i;let n=Math.max(1,m-i+1),o=a?h:Math.min(m+i,h)+d,l=Array(o+2);l[o+1]=(1<<t)-1;for(let r=o;r>=n;r-=1){let i=r-1,a=s[e[i]];if(v&&(y[i]=+!!a),l[r]=(l[r+1]<<1|1)&a,t&&(l[r]|=(b[r+1]|b[r])<<1|1|b[r+1]),l[r]&j&&(C=p(t,i))<=x){if(x=C,(g=i)<=m)break;n=Math.max(1,2*m-g)}}if(p(t+1,m)>x)break;b=l}let w={isMatch:g>=0,score:Math.max(.001,C)};if(v){let e=function(e=[],t=f.minMatchCharLength){let s=[],r=-1,i=-1,n=0;for(let a=e.length;n<a;n+=1){let a=e[n];a&&-1===r?r=n:a||-1===r||((i=n-1)-r+1>=t&&s.push([r,i]),r=-1)}return e[n-1]&&n-r>=t&&s.push([r,n-1]),s}(y,o);e.length?l&&(w.indices=e):w.isMatch=!1}return w}(e,t,s,{location:i+m,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});x&&(h=!0),d+=g,x&&p&&u.push(...p)});let m={isMatch:h,score:h?d/this.chunks.length:1};return h&&r&&(m.indices=v(u)),m}}class j{constructor(e){this.pattern=e}static isMultiMatch(e){return w(e,this.multiRegex)}static isSingleMatch(e){return w(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function w(e,t){let s=e.match(t);return s?s[1]:null}class A extends j{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:c=f.ignoreLocation}={}){super(e),this._bitapSearch=new k(e,{location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class S extends j{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,s=0,r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,s))>-1;)s=t+i,r.push([t,s-1]);let n=!!r.length;return{isMatch:n,score:+!n,indices:r}}}let N=[class extends j{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},S,class extends j{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}},class extends j{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},A],E=N.length,I=new Set([A.type,S.type]),M=[];function D(...e){M.push(...e)}function B(e,t){for(let s=0,r=M.length;s<r;s+=1){let r=M[s];if(r.condition(e,t))return new r(e,t)}return new k(e,t)}let _="$and",F="$path",R=e=>!!(e[_]||e.$or),T=e=>({[_]:Object.keys(e).map(t=>({[t]:e[t]}))});function L(e,s,{auto:i=!0}={}){let a=e=>{if(r(e)){let t={keyId:null,pattern:e};return i&&(t.searcher=B(e,s)),t}let o=Object.keys(e),l=!!e[F];if(!l&&o.length>1&&!R(e))return a(T(e));if(!t(e)&&n(e)&&!R(e)){let t=l?e[F]:o[0],n=l?e.$val:e[t];if(!r(n))throw Error(`Invalid value for key ${t}`);let a={keyId:m(t),pattern:n};return i&&(a.searcher=B(n,s)),a}let c={children:[],operator:o[0]};return o.forEach(s=>{let r=e[s];t(r)&&r.forEach(e=>{c.children.push(a(e))})}),c};return R(e)||(e=T(e)),a(e)}function $(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){let s=1;return e.forEach(({key:e,norm:r,score:i})=>{let n=e?e.weight:null;s*=Math.pow(0===i&&n?Number.EPSILON:i,(n||1)*(t?1:r))}),s}class O{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let s=e-1>>1;if(t[e].score<=t[s].score)break;let r=t[e];t[e]=t[s],t[s]=r,e=s}}_sinkDown(e){let t=this.heap,s=t.length,r=e;do{let i=2*(e=r)+1,n=2*e+2;if(i<s&&t[i].score>t[r].score&&(r=i),n<s&&t[n].score>t[r].score&&(r=n),r!==e){let s=t[e];t[e]=t[r],t[r]=s}}while(r!==e)}}function P(e,t){let s=e.matches;t.matches=[],a(s)&&s.forEach(e=>{if(!a(e.indices)||!e.indices.length)return;let{indices:s,value:r}=e,i={indices:s,value:r};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function z(e,t){t.score=e.score}let W=/\b\w+\b/g;function H({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize:s=>(e||(s=s.toLowerCase()),t&&(s=C(s)),s.match(W)||[])}}function V(e,t){for(let[s,r]of e.terms){let i=r.filter(e=>e.docIdx!==t),n=r.length-i.length;n>0&&(e.fieldCount-=n,e.df.set(s,(e.df.get(s)||0)-n),0===i.length?(e.terms.delete(s),e.df.delete(s)):e.terms.set(s,i))}}class U{constructor(e,t,s){this.options={...f,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new u(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,s),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=B(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof g))throw Error("Incorrect 'index' type");if(this._myIndex=t||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(e,t,s){let r=new Map,i=new Map,n=0;function a(e,t,a,o){let l=s.tokenize(e);if(!l.length)return;n++;let c=new Map;for(let e of l)c.set(e,(c.get(e)||0)+1);for(let[e,s]of c){let n={docIdx:t,keyIdx:a,subIdx:o,tf:s},l=r.get(e);l||(l=[],r.set(e,l)),l.push(n),i.set(e,(i.get(e)||0)+1)}}for(let s of e){let{i:e,v:r,$:i}=s;if(void 0!==r){a(r,e,-1,-1);continue}if(i)for(let s=0;s<t;s++){let t=i[s];if(t)if(Array.isArray(t))for(let r of t)a(r.v,e,s,r.i??-1);else a(t.v,e,s,-1)}}return{terms:r,fieldCount:n,df:i}}(this._myIndex.records,this._myIndex.keys.length,e)}}add(e){if(a(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){let e=this._myIndex.records[this._myIndex.records.length-1],t=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});!function(e,t,s,r){let{i:i,v:n,$:a}=t;function o(t,s,n){let a=r.tokenize(t);if(!a.length)return;e.fieldCount++;let o=new Map;for(let e of a)o.set(e,(o.get(e)||0)+1);for(let[t,r]of o){let a={docIdx:i,keyIdx:s,subIdx:n,tf:r},o=e.terms.get(t);o||(o=[],e.terms.set(t,o)),o.push(a),e.df.set(t,(e.df.get(t)||0)+1)}}if(void 0!==n)return o(n,-1,-1);if(a)for(let e=0;e<s;e++){let t=a[e];if(t)if(Array.isArray(t))for(let s of t)o(s.v,e,s.i??-1);else o(t.v,e,-1)}}(this._invertedIndex,e,this._myIndex.keys.length,t)}}remove(e=()=>!1){let t=[],s=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),s.push(r));if(s.length){if(this._invertedIndex)for(let e of s)V(this._invertedIndex,e);for(let e=s.length-1;e>=0;e-=1)this._docs.splice(s[e],1);this._myIndex.removeAll(s)}return t}removeAt(e){this._invertedIndex&&V(this._invertedIndex,e);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),t}getIndex(){return this._myIndex}search(e,t){let s,{limit:n=-1}=t||{},{includeMatches:a,includeScore:o,shouldSort:l,sortFn:c,ignoreFieldNorm:u}=this.options;if(r(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return i(n)&&n>-1&&(e=e.slice(0,n)),e}if(i(n)&&n>0&&r(e)){let t=new O(n);r(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:u}),s=t.extractSorted(c)}else!function(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){e.forEach(e=>{e.score=$(e.matches,{ignoreFieldNorm:t})})}(s=r(e)?r(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:u}),l&&s.sort(c),i(n)&&n>-1&&(s=s.slice(0,n));return function(e,t,{includeMatches:s=f.includeMatches,includeScore:r=f.includeScore}={}){let i=[];return s&&i.push(P),r&&i.push(z),e.map(e=>{let{idx:s}=e,r={item:t[s],refIndex:s};return i.length&&i.forEach(t=>{t(e,r)}),r})}(s,this._docs,{includeMatches:a,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{records:i}=this._myIndex,n=t?null:[];return i.forEach(({v:e,i:i,n:o})=>{if(!a(e))return;let{isMatch:l,score:c,indices:u}=r.searchIn(e);if(l){let r={item:e,idx:i,matches:[{score:c,value:e,norm:o,indices:u}]};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):n.push(r)}}),n}_searchLogical(e){let t=L(e,this.options),s=(e,t,r)=>{if(!("children"in e)){let s,{keyId:i,searcher:n}=e;return(null===i?(s=[],this._myIndex.keys.forEach((e,r)=>{s.push(...this._findMatches({key:e,value:t[r],searcher:n}))})):s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:n}),s&&s.length)?[{idx:r,item:t,matches:s}]:[]}let{children:i,operator:n}=e,a=[];for(let e=0,o=i.length;e<o;e+=1){let o=s(i[e],t,r);if(o.length)a.push(...o);else if(n===_)return[]}return a},r=this._myIndex.records,i=new Map,n=[];return r.forEach(({$:e,i:r})=>{if(a(e)){let a=s(t,e,r);a.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),n.push(i.get(r))),a.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),n}_searchObjectList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{keys:i,records:n}=this._myIndex,o=t?null:[];return n.forEach(({$:e,i:n})=>{if(!a(e))return;let l=[],c=!1,u=!1;if(i.forEach((t,s)=>{let i=this._findMatches({key:t,value:e[s],searcher:r});i.length?(l.push(...i),i[0].hasInverse&&(u=!0)):c=!0}),(!u||!c)&&l.length){let r={idx:n,item:e,matches:l};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}),o}_findMatches({key:e,value:s,searcher:r}){if(!a(s))return[];let i=[];if(t(s))s.forEach(({v:t,i:s,n:n})=>{if(!a(t))return;let{isMatch:o,score:l,indices:c,hasInverse:u}=r.searchIn(t);o&&i.push({score:l,key:e,value:t,idx:s,norm:n,indices:c,hasInverse:u})});else{let{v:t,n:n}=s,{isMatch:a,score:o,indices:l,hasInverse:c}=r.searchIn(t);a&&i.push({score:o,key:e,value:t,norm:n,indices:l,hasInverse:c})}return i}}U.version="7.3.0",U.createIndex=p,U.parseIndex=function(e,{getFn:t=f.getFn,fieldNormWeight:s=f.fieldNormWeight}={}){let{keys:r,records:i}=e,n=new g({getFn:t,fieldNormWeight:s});return n.setKeys(r),n.setIndexRecords(i),n},U.config=f,U.match=function(e,t,s){return B(e,{...f,...s}).searchIn(t)},U.parseQuery=L,D(class{constructor(e,{isCaseSensitive:t=f.isCaseSensitive,ignoreDiacritics:s=f.ignoreDiacritics,includeMatches:r=f.includeMatches,minMatchCharLength:i=f.minMatchCharLength,ignoreLocation:n=f.ignoreLocation,findAllMatches:a=f.findAllMatches,location:o=f.location,threshold:l=f.threshold,distance:c=f.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:i,findAllMatches:a,ignoreLocation:n,location:o,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=s?C(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{let s=(function(e){let t=[],s=e.length,r=0;for(;r<s;){for(;r<s&&" "===e[r];)r++;if(r>=s)break;let i=r;for(;i<s&&" "!==e[i]&&'"'!==e[i];)i++;if(i<s&&'"'===e[i]){for(i++;i<s;){if('"'===e[i]){let t=i+1;if(t>=s||" "===e[t]){i++;break}if("$"===e[t]&&(t+1>=s||" "===e[t+1])){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<s&&" "!==e[i];)i++;t.push(e.substring(r,i)),r=i}}return t})(e.replace(/\u0000/g,"|").trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=s.length;e<i;e+=1){let i=s[e],n=!1,a=-1;for(;!n&&++a<E;){let e=N[a],s=e.isMultiMatch(i);s&&(r.push(new e(s,t)),n=!0)}if(!n)for(a=-1;++a<E;){let e=N[a],s=e.isSingleMatch(i);if(s){r.push(new e(s,t));break}}}return r})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:s,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?C(e):e;let n=0,a=[],o=0,l=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];a.length=0,n=0,l=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:c,indices:u,score:d}=r.search(e);if(c){n+=1,o+=d;let e=r.constructor.type;e.startsWith("inverse")&&(l=!0),s&&(I.has(e)?a.push(...u):a.push(u))}else{o=0,n=0,a.length=0,l=!1;break}}if(n){let e={isMatch:!0,score:o/n};return l&&(e.hasInverse=!0),s&&(e.indices=v(a)),e}}return{isMatch:!1,score:1}}}),D(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=H({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics});const s=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;for(const e of(this.termSearchers=[],this.idfWeights=[],s)){this.termSearchers.push(new k(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const s=r.get(e)||0,n=Math.log(1+(i-s+.5)/(s+.5));this.idfWeights.push(n)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],s=0,r=0,i=0;for(let n=0;n<this.termSearchers.length;n++){let a=this.termSearchers[n].searchIn(e),o=this.idfWeights[n];r+=o,a.isMatch&&(i++,s+=o*(1-a.score),a.indices&&t.push(...a.indices))}if(0===i)return{isMatch:!1,score:1};let n={isMatch:!0,score:Math.max(.001,r>0?1-s/r:0)};return this.options.includeMatches&&t.length&&(n.indices=v(t)),n}}),U.use=function(...e){e.forEach(e=>D(e))},e.s(["default",0,U])},449636,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(533499),i=e.i(514798);let n=(0,i.createServerReference)("000e81d80a5e50fd49bd84127a4b2a07fb6e3b1f04",i.callServer,void 0,i.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var a=e.i(229672);let o=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var l=e.i(918385),c=e.i(519455),u=e.i(912505),d=e.i(572989);let h=(0,d.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var m=e.i(188e3);function f({cols:e,rows:s,active:r}){let i=Array.from({length:e*s});return(0,t.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${r?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${e}, 1fr)`,gridTemplateRows:`repeat(${s}, 1fr)`},children:i.map((e,s)=>(0,t.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${r?"bg-primary":"bg-muted-foreground/40"}`},s))})}let x="custom";function g({value:e,customValue:i,onChange:n}){let{t:a}=(0,r.useI18n)(),[l,u]=(0,s.useState)(!1),d=(0,s.useRef)(null),h=e===x,p=h?null:o.find(t=>t.id===e)??o[2],[v,y]=(0,s.useState)(i?.cols??2),[b,C]=(0,s.useState)(i?.rows??2),[k,j]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,s.useEffect)(()=>{(0,m.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{j({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{i&&(y(i.cols),C(i.rows))},[i?.cols,i?.rows]),(0,s.useEffect)(()=>{if(l)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){d.current&&!d.current.contains(e.target)&&u(!1)}},[l]);let w=(e,t,s)=>Math.max(t,Math.min(s,e)),A=h?v:p?.cols??2,S=h?b:p?.rows??2,N=h?`${v}\xd7${b}`:p?.label??"";return(0,t.jsxs)("div",{ref:d,className:"relative",children:[(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>u(e=>!e),className:"gap-2",children:[(0,t.jsx)(f,{cols:A,rows:S,active:!1}),(0,t.jsx)("span",{children:N}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),l&&(0,t.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,t.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:a("missions.gridPreset")}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[o.map(s=>{let r=s.id===e;return(0,t.jsxs)("button",{onClick:()=>{n(s.id),u(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${r?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:s.cols,rows:s.rows,active:r}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${r?"text-primary":"text-foreground"}`,children:s.label}),(0,t.jsx)("span",{className:`text-xs ${r?"text-primary/60":"text-muted-foreground"}`,children:s.desc})]},s.id)}),(0,t.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,t.jsxs)("button",{onClick:()=>{h||n(x,{cols:v,rows:b})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${h?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:v,rows:b,active:h}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${h?"text-primary":"text-foreground"}`,children:a("missions.gridCustom")}),(0,t.jsxs)("span",{className:`text-xs ${h?"text-primary/60":"text-muted-foreground"}`,children:[v,"×",b]})]}),h&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:a("missions.gridCols")}),(0,t.jsx)("input",{type:"number",min:k.minCols,max:k.maxCols,value:v,onChange:e=>{let t;y(t=w(Number(e.target.value),k.minCols,k.maxCols)),n(x,{cols:t,rows:b})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:a("missions.gridRows")}),(0,t.jsx)("input",{type:"number",min:k.minRows,max:k.maxRows,value:b,onChange:e=>{let t;C(t=w(Number(e.target.value),k.minRows,k.maxRows)),n(x,{cols:v,rows:t})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var p=e.i(720247),v=e.i(775712),y=e.i(19578),b=e.i(538059),C=e.i(67013);let k=(0,d.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),j=(0,d.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var w=e.i(657153);let A=(0,d.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var S=e.i(746798),N=e.i(487486),E=e.i(511557),I=e.i(360112);let M=(0,y.default)(()=>e.A(243288).then(e=>e.TaskTerminal),{loadableGenerated:{modules:[346069]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function D({execution:e,isRemoving:i,removeReason:n,onStop:a,onSessionEnd:o}){let{t:l}=(0,r.useI18n)(),u=(0,b.useRouter)(),{attributes:d,listeners:h,setNodeRef:m,transform:f,transition:x}=(0,v.useSortable)({id:e.executionId}),g={transform:C.CSS.Transform.toString(f),transition:x,opacity:+!i},[p,y]=(0,s.useState)(()=>e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0);(0,s.useEffect)(()=>{if(i)return;let t=setInterval(()=>{y(e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(t)},[e.startedAt,i]);let B=Math.floor(p/60),_=`${B}m ${p%60}s`;async function F(){if(e.projectLocalPath)try{await (0,E.openInTerminal)(e.projectLocalPath)}catch{I.toast.error(l("preview.terminalError"))}}return(0,t.jsxs)("div",{ref:m,style:g,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...d,children:[(0,t.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,t.jsx)("button",{...h,"aria-label":l("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,t.jsx)(k,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[e.workspaceName," ›"," ",e.projectAlias||e.projectName," ›"," ",(0,t.jsx)("span",{className:"text-foreground font-semibold",children:e.taskTitle})]}),i?(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===n?l("missions.statusStopped"):l("missions.statusCompleted")}):(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:l("missions.statusRunning")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:_}),e.projectLocalPath&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:F}),children:(0,t.jsx)(A,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.openInTerminal")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>u.push(`/workspaces/${e.workspaceId}/tasks/${e.taskId}`)}),children:(0,t.jsx)(j,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.openFullView")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>a(e.taskId),disabled:i}),children:(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.stopTask")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,t.jsx)(M,{taskId:e.taskId,worktreePath:e.worktreePath??e.projectLocalPath,onSessionEnd:t=>o?.(e.taskId,t),useCanvasRenderer:!0})})]})}var B=e.i(169751);let _=(0,i.createServerReference)("409f354f644b09f1ecfb64c96ea5cbc31d38cf60de",i.callServer,void 0,i.findSourceMapURL,"getWorkspacesWithRecentTasks"),F=(0,i.createServerReference)("4042b89cef009999033e9e4024480a4656b064f04a",i.callServer,void 0,i.findSourceMapURL,"getProjectTasks");var R=e.i(791618),T=e.i(845593),L=e.i(793479),$=e.i(776639),O=e.i(368490);let P=(0,d.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var z=e.i(922541),W=e.i(738690),H=e.i(759684);let V={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},U={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function K({status:e}){return(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[e]??"bg-slate-100 text-slate-600"}`,children:V[e]??e})}function q({task:e,isRunning:s,launchingId:r,onLaunchNew:i,onResume:n,t:a}){let o=e.executions?.[0]?.sessionId,l=r===e.id;return(0,t.jsxs)("div",{className:"group/task grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:`text-sm truncate ${s?"italic text-muted-foreground":""}`,children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)(K,{status:e.status}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:U[e.priority]??e.priority})]})]}),s?(0,t.jsx)("span",{className:"text-[10px] italic text-muted-foreground",children:a("missions.alreadyMonitored")}):(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity",children:[o&&(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>n(e.id,o),disabled:l,title:a("missions.continueSession"),children:[(0,t.jsx)(z.RotateCcw,{className:"h-3 w-3 mr-1"}),a("missions.continueLabel")]}),(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>i(e.id),disabled:l,title:a("missions.launchNew"),children:[(0,t.jsx)(P,{className:"h-3 w-3 mr-1"}),l?"...":a("missions.launchNewLabel")]})]})]})}function G({open:e,onOpenChange:i,onLaunchNew:n,onResume:a,runningTaskIds:o,launchingId:u}){let{t:d}=(0,r.useI18n)(),[h,m]=(0,s.useState)([]),[f,x]=(0,s.useState)(""),[g,p]=(0,s.useState)(""),[v,y]=(0,s.useState)([]),[b,C]=(0,s.useState)("");(0,s.useEffect)(()=>{e&&(x(""),p(""),y([]),C(""),_(100).then(m).catch(()=>I.toast.error(d("missions.error.launchFailed"))))},[e,d]),(0,s.useEffect)(()=>{g?F(g).then(e=>{y(e.filter(e=>"TODO"===e.status||"IN_PROGRESS"===e.status||"IN_REVIEW"===e.status))}).catch(()=>I.toast.error(d("missions.error.launchFailed"))):y([])},[g,d]);let k=(0,s.useMemo)(()=>{let e=[];for(let t of h)for(let s of t.projects)for(let r of s.tasks)("TODO"===r.status||"IN_PROGRESS"===r.status||"IN_REVIEW"===r.status)&&e.push({task:r,workspaceName:t.name,projectName:s.alias??s.name});return e},[h]),j=(0,s.useMemo)(()=>new B.default(k,{keys:["task.title"],threshold:.4,distance:200}),[k]),A=(0,s.useMemo)(()=>{let e=b.trim();return e?j.search(e,{limit:30}).map(e=>e.item):[]},[j,b]),S=b.trim().length>0,N=h.find(e=>e.id===f),E=N?.projects??[];return(0,t.jsx)($.Dialog,{open:e,onOpenChange:i,children:(0,t.jsxs)($.DialogContent,{className:"sm:max-w-2xl max-h-[80vh]",children:[(0,t.jsx)($.DialogHeader,{children:(0,t.jsx)($.DialogTitle,{children:d("missions.fullPickerTitle")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(W.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(L.Input,{value:b,onChange:e=>C(e.target.value),placeholder:d("missions.fullPicker.searchPlaceholder"),className:"pl-8 pr-8 h-8"}),b&&(0,t.jsx)(c.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6",onClick:()=>C(""),"aria-label":d("missions.fullPicker.clearSearch"),children:(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"})})]}),!S&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(l.Select,{value:f,onValueChange:e=>{x(e??""),p("")},children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:h.find(e=>e.id===f)?.name??d("missions.launcher.selectWorkspace")})}),(0,t.jsx)(l.SelectContent,{children:h.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)(l.Select,{value:g,onValueChange:e=>p(e??""),disabled:!f,children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:E.find(e=>e.id===g)?.name??d("missions.launcher.selectProject")})}),(0,t.jsx)(l.SelectContent,{children:E.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.alias??e.name},e.id))})]})]})]}),(0,t.jsx)(H.ScrollArea,{className:"max-h-[60vh] -mx-2",children:S?0===A.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPicker.noSearchResults")}):A.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"px-3 pt-2 pb-0.5 text-[11px] text-muted-foreground",children:[e.workspaceName," · ",e.projectName]}),(0,t.jsx)(q,{task:e.task,isRunning:o.has(e.task.id),launchingId:u,onLaunchNew:n,onResume:a,t:d})]},e.task.id)):0===v.length&&g?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.launcher.noTasks")}):0===v.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPickerHint")}):v.map(e=>(0,t.jsx)(q,{task:e,isRunning:o.has(e.id),launchingId:u,onLaunchNew:n,onResume:a,t:d},e.id))})]})})}function J({open:e,onOpenChange:i,onLaunched:n,runningTaskIds:a=new Set,anchorRef:o}){let{t:l}=(0,r.useI18n)(),u=(0,s.useRef)(null),[d,h]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),[p,v]=(0,s.useState)(!1),[y,b]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{e&&(f(!0),_(5).then(h).catch(()=>I.toast.error(l("missions.error.launchFailed"))).finally(()=>f(!1)))},[e,l]);let C=(0,s.useMemo)(()=>d.filter(e=>e.projects.some(e=>e._count.tasks>0)),[d]),k=(0,s.useCallback)(e=>{b(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);(0,s.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){let t=e.target;if(u.current&&!u.current.contains(t)){if(o?.current&&o.current.contains(t))return;i(!1)}}},[e,i,o]);let j=(0,s.useCallback)(async e=>{try{g(e),await (0,R.startPtyExecution)(e,""),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),w=(0,s.useCallback)(async(e,t)=>{try{g(e),await (0,T.resumePtyExecution)(e,t),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),A=(0,s.useCallback)(()=>{i(!1),v(!0)},[i]);return e||p?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{ref:u,className:"absolute right-0 z-50 mt-1 grid max-h-[480px] w-[28rem] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-border",children:(0,t.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:l("missions.pickerTitle")})}),(0,t.jsx)(H.ScrollArea,{children:m?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===C.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:l("missions.noAvailableTasks")}):C.map(e=>{let s=y.has(e.id),r=e.projects.filter(e=>e._count.tasks>0);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",onClick:()=>k(e.id),className:"flex h-auto w-full justify-start gap-1.5 rounded-none border-b border-border/50 px-3 py-1.5 hover:bg-accent",children:[(0,t.jsx)(O.ChevronRight,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${s?"":"rotate-90"}`}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:e.name})]}),!s&&(0,t.jsx)("div",{className:"ml-[19px] mt-0.5 border-l border-border/50",children:r.map(e=>(0,t.jsxs)("div",{className:"py-0.5",children:[(0,t.jsx)("div",{className:"pl-3 pt-1.5 pb-1",children:(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:e.alias??e.name})}),(0,t.jsx)("div",{className:"pl-3",children:e.tasks.map(e=>(0,t.jsx)(q,{task:e,isRunning:a.has(e.id),launchingId:x,onLaunchNew:j,onResume:w,t:l},e.id))})]},e.id))})]},e.id)})}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsx)(c.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:A,children:l("missions.showMoreTasks")})})]}),(0,t.jsx)(G,{open:p,onOpenChange:v,onLaunchNew:j,onResume:w,runningTaskIds:a,launchingId:x})]}):null}e.s(["MissionsClient",0,function({initialExecutions:e}){let{t:i}=(0,r.useI18n)(),[d,m]=(0,s.useState)(e),[f,x]=(0,s.useState)(()=>localStorage.getItem("missions-grid-preset")??"3x2"),[y,b]=(0,s.useState)(()=>{try{let e=localStorage.getItem("missions-grid-custom");if(e){let t=JSON.parse(e);if("number"==typeof t?.cols&&"number"==typeof t?.rows)return{cols:Math.max(1,Math.min(10,t.cols)),rows:Math.max(1,Math.min(10,t.rows))}}}catch{}return{cols:2,rows:2}}),[C,k]=(0,s.useState)(!1),[j,w]=(0,s.useState)(""),A=(0,s.useRef)(null),[S,N]=(0,s.useState)(new Map),E=(0,s.useRef)(S);(0,s.useEffect)(()=>{E.current=S},[S]);let M=(0,s.useRef)(new Map),B=o.find(e=>e.id===f)??o[2],_="custom"===f?y.cols:B.cols,F="custom"===f?y.rows:B.rows,R=(0,s.useRef)(null),[T,L]=(0,s.useState)("480px");(0,s.useEffect)(()=>{let e=R.current;if(!e)return;let t=()=>{let t=(e.clientHeight-32-16*(F-1))/F;L(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[F]);let $=(0,s.useCallback)((e,t)=>{e&&(x(e),localStorage.setItem("missions-grid-preset",e),"custom"===e&&t&&(b(t),localStorage.setItem("missions-grid-custom",JSON.stringify(t))))},[]),O=(0,p.useSensors)((0,p.useSensor)(p.PointerSensor,{activationConstraint:{distance:8}})),P=(0,s.useCallback)(e=>{let{active:t,over:s}=e;s&&t.id!==s.id&&m(e=>{let r=e.findIndex(e=>e.executionId===t.id),i=e.findIndex(e=>e.executionId===s.id);return(0,v.arrayMove)(e,r,i)})},[]),z=(0,s.useCallback)((e,t)=>{if(E.current.has(e))return;N(s=>new Map([...s,[e,t]]));let s=setTimeout(()=>{m(t=>t.filter(t=>t.executionId!==e)),N(t=>{let s=new Map(t);return s.delete(e),s}),M.current.delete(e)},500);M.current.set(e,s)},[]);(0,s.useEffect)(()=>{let e=setInterval(async()=>{try{let e=await n();m(t=>{let s=E.current,{merged:r,goneIds:i}=function({prev:e,fresh:t,removingIds:s}){let r=new Set(t.map(e=>e.executionId)),i=[];e.forEach(e=>{r.has(e.executionId)||s.has(e.executionId)||i.push(e.executionId)});let n=e.filter(e=>r.has(e.executionId)||s.has(e.executionId)),a=new Set(e.map(e=>e.executionId));return{merged:[...n,...t.filter(e=>!a.has(e.executionId))],goneIds:i}}({prev:t,fresh:e,removingIds:new Set(s.keys())});return i.forEach(e=>z(e,"completed")),r})}catch{}},4e3);return()=>clearInterval(e)},[z]),(0,s.useEffect)(()=>{let e=M.current;return()=>{e.forEach(e=>clearTimeout(e))}},[]);let W=(0,s.useCallback)(async e=>{try{await (0,a.stopPtyExecution)(e),m(t=>{let s=t.find(t=>t.taskId===e);return s&&z(s.executionId,"stopped"),t})}catch{I.toast.error(i("missions.error.stopFailed"))}},[z,i]),H=(0,s.useCallback)((e,t)=>{m(t=>{let s=t.find(t=>t.taskId===e);return s&&z(s.executionId,"completed"),t})},[z]),V=(0,s.useCallback)(e=>{n().then(e=>{m(t=>{let s=new Set(t.map(e=>e.executionId));return[...t,...e.filter(e=>!s.has(e.executionId))]})}).catch(()=>{})},[]),U=Array.from(new Map(d.map(e=>[e.workspaceId,e.workspaceName])).entries()).map(([e,t])=>({id:e,name:t})),K=j?d.filter(e=>e.workspaceId===j):d,q=new Set(d.map(e=>e.taskId));return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,t.jsx)("h1",{className:"text-base font-semibold",children:i("missions.pageTitle")}),(0,t.jsxs)(l.Select,{value:j,onValueChange:e=>w(e??""),children:[(0,t.jsx)(l.SelectTrigger,{className:"w-36 h-8",children:(0,t.jsx)("span",{className:"truncate",children:j?U.find(e=>e.id===j)?.name??i("missions.filterAll"):i("missions.filterAll")})}),(0,t.jsxs)(l.SelectContent,{children:[(0,t.jsx)(l.SelectItem,{value:"",children:i("missions.filterAll")}),U.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(g,{value:f,customValue:y,onChange:$}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Button,{ref:A,onClick:()=>k(e=>!e),children:i("missions.launchTask")}),(0,t.jsx)(J,{open:C,onOpenChange:k,onLaunched:V,runningTaskIds:q,anchorRef:A})]})]}),(0,t.jsx)("div",{ref:R,className:"flex-1 overflow-auto min-h-0 p-4",children:0===K.length&&0===S.size?(0,t.jsx)(u.EmptyState,{icon:h,title:i("missions.emptyTitle"),description:i("missions.emptyDesc"),className:"h-full",action:(0,t.jsx)(c.Button,{onClick:()=>k(!0),children:i("missions.launchTask")})}):(0,t.jsx)(p.DndContext,{id:"missions-dnd",sensors:O,collisionDetection:p.closestCenter,onDragEnd:P,children:(0,t.jsx)(v.SortableContext,{items:K.map(e=>e.executionId),strategy:v.rectSortingStrategy,children:(0,t.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${_}, 1fr)`,gridAutoRows:T},children:K.map(e=>(0,t.jsx)(D,{execution:e,isRemoving:S.has(e.executionId),removeReason:S.get(e.executionId),onStop:W,onSessionEnd:H},e.executionId))})})})})]})}],449636)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,487976,e=>{"use strict";var r=e.i(289721),t=e.i(965652),n=e.i(946822),l=e.i(40448),a=e.i(821957),o=e.i(113217),c=e.i(461526);e.s(["PreviewLogTerminal",0,function({previewKey:e,taskId:i}){let{resolvedTheme:u}=(0,a.useTheme)(),s=(0,t.useRef)(null),d=(0,t.useRef)(null),f=(0,t.useRef)(null),m=(0,t.useRef)(null);return(0,t.useEffect)(()=>{if(!s.current)return;let r="light"!==u,t=new n.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:12,scrollback:5e3,cursorBlink:!1,disableStdin:!0,allowTransparency:!1,convertEol:!0,theme:r?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),a=new l.FitAddon;t.loadAddon(a),t.open(s.current);let w=s.current.querySelector(".xterm-helper-textarea");w&&(w.style.opacity="0"),d.current=t,m.current=a;try{a.fit()}catch{}let y=!1,g=null;(async()=>{let r=await (0,o.getActualWsPort)();if(y)return;let n=new URLSearchParams({taskId:c.PREVIEW_TASK_ID,role:"terminal",previewKey:e,connectionId:crypto.randomUUID(),clientTaskId:i});(g=new WebSocket(`ws://localhost:${r}/?${n.toString()}`)).binaryType="arraybuffer",f.current=g,g.onmessage=e=>{let r="string"==typeof e.data?e.data:new TextDecoder().decode(e.data);t.write(r)}})();let b=()=>{try{m.current?.fit()}catch{}};return window.addEventListener("resize",b),()=>{y=!0,window.removeEventListener("resize",b),f.current?.close(),f.current=null,d.current&&(d.current.dispose(),d.current=null),m.current=null}},[e,i,u]),(0,r.jsx)("div",{ref:s,className:"size-full bg-black"})}])},461834,e=>{e.n(e.i(487976))}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,487976,e=>{"use strict";var r=e.i(289721),t=e.i(965652),n=e.i(946822),l=e.i(40448),a=e.i(821957),o=e.i(949528),c=e.i(461526);e.s(["PreviewLogTerminal",0,function({previewKey:e,taskId:i}){let{resolvedTheme:u}=(0,a.useTheme)(),s=(0,t.useRef)(null),d=(0,t.useRef)(null),f=(0,t.useRef)(null),m=(0,t.useRef)(null);return(0,t.useEffect)(()=>{if(!s.current)return;let r="light"!==u,t=new n.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:12,scrollback:5e3,cursorBlink:!1,disableStdin:!0,allowTransparency:!1,convertEol:!0,theme:r?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),a=new l.FitAddon;t.loadAddon(a),t.open(s.current);let w=s.current.querySelector(".xterm-helper-textarea");w&&(w.style.opacity="0"),d.current=t,m.current=a;try{a.fit()}catch{}let y=!1,g=null;(async()=>{let r=await (0,o.getActualWsPort)();if(y)return;let n=new URLSearchParams({taskId:c.PREVIEW_TASK_ID,role:"terminal",previewKey:e,connectionId:crypto.randomUUID(),clientTaskId:i});(g=new WebSocket(`ws://localhost:${r}/?${n.toString()}`)).binaryType="arraybuffer",f.current=g,g.onmessage=e=>{let r="string"==typeof e.data?e.data:new TextDecoder().decode(e.data);t.write(r)}})();let b=()=>{try{m.current?.fit()}catch{}};return window.addEventListener("resize",b),()=>{y=!0,window.removeEventListener("resize",b),f.current?.close(),f.current=null,d.current&&(d.current.dispose(),d.current=null),m.current=null}},[e,i,u]),(0,r.jsx)("div",{ref:s,className:"size-full bg-black"})}])},461834,e=>{e.n(e.i(487976))}]);