tower-studio 0.2.20 → 0.2.22

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 (208) 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 +25 -25
  13. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +3 -2
  23. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +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 +63 -63
  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 +25 -25
  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/page/react-loadable-manifest.json +1 -1
  41. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +25 -25
  42. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  45. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +106 -82
  46. package/.next/standalone/.next/server/app/settings/page.js +2 -2
  47. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  50. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +84 -84
  51. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  54. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +78 -78
  55. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  58. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +57 -57
  59. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  62. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +59 -59
  63. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  66. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
  67. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +64 -64
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +72 -72
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
  79. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +12 -0
  82. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
  83. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +1 -1
  84. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +2 -2
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05~g1fm._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +2 -2
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_6swdz._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0hc9vir._.js +1 -1
  89. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iyp~.k._.js +10 -2
  90. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3iihg._.js +3 -0
  91. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ogh_qu._.js +10 -2
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0otyifi._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q.piu~._.js +10 -2
  94. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qdvear._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0umocfj._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xot7fu._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z-k6vg._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  100. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  101. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  102. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02-6df-._.js +3 -3
  103. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0th0_fo._.js → [root-of-the-server]__03e009u._.js} +4 -4
  104. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e_-mj-._.js +3 -3
  105. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fzkdjl._.js +3 -3
  106. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0f72pl_._.js → [root-of-the-server]__0i~v.f0._.js} +2 -2
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l1.bgv._.js +3 -0
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pu-v0l._.js +3 -3
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ty1ao1._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0um1ugs._.js +3 -3
  112. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.hrt0s._.js → [root-of-the-server]__0vrp4wc._.js} +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__08mkpqd._.js → [root-of-the-server]__0x2jop0._.js} +2 -2
  114. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_xv.._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vgkq5._.js +3 -3
  117. package/.next/standalone/.next/server/chunks/ssr/{_0es22_y._.js → _00xgezz._.js} +2 -2
  118. package/.next/standalone/.next/server/chunks/ssr/{_0z-mopi._.js → _01xe7~b._.js} +2 -2
  119. package/.next/standalone/.next/server/chunks/ssr/{_12e_1hd._.js → _02o-w3k._.js} +2 -2
  120. package/.next/standalone/.next/server/chunks/ssr/_0564air._.js +4 -0
  121. package/.next/standalone/.next/server/chunks/ssr/{_0rqf5w7._.js → _05xdaz3._.js} +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/_060_9cj._.js +3 -0
  123. package/.next/standalone/.next/server/chunks/ssr/{_0unw1fq._.js → _070t_mh._.js} +3 -3
  124. package/.next/standalone/.next/server/chunks/ssr/{_0-zk1xq._.js → _075_.cb._.js} +2 -2
  125. package/.next/standalone/.next/server/chunks/ssr/{_0_2c7e0._.js → _07ca~8h._.js} +2 -2
  126. package/.next/standalone/.next/server/chunks/ssr/{_10sx3n7._.js → _084ifnn._.js} +3 -3
  127. package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
  128. package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
  129. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  130. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/_0ncltnn._.js +3 -0
  132. package/.next/standalone/.next/server/chunks/ssr/{_0ln8vj0._.js → _0qq3k6g._.js} +3 -3
  133. package/.next/standalone/.next/server/chunks/ssr/_0r6gweb._.js +3 -3
  134. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  135. package/.next/standalone/.next/server/chunks/ssr/_0rt8jf_._.js +3 -3
  136. package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/_0uuzh5m._.js +3 -3
  138. package/.next/standalone/.next/server/chunks/ssr/{_0nzwk2y._.js → _0z58pqh._.js} +3 -3
  139. package/.next/standalone/.next/server/chunks/ssr/{_0mqxe~e._.js → _0zbuayb._.js} +2 -2
  140. package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
  141. package/.next/standalone/.next/server/chunks/ssr/{_07~q7qs._.js → _13dksil._.js} +2 -2
  142. package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.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/chunks/ssr/{src_lib_0153vha._.js → src_lib_0.aklj3._.js} +1 -1
  154. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  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 +302 -278
  158. package/.next/standalone/.next/static/chunks/{08q54xdtb58sp.js → 0.onfoo7t4w-m.js} +1 -1
  159. package/.next/standalone/.next/static/chunks/0132~w09sg8ej.js +1 -0
  160. package/.next/standalone/.next/static/chunks/015m584n.xxu~.js +1 -0
  161. package/.next/standalone/.next/static/chunks/{1157qwl1lq-uv.js → 01fk6.8bw14.7.js} +1 -1
  162. package/.next/standalone/.next/static/chunks/{0wzn4nbo56gf3.js → 01vvdks5yzk7x.js} +1 -1
  163. package/.next/standalone/.next/static/chunks/{15nh9t21_9u6i.js → 030g1-s.qdj2n.js} +1 -1
  164. package/.next/standalone/.next/static/chunks/{0bxz4rml4iaob.js → 07ucj-4sybtq9.js} +1 -1
  165. package/.next/standalone/.next/static/chunks/{0m90vde-l0h1a.js → 08vuh22p.47~b.js} +2 -2
  166. package/.next/standalone/.next/static/chunks/0_t-j983f5f0p.js +1 -0
  167. package/.next/standalone/.next/static/chunks/{0yje2relcvr6r.js → 0cn44krrztr-n.js} +1 -1
  168. package/.next/standalone/.next/static/chunks/{163o-5kdc6me5.js → 0feyhaj64gfd~.js} +1 -1
  169. package/.next/standalone/.next/static/chunks/0hf2igz3z1v.5.js +1 -0
  170. package/.next/standalone/.next/static/chunks/0htnxzje.8d3f.js +5 -0
  171. package/.next/standalone/.next/static/chunks/0lq9lfznfhl-6.js +1 -0
  172. package/.next/standalone/.next/static/chunks/0plqjpgas0ygu.js +1 -0
  173. package/.next/standalone/.next/static/chunks/0t92fwd6kv5j_.js +5 -0
  174. package/.next/standalone/.next/static/chunks/0tfc~d_oxesgk.js +5 -0
  175. package/.next/standalone/.next/static/chunks/{0mqdumoz_frlg.js → 0w1jry5z5w5~5.js} +1 -1
  176. package/.next/standalone/.next/static/chunks/0x3tiuoe.l18z.js +1 -0
  177. package/.next/standalone/.next/static/chunks/{11~-fm76bj3r4.js → 0y8ywrftfsnux.js} +1 -1
  178. package/.next/standalone/.next/static/chunks/11jg-t_iw_8i6.js +1 -0
  179. package/.next/standalone/.next/static/chunks/{0-93a_ovah-e0.js → 11x05y67gti4v.js} +1 -1
  180. package/.next/standalone/.next/static/chunks/11yv2zlsl_i7z.js +1 -0
  181. package/.next/standalone/.next/static/chunks/{0odb2p6e7-8n8.js → 13z_8s26xa~p1.js} +1 -1
  182. package/.next/standalone/.next/static/chunks/{0m2o51rtidmxh.js → 15.pdp8xgoni1.js} +1 -1
  183. package/.next/standalone/.next/static/chunks/15vogvewouq8e.js +1 -0
  184. package/.next/standalone/package.json +1 -1
  185. package/dist/mcp-server.cjs +19 -5
  186. package/package.json +1 -1
  187. package/skills/tower/SKILL.md +9 -0
  188. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3ggen._.js +0 -12
  189. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ntdmyn._.js +0 -3
  190. package/.next/standalone/.next/server/chunks/ssr/_09b8zgw._.js +0 -4
  191. package/.next/standalone/.next/server/chunks/ssr/_0fhds8v._.js +0 -3
  192. package/.next/standalone/.next/server/chunks/ssr/_0tua.9p._.js +0 -3
  193. package/.next/standalone/.next/static/chunks/0.rw..0v.8a1-.js +0 -5
  194. package/.next/standalone/.next/static/chunks/08rokhw7bg_zn.js +0 -1
  195. package/.next/standalone/.next/static/chunks/0gh2r0ji~m34y.js +0 -1
  196. package/.next/standalone/.next/static/chunks/0j157xr-bax~d.js +0 -1
  197. package/.next/standalone/.next/static/chunks/0t0.k0pugrmxt.js +0 -1
  198. package/.next/standalone/.next/static/chunks/0vykez3mijj6f.js +0 -1
  199. package/.next/standalone/.next/static/chunks/0xrhj92idqx72.js +0 -5
  200. package/.next/standalone/.next/static/chunks/0yj4qfp~pk5na.js +0 -1
  201. package/.next/standalone/.next/static/chunks/0zk-aoc.g8t8h.js +0 -1
  202. package/.next/standalone/.next/static/chunks/0~7zlta-boej_.js +0 -1
  203. package/.next/standalone/.next/static/chunks/13wlh1lxhudv~.js +0 -1
  204. package/.next/standalone/.next/static/chunks/16pnb9m-vqs75.js +0 -5
  205. package/.next/standalone/.next/static/chunks/18aqm8uawnpl3.js +0 -1
  206. /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → hA1HHDvQi_vSYi568JXho}/_buildManifest.js +0 -0
  207. /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → hA1HHDvQi_vSYi568JXho}/_clientMiddlewareManifest.js +0 -0
  208. /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → hA1HHDvQi_vSYi568JXho}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[163778,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(940271),f=a.i(699570),g=a.i(866718),h=a.i(487410),i=a.i(785259),j=a.i(43775),k=a.i(368114);function l({className:a,size:c="default",...d}){return(0,b.jsx)("div",{"data-slot":"card","data-size":c,className:(0,k.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...d})}function m({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,k.cn)("px-4 group-data-[size=sm]/card:px-3",a),...c})}var n=a.i(704494),o=a.i(668116),p=a.i(54384),q=a.i(648512),r=a.i(913284),s=a.i(468862),t=a.i(951192);function u({adapterType:a,adapterLabel:d,provider:e,hideHeader:g,onResult:h}){let[i,j]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null),{t:x}=(0,t.useI18n)();async function y(){if(!i){j(!0),w(null);try{let b=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:a,provider:e})}),c=await b.json();w(c),h?.(c)}catch{let a={ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]};w(a),h?.(a)}finally{j(!1)}}}return(0,b.jsxs)("div",{className:"space-y-4",children:[!g&&(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-emerald-100 dark:bg-emerald-900/30 p-2",children:(0,b.jsx)(q.Terminal,{className:"h-5 w-5 text-emerald-600 dark:text-emerald-400"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-semibold",children:x("settings.aiTools.cliVerification")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:x("settings.aiTools.cliVerificationDesc")})]})]}),(0,b.jsx)(l,{children:(0,b.jsxs)(m,{className:"p-6 space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{children:d&&(0,b.jsx)("p",{className:"font-medium",children:d})}),(0,b.jsx)(f.Button,{onClick:y,disabled:i,variant:"outline",children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),x("settings.aiTools.testing")]}):x("settings.aiTools.testConnection")})]}),v&&(0,b.jsxs)("div",{className:(0,k.cn)("rounded-lg border p-4 space-y-3",v.ok?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-red-50 border-red-200 dark:bg-red-950/20 dark:border-red-800"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[v.ok?(0,b.jsx)(r.CheckCircle2,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):(0,b.jsx)(s.XCircle,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,b.jsx)("span",{className:(0,k.cn)("text-sm font-medium",v.ok?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:x(v.ok?"settings.aiTools.testPassed":"settings.aiTools.testFailed")})]}),(0,b.jsx)("div",{className:"space-y-2",children:v.checks.map(c=>(0,b.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[c.passed?(0,b.jsx)(o.Check,{className:"h-4 w-4 text-green-500 mt-0.5 shrink-0"}):(0,b.jsx)(p.X,{className:"h-4 w-4 text-red-500 mt-0.5 shrink-0"}),(0,b.jsx)("span",{className:(0,k.cn)(c.passed?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:c.message})]},`${a}-${c.name}`))})]})]})})]})}var v=a.i(80021),w=a.i(711796);let x=(0,w.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var y=a.i(577565),z=a.i(264589),A=a.i(912868),B=a.i(10390),C=a.i(761052),D=a.i(86354);let E=(0,w.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),F=(0,w.default)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);var G=a.i(774881),H=a.i(975231),I=a.i(347165),J=a.i(963326),K=a.i(953093),L=a.i(43312),M=a.i(780410);let N=(0,M.createServerReference)("60b00fd1a41111aff9c016bac32cb1e325e8b4c33e",M.callServer,void 0,M.findSourceMapURL,"completeOnboarding"),O=(0,M.createServerReference)("605b0a1e06e441552e6787ecacf1ccacf98322be73",M.callServer,void 0,M.findSourceMapURL,"setOnboardingExtensions");function P({username:a,onComplete:d}){let{t:e}=(0,t.useI18n)(),g=(0,K.listExtensionMetadata)(),[h,i]=(0,c.useState)(()=>new Set(g.map(a=>a.id))),[j,k]=(0,c.useState)(!1),l=g.length,m=h.size;async function o(){k(!0);let b=Array.from(h),c=[];if(b.length>0)for(let a of(await Promise.all(b.map(async a=>{try{let b=await (0,L.installExtension)(a);return{id:a,success:b.success}}catch{return{id:a,success:!1}}}))))a.success&&c.push(a.id);await O(b,c),await N(a),k(!1),d()}return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h2",{className:"text-xl font-semibold",children:e("onboarding.step4.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:e("onboarding.step4.desc")})]}),(0,b.jsx)("div",{className:"space-y-2",children:g.map(a=>{let c=a.icon,d=h.has(a.id);return(0,b.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border border-border bg-background p-3 cursor-pointer hover:bg-accent/50 transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:d,onChange:()=>{var b;return b=a.id,void i(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},disabled:j,className:"mt-0.5 h-4 w-4 cursor-pointer accent-primary"}),(0,b.jsxs)("div",{className:"flex flex-1 items-start gap-3 min-w-0",children:[(0,b.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:(0,b.jsx)(c,{className:"h-4 w-4 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),(0,b.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["~",a.sizeMB," MB"]})]}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.description}),(0,b.jsxs)("a",{href:a.homepageUrl,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[(0,b.jsx)(J.ExternalLink,{className:"h-3 w-3"}),e("settings.extensions.visitHomepage")]})]})]})]},a.id)})}),m<l&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic",children:e("onboarding.step4.skipHint")}),(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsx)(f.Button,{onClick:o,disabled:j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),e("onboarding.step4.installing")]}):0===m?e("onboarding.step4.continueWithoutInstall"):e("onboarding.step4.continue")})})]})}function Q({step:a}){let c=[x,q.Terminal,y.GitBranch,z.Package][a-1]??x,d=["Profile","Connect","Configure","Extensions"][a-1]??"";return(0,b.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[(0,b.jsx)("div",{className:"absolute inset-0 opacity-[0.07] text-white",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{width:"380px",height:"380px",background:"radial-gradient(circle, oklch(0.80 0.14 75 / 0.25) 0%, oklch(0.80 0.14 75 / 0.08) 45%, transparent 70%)",animation:"ob-pulse 6s ease-in-out infinite"}}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/25",style:{width:"260px",height:"260px",animation:"ob-spin 20s linear infinite"},children:(0,b.jsx)("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 h-3 w-3 rounded-full bg-amber-400",style:{boxShadow:"0 0 16px oklch(0.80 0.14 75 / 0.7)"}})}),(0,b.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/15",style:{width:"380px",height:"380px",animation:"ob-spin 30s linear infinite reverse"},children:[(0,b.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 h-2 w-2 rounded-full bg-amber-400/70"}),(0,b.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 h-1.5 w-1.5 rounded-full bg-amber-400/50"})]}),(0,b.jsx)("svg",{className:"absolute",style:{top:"18%",right:"22%",animation:"ob-float 8s ease-in-out infinite"},width:"44",height:"50",viewBox:"0 0 40 46",fill:"none",children:(0,b.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.4)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.06)"})}),(0,b.jsx)("svg",{className:"absolute",style:{bottom:"22%",left:"18%",animation:"ob-float 10s ease-in-out 2s infinite"},width:"32",height:"36",viewBox:"0 0 40 46",fill:"none",children:(0,b.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.3)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.05)"})}),(0,b.jsx)("div",{className:"absolute h-3.5 w-3.5 rounded-full bg-amber-400/40",style:{top:"30%",left:"28%",animation:"ob-float 7s ease-in-out 1s infinite"}}),(0,b.jsx)("div",{className:"absolute h-2.5 w-2.5 rounded-full bg-amber-400/30",style:{top:"65%",right:"30%",animation:"ob-float 9s ease-in-out 3s infinite"}}),(0,b.jsx)("div",{className:"absolute h-2 w-2 rounded-full bg-amber-400/20",style:{top:"45%",right:"15%",animation:"ob-float 6s ease-in-out 0.5s infinite"}}),(0,b.jsxs)("svg",{className:"absolute inset-0 h-full w-full text-white opacity-[0.12]",children:[(0,b.jsx)("line",{x1:"30%",y1:"25%",x2:"70%",y2:"45%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 12s linear infinite"}}),(0,b.jsx)("line",{x1:"65%",y1:"30%",x2:"35%",y2:"70%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 15s linear infinite reverse"}})]}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,b.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-400/35 bg-amber-500/10 backdrop-blur-sm transition-all duration-700",style:{boxShadow:"0 0 50px oklch(0.80 0.14 75 / 0.2)"},children:(0,b.jsx)(c,{className:"h-7 w-7 text-amber-400"})})}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 translate-y-12 text-center",children:(0,b.jsx)("p",{className:"text-[11px] font-medium tracking-widest uppercase text-amber-400/60",children:d})})]})}let R={host:"",ownerMatch:"*",localPathTemplate:""};a.s(["default",0,function(){let a,k,l,m=(0,d.useRouter)(),{t:n,locale:p,setLocale:r}=(0,t.useI18n)(),{theme:s,setTheme:w}=(0,e.useTheme)(),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(1),[N,O]=(0,c.useState)(""),[S,T]=(0,c.useState)({}),U=Object.values(S).some(a=>a.ok),[V,W]=(0,c.useState)([]),[X,Y]=(0,c.useState)({...R}),[Z,$]=(0,c.useState)(!0),[_,aa]=(0,c.useState)(0),[ab,ac]=(0,c.useState)(!1),[ad,ae]=(0,c.useState)(!1);(0,c.useEffect)(()=>K(!0),[]);let af=[{value:"light",label:(0,b.jsx)(C.Sun,{className:"h-4 w-4"})},{value:"dark",label:(0,b.jsx)(D.Moon,{className:"h-4 w-4"})},{value:"system",label:(0,b.jsx)(E,{className:"h-4 w-4"})}];function ag(){M(a=>a+1)}function ah(){M(a=>Math.max(1,a-1))}let ai=[{icon:x,label:n("onboarding.step1.title")},{icon:q.Terminal,label:n("onboarding.step2.title")},{icon:y.GitBranch,label:n("onboarding.step3.title")},{icon:z.Package,label:n("onboarding.step4.title")}];return(0,b.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,b.jsx)("div",{className:"hidden xl:block xl:w-3/5 border-r border-border/50 bg-[oklch(0.13_0.006_260)]",children:(0,b.jsx)(Q,{step:L})}),(0,b.jsx)("div",{className:"flex w-full flex-col items-center px-8 pt-[10vh] pb-10 xl:w-2/5 xl:px-16 overflow-y-auto",children:(0,b.jsxs)("div",{className:"w-full max-w-lg space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-8 w-8 rounded-lg"}),(0,b.jsx)("span",{className:"text-lg font-semibold tracking-tight",children:"Tower"})]}),(0,b.jsx)("div",{className:"flex items-center gap-1.5",children:ai.map((a,c)=>{let d=c+1,e=d===L,f=d<L,g=a.icon;return(0,b.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[c>0&&(0,b.jsx)("div",{className:`h-px w-4 transition-colors duration-500 ${f?"bg-primary":"bg-border"}`}),(0,b.jsxs)("div",{className:`flex items-center gap-1 shrink-0 rounded-full px-2 py-1 text-[11px] font-medium whitespace-nowrap transition-all duration-500 ${e?"bg-primary text-primary-foreground shadow-sm":f?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:[f?(0,b.jsx)(o.Check,{className:"h-3 w-3 shrink-0"}):(0,b.jsx)(g,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{children:a.label})]})]},c)})})]}),(0,b.jsxs)("div",{children:[1===L&&(0,b.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:n("onboarding.step1.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n("onboarding.step1.desc")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"onboarding-username",className:"text-sm font-medium",children:n("onboarding.step1.usernameLabel")}),(0,b.jsx)("input",{id:"onboarding-username",type:"text",value:N,onChange:a=>O(a.target.value),placeholder:n("onboarding.step1.usernamePlaceholder"),className:"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",maxLength:64,autoFocus:!0,autoComplete:"username"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(F,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("label",{className:"text-sm font-medium",children:n("settings.language")})]}),(0,b.jsx)(h.SegmentedControl,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}].map(a=>({value:a.value,label:a.label})),value:p,onChange:a=>r(a)})]}),(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(C.Sun,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("label",{className:"text-sm font-medium",children:n("settings.theme")})]}),J?(0,b.jsx)(h.SegmentedControl,{options:af.map(a=>({value:a.value,label:a.label})),value:s??"system",onChange:a=>w(a)}):(0,b.jsx)("div",{className:"inline-flex h-8 rounded-md border border-border bg-muted p-1 gap-1 w-[120px]"})]})]}),(0,b.jsx)("div",{className:"flex justify-end pt-3",children:(0,b.jsxs)(f.Button,{onClick:ag,disabled:0===N.trim().length,className:"px-5",children:[n("onboarding.step1.next"),(0,b.jsx)(B.ChevronRight,{className:"h-4 w-4 ml-1"})]})})]}),2===L&&(0,b.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:n("onboarding.step2.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n("onboarding.step2.desc")})]}),(0,b.jsx)(u,{adapterType:"claude_code",adapterLabel:"Claude CLI",provider:"claude",onResult:a=>T(b=>({...b,claude:a}))}),(0,b.jsx)(u,{adapterType:"codex_cli",adapterLabel:"Codex CLI",provider:"codex",hideHeader:!0,onResult:a=>T(b=>({...b,codex:a}))}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,b.jsxs)(f.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ah,children:[(0,b.jsx)(A.ChevronLeft,{className:"h-4 w-4 mr-1"}),n("onboarding.back")]}),(0,b.jsxs)(f.Button,{onClick:ag,disabled:!U,className:"px-5",children:[n("onboarding.step1.next"),(0,b.jsx)(B.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),3===L&&(0,b.jsxs)("div",{className:"space-y-5 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:n("onboarding.step3.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n("onboarding.step3.desc")})]}),V.length>0&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:n("onboarding.step3.added").replace("{count}",String(V.length))}),V.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("p",{className:"text-sm font-medium truncate",children:[a.host,(0,b.jsx)("span",{className:"text-muted-foreground",children:"*"!==a.ownerMatch?` / ${a.ownerMatch}`:""})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:a.localPathTemplate})]}),(0,b.jsx)(f.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{var b;return b=a.id,void W(a=>a.filter(a=>a.id!==b))},children:(0,b.jsx)(H.Trash2,{className:"h-3.5 w-3.5"})})]},a.id))]}),Z?(0,b.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:n("onboarding.step3.hostLabel")}),(0,b.jsx)(g.Input,{value:X.host,onChange:a=>Y(b=>({...b,host:a.target.value})),placeholder:n("onboarding.step3.hostPlaceholder"),className:"h-9",autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:n("onboarding.step3.ownerLabel")}),(0,b.jsx)(g.Input,{value:X.ownerMatch,onChange:a=>Y(b=>({...b,ownerMatch:a.target.value})),placeholder:n("onboarding.step3.ownerPlaceholder"),className:"h-9"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:n("onboarding.step3.pathLabel")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.Input,{value:X.localPathTemplate,onChange:a=>Y(b=>({...b,localPathTemplate:a.target.value})),placeholder:n("onboarding.step3.pathPlaceholder"),className:"h-9 font-mono text-xs flex-1"}),(0,b.jsxs)(i.Tooltip,{children:[(0,b.jsx)(i.TooltipTrigger,{render:(0,b.jsx)(f.Button,{variant:ab?"default":"outline",size:"sm",type:"button",onClick:()=>{ac(a=>(a||aa(2),!a))},className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(i.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:n("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:n("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(i.Tooltip,{children:[(0,b.jsx)(i.TooltipTrigger,{render:(0,b.jsx)(f.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>ae(!0),children:(0,b.jsx)(I.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(i.TooltipContent,{children:n("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:n(ab?"onboarding.step3.pathHintFull":"onboarding.step3.pathHintRepo")})]}),X.localPathTemplate&&(a=X.localPathTemplate.trim().replace(/\/+$/,""),k=ab?`${a}/{path}`:a,l=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:n("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1 flex-wrap",children:l.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>aa(c),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${_===c?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a.label},c))}),(0,b.jsxs)("div",{className:"rounded-md bg-muted/50 px-3 py-2 space-y-1",children:[(0,b.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:l[_].url}),(0,b.jsxs)("p",{className:"font-mono text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,b.jsx)("span",{className:"text-primary",children:function(a,b){if(!a||!b)return"";let c=b.trim(),d=[],e=c.match(/^git@[^:]+:(.+)$/);if(e)d=e[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let a=new URL(c);d=decodeURIComponent(a.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!d.length)return"";let f=d[0],g=d[d.length-1],h=d.join("/");if(a.includes("{path}"))return a.replace("{path}",h).replace("{owner}",f).replace("{repo}",g).replace(/\/+$/,"");let i=a.replace("{owner}",f).replace("{repo}","").replace(/\/+$/,"");return`${i}/${g}`}(k,l[_].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[V.length>0&&(0,b.jsx)(f.Button,{variant:"ghost",onClick:()=>$(!1),children:n("settings.config.git.cancel")}),(0,b.jsxs)(f.Button,{onClick:function(){if(!X.host.trim()||!X.localPathTemplate.trim())return;let a=X.localPathTemplate.trim().replace(/\/+$/,""),b=ab?`${a}/{path}`:a,c={id:crypto.randomUUID(),host:X.host.trim(),ownerMatch:X.ownerMatch.trim()||"*",localPathTemplate:b,priority:V.length};W(a=>[...a,c]),Y({...R}),ac(!1),$(!1)},disabled:!X.host.trim()||!X.localPathTemplate.trim(),children:[(0,b.jsx)(o.Check,{className:"h-4 w-4 mr-1"}),n("settings.config.git.save")]})]})]}):(0,b.jsxs)(f.Button,{variant:"outline",onClick:()=>{Y({...R}),$(!0)},children:[(0,b.jsx)(G.Plus,{className:"h-4 w-4 mr-1"}),n("settings.config.git.addRule")]}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,b.jsxs)(f.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ah,children:[(0,b.jsx)(A.ChevronLeft,{className:"h-4 w-4 mr-1"}),n("onboarding.back")]}),(0,b.jsxs)(f.Button,{onClick:async()=>{V.length>0&&await (0,v.setConfigValue)("git.pathMappingRules",V),M(a=>a+1)},className:"px-5",children:[n("onboarding.step1.next"),(0,b.jsx)(B.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),4===L&&(0,b.jsx)(P,{username:N,onComplete:()=>m.replace("/workspaces")})]}),(0,b.jsx)("div",{className:"pt-6 text-xs text-muted-foreground",children:n("onboarding.stepIndicator").replace("{current}",String(L)).replace("{total}",String(4))})]})}),(0,b.jsx)(j.FolderBrowserDialog,{open:ad,onOpenChange:ae,onSelect:a=>{Y(b=>({...b,localPathTemplate:a})),ae(!1)}})]})}],163778)}];
1
+ module.exports=[163778,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(940271),f=a.i(699570),g=a.i(866718),h=a.i(487410),i=a.i(785259),j=a.i(43775),k=a.i(368114);function l({className:a,size:c="default",...d}){return(0,b.jsx)("div",{"data-slot":"card","data-size":c,className:(0,k.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...d})}function m({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,k.cn)("px-4 group-data-[size=sm]/card:px-3",a),...c})}var n=a.i(704494),o=a.i(668116),p=a.i(54384),q=a.i(648512),r=a.i(913284),s=a.i(468862),t=a.i(951192);function u({adapterType:a,adapterLabel:d,provider:e,hideHeader:g,onResult:h}){let[i,j]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null),{t:x}=(0,t.useI18n)();async function y(){if(!i){j(!0),w(null);try{let b=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:a,provider:e})}),c=await b.json();w(c),h?.(c)}catch{let a={ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]};w(a),h?.(a)}finally{j(!1)}}}return(0,b.jsxs)("div",{className:"space-y-4",children:[!g&&(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-emerald-100 dark:bg-emerald-900/30 p-2",children:(0,b.jsx)(q.Terminal,{className:"h-5 w-5 text-emerald-600 dark:text-emerald-400"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-semibold",children:x("settings.aiTools.cliVerification")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:x("settings.aiTools.cliVerificationDesc")})]})]}),(0,b.jsx)(l,{children:(0,b.jsxs)(m,{className:"p-6 space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{children:d&&(0,b.jsx)("p",{className:"font-medium",children:d})}),(0,b.jsx)(f.Button,{onClick:y,disabled:i,variant:"outline",children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),x("settings.aiTools.testing")]}):x("settings.aiTools.testConnection")})]}),v&&(0,b.jsxs)("div",{className:(0,k.cn)("rounded-lg border p-4 space-y-3",v.ok?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-red-50 border-red-200 dark:bg-red-950/20 dark:border-red-800"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[v.ok?(0,b.jsx)(r.CheckCircle2,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):(0,b.jsx)(s.XCircle,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,b.jsx)("span",{className:(0,k.cn)("text-sm font-medium",v.ok?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:x(v.ok?"settings.aiTools.testPassed":"settings.aiTools.testFailed")})]}),(0,b.jsx)("div",{className:"space-y-2",children:v.checks.map(c=>(0,b.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[c.passed?(0,b.jsx)(o.Check,{className:"h-4 w-4 text-green-500 mt-0.5 shrink-0"}):(0,b.jsx)(p.X,{className:"h-4 w-4 text-red-500 mt-0.5 shrink-0"}),(0,b.jsx)("span",{className:(0,k.cn)(c.passed?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:c.message})]},`${a}-${c.name}`))})]})]})})]})}var v=a.i(508148),w=a.i(711796);let x=(0,w.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var y=a.i(577565),z=a.i(264589),A=a.i(912868),B=a.i(10390),C=a.i(761052),D=a.i(86354);let E=(0,w.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),F=(0,w.default)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);var G=a.i(774881),H=a.i(975231),I=a.i(347165),J=a.i(963326),K=a.i(953093),L=a.i(151428),M=a.i(780410);let N=(0,M.createServerReference)("605e2c3aa9bf23773f9c79d656f9d03df60c72f810",M.callServer,void 0,M.findSourceMapURL,"completeOnboarding"),O=(0,M.createServerReference)("603f6f60799a0a18691635b3bf0cd53e0706b73d37",M.callServer,void 0,M.findSourceMapURL,"setOnboardingExtensions");function P({username:a,onComplete:d}){let{t:e}=(0,t.useI18n)(),g=(0,K.listExtensionMetadata)(),[h,i]=(0,c.useState)(()=>new Set(g.map(a=>a.id))),[j,k]=(0,c.useState)(!1),l=g.length,m=h.size;async function o(){k(!0);let b=Array.from(h),c=[];if(b.length>0)for(let a of(await Promise.all(b.map(async a=>{try{let b=await (0,L.installExtension)(a);return{id:a,success:b.success}}catch{return{id:a,success:!1}}}))))a.success&&c.push(a.id);await O(b,c),await N(a),k(!1),d()}return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h2",{className:"text-xl font-semibold",children:e("onboarding.step4.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:e("onboarding.step4.desc")})]}),(0,b.jsx)("div",{className:"space-y-2",children:g.map(a=>{let c=a.icon,d=h.has(a.id);return(0,b.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border border-border bg-background p-3 cursor-pointer hover:bg-accent/50 transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:d,onChange:()=>{var b;return b=a.id,void i(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},disabled:j,className:"mt-0.5 h-4 w-4 cursor-pointer accent-primary"}),(0,b.jsxs)("div",{className:"flex flex-1 items-start gap-3 min-w-0",children:[(0,b.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:(0,b.jsx)(c,{className:"h-4 w-4 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.name}),(0,b.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["~",a.sizeMB," MB"]})]}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.description}),(0,b.jsxs)("a",{href:a.homepageUrl,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[(0,b.jsx)(J.ExternalLink,{className:"h-3 w-3"}),e("settings.extensions.visitHomepage")]})]})]})]},a.id)})}),m<l&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground italic",children:e("onboarding.step4.skipHint")}),(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsx)(f.Button,{onClick:o,disabled:j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),e("onboarding.step4.installing")]}):0===m?e("onboarding.step4.continueWithoutInstall"):e("onboarding.step4.continue")})})]})}function Q({step:a}){let c=[x,q.Terminal,y.GitBranch,z.Package][a-1]??x,d=["Profile","Connect","Configure","Extensions"][a-1]??"";return(0,b.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[(0,b.jsx)("div",{className:"absolute inset-0 opacity-[0.07] text-white",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{width:"380px",height:"380px",background:"radial-gradient(circle, oklch(0.80 0.14 75 / 0.25) 0%, oklch(0.80 0.14 75 / 0.08) 45%, transparent 70%)",animation:"ob-pulse 6s ease-in-out infinite"}}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/25",style:{width:"260px",height:"260px",animation:"ob-spin 20s linear infinite"},children:(0,b.jsx)("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 h-3 w-3 rounded-full bg-amber-400",style:{boxShadow:"0 0 16px oklch(0.80 0.14 75 / 0.7)"}})}),(0,b.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/15",style:{width:"380px",height:"380px",animation:"ob-spin 30s linear infinite reverse"},children:[(0,b.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 h-2 w-2 rounded-full bg-amber-400/70"}),(0,b.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 h-1.5 w-1.5 rounded-full bg-amber-400/50"})]}),(0,b.jsx)("svg",{className:"absolute",style:{top:"18%",right:"22%",animation:"ob-float 8s ease-in-out infinite"},width:"44",height:"50",viewBox:"0 0 40 46",fill:"none",children:(0,b.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.4)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.06)"})}),(0,b.jsx)("svg",{className:"absolute",style:{bottom:"22%",left:"18%",animation:"ob-float 10s ease-in-out 2s infinite"},width:"32",height:"36",viewBox:"0 0 40 46",fill:"none",children:(0,b.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.3)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.05)"})}),(0,b.jsx)("div",{className:"absolute h-3.5 w-3.5 rounded-full bg-amber-400/40",style:{top:"30%",left:"28%",animation:"ob-float 7s ease-in-out 1s infinite"}}),(0,b.jsx)("div",{className:"absolute h-2.5 w-2.5 rounded-full bg-amber-400/30",style:{top:"65%",right:"30%",animation:"ob-float 9s ease-in-out 3s infinite"}}),(0,b.jsx)("div",{className:"absolute h-2 w-2 rounded-full bg-amber-400/20",style:{top:"45%",right:"15%",animation:"ob-float 6s ease-in-out 0.5s infinite"}}),(0,b.jsxs)("svg",{className:"absolute inset-0 h-full w-full text-white opacity-[0.12]",children:[(0,b.jsx)("line",{x1:"30%",y1:"25%",x2:"70%",y2:"45%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 12s linear infinite"}}),(0,b.jsx)("line",{x1:"65%",y1:"30%",x2:"35%",y2:"70%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 15s linear infinite reverse"}})]}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,b.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-400/35 bg-amber-500/10 backdrop-blur-sm transition-all duration-700",style:{boxShadow:"0 0 50px oklch(0.80 0.14 75 / 0.2)"},children:(0,b.jsx)(c,{className:"h-7 w-7 text-amber-400"})})}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 translate-y-12 text-center",children:(0,b.jsx)("p",{className:"text-[11px] font-medium tracking-widest uppercase text-amber-400/60",children:d})})]})}let R={host:"",ownerMatch:"*",localPathTemplate:""};a.s(["default",0,function(){let a,k,l,m=(0,d.useRouter)(),{t:n,locale:p,setLocale:r}=(0,t.useI18n)(),{theme:s,setTheme:w}=(0,e.useTheme)(),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(1),[N,O]=(0,c.useState)(""),[S,T]=(0,c.useState)({}),U=Object.values(S).some(a=>a.ok),[V,W]=(0,c.useState)([]),[X,Y]=(0,c.useState)({...R}),[Z,$]=(0,c.useState)(!0),[_,aa]=(0,c.useState)(0),[ab,ac]=(0,c.useState)(!1),[ad,ae]=(0,c.useState)(!1);(0,c.useEffect)(()=>K(!0),[]);let af=[{value:"light",label:(0,b.jsx)(C.Sun,{className:"h-4 w-4"})},{value:"dark",label:(0,b.jsx)(D.Moon,{className:"h-4 w-4"})},{value:"system",label:(0,b.jsx)(E,{className:"h-4 w-4"})}];function ag(){M(a=>a+1)}function ah(){M(a=>Math.max(1,a-1))}let ai=[{icon:x,label:n("onboarding.step1.title")},{icon:q.Terminal,label:n("onboarding.step2.title")},{icon:y.GitBranch,label:n("onboarding.step3.title")},{icon:z.Package,label:n("onboarding.step4.title")}];return(0,b.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,b.jsx)("div",{className:"hidden xl:block xl:w-3/5 border-r border-border/50 bg-[oklch(0.13_0.006_260)]",children:(0,b.jsx)(Q,{step:L})}),(0,b.jsx)("div",{className:"flex w-full flex-col items-center px-8 pt-[10vh] pb-10 xl:w-2/5 xl:px-16 overflow-y-auto",children:(0,b.jsxs)("div",{className:"w-full max-w-lg space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-8 w-8 rounded-lg"}),(0,b.jsx)("span",{className:"text-lg font-semibold tracking-tight",children:"Tower"})]}),(0,b.jsx)("div",{className:"flex items-center gap-1.5",children:ai.map((a,c)=>{let d=c+1,e=d===L,f=d<L,g=a.icon;return(0,b.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[c>0&&(0,b.jsx)("div",{className:`h-px w-4 transition-colors duration-500 ${f?"bg-primary":"bg-border"}`}),(0,b.jsxs)("div",{className:`flex items-center gap-1 shrink-0 rounded-full px-2 py-1 text-[11px] font-medium whitespace-nowrap transition-all duration-500 ${e?"bg-primary text-primary-foreground shadow-sm":f?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:[f?(0,b.jsx)(o.Check,{className:"h-3 w-3 shrink-0"}):(0,b.jsx)(g,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{children:a.label})]})]},c)})})]}),(0,b.jsxs)("div",{children:[1===L&&(0,b.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:n("onboarding.step1.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n("onboarding.step1.desc")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"onboarding-username",className:"text-sm font-medium",children:n("onboarding.step1.usernameLabel")}),(0,b.jsx)("input",{id:"onboarding-username",type:"text",value:N,onChange:a=>O(a.target.value),placeholder:n("onboarding.step1.usernamePlaceholder"),className:"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",maxLength:64,autoFocus:!0,autoComplete:"username"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(F,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("label",{className:"text-sm font-medium",children:n("settings.language")})]}),(0,b.jsx)(h.SegmentedControl,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}].map(a=>({value:a.value,label:a.label})),value:p,onChange:a=>r(a)})]}),(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(C.Sun,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("label",{className:"text-sm font-medium",children:n("settings.theme")})]}),J?(0,b.jsx)(h.SegmentedControl,{options:af.map(a=>({value:a.value,label:a.label})),value:s??"system",onChange:a=>w(a)}):(0,b.jsx)("div",{className:"inline-flex h-8 rounded-md border border-border bg-muted p-1 gap-1 w-[120px]"})]})]}),(0,b.jsx)("div",{className:"flex justify-end pt-3",children:(0,b.jsxs)(f.Button,{onClick:ag,disabled:0===N.trim().length,className:"px-5",children:[n("onboarding.step1.next"),(0,b.jsx)(B.ChevronRight,{className:"h-4 w-4 ml-1"})]})})]}),2===L&&(0,b.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:n("onboarding.step2.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n("onboarding.step2.desc")})]}),(0,b.jsx)(u,{adapterType:"claude_code",adapterLabel:"Claude CLI",provider:"claude",onResult:a=>T(b=>({...b,claude:a}))}),(0,b.jsx)(u,{adapterType:"codex_cli",adapterLabel:"Codex CLI",provider:"codex",hideHeader:!0,onResult:a=>T(b=>({...b,codex:a}))}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,b.jsxs)(f.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ah,children:[(0,b.jsx)(A.ChevronLeft,{className:"h-4 w-4 mr-1"}),n("onboarding.back")]}),(0,b.jsxs)(f.Button,{onClick:ag,disabled:!U,className:"px-5",children:[n("onboarding.step1.next"),(0,b.jsx)(B.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),3===L&&(0,b.jsxs)("div",{className:"space-y-5 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:n("onboarding.step3.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:n("onboarding.step3.desc")})]}),V.length>0&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:n("onboarding.step3.added").replace("{count}",String(V.length))}),V.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("p",{className:"text-sm font-medium truncate",children:[a.host,(0,b.jsx)("span",{className:"text-muted-foreground",children:"*"!==a.ownerMatch?` / ${a.ownerMatch}`:""})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:a.localPathTemplate})]}),(0,b.jsx)(f.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{var b;return b=a.id,void W(a=>a.filter(a=>a.id!==b))},children:(0,b.jsx)(H.Trash2,{className:"h-3.5 w-3.5"})})]},a.id))]}),Z?(0,b.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:n("onboarding.step3.hostLabel")}),(0,b.jsx)(g.Input,{value:X.host,onChange:a=>Y(b=>({...b,host:a.target.value})),placeholder:n("onboarding.step3.hostPlaceholder"),className:"h-9",autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:n("onboarding.step3.ownerLabel")}),(0,b.jsx)(g.Input,{value:X.ownerMatch,onChange:a=>Y(b=>({...b,ownerMatch:a.target.value})),placeholder:n("onboarding.step3.ownerPlaceholder"),className:"h-9"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:n("onboarding.step3.pathLabel")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.Input,{value:X.localPathTemplate,onChange:a=>Y(b=>({...b,localPathTemplate:a.target.value})),placeholder:n("onboarding.step3.pathPlaceholder"),className:"h-9 font-mono text-xs flex-1"}),(0,b.jsxs)(i.Tooltip,{children:[(0,b.jsx)(i.TooltipTrigger,{render:(0,b.jsx)(f.Button,{variant:ab?"default":"outline",size:"sm",type:"button",onClick:()=>{ac(a=>(a||aa(2),!a))},className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(i.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:n("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:n("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(i.Tooltip,{children:[(0,b.jsx)(i.TooltipTrigger,{render:(0,b.jsx)(f.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>ae(!0),children:(0,b.jsx)(I.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(i.TooltipContent,{children:n("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:n(ab?"onboarding.step3.pathHintFull":"onboarding.step3.pathHintRepo")})]}),X.localPathTemplate&&(a=X.localPathTemplate.trim().replace(/\/+$/,""),k=ab?`${a}/{path}`:a,l=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:n("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1 flex-wrap",children:l.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>aa(c),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${_===c?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a.label},c))}),(0,b.jsxs)("div",{className:"rounded-md bg-muted/50 px-3 py-2 space-y-1",children:[(0,b.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:l[_].url}),(0,b.jsxs)("p",{className:"font-mono text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,b.jsx)("span",{className:"text-primary",children:function(a,b){if(!a||!b)return"";let c=b.trim(),d=[],e=c.match(/^git@[^:]+:(.+)$/);if(e)d=e[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let a=new URL(c);d=decodeURIComponent(a.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!d.length)return"";let f=d[0],g=d[d.length-1],h=d.join("/");if(a.includes("{path}"))return a.replace("{path}",h).replace("{owner}",f).replace("{repo}",g).replace(/\/+$/,"");let i=a.replace("{owner}",f).replace("{repo}","").replace(/\/+$/,"");return`${i}/${g}`}(k,l[_].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[V.length>0&&(0,b.jsx)(f.Button,{variant:"ghost",onClick:()=>$(!1),children:n("settings.config.git.cancel")}),(0,b.jsxs)(f.Button,{onClick:function(){if(!X.host.trim()||!X.localPathTemplate.trim())return;let a=X.localPathTemplate.trim().replace(/\/+$/,""),b=ab?`${a}/{path}`:a,c={id:crypto.randomUUID(),host:X.host.trim(),ownerMatch:X.ownerMatch.trim()||"*",localPathTemplate:b,priority:V.length};W(a=>[...a,c]),Y({...R}),ac(!1),$(!1)},disabled:!X.host.trim()||!X.localPathTemplate.trim(),children:[(0,b.jsx)(o.Check,{className:"h-4 w-4 mr-1"}),n("settings.config.git.save")]})]})]}):(0,b.jsxs)(f.Button,{variant:"outline",onClick:()=>{Y({...R}),$(!0)},children:[(0,b.jsx)(G.Plus,{className:"h-4 w-4 mr-1"}),n("settings.config.git.addRule")]}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,b.jsxs)(f.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ah,children:[(0,b.jsx)(A.ChevronLeft,{className:"h-4 w-4 mr-1"}),n("onboarding.back")]}),(0,b.jsxs)(f.Button,{onClick:async()=>{V.length>0&&await (0,v.setConfigValue)("git.pathMappingRules",V),M(a=>a+1)},className:"px-5",children:[n("onboarding.step1.next"),(0,b.jsx)(B.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),4===L&&(0,b.jsx)(P,{username:N,onComplete:()=>m.replace("/workspaces")})]}),(0,b.jsx)("div",{className:"pt-6 text-xs text-muted-foreground",children:n("onboarding.stepIndicator").replace("{current}",String(L)).replace("{total}",String(4))})]})}),(0,b.jsx)(j.FolderBrowserDialog,{open:ad,onOpenChange:ae,onSelect:a=>{Y(b=>({...b,localPathTemplate:a})),ae(!1)}})]})}],163778)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_onboarding_page_tsx_0xf7hpz._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[520788,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(940271),f=a.i(951192),g=a.i(699570),h=a.i(866718),i=a.i(429246),j=a.i(412783),k=a.i(786304),l=a.i(563658),m=a.i(814574),n=a.i(368114),o=a.i(369289),p=a.i(711796);let q=(0,p.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var r=a.i(350739);let s=(0,p.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var t=a.i(190076),u=a.i(705594),v=a.i(264589),w=a.i(54384),x=a.i(774881);let y=(0,p.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var z=a.i(975231);let A=(0,p.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),B=(0,p.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var C=a.i(704494),D=a.i(913284),E=a.i(468862),F=a.i(347165),G=a.i(437492),H=a.i(80021),I=a.i(184225),J=a.i(780410);let K=(0,J.createServerReference)("0056a99e938944c1198771d0e2d03d609b3fdf07a2",J.callServer,void 0,J.findSourceMapURL,"getAvailableTerminalApps"),L=(0,J.createServerReference)("00d7c2f747caf5370fa4e7e44ae99e1a7b5a279aa5",J.callServer,void 0,J.findSourceMapURL,"getAvailableEditors");var M=a.i(830416);let N=(0,J.createServerReference)("4016f1dc25a049d5ade3b609ccaf04bfdbb8b31a1d",J.callServer,void 0,J.findSourceMapURL,"createPrompt"),O=(0,J.createServerReference)("60b98ec46f3095c886c3ccd64010c4e5eaae5b89d8",J.callServer,void 0,J.findSourceMapURL,"updatePrompt"),P=(0,J.createServerReference)("402153581acf02571d760b6288d83af534084e0077",J.callServer,void 0,J.findSourceMapURL,"deletePrompt"),Q=(0,J.createServerReference)("60655a9ec4649c0d75dab6dc5c221b481d56e96b65",J.callServer,void 0,J.findSourceMapURL,"setDefaultPrompt"),R=(0,J.createServerReference)("00336c87b1156a0801c4b87ed5f6b2dc8e3ff8b1d7",J.callServer,void 0,J.findSourceMapURL,"getAvailableProviders");var S=a.i(785259),T=a.i(43775);let U=(0,p.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var V=a.i(324954);let W=(0,p.default)("folder-up",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var X=a.i(747798),Y=a.i(811344),Z=a.i(607219),$=a.i(952313);let _=(0,J.createServerReference)("40e96faa29525e08bcabee8590c0e7042f53da7012",J.callServer,void 0,J.findSourceMapURL,"createBackup"),aa=(0,J.createServerReference)("00acba62a624c05997de7ec8e08d6c718c7cbb7642",J.callServer,void 0,J.findSourceMapURL,"listBackupFiles"),ab=(0,J.createServerReference)("40d03483d6a503fa9a56e4b23e8e40de15f117b298",J.callServer,void 0,J.findSourceMapURL,"deleteBackupFile"),ac=(0,J.createServerReference)("404f64ce587650b45a8deaa98086da4c4bd9d9674f",J.callServer,void 0,J.findSourceMapURL,"restoreBackup"),ad=(0,J.createServerReference)("405a158b6a556e511c433b5042a876d4b3ac86d12f",J.callServer,void 0,J.findSourceMapURL,"resetSystem"),ae=(0,J.createServerReference)("00168a0ef05cb549067000d00cecc0e2a292dce749",J.callServer,void 0,J.findSourceMapURL,"getBackupDir"),af=(0,J.createServerReference)("40bd943f77d69aeecaa198176c5c38cf8eb6bd48e8",J.callServer,void 0,J.findSourceMapURL,"setBackupDir");function ag(){let{t:a,locale:e}=(0,f.useI18n)(),i=(0,d.useRouter)(),[j,k]=(0,c.useState)([]),[l,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(!0),[s,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(""),y=(0,c.useRef)(null),[A,B]=(0,c.useState)(!1),[D,E]=(0,c.useState)(""),F=(0,c.useCallback)(async()=>{r(!0);try{let[a,b]=await Promise.all([aa(),ae()]);k(a),n(b)}finally{r(!1)}},[]);(0,c.useEffect)(()=>{F()},[F]);let G=async()=>{let b=w.trim()||void 0;v(!1),x(""),t("create");try{await _(b),$.toast.success(a("settings.backup.createSuccess")),await F()}catch{$.toast.error(a("settings.backup.createError"))}finally{t(null)}},H=async b=>{if(confirm(a("settings.backup.restoreConfirm"))){t("restore");try{await ac(b),$.toast.success(a("settings.backup.restoreSuccess"),{action:{label:a("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await F()}catch{$.toast.error(a("settings.backup.restoreError"))}finally{t(null)}}},I=async b=>{if(confirm(a("settings.backup.deleteConfirm")))try{await ab(b),$.toast.success(a("settings.backup.deleteSuccess")),k(a=>a.filter(a=>a.filename!==b))}catch{$.toast.error(a("settings.backup.deleteError"))}},J=async b=>{p(!1);try{await af(b),n(b),$.toast.success(a("settings.backup.dirSaved")),await F()}catch{$.toast.error(a("settings.backup.dirError"))}},K=async b=>{let c=b.target.files?.[0];if(c){b.target.value="",t("import");try{let b=new FormData;b.append("file",c);let d=await fetch("/api/internal/backup/import",{method:"POST",body:b});if(!d.ok){let b=await d.json();$.toast.error("Invalid backup archive"===b.error?a("settings.backup.importInvalid"):(b.error,a("settings.backup.importError")));return}$.toast.success(a("settings.backup.importSuccess")),await F()}catch{$.toast.error(a("settings.backup.importError"))}finally{t(null)}}},L=async()=>{if("RESET"===D){B(!1),E(""),t("reset");try{await ad("RESET"),$.toast.success(a("settings.backup.resetSuccess")),i.push("/")}catch{$.toast.error(a("settings.backup.resetError"))}finally{t(null)}}},M=null!==s;return(0,b.jsxs)("div",{className:"space-y-6",children:[("restore"===s||"reset"===s)&&(0,b.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,b.jsx)(C.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===s?a("settings.backup.restoring"):a("settings.backup.resetting")})]})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-base font-semibold",children:a("settings.backup.sectionTitle")}),(0,b.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{children:[a("settings.backup.dir"),":"]}),(0,b.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:l}),(0,b.jsx)(g.Button,{variant:"ghost",onClick:()=>p(!0),className:"text-xs text-muted-foreground",children:a("settings.backup.dirChange")})]}),(0,b.jsx)(T.FolderBrowserDialog,{open:o,onOpenChange:p,onSelect:J})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.Button,{onClick:()=>{x(""),v(!0)},disabled:M,className:"gap-2",children:"create"===s?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-4 w-4 animate-spin"})," ",a("settings.backup.creating")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(U,{className:"h-4 w-4"})," ",a("settings.backup.create")]})}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsxs)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",disabled:M,onClick:()=>y.current?.click(),className:"gap-2"}),children:[(0,b.jsx)(W,{className:"h-4 w-4"}),a("settings.backup.import")]}),(0,b.jsx)(S.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.importHint")})]}),(0,b.jsx)("input",{ref:y,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:K})]}),(0,b.jsx)(m.Dialog,{open:u,onOpenChange:v,children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:a("settings.backup.create")})}),(0,b.jsxs)("div",{className:"py-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.backup.createLabel")}),(0,b.jsx)(h.Input,{value:w,onChange:a=>x(a.target.value),onKeyDown:a=>"Enter"===a.key&&G(),placeholder:a("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>v(!1),children:a("common.cancel")}),(0,b.jsx)(g.Button,{onClick:G,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:a("settings.backup.create")})]})]})}),q?(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(C.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===j.length?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,b.jsx)(Z.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("settings.backup.empty")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a("settings.backup.emptyDesc")})]}):(0,b.jsx)("div",{className:"space-y-3",children:j.map(c=>{var d,f;return(0,b.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[c.label?(0,b.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:c.label}):(0,b.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:c.filename}),c.autoBackup&&(0,b.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:a("settings.backup.autoLabel")})]}),c.label&&(0,b.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:c.filename}),(0,b.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(d=c.size)<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:`${(d/1048576).toFixed(1)} MB`," · ",(f=c.createdAt,new Date(f).toLocaleString("zh"===e?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),c.preview.length>0&&(0,b.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[c.preview.map((a,c)=>(0,b.jsxs)("span",{children:[c>0&&" ",a.workspace,"(",a.projects.join(", "),")"]},c)),c.stats.workspaces>c.preview.length&&(0,b.jsxs)("span",{children:[" ",a("settings.backup.workspaces",{count:String(c.stats.workspaces)})]})]}),(0,b.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[a("settings.backup.projects",{count:String(c.stats.projects)})," · ",a("settings.backup.tasks",{count:String(c.stats.tasks)})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>H(c.filename),disabled:M,className:"text-muted-foreground hover:text-foreground"}),children:(0,b.jsx)(V.Upload,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(S.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.restore")})]}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>I(c.filename),disabled:M,className:"text-muted-foreground hover:text-rose-400"}),children:(0,b.jsx)(z.Trash2,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(S.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.delete")})]})]})]})},c.filename)})}),(0,b.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,b.jsx)(Y.AlertTriangle,{className:"h-4 w-4"}),a("settings.backup.dangerZone")]}),(0,b.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:a("settings.backup.resetDesc")}),(0,b.jsxs)(g.Button,{variant:"outline",onClick:()=>{E(""),B(!0)},disabled:M,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,b.jsx)(X.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),a("settings.backup.reset")]})]}),(0,b.jsx)(m.Dialog,{open:A,onOpenChange:B,children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:a("settings.backup.resetConfirmTitle")}),(0,b.jsx)(m.DialogDescription,{children:a("settings.backup.resetConfirmDesc")})]}),(0,b.jsxs)("div",{className:"py-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.backup.resetConfirmInput")}),(0,b.jsx)(h.Input,{value:D,onChange:a=>E(a.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>B(!1),children:a("common.cancel")}),(0,b.jsx)(g.Button,{disabled:"RESET"!==D,onClick:L,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:a("settings.backup.reset")})]})]})})]})}var ah=a.i(953093),ai=a.i(668116);let aj=(0,p.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ak=a.i(22761),al=a.i(963326),am=a.i(192369),an=a.i(599209),ao=a.i(627141);let ap=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function aq({cmd:a}){let{t:d}=(0,f.useI18n)(),[e,h]=(0,c.useState)(!1),i=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(a);else{let b=document.createElement("textarea");b.value=a,document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b)}h(!0),$.toast.success(d("common.copied")),setTimeout(()=>h(!1),1500)}catch{$.toast.error(d("common.copyFailed"))}};return(0,b.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-background/60 pl-2 pr-1 py-1 ring-1 ring-border/60",children:[(0,b.jsx)("code",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-relaxed",children:a}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d("common.copy"),onClick:i,children:e?(0,b.jsx)(ai.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(ak.Copy,{className:"h-3 w-3"})})]})}function ar({extension:a}){let{t:d}=(0,f.useI18n)(),{status:e,loading:h,isInstalling:i,install:j,uninstall:k,refresh:l}=(0,ao.useExtension)(a.id),[m,n]=(0,c.useState)(!1),o=a.icon,p=e.installed,q=async()=>{let b=await j();b.success?$.toast.success(d("settings.extensions.installSuccess").replace("{name}",a.name)):$.toast.error(d("settings.extensions.installFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},r=async()=>{let b=await k();b.success?$.toast.success(d("settings.extensions.uninstallSuccess").replace("{name}",a.name)):$.toast.error(d("settings.extensions.uninstallFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},s=async()=>{n(!0);try{await l()}finally{n(!1)}},t=()=>{window.open(a.homepageUrl,"_blank","noopener,noreferrer")};return(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,b.jsx)(o,{className:"h-5 w-5 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:a.name}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.description})]})]}),(0,b.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",a.sizeMB," MB"]})]}),(0,b.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:d("common.loading")})]}):p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,b.jsxs)("span",{className:"text-foreground",children:[d("settings.extensions.installed"),e.version?` v${e.version}`:""]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aj,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:d("settings.extensions.notInstalledShort")})]})}),(0,b.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Button,{variant:"default",onClick:q,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.reinstalling")]}):d("settings.extensions.reinstall")}),(0,b.jsx)(g.Button,{variant:"outline",onClick:r,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.uninstalling")]}):d("settings.extensions.uninstall")})]}):a.manualInstall?(0,b.jsxs)(an.Popover,{children:[(0,b.jsx)(an.PopoverTrigger,{render:a=>(0,b.jsxs)(g.Button,{variant:"default",...a,children:[(0,b.jsx)(U,{className:"h-3.5 w-3.5"}),d("settings.extensions.installViaHomepage")]})}),(0,b.jsxs)(an.PopoverContent,{align:"start",className:"w-80 max-w-[90vw] gap-2 text-xs leading-relaxed",children:[(0,b.jsx)("p",{children:d("settings.extensions.manualInstallHintIntro")}),(0,b.jsx)("div",{className:"space-y-2",children:ap.map(({os:a,cmd:c})=>(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:a}),(0,b.jsx)(aq,{cmd:c})]},a))}),(0,b.jsx)("p",{className:"text-muted-foreground",children:d("settings.extensions.manualInstallHintAfter")}),(0,b.jsxs)("button",{type:"button",onClick:t,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,b.jsx)(al.ExternalLink,{className:"h-3 w-3"}),d("settings.extensions.visitHomepage")]})]})]}):(0,b.jsx)(g.Button,{variant:"default",onClick:q,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.installing")]}):d("settings.extensions.install")}),(0,b.jsxs)(g.Button,{variant:"ghost",onClick:s,disabled:m,children:[(0,b.jsx)(am.RefreshCw,{className:`h-3.5 w-3.5 ${m?"animate-spin":""}`}),d("settings.extensions.recheck")]}),(0,b.jsxs)(g.Button,{variant:"ghost",onClick:t,children:[(0,b.jsx)(al.ExternalLink,{className:"h-3.5 w-3.5"}),d("settings.extensions.visitHomepage")]})]})]})}function as(){let{t:a}=(0,f.useI18n)(),c=(0,ah.listExtensionMetadata)();return(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("header",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:a("settings.extensions.title")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.extensions.desc")})]}),(0,b.jsx)("div",{className:"space-y-3",children:c.map(a=>(0,b.jsx)(ar,{extension:a},a.id))})]})}function at({options:a,value:c,onChange:d}){return(0,b.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:a.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>d(a.value),className:(0,n.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",c===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value))})}function au({label:a,description:c,children:d,className:e}){return(0,b.jsxs)("div",{className:(0,n.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",e),children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:a}),c&&(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:c})]}),(0,b.jsx)("div",{className:"shrink-0",children:d})]})}let av=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:o.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:q,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:r.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:s,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:v.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:t.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:u.HardDrive,accent:"cyan"}],aw={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},ax="ai-manager:default-cli-adapter",ay={host:"",ownerMatch:"*",localPathTemplate:"",priority:0};function az(){let a=(0,d.useRouter)(),{t:o}=(0,f.useI18n)(),{theme:p,setTheme:q}=(0,e.useTheme)(),{locale:r,setLocale:s}=(0,f.useI18n)(),[t,u]=(0,c.useState)("general"),v=(0,c.useRef)(null),[J,U]=(0,c.useState)({left:0,width:0}),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)("Terminal"),[Z,$]=(0,c.useState)([]),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)([]),[ad,ae]=(0,c.useState)([]),[af,ah]=(0,c.useState)("claude"),[ai,aj]=(0,c.useState)(null),[ak,al]=(0,c.useState)({}),[am,an]=(0,c.useState)([]),[ao,ap]=(0,c.useState)(!1),[aq,ar]=(0,c.useState)(null),[az,aA]=(0,c.useState)(null),[aB,aC]=(0,c.useState)(""),[aD,aE]=(0,c.useState)(""),[aF,aG]=(0,c.useState)(""),[aH,aI]=(0,c.useState)([]),[aJ,aK]=(0,c.useState)(null),[aL,aM]=(0,c.useState)({...ay}),[aN,aO]=(0,c.useState)(!1),[aP,aQ]=(0,c.useState)({...ay}),[aR,aS]=(0,c.useState)(!1),[aT,aU]=(0,c.useState)(!1),[aV,aW]=(0,c.useState)(0),[aX,aY]=(0,c.useState)(null),[aZ,a$]=(0,c.useState)(null),[a_,a0]=(0,c.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[a1,a2]=(0,c.useState)({timeoutSec:30}),[a3,a4]=(0,c.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[a5,a6]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[a7,a8]=(0,c.useState)(null),[a9,ba]=(0,c.useState)(!1),[bb,bc]=(0,c.useState)(""),[bd,be]=(0,c.useState)(!0);(0,c.useEffect)(()=>W(!0),[]),(0,c.useEffect)(()=>{(0,G.getConfigValue)("terminal.app","Terminal").then(Y),K().then($),(0,G.getConfigValue)("editor.command","").then(aa),L().then(ac)},[]),(0,c.useEffect)(()=>{if(0===Z.length||!X||Z.some(a=>a.value===X))return;let a=Z.find(a=>a.name===X);a&&(Y(a.value),(0,H.setConfigValue)("terminal.app",a.value))},[Z,X]),(0,c.useEffect)(()=>{if(0===ab.length||!_||ab.some(a=>a.command===_))return;let a=ab.find(a=>a.name===_);a&&(aa(a.command),(0,H.setConfigValue)("editor.command",a.command))},[ab,_]),(0,c.useEffect)(()=>{R().then(ae);let a=localStorage.getItem(ax);a&&ah(a)},[]),(0,c.useEffect)(()=>{(0,M.getPrompts)().then(an)},[]);let bf=async()=>{try{let a=await fetch("/api/internal/hooks/install");if(a.ok){let b=await a.json();a8(b)}}catch{}};async function bg(a){if(!ai){aj(a),al(b=>{let c={...b};return delete c[a],c});try{let b=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:a})}),c=await b.json();al(b=>({...b,[a]:c}))}catch{al(b=>({...b,[a]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{aj(null)}}}(0,c.useEffect)(()=>{(0,G.getConfigValue)("git.pathMappingRules",[]).then(a=>{let b=new Set,c=!1,d=a.map(a=>{if(!a.id||b.has(a.id)){c=!0;let d={...a,id:crypto.randomUUID()};return b.add(d.id),d}return b.add(a.id),a});aI(d),c&&(0,H.setConfigValue)("git.pathMappingRules",d)}),(0,G.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(a=>{bc(a.join(", "))}),bf(),(0,I.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","task.defaultUseWorktree","task.defaultAutoStart","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(a=>{let b=a["system.maxUploadBytes"]??0x3200000,c=a["system.maxReadableFileBytes"]??5242880;a0({maxUploadMb:Math.round(b/1024/1024),maxConcurrent:a["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(c/1024/1024),taskDefaultUseWorktree:"boolean"!=typeof a["task.defaultUseWorktree"]||a["task.defaultUseWorktree"],taskDefaultAutoStart:"boolean"==typeof a["task.defaultAutoStart"]&&a["task.defaultAutoStart"]}),a2({timeoutSec:a["git.timeoutSec"]??30}),a4({resultLimit:a["search.resultLimit"]??20,allModeCap:a["search.allModeCap"]??5,debounceMs:a["search.debounceMs"]??250,snippetLength:a["search.snippetLength"]??80,codeTimeoutSec:a["search.codeTimeoutSec"]??30}),a6({minCols:a["missions.grid.minCols"]??1,maxCols:a["missions.grid.maxCols"]??5,minRows:a["missions.grid.minRows"]??1,maxRows:a["missions.grid.maxRows"]??5})})},[]),(0,c.useEffect)(()=>{(0,G.getConfigValue)("notification.enabled",!0).then(be)},[]);let bh=(0,c.useCallback)(()=>{ar(null),aC(""),aE(""),aG(""),ap(!0)},[]),bi=(0,c.useCallback)(a=>{ar(a),aC(a.name),aE(a.description??""),aG(a.content),ap(!0)},[]),bj=(0,c.useCallback)(async()=>{aB.trim()&&aF.trim()&&(aq?await O(aq.id,{name:aB.trim(),description:aD.trim()||void 0,content:aF.trim()}):await N({name:aB.trim(),description:aD.trim()||void 0,content:aF.trim()}),ap(!1),an(await (0,M.getPrompts)()),a.refresh())},[aB,aD,aF,aq,a]),bk=(0,c.useCallback)(async()=>{az&&(await P(az),aA(null),an(await (0,M.getPrompts)()),a.refresh())},[az,a]),bl=(0,c.useCallback)(async b=>{await Q(b),an(await (0,M.getPrompts)()),a.refresh()},[a]),bm=async()=>{await (0,H.setConfigValue)("system.maxUploadBytes",1024*a_.maxUploadMb*1024),await (0,H.setConfigValue)("system.maxConcurrentExecutions",a_.maxConcurrent),await (0,H.setConfigValue)("system.maxReadableFileBytes",1024*a_.maxReadableMb*1024)},bn=async()=>{await (0,H.setConfigValue)("task.defaultUseWorktree",a_.taskDefaultUseWorktree),await (0,H.setConfigValue)("task.defaultAutoStart",a_.taskDefaultAutoStart),await (0,H.setConfigValue)("task.mcpDefaultsConfigured",!0)},bo=async()=>{await (0,H.setConfigValue)("git.timeoutSec",a1.timeoutSec)},bp=async()=>{await (0,H.setConfigValue)("search.resultLimit",a3.resultLimit),await (0,H.setConfigValue)("search.allModeCap",a3.allModeCap),await (0,H.setConfigValue)("search.debounceMs",a3.debounceMs),await (0,H.setConfigValue)("search.snippetLength",a3.snippetLength),await (0,H.setConfigValue)("search.codeTimeoutSec",a3.codeTimeoutSec)},bq=async()=>{let a=Math.min(a5.minCols,a5.maxCols),b=Math.max(a5.minCols,a5.maxCols),c=Math.min(a5.minRows,a5.maxRows),d=Math.max(a5.minRows,a5.maxRows);a6({minCols:a,maxCols:b,minRows:c,maxRows:d}),await (0,H.setConfigValue)("missions.grid.minCols",a),await (0,H.setConfigValue)("missions.grid.maxCols",b),await (0,H.setConfigValue)("missions.grid.minRows",c),await (0,H.setConfigValue)("missions.grid.maxRows",d)},br=async()=>{let a=bb.split(",").map(a=>a.trim()).filter(Boolean);await (0,H.setConfigValue)("hooks.autoUploadTypes",a)},bs=async()=>{if(a7){ba(!0);try{let a=a7.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:a}),await bf()}finally{ba(!1)}}},bt=async()=>{if(!aP.host.trim()||!aP.localPathTemplate.trim())return;let a=aP.localPathTemplate.trim().replace(/\/+$/,""),b=aR?`${a}/{path}`:a,c=[...aH,{id:crypto.randomUUID(),host:aP.host.trim(),ownerMatch:aP.ownerMatch.trim()||"*",localPathTemplate:b,priority:aP.priority}];await (0,H.setConfigValue)("git.pathMappingRules",c),aI(c),aQ({...ay}),aS(!1),aO(!1)},bu=async a=>{if(!aL.host.trim()||!aL.localPathTemplate.trim())return;let b=aL.localPathTemplate.trim().replace(/\/+$/,""),c=aT?`${b}/{path}`:b,d=aH.map(b=>b.id===a?{...b,host:aL.host.trim(),ownerMatch:aL.ownerMatch.trim()||"*",localPathTemplate:c,priority:aL.priority}:b);await (0,H.setConfigValue)("git.pathMappingRules",d),aI(d),aK(null),aU(!1)},bv=async a=>{let b=aH.filter(b=>b.id!==a);await (0,H.setConfigValue)("git.pathMappingRules",b),aI(b),aY(null)};async function bw(){let a=!bd;be(a),await (0,H.setConfigValue)("notification.enabled",a)}let bx=(0,c.useCallback)(()=>{a.back()},[a]);(0,c.useEffect)(()=>{let a=v.current;if(!a)return;let b=a.querySelector(`[data-section="${t}"]`);if(!b)return;let c=a.getBoundingClientRect(),d=b.getBoundingClientRect();U({left:d.left-c.left,width:d.width})},[t]);let by=av.find(a=>a.id===t),bz=by?aw[by.accent]:aw.blue;return(0,b.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,b.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,b.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:o("settings.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:o("settings.configDesc")})]}),(0,b.jsxs)(g.Button,{variant:"outline",onClick:bx,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,b.jsx)(w.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,b.jsxs)("div",{ref:v,className:"relative flex gap-1 overflow-x-auto",children:[av.map(a=>{let c=a.icon,d=t===a.id,e=aw[a.accent];return(0,b.jsxs)("button",{"data-section":a.id,onClick:()=>u(a.id),className:(0,n.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",d?`${e.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,b.jsx)("span",{className:(0,n.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",d?e.bg:"bg-transparent"),children:(0,b.jsx)(c,{className:"h-3.5 w-3.5"})}),(0,b.jsx)("span",{children:o(a.labelKey)})]},a.id)}),(0,b.jsx)("div",{className:(0,n.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",bz.indicator),style:{left:J.left,width:J.width}})]})]})}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:(0,b.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[by&&(0,b.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,b.jsx)("div",{className:(0,n.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",bz.bg,bz.text,bz.ring),children:(0,b.jsx)(by.icon,{className:"h-5 w-5"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:o(by.labelKey)}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:o(by.descKey)})]})]}),(0,b.jsx)("div",{className:"mb-6 border-t"}),function(){switch(t){case"general":let a;return a=[{value:"light",label:o("settings.themeLight")},{value:"dark",label:o("settings.themeDark")},{value:"system",label:o("settings.themeSystem")}],(0,b.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,b.jsx)(au,{label:o("settings.theme"),description:o("settings.themeDesc"),children:V?(0,b.jsx)(at,{options:a,value:p??"system",onChange:a=>q(a)}):(0,b.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,b.jsx)(au,{label:o("settings.language"),description:o("settings.languageDesc"),children:(0,b.jsx)(at,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:r,onChange:a=>s(a)})}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.terminal.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.terminal.desc")})]}),Z.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:Z.map(a=>{let c=X===a.value,d=(0,n.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",a.installed?c?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),e=()=>{a.installed&&(Y(a.value),(0,H.setConfigValue)("terminal.app",a.value))};return a.installed?(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name},a.value):(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(S.TooltipContent,{side:"top",children:o("settings.app.notInstalled")})]},a.value)})})]}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.editor.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.editor.desc")})]}),ab.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ab.map(a=>{let c=_===a.command,d=(0,n.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",a.installed?c?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),e=()=>{a.installed&&(aa(a.command),(0,H.setConfigValue)("editor.command",a.command))};return a.installed?(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name},a.command):(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(S.TooltipContent,{side:"top",children:o("settings.app.notInstalled")})]},a.command)})})]})]});case"ai-tools":return(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ad.map(a=>{let c=af===a.name,d=ai===a.name,e=ak[a.name];return(0,b.jsx)("li",{children:(0,b.jsxs)("div",{className:"px-5 py-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium",children:a.displayName}),(0,b.jsx)(k.Badge,{variant:"outline",children:o("label.builtin")}),c&&(0,b.jsxs)(k.Badge,{variant:"secondary",className:"shrink-0",children:[(0,b.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),o("settings.prompts.default")]}),e&&(0,b.jsx)(k.Badge,{variant:e.ok?"secondary":"destructive",className:(0,n.cn)("shrink-0",e.ok&&"bg-green-600 text-white hover:bg-green-700"),children:e.ok?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.CheckCircle2,{className:"h-3 w-3 mr-1"}),o("settings.aiTools.testPassed")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(E.XCircle,{className:"h-3 w-3 mr-1"}),o("settings.aiTools.testFailed")]})})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.cli.available&&a.cli.version?`${a.name} \xb7 ${a.cli.version}`:a.name})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!c&&(0,b.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:()=>{var b;ah(b=a.name),localStorage.setItem(ax,b)},children:[(0,b.jsx)(y,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),o("settings.prompts.setDefault")]}),(0,b.jsx)(g.Button,{variant:"outline",size:"sm",onClick:()=>bg(a.name),disabled:d,children:d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),o("settings.aiTools.testing")]}):o("settings.aiTools.testConnection")})]})]}),e&&(0,b.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,b.jsx)("div",{className:"space-y-1.5",children:e.checks.map(c=>(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)("span",{className:(0,n.cn)("w-1.5 h-1.5 rounded-full shrink-0",c.passed?"bg-green-500":"bg-red-500")}),(0,b.jsx)("span",{className:(0,n.cn)(c.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:c.message})]},`${a.name}-${c.name}`))})})]})},a.name)})});case"prompts":return V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(g.Button,{onClick:bh,variant:"default",children:[(0,b.jsx)(x.Plus,{className:"h-4 w-4 mr-2"}),o("settings.prompts.newPrompt")]})}),0===am.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,b.jsx)("p",{className:"text-muted-foreground",children:o("settings.prompts.empty")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:o("settings.prompts.emptyHint")})]}):(0,b.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:am.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h4",{className:"text-sm font-medium truncate",children:a.name}),a.isDefault&&(0,b.jsxs)(k.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,b.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),o("settings.prompts.default")]})]}),a.description&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:a.description})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bl(a.id),title:o("settings.prompts.setDefault"),children:(0,b.jsx)(y,{className:(0,n.cn)("h-4 w-4",a.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bi(a),title:o("settings.prompts.editPrompt"),children:(0,b.jsx)(A,{className:"h-4 w-4"})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>aA(a.id),className:"text-destructive",title:o("settings.prompts.delete"),children:(0,b.jsx)(z.Trash2,{className:"h-4 w-4"})})]})]},a.id))}),(0,b.jsx)(m.Dialog,{open:ao,onOpenChange:ap,children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:aq?o("settings.prompts.editPrompt"):o("settings.prompts.newPrompt")}),(0,b.jsx)(m.DialogDescription,{children:aq?o("settings.prompts.editPrompt"):o("settings.prompts.newPrompt")})]}),(0,b.jsxs)("div",{className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-name",children:o("settings.prompts.promptName")}),(0,b.jsx)(h.Input,{id:"prompt-name",value:aB,onChange:a=>aC(a.target.value),placeholder:o("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-description",children:o("settings.prompts.promptDescription")}),(0,b.jsx)(h.Input,{id:"prompt-description",value:aD,onChange:a=>aE(a.target.value),placeholder:o("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-content",children:o("settings.prompts.promptContent")}),(0,b.jsx)(i.Textarea,{id:"prompt-content",value:aF,onChange:a=>aG(a.target.value),placeholder:o("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>ap(!1),children:o("settings.prompts.cancel")}),(0,b.jsx)(g.Button,{onClick:bj,disabled:!aB.trim()||!aF.trim(),children:o("settings.prompts.save")})]})]})}),(0,b.jsx)(m.Dialog,{open:!!az,onOpenChange:a=>!a&&aA(null),children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:o("settings.prompts.deleteConfirmTitle")}),(0,b.jsx)(m.DialogDescription,{children:o("settings.prompts.deleteConfirmMessage")})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>aA(null),children:o("settings.prompts.cancel")}),(0,b.jsx)(g.Button,{variant:"destructive",onClick:bk,children:o("settings.prompts.delete")})]})]})})]}):(0,b.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let c,d,e;return(0,b.jsxs)("div",{className:"space-y-8",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.git.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.git.desc")})]}),(0,b.jsxs)(g.Button,{onClick:()=>{aQ({...ay}),aO(!0)},children:[(0,b.jsx)(x.Plus,{className:"mr-2 h-4 w-4"}),o("settings.config.git.addRule")]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[0!==aH.length||aN?(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:aH.map(a=>aJ===a.id?(0,b.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.host")}),(0,b.jsx)(h.Input,{value:aL.host,onChange:a=>aM(b=>({...b,host:a.target.value})),placeholder:o("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.ownerMatch")}),(0,b.jsx)(h.Input,{value:aL.ownerMatch,onChange:a=>aM(b=>({...b,ownerMatch:a.target.value})),placeholder:o("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,b.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{value:aL.localPathTemplate,onChange:a=>aM(b=>({...b,localPathTemplate:a.target.value})),placeholder:o("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:aT?"default":"outline",size:"sm",type:"button",onClick:()=>aU(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(S.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:o("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:o("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>a$("edit"),children:(0,b.jsx)(F.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(S.TooltipContent,{children:o("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:aT?o("onboarding.step3.pathHintFull"):o("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.priority")}),(0,b.jsx)(h.Input,{type:"number",value:aL.priority,onChange:a=>aM(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"sm",onClick:()=>{aK(null),aU(!1)},children:o("settings.config.git.cancel")}),(0,b.jsx)(g.Button,{size:"sm",onClick:()=>bu(a.id),children:o("settings.config.git.save")})]})]},a.id):(0,b.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium text-sm",children:a.host}),"*"!==a.ownerMatch&&(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",a.ownerMatch]}),(0,b.jsxs)(k.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[o("settings.config.git.priority")," ",a.priority]})]}),(0,b.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:a.localPathTemplate})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let b,c,d;return b=a.localPathTemplate,d=(c=/\/\{path\}\/?$/.test(b))?b.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):b,void(aK(a.id),aM({host:a.host,ownerMatch:a.ownerMatch,localPathTemplate:d,priority:a.priority}),aU(c))},title:o("settings.config.git.edit"),children:(0,b.jsx)(A,{className:"h-4 w-4"})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>aY(a.id),className:"text-destructive",title:o("settings.config.git.delete"),children:(0,b.jsx)(z.Trash2,{className:"h-4 w-4"})})]})]})},a.id))}):(0,b.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:o("settings.config.git.noRules")})}),aN&&(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:o("settings.config.git.host")}),(0,b.jsx)(h.Input,{value:aP.host,onChange:a=>aQ(b=>({...b,host:a.target.value})),placeholder:o("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:o("settings.config.git.ownerMatch")}),(0,b.jsx)(h.Input,{value:aP.ownerMatch,onChange:a=>aQ(b=>({...b,ownerMatch:a.target.value})),placeholder:o("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:o("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{value:aP.localPathTemplate,onChange:a=>aQ(b=>({...b,localPathTemplate:a.target.value})),placeholder:o("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:aR?"default":"outline",size:"sm",type:"button",onClick:()=>aS(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(S.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:o("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:o("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>a$("add"),children:(0,b.jsx)(F.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(S.TooltipContent,{children:o("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:aR?o("onboarding.step3.pathHintFull"):o("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:o("settings.config.git.priority")}),(0,b.jsx)(h.Input,{type:"number",value:aP.priority,onChange:a=>aQ(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]}),aP.localPathTemplate&&(c=aP.localPathTemplate.trim().replace(/\/+$/,""),d=aR?`${c}/{path}`:c,e=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,b.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:o("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1",children:e.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>aW(c),className:(0,n.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",aV===c?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:a.label},c))})]}),(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:e[aV].url}),(0,b.jsxs)("p",{className:"font-mono text-sm",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,b.jsx)("span",{className:"text-foreground font-medium",children:function(a,b){if(!a||!b)return"";let c=b.trim(),d=[],e=c.match(/^git@[^:]+:(.+)$/);if(e)d=e[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let a=new URL(c);d=decodeURIComponent(a.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!d.length)return"";let f=d[0],g=d[d.length-1],h=d.join("/");if(a.includes("{path}"))return a.replace("{path}",h).replace("{owner}",f).replace("{repo}",g).replace(/\/+$/,"");let i=a.replace("{owner}",f).replace("{repo}","").replace(/\/+$/,"");return`${i}/${g}`}(d,e[aV].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"sm",onClick:()=>aO(!1),children:o("settings.config.git.cancel")}),(0,b.jsxs)(g.Button,{size:"sm",onClick:bt,disabled:!aP.host.trim()||!aP.localPathTemplate.trim(),children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 mr-1.5"}),o("settings.config.git.save")]})]})]})]})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.system.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.system.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxUpload")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxUploadHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:500,value:a_.maxUploadMb,onChange:a=>a0(b=>({...b,maxUploadMb:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxConcurrent")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxConcurrentHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a_.maxConcurrent,onChange:a=>a0(b=>({...b,maxConcurrent:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxReadable")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxReadableHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:50,value:a_.maxReadableMb,onChange:a=>a0(b=>({...b,maxReadableMb:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]})]}),(0,b.jsx)(g.Button,{onClick:bm,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.task.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.task.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.taskDefaultWorktree")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.taskDefaultWorktreeHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>a0(a=>({...a,taskDefaultUseWorktree:!a.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a_.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a_.taskDefaultUseWorktree?o("task.worktreeYes"):o("task.worktreeNo")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.taskDefaultAutoStart")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.taskDefaultAutoStartHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>a0(a=>({...a,taskDefaultAutoStart:!a.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a_.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a_.taskDefaultAutoStart?o("task.autoStartYes"):o("task.autoStartNo")})]})]}),(0,b.jsx)(g.Button,{onClick:bn,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.gitParams.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.gitParams.desc")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.gitParams.timeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.gitParams.timeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:5,max:300,value:a1.timeoutSec,onChange:a=>a2(b=>({...b,timeoutSec:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,b.jsx)(g.Button,{onClick:bo,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.search.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.search.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.resultLimit")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.resultLimitHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:5,max:100,value:a3.resultLimit,onChange:a=>a4(b=>({...b,resultLimit:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.allModeCap")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.allModeCapHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:1,max:20,value:a3.allModeCap,onChange:a=>a4(b=>({...b,allModeCap:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.debounceMs")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.debounceMsHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:50,max:1e3,value:a3.debounceMs,onChange:a=>a4(b=>({...b,debounceMs:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.snippetLength")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.snippetLengthHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:20,max:500,value:a3.snippetLength,onChange:a=>a4(b=>({...b,snippetLength:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.codeTimeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.codeTimeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:5,max:300,step:5,value:a3.codeTimeoutSec,onChange:a=>a4(b=>({...b,codeTimeoutSec:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,b.jsx)(g.Button,{onClick:bp,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.missions.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.missions.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.minCols")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.minCols,onChange:a=>a6(b=>({...b,minCols:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.maxCols")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.maxCols,onChange:a=>a6(b=>({...b,maxCols:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.minRows")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.minRows,onChange:a=>a6(b=>({...b,minRows:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.maxRows")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.maxRows,onChange:a=>a6(b=>({...b,maxRows:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,b.jsx)(g.Button,{onClick:bq,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.hooks.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.hooks.desc")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.hooks.autoUploadTypes")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.hooks.autoUploadTypesHint")})]}),(0,b.jsx)(h.Input,{value:bb,onChange:a=>bc(a.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsx)(g.Button,{onClick:br,className:"rounded-lg",children:o("common.save")}),(0,b.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:a7?.installed?o("settings.config.hooks.installed"):o("settings.config.hooks.notInstalled")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.hooks.installHint")})]}),(0,b.jsx)(g.Button,{variant:a7?.installed?"destructive":"default",onClick:bs,disabled:a9||!a7,className:"rounded-lg",children:a7?.installed?o("settings.config.hooks.uninstall"):o("settings.config.hooks.install")})]})]}),(0,b.jsx)(m.Dialog,{open:!!aX,onOpenChange:a=>!a&&aY(null),children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:o("settings.config.git.deleteConfirm")}),(0,b.jsx)(m.DialogDescription,{children:o("settings.config.git.deleteConfirmMessage")})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>aY(null),children:o("settings.config.git.cancel")}),(0,b.jsx)(g.Button,{variant:"destructive",onClick:()=>aX&&bv(aX),children:o("settings.config.git.delete")})]})]})})]});case"notifications":return(0,b.jsx)("div",{className:"divide-y divide-border/50",children:(0,b.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.notifications.enable")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.notifications.enableDesc")})]}),(0,b.jsx)(l.Switch,{checked:bd,onCheckedChange:bw})]})});case"backup":return(0,b.jsx)(ag,{});case"extensions":return(0,b.jsx)(as,{})}}()]})}),(0,b.jsx)(T.FolderBrowserDialog,{open:null!==aZ,onOpenChange:a=>{a||a$(null)},onSelect:a=>{"add"===aZ?aQ(b=>({...b,localPathTemplate:a})):"edit"===aZ&&aM(b=>({...b,localPathTemplate:a})),a$(null)}})]})}a.s(["default",0,function(){return(0,b.jsx)(az,{})}],520788)}];
1
+ module.exports=[520788,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(940271),f=a.i(951192),g=a.i(699570),h=a.i(866718),i=a.i(429246),j=a.i(412783),k=a.i(786304),l=a.i(563658),m=a.i(814574),n=a.i(368114),o=a.i(369289),p=a.i(711796);let q=(0,p.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var r=a.i(350739);let s=(0,p.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var t=a.i(190076),u=a.i(705594),v=a.i(264589),w=a.i(54384),x=a.i(774881);let y=(0,p.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var z=a.i(975231);let A=(0,p.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),B=(0,p.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var C=a.i(704494),D=a.i(913284),E=a.i(468862),F=a.i(347165),G=a.i(162044),H=a.i(508148),I=a.i(890249),J=a.i(780410);let K=(0,J.createServerReference)("008d598d25243d91f5b24ca0785511aa9206b0ce25",J.callServer,void 0,J.findSourceMapURL,"getAvailableTerminalApps"),L=(0,J.createServerReference)("00c4e5e90614c5b26e3b92a76b43b92c57d8d459b3",J.callServer,void 0,J.findSourceMapURL,"getAvailableEditors");var M=a.i(887004);let N=(0,J.createServerReference)("40175c51fa0d44429072131b0ff3907bc6a4d3f365",J.callServer,void 0,J.findSourceMapURL,"createPrompt"),O=(0,J.createServerReference)("60310e7ecc9f34a9a2a3b8540190b98be5cce66499",J.callServer,void 0,J.findSourceMapURL,"updatePrompt"),P=(0,J.createServerReference)("40e578e4e5edfcfc433101fc4cf376fdc591f2d093",J.callServer,void 0,J.findSourceMapURL,"deletePrompt"),Q=(0,J.createServerReference)("60ec7f1b16b58184242ab39e4597a673f56a7ad9b5",J.callServer,void 0,J.findSourceMapURL,"setDefaultPrompt"),R=(0,J.createServerReference)("0077e12c67c71edf32304f495f1a98f1df5dee1359",J.callServer,void 0,J.findSourceMapURL,"getAvailableProviders");var S=a.i(785259),T=a.i(43775);let U=(0,p.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var V=a.i(324954);let W=(0,p.default)("folder-up",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var X=a.i(747798),Y=a.i(811344),Z=a.i(607219),$=a.i(952313);let _=(0,J.createServerReference)("4082a8a4cff83f6941b0077088cd17bc93e461532c",J.callServer,void 0,J.findSourceMapURL,"createBackup"),aa=(0,J.createServerReference)("00a8677efb6eb5f0478b07195d3eb7059fda168a77",J.callServer,void 0,J.findSourceMapURL,"listBackupFiles"),ab=(0,J.createServerReference)("40554a34eb868f9c5037d5acf1d6fc104b7cb0b884",J.callServer,void 0,J.findSourceMapURL,"deleteBackupFile"),ac=(0,J.createServerReference)("405d6c5551f3eb75d2a994c3f7cc953806de512c4a",J.callServer,void 0,J.findSourceMapURL,"restoreBackup"),ad=(0,J.createServerReference)("40709f4c99f1a3e3fb36c17c7d90675589994beace",J.callServer,void 0,J.findSourceMapURL,"resetSystem"),ae=(0,J.createServerReference)("005a9aac6b28314731d259299dfca16de7f4dad7ea",J.callServer,void 0,J.findSourceMapURL,"getBackupDir"),af=(0,J.createServerReference)("40a1e0b863ecfe471892ca5ad2da6ea9bcf50a9752",J.callServer,void 0,J.findSourceMapURL,"setBackupDir"),ag=(0,J.createServerReference)("00b9d10932281c736d11437a0ca12c5c2632d1d777",J.callServer,void 0,J.findSourceMapURL,"getStorageLocation"),ah=(0,J.createServerReference)("40a9809b5ab5dbda7aa08b9439a20c06cedf83cb87",J.callServer,void 0,J.findSourceMapURL,"setStorageLocation");function ai(){let{t:a,locale:e}=(0,f.useI18n)(),i=(0,d.useRouter)(),[j,k]=(0,c.useState)([]),[l,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(!0),[w,x]=(0,c.useState)(null),[y,A]=(0,c.useState)(!1),[B,D]=(0,c.useState)(""),E=(0,c.useRef)(null),[F,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(""),J=(0,c.useCallback)(async()=>{v(!0);try{let[a,b,c]=await Promise.all([aa(),ae(),ag()]);k(a),n(b),r(c)}finally{v(!1)}},[]);(0,c.useEffect)(()=>{J()},[J]);let K=async()=>{let b=B.trim()||void 0;A(!1),D(""),x("create");try{await _(b),$.toast.success(a("settings.backup.createSuccess")),await J()}catch{$.toast.error(a("settings.backup.createError"))}finally{x(null)}},L=async b=>{if(confirm(a("settings.backup.restoreConfirm"))){x("restore");try{await ac(b),$.toast.success(a("settings.backup.restoreSuccess"),{action:{label:a("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await J()}catch{$.toast.error(a("settings.backup.restoreError"))}finally{x(null)}}},M=async b=>{if(confirm(a("settings.backup.deleteConfirm")))try{await ab(b),$.toast.success(a("settings.backup.deleteSuccess")),k(a=>a.filter(a=>a.filename!==b))}catch{$.toast.error(a("settings.backup.deleteError"))}},N=async b=>{p(!1);try{await af(b),n(b),$.toast.success(a("settings.backup.dirSaved")),await J()}catch{$.toast.error(a("settings.backup.dirError"))}},O=async b=>{x("storage");try{let c=await ah({newPath:b});if(!c.ok)return void $.toast.error(c.error||a("settings.storage.moveError"));$.toast.success(a("settings.storage.moveSuccess",{count:String(c.moved??0)})),await J()}catch(b){$.toast.error(b instanceof Error?b.message:a("settings.storage.moveError"))}finally{x(null)}},P=async b=>{t(!1),confirm(a("settings.storage.moveConfirm"))&&await O(b)},Q=async()=>{!q||q.isDefault||confirm(a("settings.storage.resetConfirm"))&&await O(q.default)},R=async b=>{let c=b.target.files?.[0];if(c){b.target.value="",x("import");try{let b=new FormData;b.append("file",c);let d=await fetch("/api/internal/backup/import",{method:"POST",body:b});if(!d.ok){let b=await d.json();$.toast.error("Invalid backup archive"===b.error?a("settings.backup.importInvalid"):(b.error,a("settings.backup.importError")));return}$.toast.success(a("settings.backup.importSuccess")),await J()}catch{$.toast.error(a("settings.backup.importError"))}finally{x(null)}}},ai=async()=>{if("RESET"===H){G(!1),I(""),x("reset");try{await ad("RESET"),$.toast.success(a("settings.backup.resetSuccess")),i.push("/")}catch{$.toast.error(a("settings.backup.resetError"))}finally{x(null)}}},aj=null!==w;return(0,b.jsxs)("div",{className:"space-y-6",children:[("restore"===w||"reset"===w)&&(0,b.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,b.jsx)(C.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===w?a("settings.backup.restoring"):a("settings.backup.resetting")})]})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-base font-semibold",children:a("settings.backup.sectionTitle")}),(0,b.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{children:[a("settings.backup.dir"),":"]}),(0,b.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:l}),(0,b.jsx)(g.Button,{variant:"ghost",onClick:()=>p(!0),className:"text-xs text-muted-foreground",children:a("settings.backup.dirChange")})]}),(0,b.jsx)(T.FolderBrowserDialog,{open:o,onOpenChange:p,onSelect:N})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-base font-semibold",children:a("settings.storage.sectionTitle")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.storage.hint")}),(0,b.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{children:[a("settings.storage.current"),":"]}),(0,b.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:q?.current??"…"}),q?.isDefault&&(0,b.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:a("settings.storage.defaultBadge")}),(0,b.jsx)(g.Button,{variant:"ghost",onClick:()=>t(!0),disabled:"storage"===w,className:"text-xs text-muted-foreground",children:"storage"===w?(0,b.jsx)(C.Loader2,{className:"h-3 w-3 animate-spin"}):a("settings.storage.change")}),q&&!q.isDefault&&(0,b.jsx)(g.Button,{variant:"ghost",onClick:Q,disabled:"storage"===w,className:"text-xs text-muted-foreground",children:a("settings.storage.reset")})]}),(0,b.jsx)(T.FolderBrowserDialog,{open:s,onOpenChange:t,onSelect:P})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.Button,{onClick:()=>{D(""),A(!0)},disabled:aj,className:"gap-2",children:"create"===w?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-4 w-4 animate-spin"})," ",a("settings.backup.creating")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(U,{className:"h-4 w-4"})," ",a("settings.backup.create")]})}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsxs)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",disabled:aj,onClick:()=>E.current?.click(),className:"gap-2"}),children:[(0,b.jsx)(W,{className:"h-4 w-4"}),a("settings.backup.import")]}),(0,b.jsx)(S.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.importHint")})]}),(0,b.jsx)("input",{ref:E,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:R})]}),(0,b.jsx)(m.Dialog,{open:y,onOpenChange:A,children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:a("settings.backup.create")})}),(0,b.jsxs)("div",{className:"py-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.backup.createLabel")}),(0,b.jsx)(h.Input,{value:B,onChange:a=>D(a.target.value),onKeyDown:a=>"Enter"===a.key&&K(),placeholder:a("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>A(!1),children:a("common.cancel")}),(0,b.jsx)(g.Button,{onClick:K,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:a("settings.backup.create")})]})]})}),u?(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(C.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===j.length?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,b.jsx)(Z.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("settings.backup.empty")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a("settings.backup.emptyDesc")})]}):(0,b.jsx)("div",{className:"space-y-3",children:j.map(c=>{var d,f;return(0,b.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[c.label?(0,b.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:c.label}):(0,b.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:c.filename}),c.autoBackup&&(0,b.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:a("settings.backup.autoLabel")})]}),c.label&&(0,b.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:c.filename}),(0,b.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(d=c.size)<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:`${(d/1048576).toFixed(1)} MB`," · ",(f=c.createdAt,new Date(f).toLocaleString("zh"===e?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),c.preview.length>0&&(0,b.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[c.preview.map((a,c)=>(0,b.jsxs)("span",{children:[c>0&&" ",a.workspace,"(",a.projects.join(", "),")"]},c)),c.stats.workspaces>c.preview.length&&(0,b.jsxs)("span",{children:[" ",a("settings.backup.workspaces",{count:String(c.stats.workspaces)})]})]}),(0,b.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[a("settings.backup.projects",{count:String(c.stats.projects)})," · ",a("settings.backup.tasks",{count:String(c.stats.tasks)})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>L(c.filename),disabled:aj,className:"text-muted-foreground hover:text-foreground"}),children:(0,b.jsx)(V.Upload,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(S.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.restore")})]}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>M(c.filename),disabled:aj,className:"text-muted-foreground hover:text-rose-400"}),children:(0,b.jsx)(z.Trash2,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(S.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.delete")})]})]})]})},c.filename)})}),(0,b.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,b.jsx)(Y.AlertTriangle,{className:"h-4 w-4"}),a("settings.backup.dangerZone")]}),(0,b.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:a("settings.backup.resetDesc")}),(0,b.jsxs)(g.Button,{variant:"outline",onClick:()=>{I(""),G(!0)},disabled:aj,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,b.jsx)(X.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),a("settings.backup.reset")]})]}),(0,b.jsx)(m.Dialog,{open:F,onOpenChange:G,children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:a("settings.backup.resetConfirmTitle")}),(0,b.jsx)(m.DialogDescription,{children:a("settings.backup.resetConfirmDesc")})]}),(0,b.jsxs)("div",{className:"py-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.backup.resetConfirmInput")}),(0,b.jsx)(h.Input,{value:H,onChange:a=>I(a.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>G(!1),children:a("common.cancel")}),(0,b.jsx)(g.Button,{disabled:"RESET"!==H,onClick:ai,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:a("settings.backup.reset")})]})]})})]})}var aj=a.i(953093),ak=a.i(668116);let al=(0,p.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var am=a.i(22761),an=a.i(963326),ao=a.i(192369),ap=a.i(599209),aq=a.i(627141);let ar=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function as({cmd:a}){let{t:d}=(0,f.useI18n)(),[e,h]=(0,c.useState)(!1),i=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(a);else{let b=document.createElement("textarea");b.value=a,document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b)}h(!0),$.toast.success(d("common.copied")),setTimeout(()=>h(!1),1500)}catch{$.toast.error(d("common.copyFailed"))}};return(0,b.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-background/60 pl-2 pr-1 py-1 ring-1 ring-border/60",children:[(0,b.jsx)("code",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-relaxed",children:a}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d("common.copy"),onClick:i,children:e?(0,b.jsx)(ak.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(am.Copy,{className:"h-3 w-3"})})]})}function at({extension:a}){let{t:d}=(0,f.useI18n)(),{status:e,loading:h,isInstalling:i,install:j,uninstall:k,refresh:l}=(0,aq.useExtension)(a.id),[m,n]=(0,c.useState)(!1),o=a.icon,p=e.installed,q=async()=>{let b=await j();b.success?$.toast.success(d("settings.extensions.installSuccess").replace("{name}",a.name)):$.toast.error(d("settings.extensions.installFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},r=async()=>{let b=await k();b.success?$.toast.success(d("settings.extensions.uninstallSuccess").replace("{name}",a.name)):$.toast.error(d("settings.extensions.uninstallFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},s=async()=>{n(!0);try{await l()}finally{n(!1)}},t=()=>{window.open(a.homepageUrl,"_blank","noopener,noreferrer")};return(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,b.jsx)(o,{className:"h-5 w-5 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:a.name}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.description})]})]}),(0,b.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",a.sizeMB," MB"]})]}),(0,b.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:d("common.loading")})]}):p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,b.jsxs)("span",{className:"text-foreground",children:[d("settings.extensions.installed"),e.version?` v${e.version}`:""]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(al,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:d("settings.extensions.notInstalledShort")})]})}),(0,b.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Button,{variant:"default",onClick:q,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.reinstalling")]}):d("settings.extensions.reinstall")}),(0,b.jsx)(g.Button,{variant:"outline",onClick:r,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.uninstalling")]}):d("settings.extensions.uninstall")})]}):a.manualInstall?(0,b.jsxs)(ap.Popover,{children:[(0,b.jsx)(ap.PopoverTrigger,{render:a=>(0,b.jsxs)(g.Button,{variant:"default",...a,children:[(0,b.jsx)(U,{className:"h-3.5 w-3.5"}),d("settings.extensions.installViaHomepage")]})}),(0,b.jsxs)(ap.PopoverContent,{align:"start",className:"w-80 max-w-[90vw] gap-2 text-xs leading-relaxed",children:[(0,b.jsx)("p",{children:d("settings.extensions.manualInstallHintIntro")}),(0,b.jsx)("div",{className:"space-y-2",children:ar.map(({os:a,cmd:c})=>(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:a}),(0,b.jsx)(as,{cmd:c})]},a))}),(0,b.jsx)("p",{className:"text-muted-foreground",children:d("settings.extensions.manualInstallHintAfter")}),(0,b.jsxs)("button",{type:"button",onClick:t,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,b.jsx)(an.ExternalLink,{className:"h-3 w-3"}),d("settings.extensions.visitHomepage")]})]})]}):(0,b.jsx)(g.Button,{variant:"default",onClick:q,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.installing")]}):d("settings.extensions.install")}),(0,b.jsxs)(g.Button,{variant:"ghost",onClick:s,disabled:m,children:[(0,b.jsx)(ao.RefreshCw,{className:`h-3.5 w-3.5 ${m?"animate-spin":""}`}),d("settings.extensions.recheck")]}),(0,b.jsxs)(g.Button,{variant:"ghost",onClick:t,children:[(0,b.jsx)(an.ExternalLink,{className:"h-3.5 w-3.5"}),d("settings.extensions.visitHomepage")]})]})]})}function au(){let{t:a}=(0,f.useI18n)(),c=(0,aj.listExtensionMetadata)();return(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("header",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:a("settings.extensions.title")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.extensions.desc")})]}),(0,b.jsx)("div",{className:"space-y-3",children:c.map(a=>(0,b.jsx)(at,{extension:a},a.id))})]})}function av({options:a,value:c,onChange:d}){return(0,b.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:a.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>d(a.value),className:(0,n.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",c===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value))})}function aw({label:a,description:c,children:d,className:e}){return(0,b.jsxs)("div",{className:(0,n.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",e),children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:a}),c&&(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:c})]}),(0,b.jsx)("div",{className:"shrink-0",children:d})]})}let ax=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:o.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:q,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:r.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:s,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:v.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:t.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:u.HardDrive,accent:"cyan"}],ay={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},az="ai-manager:default-cli-adapter",aA={host:"",ownerMatch:"*",localPathTemplate:"",priority:0};function aB(){let a=(0,d.useRouter)(),{t:o}=(0,f.useI18n)(),{theme:p,setTheme:q}=(0,e.useTheme)(),{locale:r,setLocale:s}=(0,f.useI18n)(),[t,u]=(0,c.useState)("general"),v=(0,c.useRef)(null),[J,U]=(0,c.useState)({left:0,width:0}),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)("Terminal"),[Z,$]=(0,c.useState)([]),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)([]),[ad,ae]=(0,c.useState)([]),[af,ag]=(0,c.useState)("claude"),[ah,aj]=(0,c.useState)(null),[ak,al]=(0,c.useState)({}),[am,an]=(0,c.useState)([]),[ao,ap]=(0,c.useState)(!1),[aq,ar]=(0,c.useState)(null),[as,at]=(0,c.useState)(null),[aB,aC]=(0,c.useState)(""),[aD,aE]=(0,c.useState)(""),[aF,aG]=(0,c.useState)(""),[aH,aI]=(0,c.useState)([]),[aJ,aK]=(0,c.useState)(null),[aL,aM]=(0,c.useState)({...aA}),[aN,aO]=(0,c.useState)(!1),[aP,aQ]=(0,c.useState)({...aA}),[aR,aS]=(0,c.useState)(!1),[aT,aU]=(0,c.useState)(!1),[aV,aW]=(0,c.useState)(0),[aX,aY]=(0,c.useState)(null),[aZ,a$]=(0,c.useState)(null),[a_,a0]=(0,c.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[a1,a2]=(0,c.useState)({timeoutSec:30}),[a3,a4]=(0,c.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[a5,a6]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[a7,a8]=(0,c.useState)(null),[a9,ba]=(0,c.useState)(!1),[bb,bc]=(0,c.useState)(""),[bd,be]=(0,c.useState)(!0);(0,c.useEffect)(()=>W(!0),[]),(0,c.useEffect)(()=>{(0,G.getConfigValue)("terminal.app","Terminal").then(Y),K().then($),(0,G.getConfigValue)("editor.command","").then(aa),L().then(ac)},[]),(0,c.useEffect)(()=>{if(0===Z.length||!X||Z.some(a=>a.value===X))return;let a=Z.find(a=>a.name===X);a&&(Y(a.value),(0,H.setConfigValue)("terminal.app",a.value))},[Z,X]),(0,c.useEffect)(()=>{if(0===ab.length||!_||ab.some(a=>a.command===_))return;let a=ab.find(a=>a.name===_);a&&(aa(a.command),(0,H.setConfigValue)("editor.command",a.command))},[ab,_]),(0,c.useEffect)(()=>{R().then(ae);let a=localStorage.getItem(az);a&&ag(a)},[]),(0,c.useEffect)(()=>{(0,M.getPrompts)().then(an)},[]);let bf=async()=>{try{let a=await fetch("/api/internal/hooks/install");if(a.ok){let b=await a.json();a8(b)}}catch{}};async function bg(a){if(!ah){aj(a),al(b=>{let c={...b};return delete c[a],c});try{let b=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:a})}),c=await b.json();al(b=>({...b,[a]:c}))}catch{al(b=>({...b,[a]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{aj(null)}}}(0,c.useEffect)(()=>{(0,G.getConfigValue)("git.pathMappingRules",[]).then(a=>{let b=new Set,c=!1,d=a.map(a=>{if(!a.id||b.has(a.id)){c=!0;let d={...a,id:crypto.randomUUID()};return b.add(d.id),d}return b.add(a.id),a});aI(d),c&&(0,H.setConfigValue)("git.pathMappingRules",d)}),(0,G.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(a=>{bc(a.join(", "))}),bf(),(0,I.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","task.defaultUseWorktree","task.defaultAutoStart","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(a=>{let b=a["system.maxUploadBytes"]??0x3200000,c=a["system.maxReadableFileBytes"]??5242880;a0({maxUploadMb:Math.round(b/1024/1024),maxConcurrent:a["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(c/1024/1024),taskDefaultUseWorktree:"boolean"!=typeof a["task.defaultUseWorktree"]||a["task.defaultUseWorktree"],taskDefaultAutoStart:"boolean"==typeof a["task.defaultAutoStart"]&&a["task.defaultAutoStart"]}),a2({timeoutSec:a["git.timeoutSec"]??30}),a4({resultLimit:a["search.resultLimit"]??20,allModeCap:a["search.allModeCap"]??5,debounceMs:a["search.debounceMs"]??250,snippetLength:a["search.snippetLength"]??80,codeTimeoutSec:a["search.codeTimeoutSec"]??30}),a6({minCols:a["missions.grid.minCols"]??1,maxCols:a["missions.grid.maxCols"]??5,minRows:a["missions.grid.minRows"]??1,maxRows:a["missions.grid.maxRows"]??5})})},[]),(0,c.useEffect)(()=>{(0,G.getConfigValue)("notification.enabled",!0).then(be)},[]);let bh=(0,c.useCallback)(()=>{ar(null),aC(""),aE(""),aG(""),ap(!0)},[]),bi=(0,c.useCallback)(a=>{ar(a),aC(a.name),aE(a.description??""),aG(a.content),ap(!0)},[]),bj=(0,c.useCallback)(async()=>{aB.trim()&&aF.trim()&&(aq?await O(aq.id,{name:aB.trim(),description:aD.trim()||void 0,content:aF.trim()}):await N({name:aB.trim(),description:aD.trim()||void 0,content:aF.trim()}),ap(!1),an(await (0,M.getPrompts)()),a.refresh())},[aB,aD,aF,aq,a]),bk=(0,c.useCallback)(async()=>{as&&(await P(as),at(null),an(await (0,M.getPrompts)()),a.refresh())},[as,a]),bl=(0,c.useCallback)(async b=>{await Q(b),an(await (0,M.getPrompts)()),a.refresh()},[a]),bm=async()=>{await (0,H.setConfigValue)("system.maxUploadBytes",1024*a_.maxUploadMb*1024),await (0,H.setConfigValue)("system.maxConcurrentExecutions",a_.maxConcurrent),await (0,H.setConfigValue)("system.maxReadableFileBytes",1024*a_.maxReadableMb*1024)},bn=async()=>{await (0,H.setConfigValue)("task.defaultUseWorktree",a_.taskDefaultUseWorktree),await (0,H.setConfigValue)("task.defaultAutoStart",a_.taskDefaultAutoStart),await (0,H.setConfigValue)("task.mcpDefaultsConfigured",!0)},bo=async()=>{await (0,H.setConfigValue)("git.timeoutSec",a1.timeoutSec)},bp=async()=>{await (0,H.setConfigValue)("search.resultLimit",a3.resultLimit),await (0,H.setConfigValue)("search.allModeCap",a3.allModeCap),await (0,H.setConfigValue)("search.debounceMs",a3.debounceMs),await (0,H.setConfigValue)("search.snippetLength",a3.snippetLength),await (0,H.setConfigValue)("search.codeTimeoutSec",a3.codeTimeoutSec)},bq=async()=>{let a=Math.min(a5.minCols,a5.maxCols),b=Math.max(a5.minCols,a5.maxCols),c=Math.min(a5.minRows,a5.maxRows),d=Math.max(a5.minRows,a5.maxRows);a6({minCols:a,maxCols:b,minRows:c,maxRows:d}),await (0,H.setConfigValue)("missions.grid.minCols",a),await (0,H.setConfigValue)("missions.grid.maxCols",b),await (0,H.setConfigValue)("missions.grid.minRows",c),await (0,H.setConfigValue)("missions.grid.maxRows",d)},br=async()=>{let a=bb.split(",").map(a=>a.trim()).filter(Boolean);await (0,H.setConfigValue)("hooks.autoUploadTypes",a)},bs=async()=>{if(a7){ba(!0);try{let a=a7.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:a}),await bf()}finally{ba(!1)}}},bt=async()=>{if(!aP.host.trim()||!aP.localPathTemplate.trim())return;let a=aP.localPathTemplate.trim().replace(/\/+$/,""),b=aR?`${a}/{path}`:a,c=[...aH,{id:crypto.randomUUID(),host:aP.host.trim(),ownerMatch:aP.ownerMatch.trim()||"*",localPathTemplate:b,priority:aP.priority}];await (0,H.setConfigValue)("git.pathMappingRules",c),aI(c),aQ({...aA}),aS(!1),aO(!1)},bu=async a=>{if(!aL.host.trim()||!aL.localPathTemplate.trim())return;let b=aL.localPathTemplate.trim().replace(/\/+$/,""),c=aT?`${b}/{path}`:b,d=aH.map(b=>b.id===a?{...b,host:aL.host.trim(),ownerMatch:aL.ownerMatch.trim()||"*",localPathTemplate:c,priority:aL.priority}:b);await (0,H.setConfigValue)("git.pathMappingRules",d),aI(d),aK(null),aU(!1)},bv=async a=>{let b=aH.filter(b=>b.id!==a);await (0,H.setConfigValue)("git.pathMappingRules",b),aI(b),aY(null)};async function bw(){let a=!bd;be(a),await (0,H.setConfigValue)("notification.enabled",a)}let bx=(0,c.useCallback)(()=>{a.back()},[a]);(0,c.useEffect)(()=>{let a=v.current;if(!a)return;let b=a.querySelector(`[data-section="${t}"]`);if(!b)return;let c=a.getBoundingClientRect(),d=b.getBoundingClientRect();U({left:d.left-c.left,width:d.width})},[t]);let by=ax.find(a=>a.id===t),bz=by?ay[by.accent]:ay.blue;return(0,b.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,b.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,b.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:o("settings.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:o("settings.configDesc")})]}),(0,b.jsxs)(g.Button,{variant:"outline",onClick:bx,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,b.jsx)(w.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,b.jsxs)("div",{ref:v,className:"relative flex gap-1 overflow-x-auto",children:[ax.map(a=>{let c=a.icon,d=t===a.id,e=ay[a.accent];return(0,b.jsxs)("button",{"data-section":a.id,onClick:()=>u(a.id),className:(0,n.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",d?`${e.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,b.jsx)("span",{className:(0,n.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",d?e.bg:"bg-transparent"),children:(0,b.jsx)(c,{className:"h-3.5 w-3.5"})}),(0,b.jsx)("span",{children:o(a.labelKey)})]},a.id)}),(0,b.jsx)("div",{className:(0,n.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",bz.indicator),style:{left:J.left,width:J.width}})]})]})}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:(0,b.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[by&&(0,b.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,b.jsx)("div",{className:(0,n.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",bz.bg,bz.text,bz.ring),children:(0,b.jsx)(by.icon,{className:"h-5 w-5"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:o(by.labelKey)}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:o(by.descKey)})]})]}),(0,b.jsx)("div",{className:"mb-6 border-t"}),function(){switch(t){case"general":let a;return a=[{value:"light",label:o("settings.themeLight")},{value:"dark",label:o("settings.themeDark")},{value:"system",label:o("settings.themeSystem")}],(0,b.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,b.jsx)(aw,{label:o("settings.theme"),description:o("settings.themeDesc"),children:V?(0,b.jsx)(av,{options:a,value:p??"system",onChange:a=>q(a)}):(0,b.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,b.jsx)(aw,{label:o("settings.language"),description:o("settings.languageDesc"),children:(0,b.jsx)(av,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:r,onChange:a=>s(a)})}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.terminal.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.terminal.desc")})]}),Z.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:Z.map(a=>{let c=X===a.value,d=(0,n.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",a.installed?c?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),e=()=>{a.installed&&(Y(a.value),(0,H.setConfigValue)("terminal.app",a.value))};return a.installed?(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name},a.value):(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(S.TooltipContent,{side:"top",children:o("settings.app.notInstalled")})]},a.value)})})]}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.editor.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.editor.desc")})]}),ab.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ab.map(a=>{let c=_===a.command,d=(0,n.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",a.installed?c?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),e=()=>{a.installed&&(aa(a.command),(0,H.setConfigValue)("editor.command",a.command))};return a.installed?(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name},a.command):(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(S.TooltipContent,{side:"top",children:o("settings.app.notInstalled")})]},a.command)})})]})]});case"ai-tools":return(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ad.map(a=>{let c=af===a.name,d=ah===a.name,e=ak[a.name];return(0,b.jsx)("li",{children:(0,b.jsxs)("div",{className:"px-5 py-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium",children:a.displayName}),(0,b.jsx)(k.Badge,{variant:"outline",children:o("label.builtin")}),c&&(0,b.jsxs)(k.Badge,{variant:"secondary",className:"shrink-0",children:[(0,b.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),o("settings.prompts.default")]}),e&&(0,b.jsx)(k.Badge,{variant:e.ok?"secondary":"destructive",className:(0,n.cn)("shrink-0",e.ok&&"bg-green-600 text-white hover:bg-green-700"),children:e.ok?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.CheckCircle2,{className:"h-3 w-3 mr-1"}),o("settings.aiTools.testPassed")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(E.XCircle,{className:"h-3 w-3 mr-1"}),o("settings.aiTools.testFailed")]})})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.cli.available&&a.cli.version?`${a.name} \xb7 ${a.cli.version}`:a.name})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!c&&(0,b.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:()=>{var b;ag(b=a.name),localStorage.setItem(az,b)},children:[(0,b.jsx)(y,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),o("settings.prompts.setDefault")]}),(0,b.jsx)(g.Button,{variant:"outline",size:"sm",onClick:()=>bg(a.name),disabled:d,children:d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(C.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),o("settings.aiTools.testing")]}):o("settings.aiTools.testConnection")})]})]}),e&&(0,b.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,b.jsx)("div",{className:"space-y-1.5",children:e.checks.map(c=>(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)("span",{className:(0,n.cn)("w-1.5 h-1.5 rounded-full shrink-0",c.passed?"bg-green-500":"bg-red-500")}),(0,b.jsx)("span",{className:(0,n.cn)(c.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:c.message})]},`${a.name}-${c.name}`))})})]})},a.name)})});case"prompts":return V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(g.Button,{onClick:bh,variant:"default",children:[(0,b.jsx)(x.Plus,{className:"h-4 w-4 mr-2"}),o("settings.prompts.newPrompt")]})}),0===am.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,b.jsx)("p",{className:"text-muted-foreground",children:o("settings.prompts.empty")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:o("settings.prompts.emptyHint")})]}):(0,b.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:am.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h4",{className:"text-sm font-medium truncate",children:a.name}),a.isDefault&&(0,b.jsxs)(k.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,b.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),o("settings.prompts.default")]})]}),a.description&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:a.description})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bl(a.id),title:o("settings.prompts.setDefault"),children:(0,b.jsx)(y,{className:(0,n.cn)("h-4 w-4",a.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bi(a),title:o("settings.prompts.editPrompt"),children:(0,b.jsx)(A,{className:"h-4 w-4"})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>at(a.id),className:"text-destructive",title:o("settings.prompts.delete"),children:(0,b.jsx)(z.Trash2,{className:"h-4 w-4"})})]})]},a.id))}),(0,b.jsx)(m.Dialog,{open:ao,onOpenChange:ap,children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:aq?o("settings.prompts.editPrompt"):o("settings.prompts.newPrompt")}),(0,b.jsx)(m.DialogDescription,{children:aq?o("settings.prompts.editPrompt"):o("settings.prompts.newPrompt")})]}),(0,b.jsxs)("div",{className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-name",children:o("settings.prompts.promptName")}),(0,b.jsx)(h.Input,{id:"prompt-name",value:aB,onChange:a=>aC(a.target.value),placeholder:o("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-description",children:o("settings.prompts.promptDescription")}),(0,b.jsx)(h.Input,{id:"prompt-description",value:aD,onChange:a=>aE(a.target.value),placeholder:o("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-content",children:o("settings.prompts.promptContent")}),(0,b.jsx)(i.Textarea,{id:"prompt-content",value:aF,onChange:a=>aG(a.target.value),placeholder:o("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>ap(!1),children:o("settings.prompts.cancel")}),(0,b.jsx)(g.Button,{onClick:bj,disabled:!aB.trim()||!aF.trim(),children:o("settings.prompts.save")})]})]})}),(0,b.jsx)(m.Dialog,{open:!!as,onOpenChange:a=>!a&&at(null),children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:o("settings.prompts.deleteConfirmTitle")}),(0,b.jsx)(m.DialogDescription,{children:o("settings.prompts.deleteConfirmMessage")})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>at(null),children:o("settings.prompts.cancel")}),(0,b.jsx)(g.Button,{variant:"destructive",onClick:bk,children:o("settings.prompts.delete")})]})]})})]}):(0,b.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let c,d,e;return(0,b.jsxs)("div",{className:"space-y-8",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.git.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.git.desc")})]}),(0,b.jsxs)(g.Button,{onClick:()=>{aQ({...aA}),aO(!0)},children:[(0,b.jsx)(x.Plus,{className:"mr-2 h-4 w-4"}),o("settings.config.git.addRule")]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[0!==aH.length||aN?(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:aH.map(a=>aJ===a.id?(0,b.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.host")}),(0,b.jsx)(h.Input,{value:aL.host,onChange:a=>aM(b=>({...b,host:a.target.value})),placeholder:o("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.ownerMatch")}),(0,b.jsx)(h.Input,{value:aL.ownerMatch,onChange:a=>aM(b=>({...b,ownerMatch:a.target.value})),placeholder:o("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,b.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{value:aL.localPathTemplate,onChange:a=>aM(b=>({...b,localPathTemplate:a.target.value})),placeholder:o("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:aT?"default":"outline",size:"sm",type:"button",onClick:()=>aU(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(S.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:o("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:o("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>a$("edit"),children:(0,b.jsx)(F.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(S.TooltipContent,{children:o("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:aT?o("onboarding.step3.pathHintFull"):o("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.priority")}),(0,b.jsx)(h.Input,{type:"number",value:aL.priority,onChange:a=>aM(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"sm",onClick:()=>{aK(null),aU(!1)},children:o("settings.config.git.cancel")}),(0,b.jsx)(g.Button,{size:"sm",onClick:()=>bu(a.id),children:o("settings.config.git.save")})]})]},a.id):(0,b.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium text-sm",children:a.host}),"*"!==a.ownerMatch&&(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",a.ownerMatch]}),(0,b.jsxs)(k.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[o("settings.config.git.priority")," ",a.priority]})]}),(0,b.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:a.localPathTemplate})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let b,c,d;return b=a.localPathTemplate,d=(c=/\/\{path\}\/?$/.test(b))?b.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):b,void(aK(a.id),aM({host:a.host,ownerMatch:a.ownerMatch,localPathTemplate:d,priority:a.priority}),aU(c))},title:o("settings.config.git.edit"),children:(0,b.jsx)(A,{className:"h-4 w-4"})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>aY(a.id),className:"text-destructive",title:o("settings.config.git.delete"),children:(0,b.jsx)(z.Trash2,{className:"h-4 w-4"})})]})]})},a.id))}):(0,b.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:o("settings.config.git.noRules")})}),aN&&(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:o("settings.config.git.host")}),(0,b.jsx)(h.Input,{value:aP.host,onChange:a=>aQ(b=>({...b,host:a.target.value})),placeholder:o("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:o("settings.config.git.ownerMatch")}),(0,b.jsx)(h.Input,{value:aP.ownerMatch,onChange:a=>aQ(b=>({...b,ownerMatch:a.target.value})),placeholder:o("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:o("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{value:aP.localPathTemplate,onChange:a=>aQ(b=>({...b,localPathTemplate:a.target.value})),placeholder:o("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:aR?"default":"outline",size:"sm",type:"button",onClick:()=>aS(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(S.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:o("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:o("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(S.Tooltip,{children:[(0,b.jsx)(S.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>a$("add"),children:(0,b.jsx)(F.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(S.TooltipContent,{children:o("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:aR?o("onboarding.step3.pathHintFull"):o("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:o("settings.config.git.priority")}),(0,b.jsx)(h.Input,{type:"number",value:aP.priority,onChange:a=>aQ(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]}),aP.localPathTemplate&&(c=aP.localPathTemplate.trim().replace(/\/+$/,""),d=aR?`${c}/{path}`:c,e=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,b.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:o("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1",children:e.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>aW(c),className:(0,n.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",aV===c?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:a.label},c))})]}),(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:e[aV].url}),(0,b.jsxs)("p",{className:"font-mono text-sm",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,b.jsx)("span",{className:"text-foreground font-medium",children:function(a,b){if(!a||!b)return"";let c=b.trim(),d=[],e=c.match(/^git@[^:]+:(.+)$/);if(e)d=e[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let a=new URL(c);d=decodeURIComponent(a.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!d.length)return"";let f=d[0],g=d[d.length-1],h=d.join("/");if(a.includes("{path}"))return a.replace("{path}",h).replace("{owner}",f).replace("{repo}",g).replace(/\/+$/,"");let i=a.replace("{owner}",f).replace("{repo}","").replace(/\/+$/,"");return`${i}/${g}`}(d,e[aV].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"sm",onClick:()=>aO(!1),children:o("settings.config.git.cancel")}),(0,b.jsxs)(g.Button,{size:"sm",onClick:bt,disabled:!aP.host.trim()||!aP.localPathTemplate.trim(),children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 mr-1.5"}),o("settings.config.git.save")]})]})]})]})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.system.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.system.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxUpload")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxUploadHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:500,value:a_.maxUploadMb,onChange:a=>a0(b=>({...b,maxUploadMb:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxConcurrent")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxConcurrentHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a_.maxConcurrent,onChange:a=>a0(b=>({...b,maxConcurrent:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxReadable")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxReadableHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:50,value:a_.maxReadableMb,onChange:a=>a0(b=>({...b,maxReadableMb:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]})]}),(0,b.jsx)(g.Button,{onClick:bm,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.task.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.task.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.taskDefaultWorktree")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.taskDefaultWorktreeHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>a0(a=>({...a,taskDefaultUseWorktree:!a.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a_.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a_.taskDefaultUseWorktree?o("task.worktreeYes"):o("task.worktreeNo")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.taskDefaultAutoStart")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.taskDefaultAutoStartHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>a0(a=>({...a,taskDefaultAutoStart:!a.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a_.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a_.taskDefaultAutoStart?o("task.autoStartYes"):o("task.autoStartNo")})]})]}),(0,b.jsx)(g.Button,{onClick:bn,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.gitParams.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.gitParams.desc")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.gitParams.timeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.gitParams.timeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:5,max:300,value:a1.timeoutSec,onChange:a=>a2(b=>({...b,timeoutSec:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,b.jsx)(g.Button,{onClick:bo,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.search.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.search.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.resultLimit")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.resultLimitHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:5,max:100,value:a3.resultLimit,onChange:a=>a4(b=>({...b,resultLimit:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.allModeCap")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.allModeCapHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:1,max:20,value:a3.allModeCap,onChange:a=>a4(b=>({...b,allModeCap:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.debounceMs")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.debounceMsHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:50,max:1e3,value:a3.debounceMs,onChange:a=>a4(b=>({...b,debounceMs:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.snippetLength")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.snippetLengthHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:20,max:500,value:a3.snippetLength,onChange:a=>a4(b=>({...b,snippetLength:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.codeTimeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.codeTimeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:5,max:300,step:5,value:a3.codeTimeoutSec,onChange:a=>a4(b=>({...b,codeTimeoutSec:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,b.jsx)(g.Button,{onClick:bp,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.missions.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.missions.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.minCols")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.minCols,onChange:a=>a6(b=>({...b,minCols:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.maxCols")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.maxCols,onChange:a=>a6(b=>({...b,maxCols:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.minRows")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.minRows,onChange:a=>a6(b=>({...b,minRows:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.maxRows")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.maxRows,onChange:a=>a6(b=>({...b,maxRows:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,b.jsx)(g.Button,{onClick:bq,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.hooks.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.hooks.desc")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.hooks.autoUploadTypes")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.hooks.autoUploadTypesHint")})]}),(0,b.jsx)(h.Input,{value:bb,onChange:a=>bc(a.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsx)(g.Button,{onClick:br,className:"rounded-lg",children:o("common.save")}),(0,b.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:a7?.installed?o("settings.config.hooks.installed"):o("settings.config.hooks.notInstalled")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.hooks.installHint")})]}),(0,b.jsx)(g.Button,{variant:a7?.installed?"destructive":"default",onClick:bs,disabled:a9||!a7,className:"rounded-lg",children:a7?.installed?o("settings.config.hooks.uninstall"):o("settings.config.hooks.install")})]})]}),(0,b.jsx)(m.Dialog,{open:!!aX,onOpenChange:a=>!a&&aY(null),children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:o("settings.config.git.deleteConfirm")}),(0,b.jsx)(m.DialogDescription,{children:o("settings.config.git.deleteConfirmMessage")})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>aY(null),children:o("settings.config.git.cancel")}),(0,b.jsx)(g.Button,{variant:"destructive",onClick:()=>aX&&bv(aX),children:o("settings.config.git.delete")})]})]})})]});case"notifications":return(0,b.jsx)("div",{className:"divide-y divide-border/50",children:(0,b.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.notifications.enable")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.notifications.enableDesc")})]}),(0,b.jsx)(l.Switch,{checked:bd,onCheckedChange:bw})]})});case"backup":return(0,b.jsx)(ai,{});case"extensions":return(0,b.jsx)(au,{})}}()]})}),(0,b.jsx)(T.FolderBrowserDialog,{open:null!==aZ,onOpenChange:a=>{a||a$(null)},onSelect:a=>{"add"===aZ?aQ(b=>({...b,localPathTemplate:a})):"edit"===aZ&&aM(b=>({...b,localPathTemplate:a})),a$(null)}})]})}a.s(["default",0,function(){return(0,b.jsx)(aB,{})}],520788)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_settings_page_tsx_0h9v7dr._.js.map