tower-studio 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/diagnostics/route-bundle-stats.json +95 -95
  7. package/.next/fallback-build-manifest.json +3 -3
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  17. package/.next/server/app/_not-found/page/server-reference-manifest.json +23 -23
  18. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +14 -14
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  25. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  26. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  27. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  28. package/.next/server/app/api/internal/assistant/route.js +1 -1
  29. package/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  30. package/.next/server/app/api/internal/terminal/[taskId]/start/route.js +2 -2
  31. package/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  32. package/.next/server/app/index.html +1 -1
  33. package/.next/server/app/index.rsc +14 -14
  34. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  35. package/.next/server/app/index.segments/_full.segment.rsc +14 -14
  36. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  37. package/.next/server/app/index.segments/_index.segment.rsc +9 -9
  38. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  39. package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  40. package/.next/server/app/missions/page/server-reference-manifest.json +49 -49
  41. package/.next/server/app/missions/page.js +1 -1
  42. package/.next/server/app/missions/page.js.nft.json +1 -1
  43. package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  44. package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  45. package/.next/server/app/onboarding/page/server-reference-manifest.json +23 -23
  46. package/.next/server/app/onboarding/page.js.nft.json +1 -1
  47. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  48. package/.next/server/app/onboarding.html +1 -1
  49. package/.next/server/app/onboarding.rsc +16 -16
  50. package/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  51. package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  52. package/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  53. package/.next/server/app/onboarding.segments/_tree.segment.rsc +2 -2
  54. package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  55. package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  56. package/.next/server/app/page/react-loadable-manifest.json +1 -1
  57. package/.next/server/app/page/server-reference-manifest.json +23 -23
  58. package/.next/server/app/page.js.nft.json +1 -1
  59. package/.next/server/app/page_client-reference-manifest.js +1 -1
  60. package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  61. package/.next/server/app/settings/page/server-reference-manifest.json +56 -80
  62. package/.next/server/app/settings/page.js +1 -1
  63. package/.next/server/app/settings/page.js.nft.json +1 -1
  64. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  65. package/.next/server/app/settings.html +1 -1
  66. package/.next/server/app/settings.rsc +16 -16
  67. package/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  68. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  69. package/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  70. package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  71. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  72. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  73. package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  74. package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +77 -77
  75. package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  76. package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  78. package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +64 -64
  79. package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  80. package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  81. package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  82. package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +61 -61
  83. package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  84. package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  86. package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +51 -51
  87. package/.next/server/app/workspaces/[workspaceId]/page.js +1 -1
  88. package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  89. package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  90. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  91. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +23 -23
  92. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  93. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
  95. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +56 -56
  96. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +2 -2
  97. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  98. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  99. package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  100. package/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
  101. package/.next/server/app/workspaces/page.js.nft.json +1 -1
  102. package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  103. package/.next/server/chunks/0uz~_next_dist_esm_build_templates_app-route_05yec2y.js +2 -2
  104. package/.next/server/chunks/[root-of-the-server]__00~8_qz._.js +4 -0
  105. package/.next/server/chunks/[root-of-the-server]__05mc_xk._.js +1 -1
  106. package/.next/server/chunks/[root-of-the-server]__0p5iuez._.js +2 -2
  107. package/.next/server/chunks/[root-of-the-server]__0rb-ear._.js +4 -0
  108. package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
  109. package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
  110. package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
  111. package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
  112. package/.next/server/chunks/ssr/[root-of-the-server]__0-x7b4t._.js +3 -0
  113. package/.next/server/chunks/ssr/[root-of-the-server]__00.lowc._.js +1 -1
  114. package/.next/server/chunks/ssr/[root-of-the-server]__007tg36._.js +1 -1
  115. package/.next/server/chunks/ssr/[root-of-the-server]__025.0xa._.js +1 -1
  116. package/.next/server/chunks/ssr/[root-of-the-server]__04u4kb4._.js +1 -1
  117. package/.next/server/chunks/ssr/[root-of-the-server]__05a17ca._.js +1 -1
  118. package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
  119. package/.next/server/chunks/ssr/{[root-of-the-server]__0wkjslq._.js → [root-of-the-server]__08-2pn1._.js} +1 -1
  120. package/.next/server/chunks/ssr/[root-of-the-server]__0_47k-j._.js +3 -0
  121. package/.next/server/chunks/ssr/[root-of-the-server]__0aidehy._.js +3 -0
  122. package/.next/server/chunks/ssr/[root-of-the-server]__0ex911v._.js +30 -0
  123. package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
  124. package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
  125. package/.next/server/chunks/ssr/[root-of-the-server]__0r6gkos._.js +1 -1
  126. package/.next/server/chunks/ssr/[root-of-the-server]__0u26l~e._.js +1 -1
  127. package/.next/server/chunks/ssr/[root-of-the-server]__0uca1bc._.js +1 -1
  128. package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
  129. package/.next/server/chunks/ssr/[root-of-the-server]__0xe-o3g._.js +1 -1
  130. package/.next/server/chunks/ssr/{[root-of-the-server]__0fb0m0v._.js → [root-of-the-server]__0z9azne._.js} +2 -2
  131. package/.next/server/chunks/ssr/[root-of-the-server]__0zaw-fl._.js +3 -0
  132. package/.next/server/chunks/ssr/[root-of-the-server]__13b2wve._.js +3 -0
  133. package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
  134. package/.next/server/chunks/ssr/[root-of-the-server]__13x5mmo._.js +1 -1
  135. package/.next/server/chunks/ssr/project_f_tower_0-wsdce._.js +3 -0
  136. package/.next/server/chunks/ssr/project_f_tower_0.nfmle._.js +3 -0
  137. package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
  138. package/.next/server/chunks/ssr/{project_f_tower_0u8bo7w._.js → project_f_tower_0ai4twk._.js} +2 -2
  139. package/.next/server/chunks/ssr/{project_f_tower_06z7x~2._.js → project_f_tower_0e3m009._.js} +2 -2
  140. package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
  141. package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
  142. package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
  143. package/.next/server/chunks/ssr/{project_f_tower_0ntkd-l._.js → project_f_tower_0jhlcus._.js} +2 -2
  144. package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
  145. package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
  146. package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
  147. package/.next/server/chunks/ssr/project_f_tower_0uu8dha._.js +3 -0
  148. package/.next/server/chunks/ssr/project_f_tower_0w01kgd._.js +3 -0
  149. package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
  150. package/.next/server/chunks/ssr/{project_f_tower_0qepwa~._.js → project_f_tower_0zqkh.-._.js} +2 -2
  151. package/.next/server/chunks/ssr/{project_f_tower_src_0w26c.x._.js → project_f_tower_src_03-54or._.js} +2 -2
  152. package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +2 -2
  153. package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
  154. package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
  155. package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
  156. package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
  157. package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
  158. package/.next/server/chunks/ssr/{project_f_tower_0u6dr5n._.js → project_f_tower_src_components_ui_input_tsx_02yu4ri._.js} +2 -2
  159. package/.next/server/middleware-build-manifest.js +3 -3
  160. package/.next/server/pages/404.html +1 -1
  161. package/.next/server/pages/500.html +1 -1
  162. package/.next/server/server-reference-manifest.js +1 -1
  163. package/.next/server/server-reference-manifest.json +231 -255
  164. package/.next/static/chunks/{09wk17shlbfp6.js → 037e47w8xw0vw.js} +1 -1
  165. package/.next/static/chunks/{0qz_w~ilkw07_.js → 083e56klgnjgy.js} +1 -1
  166. package/.next/static/chunks/0a8x8yl_kme06.js +1 -0
  167. package/.next/static/chunks/{0jz83jbb6_ldj.js → 0cqsk~mfhg.i5.js} +1 -1
  168. package/.next/static/chunks/{0gpckquc5j5cx.js → 0i_v_7f3gdmz4.js} +1 -1
  169. package/.next/static/chunks/0j.~gle~mn8uy.js +1 -0
  170. package/.next/static/chunks/{0_-rw81.wbmu..js → 0nyip_341~xyg.js} +2 -2
  171. package/.next/static/chunks/0rt2m4hy13qby.js +1 -0
  172. package/.next/static/chunks/0s4zpgzk~au6x.css +1 -0
  173. package/.next/static/chunks/{0qnz9q6uieuv8.js → 0sszltblb5pss.js} +1 -1
  174. package/.next/static/chunks/0x5iegao~6ge3.js +1 -0
  175. package/.next/static/chunks/{05_0-v~c00b__.js → 0x6gp.e04de4e.js} +1 -1
  176. package/.next/static/chunks/{12x6kubkc37zq.js → 0zz4ryeh6j~.x.js} +1 -1
  177. package/.next/static/chunks/{0n3o6vvrc4ks4.js → 110k271zgqb6h.js} +1 -1
  178. package/.next/static/chunks/{0nvuuwr.v3r4k.js → 125_gss3san00.js} +1 -1
  179. package/.next/static/chunks/12wq.0xcxup1q.js +1 -0
  180. package/.next/static/chunks/187llw593phxu.js +1 -0
  181. package/.next/trace +2 -2
  182. package/.next/trace-build +1 -1
  183. package/package.json +4 -2
  184. package/scripts/init-db.ts +0 -17
  185. package/.next/server/chunks/[root-of-the-server]__02~bq0q._.js +0 -4
  186. package/.next/server/chunks/[root-of-the-server]__0~33o~m._.js +0 -4
  187. package/.next/server/chunks/ssr/[root-of-the-server]__0fp7reb._.js +0 -3
  188. package/.next/server/chunks/ssr/[root-of-the-server]__0fwuc5u._.js +0 -3
  189. package/.next/server/chunks/ssr/[root-of-the-server]__0nmyvwk._.js +0 -3
  190. package/.next/server/chunks/ssr/[root-of-the-server]__0y3o4rp._.js +0 -3
  191. package/.next/server/chunks/ssr/[root-of-the-server]__11j4k9o._.js +0 -3
  192. package/.next/server/chunks/ssr/[root-of-the-server]__13cjs8r._.js +0 -3
  193. package/.next/server/chunks/ssr/project_f_tower_04g3~44._.js +0 -30
  194. package/.next/server/chunks/ssr/project_f_tower_08d6__q._.js +0 -3
  195. package/.next/server/chunks/ssr/project_f_tower_0arf7nr._.js +0 -3
  196. package/.next/server/chunks/ssr/project_f_tower_135-_23._.js +0 -3
  197. package/.next/static/chunks/0-ggl6l3h5syr.js +0 -1
  198. package/.next/static/chunks/04pjsuj.mivbh.css +0 -1
  199. package/.next/static/chunks/05tpf5j-jft-k.js +0 -1
  200. package/.next/static/chunks/0_vexk9jnxj9q.js +0 -1
  201. package/.next/static/chunks/0h0m-v8uoeq~u.js +0 -1
  202. package/.next/static/chunks/0ynxf.i-o3-xn.js +0 -1
  203. package/.next/static/chunks/0zio-v5989p.b.js +0 -1
  204. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → Gxj1QMzOqxH1St959O3yh}/_buildManifest.js +0 -0
  205. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → Gxj1QMzOqxH1St959O3yh}/_clientMiddlewareManifest.js +0 -0
  206. /package/.next/static/{QCWJhjbC4McTn-0CAT1Gx → Gxj1QMzOqxH1St959O3yh}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[690834,a=>{"use strict";let b=(0,a.i(302856).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);a.s(["default",0,b])},582043,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(448287),e=a.i(759985),f=a.i(14180),g=a.i(263973),h=a.i(94202),i=a.i(569210),j=a.i(317076),k=a.i(302856);let l=(0,k.default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]),m=(0,k.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var n=a.i(161604),o=a.i(986379);let p=(0,k.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var q=a.i(445705),r=a.i(358440),s=a.i(857122),t=a.i(95446),u=a.i(410756),v=a.i(620235),w=a.i(879876);let x=(0,w.createServerReference)("407b2af6329533534febb291b9b6995ca0c57ecfb6",w.callServer,void 0,w.findSourceMapURL,"createWorkspace"),y=(0,w.createServerReference)("60557d38533851a85e3b22aff36176ee7e8ce42871",w.callServer,void 0,w.findSourceMapURL,"updateWorkspace"),z=(0,w.createServerReference)("40d7736a6bd6d01f427300af149cbed5f8178fd0b7",w.callServer,void 0,w.findSourceMapURL,"deleteWorkspace"),A=(0,w.createServerReference)("403e569967f7e40ef9f95a932fd1402ccf721dc22e",w.callServer,void 0,w.findSourceMapURL,"getLabelsForWorkspace"),B=(0,w.createServerReference)("405fdc9c4d8b06477fa2fab70470ea3bcd09a3af4e",w.callServer,void 0,w.findSourceMapURL,"createLabel"),C=(0,w.createServerReference)("40f99af0c2ef3e8f82b39d8517d51f004fa12d9445",w.callServer,void 0,w.findSourceMapURL,"deleteLabel");var D=a.i(584335),E=a.i(942308);let F=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function G({workspaces:a}){let k,s=(0,d.useRouter)(),v=(0,d.usePathname)(),{t:w}=(0,D.useI18n)(),[A,B]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&B(!0)},[]);let[C,I]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)(!1),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)(""),[S,T]=(0,c.useState)(F[0]),[U,V]=(0,c.useState)(null),W=v.split("/workspaces/")[1]?.split("/")[0],X=(0,c.useCallback)(()=>{B(a=>{let b=!a;return localStorage.setItem("sidebar-collapsed",String(b)),b})},[]),Y=(0,c.useCallback)(async()=>{if(!Q.trim())return;let a=await x({name:Q.trim(),description:S});R(""),T(F[0]),I(!1),s.refresh(),s.push(`/workspaces/${a.id}`)},[Q,S,s]),Z=(0,c.useCallback)(async()=>{Q.trim()&&U&&(await y(U,{name:Q.trim(),description:S}),R(""),L(!1),V(null),s.refresh())},[Q,S,U,s]),$=(0,c.useCallback)(a=>{V(a.id),R(a.name),T(a.description&&F.includes(a.description)?a.description:F[0]),L(!0)},[]),_=(0,c.useCallback)(async(b,c)=>{if(a.length<=1)return void E.toast.error(w("sidebar.lastWorkspaceError"));if(confirm(w("sidebar.deleteConfirm",{name:c})))try{await z(b),s.refresh(),W===b&&s.push("/workspaces")}catch{E.toast.error(w("sidebar.lastWorkspaceError"))}},[W,s,w,a.length]),aa=(0,c.useCallback)(a=>{P(a),N(!0)},[]),ab=a=>a.description&&F.includes(a.description)?a.description:a.name.charAt(0).toUpperCase();if(A){let c;return(0,b.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:X,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.expand")})]}),(0,b.jsx)(r.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[a.map(a=>{let c=W===a.id,d=ab(a);return(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>{c||s.push(`/workspaces/${a.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${c?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,b.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:F.includes(d)?d:(0,b.jsx)("span",{className:"text-xs font-semibold",children:d})})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:a.name})]},a.id)}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{"data-tour":"create-workspace",onClick:()=>I(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,b.jsx)(g.Plus,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.newWorkspace")})]})]})}),(0,b.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(c=W||a[0]?.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/notes`),className:`rounded-lg p-2 transition-colors ${v.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(n.FileText,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.notes")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/assets`),className:`rounded-lg p-2 transition-colors ${v.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(o.FolderOpen,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.assets")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/archive`),className:`rounded-lg p-2 transition-colors ${v.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(f.Archive,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.archive")})]})]}):null,(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===v?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(p,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("missions.navLabel")})]})]}),(0,b.jsx)(H,{open:C,onOpenChange:I,title:w("workspace.create"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Y,submitLabel:w("common.create"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")})]})}return(0,b.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,b.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,b.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon-xs",onClick:X,className:"text-muted-foreground",title:w("sidebar.collapse"),children:(0,b.jsx)(l,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:w("sidebar.workspace")}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{R(""),T(F[0]),I(!0)},title:w("sidebar.newWorkspace"),children:(0,b.jsx)(g.Plus,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)(r.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,b.jsx)("div",{className:"px-2 py-1",children:a.map(c=>{var d;let e,f,g,k=W===c.id,l=ab(c);return(0,b.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${k?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,b.jsxs)("button",{onClick:()=>{k||s.push(`/workspaces/${c.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${k?"cursor-default":"cursor-pointer"}`,children:[(0,b.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:F.includes(l)?l:(0,b.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:l})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:`truncate text-sm font-medium ${k?"text-foreground":"text-secondary-foreground"}`,children:c.name}),(0,b.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(d=c.updatedAt,f=Math.floor((e=Date.now()-new Date(d).getTime())/6e4),g=Math.floor(e/36e5),f<60?`${f}m ago`:g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`)})]})]}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{render:(0,b.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:a=>a.stopPropagation()}),children:(0,b.jsx)(j.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)(q.DropdownMenuContent,{align:"start",side:"right",children:[(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>$(c),children:[(0,b.jsx)(h.Pencil,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.rename")]}),(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>aa(c.id),children:[(0,b.jsx)(m,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.manageLabels")]}),(0,b.jsxs)(q.DropdownMenuItem,{className:a.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:a.length<=1,onClick:()=>_(c.id,c.name),children:[(0,b.jsx)(i.Trash2,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.delete")]})]})]})]},c.id)})})}),(0,b.jsxs)(e.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===v?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(p,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("missions.navLabel")})]}),(k=W||a[0]?.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(e.default,{href:`/workspaces/${k}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(n.FileText,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.notes")})]}),(0,b.jsxs)(e.default,{href:`/workspaces/${k}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.assets")})]}),(0,b.jsxs)(e.default,{href:`/workspaces/${k}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(f.Archive,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.archive")})]})]}):null,(0,b.jsx)(H,{open:C,onOpenChange:I,title:w("workspace.create"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Y,submitLabel:w("common.create"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")}),(0,b.jsx)(H,{open:K,onOpenChange:a=>{L(a),a||V(null)},title:w("workspace.edit"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Z,submitLabel:w("common.save"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")}),O&&(0,b.jsx)(J,{open:M,onOpenChange:a=>{N(a),a||P(null)},workspaceId:O})]})}function H({open:a,onOpenChange:c,title:d,name:e,onNameChange:f,icon:g,onIconChange:h,onSubmit:i,submitLabel:j,nameLabel:k,iconLabel:l,namePlaceholder:m,cancelLabel:n}){return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:c,disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:d})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k}),(0,b.jsx)(v.Input,{placeholder:m,value:e,onChange:a=>f(a.target.value),onKeyDown:a=>"Enter"===a.key&&a.preventDefault(),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:l}),(0,b.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:F.map(a=>(0,b.jsx)("button",{onClick:()=>h(a),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${g===a?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:a},a))})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>c(!1),children:n}),(0,b.jsx)(u.Button,{onClick:i,disabled:!e.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:j})]})]})})}let I=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function J({open:a,onOpenChange:d,workspaceId:e}){let{t:f}=(0,D.useI18n)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(I[0]);(0,c.useEffect)(()=>{a&&A(e).then(h)},[a,e]);let m=async()=>{i.trim()&&(await B({name:i.trim(),color:k,workspaceId:e}),h(await A(e)),j(""))},n=async a=>{await C(a),h(b=>b.filter(b=>b.id!==a))};return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:d,disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("label.manage")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[g.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:a.color}}),(0,b.jsx)("span",{className:"flex-1 text-sm text-foreground",children:a.name}),a.isBuiltin?(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:f("label.builtin")}):(0,b.jsx)("button",{onClick:()=>n(a.id),className:"text-xs text-rose-400 hover:text-rose-300",children:f("common.delete")})]},a.id)),(0,b.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(v.Input,{placeholder:f("label.name"),value:i,onChange:a=>j(a.target.value),onKeyDown:a=>"Enter"===a.key&&a.preventDefault(),className:"flex-1 h-8"}),(0,b.jsx)(u.Button,{size:"sm",onClick:m,disabled:!i.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:f("label.add")})]}),(0,b.jsx)("div",{className:"mt-2 flex gap-1.5",children:I.map(a=>(0,b.jsx)("button",{onClick:()=>l(a),className:`h-5 w-5 rounded-full transition-all ${k===a?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:a}},a))})]})]})]})})}var K=a.i(432120),L=a.i(410215),M=a.i(666775);let N=(0,k.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var O=a.i(212765);let P=(0,k.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var Q=a.i(248763),R=a.i(470612);a.s([],243701),a.i(243701);var S=a.i(256116),T=a.i(545264);let U=c.createContext(void 0);function V(){let a=c.useContext(U);if(void 0===a)throw Error((0,T.default)(13));return a}let W={imageLoadingStatus:()=>null},X=c.forwardRef(function(a,d){let{className:e,render:f,...g}=a,[h,i]=c.useState("idle"),j=c.useMemo(()=>({imageLoadingStatus:h,setImageLoadingStatus:i}),[h,i]),k=(0,S.useRenderElement)("span",a,{state:{imageLoadingStatus:h},ref:d,props:g,stateAttributesMapping:W});return(0,b.jsx)(U.Provider,{value:j,children:k})});var Y=a.i(825863),Z=a.i(527993),$=a.i(759002),_=a.i(163323),aa=a.i(6644),ab=a.i(302398);let ac={...W,..._.transitionStatusMapping},ad=c.forwardRef(function(a,b){let{className:d,render:e,onLoadingStatusChange:f,referrerPolicy:g,crossOrigin:h,...i}=a,j=V(),k=function(a,{referrerPolicy:b,crossOrigin:d}){let[e,f]=c.useState("idle");return(0,Z.useIsoLayoutEffect)(()=>{if(!a)return f("error"),ab.NOOP;let c=!0,e=new window.Image,g=a=>()=>{c&&f(a)};return f("loading"),e.onload=g("loaded"),e.onerror=g("error"),b&&(e.referrerPolicy=b),e.crossOrigin=d??null,e.src=a,()=>{c=!1}},[a,d,b]),e}(a.src,{referrerPolicy:g,crossOrigin:h}),l="loaded"===k,{mounted:m,transitionStatus:n,setMounted:o}=(0,aa.useTransitionStatus)(l),p=c.useRef(null),q=(0,Y.useStableCallback)(a=>{f?.(a),j.setImageLoadingStatus(a)});(0,Z.useIsoLayoutEffect)(()=>{"idle"!==k&&q(k)},[k,q]),(0,$.useOpenChangeComplete)({open:l,ref:p,onComplete(){l||o(!1)}});let r=(0,S.useRenderElement)("img",a,{state:{imageLoadingStatus:k,transitionStatus:n},ref:[b,p],props:i,stateAttributesMapping:ac,enabled:m});return m?r:null});var ae=a.i(313668);let af=c.forwardRef(function(a,b){let{className:d,render:e,delay:f,...g}=a,{imageLoadingStatus:h}=V(),[i,j]=c.useState(void 0===f),k=(0,ae.useTimeout)();return c.useEffect(()=>(void 0!==f&&k.start(f,()=>j(!0)),k.clear),[k,f]),(0,S.useRenderElement)("span",a,{state:{imageLoadingStatus:h},ref:b,props:g,stateAttributesMapping:W,enabled:"loaded"!==h&&i})});a.s(["Fallback",0,af,"Image",0,ad,"Root",0,X],60418);var ag=a.i(60418),ag=ag,ah=a.i(44585);function ai({className:a,size:c="default",...d}){return(0,b.jsx)(ag.Root,{"data-slot":"avatar","data-size":c,className:(0,ah.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",a),...d})}function aj({className:a,...c}){return(0,b.jsx)(ag.Fallback,{"data-slot":"avatar-fallback",className:(0,ah.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",a),...c})}let ak=(0,k.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var al=a.i(61966);let am=(0,k.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),an=(0,k.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var ao=a.i(54709);let ap=(0,w.createServerReference)("608f69f95a3beba367f60aa9887945df91c205a5a8",w.callServer,void 0,w.findSourceMapURL,"globalSearch");var aq=a.i(622957);let ar=[{id:"all",key:"search.all",icon:L.Search},{id:"task",key:"search.task",icon:n.FileText},{id:"project",key:"search.project",icon:ak},{id:"repository",key:"search.repository",icon:al.GitBranch},{id:"note",key:"search.note",icon:am},{id:"asset",key:"search.asset",icon:an}],as=["task","project","repository","note","asset"],at={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function au({result:a,onSelect:c}){let d=ar.find(b=>b.id===a.type)?.icon??n.FileText;return(0,b.jsxs)("button",{onClick:()=>c(a),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,b.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,b.jsx)(d,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:a.title}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:a.subtitle}),a.snippet&&(0,b.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:a.snippet})]})]})}function av({open:a,onOpenChange:e}){let f,{t:g}=(0,D.useI18n)(),h=(0,d.useRouter)(),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)("all"),[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(!1),[q,t]=(0,c.useState)(250),v=(0,c.useRef)(null),w=(0,c.useRef)(null);(0,c.useEffect)(()=>{a&&((0,aq.getConfigValue)("search.debounceMs",250).then(t),setTimeout(()=>v.current?.focus(),100),j(""),n([]))},[a]),(0,c.useEffect)(()=>{if(w.current&&clearTimeout(w.current),!i.trim()){n([]),p(!1);return}p(!0);let a=!1;return w.current=setTimeout(async()=>{let b=await ap(i,k);a||(n(b),p(!1))},q),()=>{w.current&&clearTimeout(w.current),a=!0}},[i,k,q]);let x=(0,c.useCallback)(a=>{h.push(a.navigateTo),e(!1)},[h,e]);return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,b.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,b.jsx)(L.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,b.jsx)("input",{ref:v,value:i,onChange:a=>j(a.target.value),placeholder:g("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),i&&(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",onClick:()=>{j(""),n([])},className:"text-muted-foreground",children:(0,b.jsx)(ao.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:ar.map(a=>{let c=a.icon;return(0,b.jsxs)("button",{onClick:()=>l(a.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${k===a.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,b.jsx)(c,{className:"h-3 w-3"}),g(a.key)]},a.id)})}),(0,b.jsxs)(r.ScrollArea,{className:"max-h-80",children:[!i.trim()&&(0,b.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:g("search.typeToSearch")}),i.trim()&&0===m.length&&!o&&(0,b.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:g("search.noResults")}),"all"===k&&m.length>0&&(f=m.reduce((a,b)=>((a[b.type]??=[]).push(b),a),{}),as.filter(a=>f[a]?.length).map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:g(at[a])}),f[a].map(a=>(0,b.jsx)(au,{result:a,onSelect:x},`${a.type}-${a.id}`))]},a))),"all"!==k&&m.map(a=>(0,b.jsx)(au,{result:a,onSelect:x},`${a.type}-${a.id}`))]})]})})}function aw(a){}let ax=(0,c.createContext)(null);function ay(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let az="assistant-image-cache";function aA(a,b,c){try{let d=sessionStorage.getItem(az),e=d?JSON.parse(d):{};e[a]||(e[a]={}),e[a][b]=c,sessionStorage.setItem(az,JSON.stringify(e))}catch{}}function aB({children:a}){let[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)("sidebar"),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)("idle"),[p,q]=(0,c.useState)(!1),r=(0,c.useRef)([]),s=(0,c.useRef)(null),t=(0,c.useRef)(null),[u,v]=(0,c.useState)([]),[w,x]=(0,c.useState)(null),y=(0,c.useRef)(!1),z=(0,c.useCallback)(()=>{m([...r.current])},[]),A=(0,c.useCallback)(async()=>{i("dialog"===await (0,aq.getConfigValue)("assistant.displayMode","sidebar")?"dialog":"sidebar")},[]);(0,c.useEffect)(()=>{A()},[A]);let B=(0,c.useCallback)(async()=>{v([])},[]),C=(0,c.useCallback)(async a=>{q(!0);try{let b=await fetch(`/api/internal/assistant/sessions?sessionId=${encodeURIComponent(a)}`);if(!b.ok)return;let c=await b.json();if(Array.isArray(c.messages)){r.current=c.messages;let b=function(a){try{let b=sessionStorage.getItem(az);if(!b)return{};return JSON.parse(b)[a]??{}}catch{return{}}}(a);if(Object.keys(b).length>0){let a=0;r.current=r.current.map(c=>{if("user"===c.role){let d=b[a];if(a++,d?.length)return{...c,imageFilenames:d}}return c})}m([...r.current])}}catch{}finally{q(!1)}},[]);(0,c.useEffect)(()=>{B()},[B,C]);let D=(0,c.useCallback)(()=>{t.current?.abort(),s.current=null,y.current=!1,x(null),aw(null),r.current=[],m([]),o("idle")},[]),E=(0,c.useCallback)(a=>{t.current?.abort(),s.current=a,y.current=!0,x(a),aw(a),r.current=[],m([]),o("idle"),C(a)},[C]),F=(0,c.useCallback)(a=>{v([]),w===a&&D()},[w,D]),G=(0,c.useCallback)(async()=>{g(!0);try{await A(),e(!0)}finally{g(!1)}},[A]),H=(0,c.useCallback)(()=>{e(!1),t.current?.abort()},[]),I=(0,c.useCallback)(()=>{d||f?H():G()},[d,f,H,G]);(0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"l"===a.key&&(a.preventDefault(),I())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[I]);let J=(0,c.useCallback)(async(a,b)=>{if(!a.trim()&&!b?.imageFilenames?.length)return;t.current?.abort();let c=new AbortController;t.current=c;let d=0!==r.current.length||y.current?null:a,e=ay();if(r.current=[...r.current,{id:ay(),role:"user",content:a,imageFilenames:b?.imageFilenames?.length?b.imageFilenames:void 0},{id:e,role:"thinking",content:"",isStreaming:!0}],z(),b?.imageFilenames?.length&&s.current){let a=r.current.filter(a=>"user"===a.role).length-1;aA(s.current,a,b.imageFilenames)}o("connecting");let f=null;try{let g=await fetch("/api/internal/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a,sessionId:s.current,imageFilenames:b?.imageFilenames??[]}),signal:c.signal});if(!g.ok||!g.body)throw Error(`HTTP ${g.status}`);o("streaming");let h=g.body.getReader(),i=new TextDecoder,j="";for(;;){let{done:a,value:c}=await h.read();if(a)break;let g=(j+=i.decode(c,{stream:!0})).split("\n");for(let a of(j=g.pop()??"",g)){let c;if(a.startsWith("data: ")){try{c=JSON.parse(a.slice(6).trim())}catch{continue}if(c.sessionId){let a=s.current;if(s.current=c.sessionId,d&&!y.current&&c.sessionId!==a){y.current=!0;new Date().toISOString();c.sessionId,function(a){let b=a.trim();b&&b.length>30&&b.slice(0,30)}(d),v([]),x(c.sessionId),aw(c.sessionId),b?.imageFilenames?.length&&aA(c.sessionId,0,b.imageFilenames)}}switch(c.type){case"text_delta":{let a=r.current.filter(a=>a.id!==e);f?r.current=a.map(a=>a.id===f?{...a,content:a.content+(c.content??""),isStreaming:!0}:a):(f=ay(),r.current=[...a,{id:f,role:"assistant",content:c.content??"",isStreaming:!0}]),z();break}case"text":{let a=r.current.filter(a=>a.id!==e);f?r.current=a.map(a=>a.id===f?{...a,content:c.content??a.content,isStreaming:!0}:a):(f=ay(),r.current=[...a,{id:f,role:"assistant",content:c.content??"",isStreaming:!0}]),z();break}case"tool_start":{let a=r.current.filter(a=>a.id!==e);f?(r.current=a.map(a=>a.id===f?{...a,isStreaming:!1}:a),f=null):r.current=a,r.current=[...r.current,{id:ay(),role:"tool",content:`Calling ${c.content??"tool"}...`,toolName:c.content,isStreaming:!0}],z();break}case"tool_use":{let a=r.current.filter(a=>a.id!==e),b=f?a.map(a=>a.id===f?{...a,isStreaming:!1}:a):a;f=null,r.current=[...b,{id:ay(),role:"tool",content:JSON.stringify(c.toolInput??{},null,2),toolName:c.content}],z();break}case"tool_result":r.current=[...r.current,{id:ay(),role:"tool",content:String(c.toolOutput??""),toolName:`${c.content??"tool"} (result)`}],z();break;case"error":r.current=[...r.current.filter(a=>a.id!==e),{id:ay(),role:"assistant",content:`Error: ${c.content??"Unknown error"}`}],z(),o("error");break;case"done":f&&(r.current=r.current.map(a=>a.id===f?{...a,isStreaming:!1}:a)),r.current=r.current.filter(a=>a.id!==e),z(),o("idle")}}}}r.current=r.current.filter(a=>a.id!==e),z(),o(a=>"streaming"===a?"idle":a),B()}catch(a){if("AbortError"===a.name)return;r.current=[...r.current.filter(a=>a.id!==e),{id:ay(),role:"assistant",content:`Connection error: ${a.message??"Unknown error"}`}],z(),o("error")}},[z,B]),K=(0,c.useCallback)(()=>{t.current?.abort(),t.current=null;let a=[...r.current].reverse().find(a=>"user"===a.role),b=a?.content??null;if(a){let b=r.current.lastIndexOf(a);r.current=r.current.slice(0,b),m([...r.current])}return o("idle"),b},[]),L=l[l.length-1],M="connecting"===n||"streaming"===n||L?.role==="thinking"&&!0===L.isStreaming;return(0,b.jsx)(ax.Provider,{value:{isOpen:d,isStarting:f,displayMode:h,worktreePath:j,toggleAssistant:I,closeAssistant:H,chatMessages:l,chatStatus:n,isChatThinking:M,isLoadingHistory:p,sendChatMessage:J,cancelChat:K,sessions:u,activeSessionId:w,createNewSession:D,switchSession:E,removeSession:F,refreshSessions:B},children:a})}function aC(){let a=(0,c.useContext)(ax);if(!a)throw Error("useAssistant must be used within an AssistantProvider");return a}var aD=a.i(109434),aE=a.i(858967),aF=a.i(467034),aG=a.i(938899),aH=a.i(845924),aI=a.i(246962);function aJ(a){return a.replace(/\.git\/?$/,"")}a.i(446786),a.i(814747);let aK=(0,w.createServerReference)("406f4c33d6ee0b57f32ef36912f062f165599174b0",w.callServer,void 0,w.findSourceMapURL,"resolveGitLocalPath");var aL=a.i(918121);function aM({open:a,onOpenChange:d,onCreateProject:e}){let{t:f,locale:g}=(0,D.useI18n)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)("FRONTEND"),[z,A]=(0,c.useState)("idle"),[B,C]=(0,c.useState)(""),[F,G]=(0,c.useState)(!1),H=()=>{i(""),k(""),m(""),o(""),q(""),w(!1),y("FRONTEND"),A("idle"),C(""),G(!1)},I=async()=>{if(p.trim()&&!F&&"success"===z){G(!0);try{let a=await (0,aL.analyzeProjectDirectory)(p.trim(),g);m(a)}catch{E.toast.error(f("project.analyzeError"))}finally{G(!1)}}},J=async a=>{o(a),A("idle"),C("");let b=function(a){let b,c=a.match(/^git@([^:]+):(.+)$/);if(c)return{host:c[1],pathSegments:aJ(c[2]).split("/").filter(Boolean)};try{b=new URL(a)}catch{return null}return{host:b.hostname,pathSegments:aJ(decodeURIComponent(b.pathname)).split("/").filter(Boolean)}}(a);b&&b.pathSegments.length>0&&i(b.pathSegments[b.pathSegments.length-1]),r||q(await aK(a))},K=async()=>{if(n.trim()&&p.trim()){A("cloning"),C("");try{let a=function(a){let b=a.trim();if(!b)return"";if(b.startsWith("git@")||b.startsWith("ssh://")||b.endsWith(".git"))return b;try{let a=new URL(b),c=a.hostname,d=decodeURIComponent(a.pathname).split("/").filter(Boolean);if("code.iflytek.com"===c){let a=[...d];"osc"===a[0]&&"_source"===a[1]&&(a=a.slice(2));let e=a.indexOf("-");if(e>0&&(a=a.slice(0,e)),0===a.length)return b;return`https://${c}/${a.join("/")}.git`}return`${a.origin}${a.pathname.replace(/\/$/,"")}.git`}catch{return b}}(n.trim()),b=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:a,path:p.trim()})}),c=await b.json();if(!b.ok){A("error"),C(c.error||"Clone failed");return}A("success")}catch{A("error"),C("Network error")}}},L=async()=>{h.trim()&&(await e?.({name:h.trim(),alias:j.trim()||void 0,description:l.trim()||void 0,gitUrl:n.trim()||void 0,localPath:p.trim()||void 0,projectType:x}),H(),d(!1))};return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(s.Dialog,{open:a,onOpenChange:a=>{d(a),a||H()},disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("topbar.newProject")})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.gitUrl")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.gitUrlHint")}),(0,b.jsx)(v.Input,{placeholder:f("project.gitPlaceholder"),value:n,onChange:a=>J(a.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.localPathHint")}),(0,b.jsx)(v.Input,{placeholder:f("project.localPathPlaceholder"),value:p,onChange:a=>{q(a.target.value),w(!0)},className:"mt-1.5 font-mono text-xs w-full"}),p.trim().startsWith("~")&&(0,b.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),f("project.tildeWarning")]}),n.trim()&&p.trim()&&(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,b.jsxs)(u.Button,{type:"button",disabled:"cloning"===z||"success"===z,onClick:K,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===z?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===z?(0,b.jsx)(aE.Check,{className:"h-3 w-3"}):(0,b.jsx)(al.GitBranch,{className:"h-3 w-3"}),"cloning"===z?f("git.cloning"):"success"===z?f("git.cloned"):f("git.clone")]}),"error"===z&&(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),B]}),"success"===z&&(0,b.jsx)("span",{className:"text-[11px] text-emerald-400",children:f("git.cloneSuccess")})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(v.Input,{placeholder:f("project.namePlaceholder"),value:h,onChange:a=>i(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(aH.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:x,onChange:y})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(v.Input,{placeholder:f("project.aliasPlaceholder"),value:j,onChange:a=>k(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{type:"button",variant:"ghost",onClick:I,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!p.trim()||F?"opacity-50":""}`}),children:[F?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(aG.Sparkles,{className:"h-3 w-3"}),F?f("project.analyzing"):f("project.genDesc")]}),(0,b.jsx)(t.TooltipContent,{children:p.trim()?"success"!==z?f("project.genDescNotCloned"):f("project.genDescReady"):f("project.genDescNoPath")})]})]}),(0,b.jsx)(aI.Textarea,{placeholder:f("project.descPlaceholder"),value:l,onChange:a=>m(a.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>{d(!1),H()},children:f("common.cancel")}),(0,b.jsx)(u.Button,{onClick:L,disabled:!h.trim()||F,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:f("common.create")})]})]})})})}var aN=a.i(690834),aN=aN,aO=a.i(563504),aP=a.i(775788);let aQ=(0,w.createServerReference)("60c9debab62ab636e3bb82d67fe9d032e6722bba52",w.callServer,void 0,w.findSourceMapURL,"migrateProjectPath"),aR=(0,w.createServerReference)("40d22d8522ddcd2962bee63eb58d49f34d0df34faf",w.callServer,void 0,w.findSourceMapURL,"checkMigrationSafety");function aS({open:a,onOpenChange:d,onCreateProject:e}){let{t:f,locale:g}=(0,D.useI18n)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(""),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)("FRONTEND"),[A,B]=(0,c.useState)(!1),[C,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(""),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(""),[M,N]=(0,c.useState)(""),[O,P]=(0,c.useState)(!1),[Q,R]=(0,c.useState)(!1),S=()=>{i(""),k(""),m(""),p(""),r(""),z("FRONTEND"),B(!1),F(!1),H(""),J(!1),L(""),N(""),P(!1),R(!1)},T=async a=>{r(a),B(!1),F(!1),H(""),L(""),N(""),P(!1),i(a.split("/").filter(Boolean).pop()??"");try{let b=await fetch(`/api/git?path=${encodeURIComponent(a)}`);if(b.ok){let a=await b.json();if(a.isGit&&a.remoteUrl){p(a.remoteUrl),B(!0);let b=a.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);b&&i(b[1])}}}catch{}},U=(0,c.useCallback)(async a=>{if(F(a),L(""),N(""),P(!1),!a)return void H("");if(n)try{let a=await aK(n);a&&(H(a),a===q&&P(!0))}catch{}if(q)try{let a=await fetch(`/api/git?path=${encodeURIComponent(q)}&checkWorktrees=true`);a.ok&&(await a.json()).hasWorktrees&&N(f("project.worktreeWarning"))}catch{}},[n,q]),V=async()=>{if(q&&!Q){R(!0);try{let a=await (0,aL.analyzeProjectDirectory)(q.trim(),g);m(a)}catch{E.toast.error(f("project.analyzeError"))}finally{R(!1)}}},W=async()=>{if(!h.trim())return;let a={name:h.trim(),alias:j.trim()||void 0,description:l.trim()||void 0,gitUrl:n.trim()||void 0,localPath:q.trim()||void 0,projectType:y},b=await e?.(a);if(C&&G&&G!==q&&b&&"id"in b){J(!0),L("");let a=await aR(b.id);if(!a.safe){L(a.reason),J(!1);return}let c=await aQ(b.id,G);if(J(!1),!c.success)return void L(c.error??f("project.migrateError"));E.toast.success(f("project.migrateSuccess"))}S(),d(!1)},X=!h.trim()||!q.trim()||I||Q||C&&!!M;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s.Dialog,{open:a,onOpenChange:a=>{d(a),a||S()},disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("topbar.importProject")})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.importHint")}),(0,b.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,b.jsx)(v.Input,{value:q,readOnly:!0,placeholder:f("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,b.jsxs)(u.Button,{type:"button",variant:"outline",onClick:()=>x(!0),className:"shrink-0 gap-1.5",children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),f("folder.browse")]})]}),A&&(0,b.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:f("project.autoDetected")})]}),n&&(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.gitUrl")}),(0,b.jsx)(v.Input,{value:n,onChange:a=>p(a.target.value),className:"mt-1.5 font-mono text-xs"})]}),A&&q&&(0,b.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs font-medium",children:f("project.migrate")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.migrateHint")})]}),(0,b.jsx)(aP.Switch,{checked:C,onCheckedChange:a=>U(a)})]}),C&&(0,b.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:f("project.targetPath")}),(0,b.jsx)(v.Input,{value:G,onChange:a=>{H(a.target.value),P(a.target.value===q)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),O&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,b.jsx)(aN.default,{className:"h-3 w-3"}),f("project.samePathInfo")]}),M&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),M]}),K&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),K]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(v.Input,{placeholder:f("project.namePlaceholder"),value:h,onChange:a=>i(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(aH.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:y,onChange:z})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(v.Input,{placeholder:f("project.aliasPlaceholder"),value:j,onChange:a=>k(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{type:"button",variant:"ghost",onClick:V,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!q||Q?"opacity-50":""}`}),children:[Q?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(aG.Sparkles,{className:"h-3 w-3"}),Q?f("project.analyzing"):f("project.genDesc")]}),(0,b.jsx)(t.TooltipContent,{children:q?f("project.genDescReady"):f("project.genDescNoPath")})]})]}),(0,b.jsx)(aI.Textarea,{placeholder:f("project.descPlaceholder"),value:l,onChange:a=>m(a.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>{d(!1),S()},children:f("common.cancel")}),(0,b.jsx)(u.Button,{onClick:W,disabled:X,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:I?f("project.migrating"):f("common.create")})]})]})}),(0,b.jsx)(aO.FolderBrowserDialog,{open:w,onOpenChange:x,onSelect:a=>T(a)})]})}function aT({onCreateProject:a,username:e}){let{t:f,locale:h,setLocale:i}=(0,D.useI18n)(),{isOpen:j,toggleAssistant:k}=aC(),{resolvedTheme:l,toggleTheme:m,triggerRef:n}=function(){let{resolvedTheme:a,setTheme:b}=(0,K.useTheme)(),d=(0,c.useRef)(null),e=(0,c.useCallback)(c=>{let d="dark"===a?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let a=c?.clientX??window.innerWidth/2,e=c?.clientY??0,f=Math.hypot(Math.max(a,window.innerWidth-a),Math.max(e,window.innerHeight-e));document.startViewTransition(()=>{b(d)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${e}px)`,`circle(${f}px at ${a}px ${e}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else b(d)},[a,b]);return{resolvedTheme:a,toggleTheme:e,triggerRef:d}}(),p=(0,d.useRouter)(),[r,s]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"k"===a.key&&(a.preventDefault(),s(!0))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,b.jsx)("div",{className:"w-40"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(u.Button,{variant:"outline",onClick:()=>s(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,b.jsx)(L.Search,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:f("topbar.searchPlaceholder")}),(0,b.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,b.jsx)(N,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{delay:500,render:(0,b.jsx)("button",{"data-tour":"open-assistant",onClick:k,"aria-label":f("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",j?"bg-accent text-foreground":""].join(" ")}),children:(0,b.jsx)(P,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{children:f("assistant.iconLabel")})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{variant:"ghost",onClick:()=>i("zh"===h?"en":"zh"),className:"text-muted-foreground"}),children:[(0,b.jsx)(O.Globe,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===h?"EN":"中"})]}),(0,b.jsx)(t.TooltipContent,{children:f("settings.language")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{ref:n,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===l?(0,b.jsx)(Q.Sun,{className:"h-4 w-4"}):(0,b.jsx)(R.Moon,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{children:f("settings.theme")})]}),(0,b.jsx)("div",{className:"h-4 w-px bg-border"}),(0,b.jsxs)(u.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>y(!0),children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),f("topbar.importProject")]}),(0,b.jsxs)(u.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>w(!0),children:[(0,b.jsx)(g.Plus,{className:"h-3.5 w-3.5"}),f("topbar.newProject")]}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{render:(0,b.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[e&&(0,b.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:e}),(0,b.jsx)(ai,{className:"h-7 w-7 ring-1 ring-border",children:(0,b.jsx)(aj,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:e?e.trim().split(/\s+/).filter(a=>a.length>0).slice(0,2).map(a=>a[0].toUpperCase()).join(""):"U"})})]})}),(0,b.jsx)(q.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,b.jsx)(M.Settings,{className:"mr-2 h-3.5 w-3.5"}),f("settings.title")]})})]})]})]}),(0,b.jsx)(av,{open:r,onOpenChange:s}),(0,b.jsx)(aM,{open:v,onOpenChange:w,onCreateProject:a}),(0,b.jsx)(aS,{open:x,onOpenChange:y,onCreateProject:a})]})}var aU=a.i(184083),aV=c,aW=a.i(145685);class aX extends aV.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,b.jsxs)(u.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,b.jsx)(aW.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}var aY=a.i(322117),aZ=a.i(357089),a$=a.i(354994);let a_=(0,aZ.default)(async()=>{},{loadableGenerated:{modules:[834880]},ssr:!1});function a0({mode:a}){let{isOpen:c,closeAssistant:d,sessions:e,activeSessionId:f,createNewSession:h,switchSession:j,removeSession:k}=aC(),{t:l}=(0,D.useI18n)(),m=e.find(a=>a.id===f),n=m?.title??l("assistant.newSession");return(0,b.jsxs)("div",{className:"sidebar"===a?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,b.jsx)(P,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:l("assistant.title")}),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsxs)(q.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":l("assistant.sessionList"),children:[(0,b.jsx)("span",{className:"truncate",children:n}),(0,b.jsx)(a$.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,b.jsxs)(q.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===e.length?(0,b.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:l("assistant.noSessions")}):e.map(a=>(0,b.jsxs)(q.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>j(a.id),children:[(0,b.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,b.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:a.title}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return`${e}d ago`}(a.updatedAt)})]}),(0,b.jsx)(u.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:b=>{b.stopPropagation(),k(a.id)},"aria-label":l("assistant.deleteSession"),children:(0,b.jsx)(i.Trash2,{className:"h-3 w-3"})})]},a.id)),e.length>0&&(0,b.jsx)(q.DropdownMenuSeparator,{}),(0,b.jsxs)(q.DropdownMenuItem,{onClick:h,children:[(0,b.jsx)(g.Plus,{className:"h-3 w-3 mr-1"}),(0,b.jsx)("span",{className:"text-xs",children:l("assistant.newSession")})]})]})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:h,"aria-label":l("assistant.newSession"),children:(0,b.jsx)(g.Plus,{className:"h-4 w-4"})})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:d,"aria-label":l("assistant.closeLabel"),children:(0,b.jsx)(ao.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden",children:c?(0,b.jsx)(a_,{}):null})]})}var a1=a.i(684262);function a2({onDismiss:a}){let{t:d}=(0,D.useI18n)(),[e,f]=(0,c.useState)(!1);(0,c.useEffect)(()=>{},[]);let g=async()=>{"default"!==await window.Notification.requestPermission()&&(f(!1),a?.())};return e?(0,b.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,b.jsx)(a1.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,b.jsx)("span",{className:"flex-1 text-sm",children:d("notification.permissionPrompt")}),(0,b.jsx)(u.Button,{size:"default",onClick:g,children:d("notification.allow")}),(0,b.jsx)(u.Button,{variant:"ghost",size:"default",onClick:()=>{f(!1),a?.()},children:d("notification.dismiss")})]}):null}w.callServer,w.findSourceMapURL;var a3=a.i(496231);let a4=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function a5({onComplete:a}){let{t:d}=(0,D.useI18n)(),[e,f]=(0,c.useState)(0),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,c.useRef)(null),l=a4[e],m=(0,c.useCallback)(async()=>{await (0,a3.setConfigValue)("onboarding.tourCompleted",!0),a()},[a]),n=(0,c.useCallback)(()=>l?document.querySelector(`[data-tour="${l.target}"]`):null,[l]),o=(0,c.useCallback)(()=>{let a=n();a?(h(a.getBoundingClientRect()),j(!0)):j(!1)},[n]);(0,c.useEffect)(()=>{o();let a=null;!i&&l?.waitForTarget&&(k.current=new MutationObserver(()=>{let b=n();b&&(h(b.getBoundingClientRect()),j(!0),k.current?.disconnect(),a&&clearTimeout(a))}),k.current.observe(document.body,{childList:!0,subtree:!0}),a=setTimeout(()=>{!n()&&(f(a=>{let b=a+1;return b<a4.length?b:a}),e>=a4.length-1&&m())},5e3));let b=()=>o();return window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{k.current?.disconnect(),a&&clearTimeout(a),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[e,l,n,o,i,m]),(0,c.useEffect)(()=>{let a=setInterval(o,1e3);return()=>clearInterval(a)},[o]);let p=(0,c.useCallback)(()=>{e<a4.length-1?(f(a=>a+1),j(!1)):m()},[e]);return l?(0,b.jsx)(b.Fragment,{children:i&&g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
1
+ module.exports=[690834,a=>{"use strict";let b=(0,a.i(302856).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);a.s(["default",0,b])},582043,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(448287),e=a.i(759985),f=a.i(14180),g=a.i(263973),h=a.i(94202),i=a.i(569210),j=a.i(317076),k=a.i(302856);let l=(0,k.default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]),m=(0,k.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var n=a.i(161604),o=a.i(986379);let p=(0,k.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var q=a.i(445705),r=a.i(358440),s=a.i(857122),t=a.i(95446),u=a.i(410756),v=a.i(620235),w=a.i(879876);let x=(0,w.createServerReference)("4053cafa02cfb9b55db9d70ab047af599c29eeab39",w.callServer,void 0,w.findSourceMapURL,"createWorkspace"),y=(0,w.createServerReference)("60382ca4975ce6e8a3b876b6a2415db12da405a8d8",w.callServer,void 0,w.findSourceMapURL,"updateWorkspace"),z=(0,w.createServerReference)("4023799bb1b6e289b1eea80ca7e9f2e796aeccfd47",w.callServer,void 0,w.findSourceMapURL,"deleteWorkspace"),A=(0,w.createServerReference)("401b4febc29d245dbea2f3b93a5a36d6be2b17db72",w.callServer,void 0,w.findSourceMapURL,"getLabelsForWorkspace"),B=(0,w.createServerReference)("404ada0c6930a1e775347f7dcdf03527fce7fb1f3b",w.callServer,void 0,w.findSourceMapURL,"createLabel"),C=(0,w.createServerReference)("40d11c3253d7863ddc15a680b4feb0124c7adaf829",w.callServer,void 0,w.findSourceMapURL,"deleteLabel");var D=a.i(584335),E=a.i(942308);let F=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function G({workspaces:a}){let k,s=(0,d.useRouter)(),v=(0,d.usePathname)(),{t:w}=(0,D.useI18n)(),[A,B]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&B(!0)},[]);let[C,I]=(0,c.useState)(!1),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)(!1),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)(""),[S,T]=(0,c.useState)(F[0]),[U,V]=(0,c.useState)(null),W=v.split("/workspaces/")[1]?.split("/")[0],X=(0,c.useCallback)(()=>{B(a=>{let b=!a;return localStorage.setItem("sidebar-collapsed",String(b)),b})},[]),Y=(0,c.useCallback)(async()=>{if(!Q.trim())return;let a=await x({name:Q.trim(),description:S});R(""),T(F[0]),I(!1),s.refresh(),s.push(`/workspaces/${a.id}`)},[Q,S,s]),Z=(0,c.useCallback)(async()=>{Q.trim()&&U&&(await y(U,{name:Q.trim(),description:S}),R(""),L(!1),V(null),s.refresh())},[Q,S,U,s]),$=(0,c.useCallback)(a=>{V(a.id),R(a.name),T(a.description&&F.includes(a.description)?a.description:F[0]),L(!0)},[]),_=(0,c.useCallback)(async(b,c)=>{if(a.length<=1)return void E.toast.error(w("sidebar.lastWorkspaceError"));if(confirm(w("sidebar.deleteConfirm",{name:c})))try{await z(b),s.refresh(),W===b&&s.push("/workspaces")}catch{E.toast.error(w("sidebar.lastWorkspaceError"))}},[W,s,w,a.length]),aa=(0,c.useCallback)(a=>{P(a),N(!0)},[]),ab=a=>a.description&&F.includes(a.description)?a.description:a.name.charAt(0).toUpperCase();if(A){let c;return(0,b.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:X,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.expand")})]}),(0,b.jsx)(r.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[a.map(a=>{let c=W===a.id,d=ab(a);return(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>{c||s.push(`/workspaces/${a.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${c?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,b.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:F.includes(d)?d:(0,b.jsx)("span",{className:"text-xs font-semibold",children:d})})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:a.name})]},a.id)}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{"data-tour":"create-workspace",onClick:()=>I(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,b.jsx)(g.Plus,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.newWorkspace")})]})]})}),(0,b.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(c=W||a[0]?.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/notes`),className:`rounded-lg p-2 transition-colors ${v.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(n.FileText,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.notes")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/assets`),className:`rounded-lg p-2 transition-colors ${v.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(o.FolderOpen,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.assets")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push(`/workspaces/${c}/archive`),className:`rounded-lg p-2 transition-colors ${v.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(f.Archive,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("sidebar.archive")})]})]}):null,(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)("button",{onClick:()=>s.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===v?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,b.jsx)(p,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{side:"right",sideOffset:8,children:w("missions.navLabel")})]})]}),(0,b.jsx)(H,{open:C,onOpenChange:I,title:w("workspace.create"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Y,submitLabel:w("common.create"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")})]})}return(0,b.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,b.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,b.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon-xs",onClick:X,className:"text-muted-foreground",title:w("sidebar.collapse"),children:(0,b.jsx)(l,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:w("sidebar.workspace")}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{R(""),T(F[0]),I(!0)},title:w("sidebar.newWorkspace"),children:(0,b.jsx)(g.Plus,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)(r.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,b.jsx)("div",{className:"px-2 py-1",children:a.map(c=>{var d;let e,f,g,k=W===c.id,l=ab(c);return(0,b.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${k?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,b.jsxs)("button",{onClick:()=>{k||s.push(`/workspaces/${c.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${k?"cursor-default":"cursor-pointer"}`,children:[(0,b.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:F.includes(l)?l:(0,b.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:l})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:`truncate text-sm font-medium ${k?"text-foreground":"text-secondary-foreground"}`,children:c.name}),(0,b.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(d=c.updatedAt,f=Math.floor((e=Date.now()-new Date(d).getTime())/6e4),g=Math.floor(e/36e5),f<60?`${f}m ago`:g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`)})]})]}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{render:(0,b.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:a=>a.stopPropagation()}),children:(0,b.jsx)(j.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)(q.DropdownMenuContent,{align:"start",side:"right",children:[(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>$(c),children:[(0,b.jsx)(h.Pencil,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.rename")]}),(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>aa(c.id),children:[(0,b.jsx)(m,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.manageLabels")]}),(0,b.jsxs)(q.DropdownMenuItem,{className:a.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:a.length<=1,onClick:()=>_(c.id,c.name),children:[(0,b.jsx)(i.Trash2,{className:"mr-2 h-3.5 w-3.5"}),w("sidebar.delete")]})]})]})]},c.id)})})}),(0,b.jsxs)(e.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===v?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(p,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("missions.navLabel")})]}),(k=W||a[0]?.id)?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(e.default,{href:`/workspaces/${k}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(n.FileText,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.notes")})]}),(0,b.jsxs)(e.default,{href:`/workspaces/${k}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.assets")})]}),(0,b.jsxs)(e.default,{href:`/workspaces/${k}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,b.jsx)(f.Archive,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:w("sidebar.archive")})]})]}):null,(0,b.jsx)(H,{open:C,onOpenChange:I,title:w("workspace.create"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Y,submitLabel:w("common.create"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")}),(0,b.jsx)(H,{open:K,onOpenChange:a=>{L(a),a||V(null)},title:w("workspace.edit"),name:Q,onNameChange:R,icon:S,onIconChange:T,onSubmit:Z,submitLabel:w("common.save"),nameLabel:w("workspace.name"),iconLabel:w("workspace.icon"),namePlaceholder:w("workspace.namePlaceholder"),cancelLabel:w("common.cancel")}),O&&(0,b.jsx)(J,{open:M,onOpenChange:a=>{N(a),a||P(null)},workspaceId:O})]})}function H({open:a,onOpenChange:c,title:d,name:e,onNameChange:f,icon:g,onIconChange:h,onSubmit:i,submitLabel:j,nameLabel:k,iconLabel:l,namePlaceholder:m,cancelLabel:n}){return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:c,disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:d})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k}),(0,b.jsx)(v.Input,{placeholder:m,value:e,onChange:a=>f(a.target.value),onKeyDown:a=>"Enter"===a.key&&a.preventDefault(),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:l}),(0,b.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:F.map(a=>(0,b.jsx)("button",{onClick:()=>h(a),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${g===a?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:a},a))})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>c(!1),children:n}),(0,b.jsx)(u.Button,{onClick:i,disabled:!e.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:j})]})]})})}let I=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function J({open:a,onOpenChange:d,workspaceId:e}){let{t:f}=(0,D.useI18n)(),[g,h]=(0,c.useState)([]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(I[0]);(0,c.useEffect)(()=>{a&&A(e).then(h)},[a,e]);let m=async()=>{i.trim()&&(await B({name:i.trim(),color:k,workspaceId:e}),h(await A(e)),j(""))},n=async a=>{await C(a),h(b=>b.filter(b=>b.id!==a))};return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:d,disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("label.manage")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[g.map(a=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:a.color}}),(0,b.jsx)("span",{className:"flex-1 text-sm text-foreground",children:a.name}),a.isBuiltin?(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:f("label.builtin")}):(0,b.jsx)("button",{onClick:()=>n(a.id),className:"text-xs text-rose-400 hover:text-rose-300",children:f("common.delete")})]},a.id)),(0,b.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(v.Input,{placeholder:f("label.name"),value:i,onChange:a=>j(a.target.value),onKeyDown:a=>"Enter"===a.key&&a.preventDefault(),className:"flex-1 h-8"}),(0,b.jsx)(u.Button,{size:"sm",onClick:m,disabled:!i.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:f("label.add")})]}),(0,b.jsx)("div",{className:"mt-2 flex gap-1.5",children:I.map(a=>(0,b.jsx)("button",{onClick:()=>l(a),className:`h-5 w-5 rounded-full transition-all ${k===a?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:a}},a))})]})]})]})})}var K=a.i(432120),L=a.i(410215),M=a.i(666775);let N=(0,k.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var O=a.i(212765);let P=(0,k.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var Q=a.i(248763),R=a.i(470612);a.s([],243701),a.i(243701);var S=a.i(256116),T=a.i(545264);let U=c.createContext(void 0);function V(){let a=c.useContext(U);if(void 0===a)throw Error((0,T.default)(13));return a}let W={imageLoadingStatus:()=>null},X=c.forwardRef(function(a,d){let{className:e,render:f,...g}=a,[h,i]=c.useState("idle"),j=c.useMemo(()=>({imageLoadingStatus:h,setImageLoadingStatus:i}),[h,i]),k=(0,S.useRenderElement)("span",a,{state:{imageLoadingStatus:h},ref:d,props:g,stateAttributesMapping:W});return(0,b.jsx)(U.Provider,{value:j,children:k})});var Y=a.i(825863),Z=a.i(527993),$=a.i(759002),_=a.i(163323),aa=a.i(6644),ab=a.i(302398);let ac={...W,..._.transitionStatusMapping},ad=c.forwardRef(function(a,b){let{className:d,render:e,onLoadingStatusChange:f,referrerPolicy:g,crossOrigin:h,...i}=a,j=V(),k=function(a,{referrerPolicy:b,crossOrigin:d}){let[e,f]=c.useState("idle");return(0,Z.useIsoLayoutEffect)(()=>{if(!a)return f("error"),ab.NOOP;let c=!0,e=new window.Image,g=a=>()=>{c&&f(a)};return f("loading"),e.onload=g("loaded"),e.onerror=g("error"),b&&(e.referrerPolicy=b),e.crossOrigin=d??null,e.src=a,()=>{c=!1}},[a,d,b]),e}(a.src,{referrerPolicy:g,crossOrigin:h}),l="loaded"===k,{mounted:m,transitionStatus:n,setMounted:o}=(0,aa.useTransitionStatus)(l),p=c.useRef(null),q=(0,Y.useStableCallback)(a=>{f?.(a),j.setImageLoadingStatus(a)});(0,Z.useIsoLayoutEffect)(()=>{"idle"!==k&&q(k)},[k,q]),(0,$.useOpenChangeComplete)({open:l,ref:p,onComplete(){l||o(!1)}});let r=(0,S.useRenderElement)("img",a,{state:{imageLoadingStatus:k,transitionStatus:n},ref:[b,p],props:i,stateAttributesMapping:ac,enabled:m});return m?r:null});var ae=a.i(313668);let af=c.forwardRef(function(a,b){let{className:d,render:e,delay:f,...g}=a,{imageLoadingStatus:h}=V(),[i,j]=c.useState(void 0===f),k=(0,ae.useTimeout)();return c.useEffect(()=>(void 0!==f&&k.start(f,()=>j(!0)),k.clear),[k,f]),(0,S.useRenderElement)("span",a,{state:{imageLoadingStatus:h},ref:b,props:g,stateAttributesMapping:W,enabled:"loaded"!==h&&i})});a.s(["Fallback",0,af,"Image",0,ad,"Root",0,X],60418);var ag=a.i(60418),ag=ag,ah=a.i(44585);function ai({className:a,size:c="default",...d}){return(0,b.jsx)(ag.Root,{"data-slot":"avatar","data-size":c,className:(0,ah.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",a),...d})}function aj({className:a,...c}){return(0,b.jsx)(ag.Fallback,{"data-slot":"avatar-fallback",className:(0,ah.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",a),...c})}let ak=(0,k.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var al=a.i(61966);let am=(0,k.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),an=(0,k.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var ao=a.i(54709);let ap=(0,w.createServerReference)("609244a9f3f4f377d81d0ae7115b92c04e7345c72c",w.callServer,void 0,w.findSourceMapURL,"globalSearch");var aq=a.i(4909);let ar=[{id:"all",key:"search.all",icon:L.Search},{id:"task",key:"search.task",icon:n.FileText},{id:"project",key:"search.project",icon:ak},{id:"repository",key:"search.repository",icon:al.GitBranch},{id:"note",key:"search.note",icon:am},{id:"asset",key:"search.asset",icon:an}],as=["task","project","repository","note","asset"],at={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function au({result:a,onSelect:c}){let d=ar.find(b=>b.id===a.type)?.icon??n.FileText;return(0,b.jsxs)("button",{onClick:()=>c(a),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,b.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,b.jsx)(d,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:a.title}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:a.subtitle}),a.snippet&&(0,b.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:a.snippet})]})]})}function av({open:a,onOpenChange:e}){let f,{t:g}=(0,D.useI18n)(),h=(0,d.useRouter)(),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)("all"),[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(!1),[q,t]=(0,c.useState)(250),v=(0,c.useRef)(null),w=(0,c.useRef)(null);(0,c.useEffect)(()=>{a&&((0,aq.getConfigValue)("search.debounceMs",250).then(t),setTimeout(()=>v.current?.focus(),100),j(""),n([]))},[a]),(0,c.useEffect)(()=>{if(w.current&&clearTimeout(w.current),!i.trim()){n([]),p(!1);return}p(!0);let a=!1;return w.current=setTimeout(async()=>{let b=await ap(i,k);a||(n(b),p(!1))},q),()=>{w.current&&clearTimeout(w.current),a=!0}},[i,k,q]);let x=(0,c.useCallback)(a=>{h.push(a.navigateTo),e(!1)},[h,e]);return(0,b.jsx)(s.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,b.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,b.jsx)(L.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,b.jsx)("input",{ref:v,value:i,onChange:a=>j(a.target.value),placeholder:g("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),i&&(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",onClick:()=>{j(""),n([])},className:"text-muted-foreground",children:(0,b.jsx)(ao.X,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:ar.map(a=>{let c=a.icon;return(0,b.jsxs)("button",{onClick:()=>l(a.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${k===a.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,b.jsx)(c,{className:"h-3 w-3"}),g(a.key)]},a.id)})}),(0,b.jsxs)(r.ScrollArea,{className:"max-h-80",children:[!i.trim()&&(0,b.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:g("search.typeToSearch")}),i.trim()&&0===m.length&&!o&&(0,b.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:g("search.noResults")}),"all"===k&&m.length>0&&(f=m.reduce((a,b)=>((a[b.type]??=[]).push(b),a),{}),as.filter(a=>f[a]?.length).map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:g(at[a])}),f[a].map(a=>(0,b.jsx)(au,{result:a,onSelect:x},`${a.type}-${a.id}`))]},a))),"all"!==k&&m.map(a=>(0,b.jsx)(au,{result:a,onSelect:x},`${a.type}-${a.id}`))]})]})})}function aw(a){}let ax=(0,c.createContext)(null);function ay(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let az="assistant-image-cache";function aA(a,b,c){try{let d=sessionStorage.getItem(az),e=d?JSON.parse(d):{};e[a]||(e[a]={}),e[a][b]=c,sessionStorage.setItem(az,JSON.stringify(e))}catch{}}function aB({children:a}){let[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)("sidebar"),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)("idle"),[p,q]=(0,c.useState)(!1),r=(0,c.useRef)([]),s=(0,c.useRef)(null),t=(0,c.useRef)(null),[u,v]=(0,c.useState)([]),[w,x]=(0,c.useState)(null),y=(0,c.useRef)(!1),z=(0,c.useCallback)(()=>{m([...r.current])},[]),A=(0,c.useCallback)(async()=>{i("dialog"===await (0,aq.getConfigValue)("assistant.displayMode","sidebar")?"dialog":"sidebar")},[]);(0,c.useEffect)(()=>{A()},[A]);let B=(0,c.useCallback)(async()=>{v([])},[]),C=(0,c.useCallback)(async a=>{q(!0);try{let b=await fetch(`/api/internal/assistant/sessions?sessionId=${encodeURIComponent(a)}`);if(!b.ok)return;let c=await b.json();if(Array.isArray(c.messages)){r.current=c.messages;let b=function(a){try{let b=sessionStorage.getItem(az);if(!b)return{};return JSON.parse(b)[a]??{}}catch{return{}}}(a);if(Object.keys(b).length>0){let a=0;r.current=r.current.map(c=>{if("user"===c.role){let d=b[a];if(a++,d?.length)return{...c,imageFilenames:d}}return c})}m([...r.current])}}catch{}finally{q(!1)}},[]);(0,c.useEffect)(()=>{B()},[B,C]);let D=(0,c.useCallback)(()=>{t.current?.abort(),s.current=null,y.current=!1,x(null),aw(null),r.current=[],m([]),o("idle")},[]),E=(0,c.useCallback)(a=>{t.current?.abort(),s.current=a,y.current=!0,x(a),aw(a),r.current=[],m([]),o("idle"),C(a)},[C]),F=(0,c.useCallback)(a=>{v([]),w===a&&D()},[w,D]),G=(0,c.useCallback)(async()=>{g(!0);try{await A(),e(!0)}finally{g(!1)}},[A]),H=(0,c.useCallback)(()=>{e(!1),t.current?.abort()},[]),I=(0,c.useCallback)(()=>{d||f?H():G()},[d,f,H,G]);(0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"l"===a.key&&(a.preventDefault(),I())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[I]);let J=(0,c.useCallback)(async(a,b)=>{if(!a.trim()&&!b?.imageFilenames?.length)return;t.current?.abort();let c=new AbortController;t.current=c;let d=0!==r.current.length||y.current?null:a,e=ay();if(r.current=[...r.current,{id:ay(),role:"user",content:a,imageFilenames:b?.imageFilenames?.length?b.imageFilenames:void 0},{id:e,role:"thinking",content:"",isStreaming:!0}],z(),b?.imageFilenames?.length&&s.current){let a=r.current.filter(a=>"user"===a.role).length-1;aA(s.current,a,b.imageFilenames)}o("connecting");let f=null;try{let g=await fetch("/api/internal/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a,sessionId:s.current,imageFilenames:b?.imageFilenames??[]}),signal:c.signal});if(!g.ok||!g.body)throw Error(`HTTP ${g.status}`);o("streaming");let h=g.body.getReader(),i=new TextDecoder,j="";for(;;){let{done:a,value:c}=await h.read();if(a)break;let g=(j+=i.decode(c,{stream:!0})).split("\n");for(let a of(j=g.pop()??"",g)){let c;if(a.startsWith("data: ")){try{c=JSON.parse(a.slice(6).trim())}catch{continue}if(c.sessionId){let a=s.current;if(s.current=c.sessionId,d&&!y.current&&c.sessionId!==a){y.current=!0;new Date().toISOString();c.sessionId,function(a){let b=a.trim();b&&b.length>30&&b.slice(0,30)}(d),v([]),x(c.sessionId),aw(c.sessionId),b?.imageFilenames?.length&&aA(c.sessionId,0,b.imageFilenames)}}switch(c.type){case"text_delta":{let a=r.current.filter(a=>a.id!==e);f?r.current=a.map(a=>a.id===f?{...a,content:a.content+(c.content??""),isStreaming:!0}:a):(f=ay(),r.current=[...a,{id:f,role:"assistant",content:c.content??"",isStreaming:!0}]),z();break}case"text":{let a=r.current.filter(a=>a.id!==e);f?r.current=a.map(a=>a.id===f?{...a,content:c.content??a.content,isStreaming:!0}:a):(f=ay(),r.current=[...a,{id:f,role:"assistant",content:c.content??"",isStreaming:!0}]),z();break}case"tool_start":{let a=r.current.filter(a=>a.id!==e);f?(r.current=a.map(a=>a.id===f?{...a,isStreaming:!1}:a),f=null):r.current=a,r.current=[...r.current,{id:ay(),role:"tool",content:`Calling ${c.content??"tool"}...`,toolName:c.content,isStreaming:!0}],z();break}case"tool_use":{let a=r.current.filter(a=>a.id!==e),b=f?a.map(a=>a.id===f?{...a,isStreaming:!1}:a):a;f=null,r.current=[...b,{id:ay(),role:"tool",content:JSON.stringify(c.toolInput??{},null,2),toolName:c.content}],z();break}case"tool_result":r.current=[...r.current,{id:ay(),role:"tool",content:String(c.toolOutput??""),toolName:`${c.content??"tool"} (result)`}],z();break;case"error":r.current=[...r.current.filter(a=>a.id!==e),{id:ay(),role:"assistant",content:`Error: ${c.content??"Unknown error"}`}],z(),o("error");break;case"done":f&&(r.current=r.current.map(a=>a.id===f?{...a,isStreaming:!1}:a)),r.current=r.current.filter(a=>a.id!==e),z(),o("idle")}}}}r.current=r.current.filter(a=>a.id!==e),z(),o(a=>"streaming"===a?"idle":a),B()}catch(a){if("AbortError"===a.name)return;r.current=[...r.current.filter(a=>a.id!==e),{id:ay(),role:"assistant",content:`Connection error: ${a.message??"Unknown error"}`}],z(),o("error")}},[z,B]),K=(0,c.useCallback)(()=>{t.current?.abort(),t.current=null;let a=[...r.current].reverse().find(a=>"user"===a.role),b=a?.content??null;if(a){let b=r.current.lastIndexOf(a);r.current=r.current.slice(0,b),m([...r.current])}return o("idle"),b},[]),L=l[l.length-1],M="connecting"===n||"streaming"===n||L?.role==="thinking"&&!0===L.isStreaming;return(0,b.jsx)(ax.Provider,{value:{isOpen:d,isStarting:f,displayMode:h,worktreePath:j,toggleAssistant:I,closeAssistant:H,chatMessages:l,chatStatus:n,isChatThinking:M,isLoadingHistory:p,sendChatMessage:J,cancelChat:K,sessions:u,activeSessionId:w,createNewSession:D,switchSession:E,removeSession:F,refreshSessions:B},children:a})}function aC(){let a=(0,c.useContext)(ax);if(!a)throw Error("useAssistant must be used within an AssistantProvider");return a}var aD=a.i(109434),aE=a.i(858967),aF=a.i(467034),aG=a.i(938899),aH=a.i(845924),aI=a.i(246962);function aJ(a){return a.replace(/\.git\/?$/,"")}a.i(446786),a.i(814747);let aK=(0,w.createServerReference)("405f61fe259486435dbe10e4e794fd1e184ebe56aa",w.callServer,void 0,w.findSourceMapURL,"resolveGitLocalPath");var aL=a.i(627800);function aM({open:a,onOpenChange:d,onCreateProject:e}){let{t:f,locale:g}=(0,D.useI18n)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)("FRONTEND"),[z,A]=(0,c.useState)("idle"),[B,C]=(0,c.useState)(""),[F,G]=(0,c.useState)(!1),H=()=>{i(""),k(""),m(""),o(""),q(""),w(!1),y("FRONTEND"),A("idle"),C(""),G(!1)},I=async()=>{if(p.trim()&&!F&&"success"===z){G(!0);try{let a=await (0,aL.analyzeProjectDirectory)(p.trim(),g);m(a)}catch{E.toast.error(f("project.analyzeError"))}finally{G(!1)}}},J=async a=>{o(a),A("idle"),C("");let b=function(a){let b,c=a.match(/^git@([^:]+):(.+)$/);if(c)return{host:c[1],pathSegments:aJ(c[2]).split("/").filter(Boolean)};try{b=new URL(a)}catch{return null}return{host:b.hostname,pathSegments:aJ(decodeURIComponent(b.pathname)).split("/").filter(Boolean)}}(a);b&&b.pathSegments.length>0&&i(b.pathSegments[b.pathSegments.length-1]),r||q(await aK(a))},K=async()=>{if(n.trim()&&p.trim()){A("cloning"),C("");try{let a=function(a){let b=a.trim();if(!b)return"";if(b.startsWith("git@")||b.startsWith("ssh://")||b.endsWith(".git"))return b;try{let a=new URL(b),c=a.hostname,d=decodeURIComponent(a.pathname).split("/").filter(Boolean);if("code.iflytek.com"===c){let a=[...d];"osc"===a[0]&&"_source"===a[1]&&(a=a.slice(2));let e=a.indexOf("-");if(e>0&&(a=a.slice(0,e)),0===a.length)return b;return`https://${c}/${a.join("/")}.git`}return`${a.origin}${a.pathname.replace(/\/$/,"")}.git`}catch{return b}}(n.trim()),b=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:a,path:p.trim()})}),c=await b.json();if(!b.ok){A("error"),C(c.error||"Clone failed");return}A("success")}catch{A("error"),C("Network error")}}},L=async()=>{h.trim()&&(await e?.({name:h.trim(),alias:j.trim()||void 0,description:l.trim()||void 0,gitUrl:n.trim()||void 0,localPath:p.trim()||void 0,projectType:x}),H(),d(!1))};return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(s.Dialog,{open:a,onOpenChange:a=>{d(a),a||H()},disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("topbar.newProject")})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.gitUrl")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.gitUrlHint")}),(0,b.jsx)(v.Input,{placeholder:f("project.gitPlaceholder"),value:n,onChange:a=>J(a.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.localPathHint")}),(0,b.jsx)(v.Input,{placeholder:f("project.localPathPlaceholder"),value:p,onChange:a=>{q(a.target.value),w(!0)},className:"mt-1.5 font-mono text-xs w-full"}),p.trim().startsWith("~")&&(0,b.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),f("project.tildeWarning")]}),n.trim()&&p.trim()&&(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,b.jsxs)(u.Button,{type:"button",disabled:"cloning"===z||"success"===z,onClick:K,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===z?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===z?(0,b.jsx)(aE.Check,{className:"h-3 w-3"}):(0,b.jsx)(al.GitBranch,{className:"h-3 w-3"}),"cloning"===z?f("git.cloning"):"success"===z?f("git.cloned"):f("git.clone")]}),"error"===z&&(0,b.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),B]}),"success"===z&&(0,b.jsx)("span",{className:"text-[11px] text-emerald-400",children:f("git.cloneSuccess")})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(v.Input,{placeholder:f("project.namePlaceholder"),value:h,onChange:a=>i(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(aH.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:x,onChange:y})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(v.Input,{placeholder:f("project.aliasPlaceholder"),value:j,onChange:a=>k(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{type:"button",variant:"ghost",onClick:I,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!p.trim()||F?"opacity-50":""}`}),children:[F?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(aG.Sparkles,{className:"h-3 w-3"}),F?f("project.analyzing"):f("project.genDesc")]}),(0,b.jsx)(t.TooltipContent,{children:p.trim()?"success"!==z?f("project.genDescNotCloned"):f("project.genDescReady"):f("project.genDescNoPath")})]})]}),(0,b.jsx)(aI.Textarea,{placeholder:f("project.descPlaceholder"),value:l,onChange:a=>m(a.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>{d(!1),H()},children:f("common.cancel")}),(0,b.jsx)(u.Button,{onClick:L,disabled:!h.trim()||F,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:f("common.create")})]})]})})})}var aN=a.i(690834),aN=aN,aO=a.i(563504),aP=a.i(775788);let aQ=(0,w.createServerReference)("6088dcf2196516975ad5c496c5ac1b71f5932a6e39",w.callServer,void 0,w.findSourceMapURL,"migrateProjectPath"),aR=(0,w.createServerReference)("40e803ed0564bd5bb60bc440ffa8fa78032b84210f",w.callServer,void 0,w.findSourceMapURL,"checkMigrationSafety");function aS({open:a,onOpenChange:d,onCreateProject:e}){let{t:f,locale:g}=(0,D.useI18n)(),[h,i]=(0,c.useState)(""),[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(""),[n,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(""),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)("FRONTEND"),[A,B]=(0,c.useState)(!1),[C,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(""),[I,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(""),[M,N]=(0,c.useState)(""),[O,P]=(0,c.useState)(!1),[Q,R]=(0,c.useState)(!1),S=()=>{i(""),k(""),m(""),p(""),r(""),z("FRONTEND"),B(!1),F(!1),H(""),J(!1),L(""),N(""),P(!1),R(!1)},T=async a=>{r(a),B(!1),F(!1),H(""),L(""),N(""),P(!1),i(a.split("/").filter(Boolean).pop()??"");try{let b=await fetch(`/api/git?path=${encodeURIComponent(a)}`);if(b.ok){let a=await b.json();if(a.isGit&&a.remoteUrl){p(a.remoteUrl),B(!0);let b=a.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);b&&i(b[1])}}}catch{}},U=(0,c.useCallback)(async a=>{if(F(a),L(""),N(""),P(!1),!a)return void H("");if(n)try{let a=await aK(n);a&&(H(a),a===q&&P(!0))}catch{}if(q)try{let a=await fetch(`/api/git?path=${encodeURIComponent(q)}&checkWorktrees=true`);a.ok&&(await a.json()).hasWorktrees&&N(f("project.worktreeWarning"))}catch{}},[n,q]),V=async()=>{if(q&&!Q){R(!0);try{let a=await (0,aL.analyzeProjectDirectory)(q.trim(),g);m(a)}catch{E.toast.error(f("project.analyzeError"))}finally{R(!1)}}},W=async()=>{if(!h.trim())return;let a={name:h.trim(),alias:j.trim()||void 0,description:l.trim()||void 0,gitUrl:n.trim()||void 0,localPath:q.trim()||void 0,projectType:y},b=await e?.(a);if(C&&G&&G!==q&&b&&"id"in b){J(!0),L("");let a=await aR(b.id);if(!a.safe){L(a.reason),J(!1);return}let c=await aQ(b.id,G);if(J(!1),!c.success)return void L(c.error??f("project.migrateError"));E.toast.success(f("project.migrateSuccess"))}S(),d(!1)},X=!h.trim()||!q.trim()||I||Q||C&&!!M;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s.Dialog,{open:a,onOpenChange:a=>{d(a),a||S()},disablePointerDismissal:!0,children:(0,b.jsxs)(s.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(s.DialogHeader,{children:(0,b.jsx)(s.DialogTitle,{children:f("topbar.importProject")})}),(0,b.jsxs)("div",{className:"space-y-4 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.importHint")}),(0,b.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,b.jsx)(v.Input,{value:q,readOnly:!0,placeholder:f("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,b.jsxs)(u.Button,{type:"button",variant:"outline",onClick:()=>x(!0),className:"shrink-0 gap-1.5",children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),f("folder.browse")]})]}),A&&(0,b.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:f("project.autoDetected")})]}),n&&(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.gitUrl")}),(0,b.jsx)(v.Input,{value:n,onChange:a=>p(a.target.value),className:"mt-1.5 font-mono text-xs"})]}),A&&q&&(0,b.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs font-medium",children:f("project.migrate")}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:f("project.migrateHint")})]}),(0,b.jsx)(aP.Switch,{checked:C,onCheckedChange:a=>U(a)})]}),C&&(0,b.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:f("project.targetPath")}),(0,b.jsx)(v.Input,{value:G,onChange:a=>{H(a.target.value),P(a.target.value===q)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),O&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,b.jsx)(aN.default,{className:"h-3 w-3"}),f("project.samePathInfo")]}),M&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),M]}),K&&(0,b.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-3 w-3"}),K]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(v.Input,{placeholder:f("project.namePlaceholder"),value:h,onChange:a=>i(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(aH.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:y,onChange:z})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(v.Input,{placeholder:f("project.aliasPlaceholder"),value:j,onChange:a=>k(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{type:"button",variant:"ghost",onClick:V,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!q||Q?"opacity-50":""}`}),children:[Q?(0,b.jsx)(aD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(aG.Sparkles,{className:"h-3 w-3"}),Q?f("project.analyzing"):f("project.genDesc")]}),(0,b.jsx)(t.TooltipContent,{children:q?f("project.genDescReady"):f("project.genDescNoPath")})]})]}),(0,b.jsx)(aI.Textarea,{placeholder:f("project.descPlaceholder"),value:l,onChange:a=>m(a.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,b.jsxs)(s.DialogFooter,{children:[(0,b.jsx)(u.Button,{variant:"outline",onClick:()=>{d(!1),S()},children:f("common.cancel")}),(0,b.jsx)(u.Button,{onClick:W,disabled:X,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:I?f("project.migrating"):f("common.create")})]})]})}),(0,b.jsx)(aO.FolderBrowserDialog,{open:w,onOpenChange:x,onSelect:a=>T(a)})]})}function aT({onCreateProject:a,username:e}){let{t:f,locale:h,setLocale:i}=(0,D.useI18n)(),{isOpen:j,toggleAssistant:k}=aC(),{resolvedTheme:l,toggleTheme:m,triggerRef:n}=function(){let{resolvedTheme:a,setTheme:b}=(0,K.useTheme)(),d=(0,c.useRef)(null),e=(0,c.useCallback)(c=>{let d="dark"===a?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let a=c?.clientX??window.innerWidth/2,e=c?.clientY??0,f=Math.hypot(Math.max(a,window.innerWidth-a),Math.max(e,window.innerHeight-e));document.startViewTransition(()=>{b(d)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${e}px)`,`circle(${f}px at ${a}px ${e}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else b(d)},[a,b]);return{resolvedTheme:a,toggleTheme:e,triggerRef:d}}(),p=(0,d.useRouter)(),[r,s]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let a=a=>{(a.metaKey||a.ctrlKey)&&"k"===a.key&&(a.preventDefault(),s(!0))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,b.jsx)("div",{className:"w-40"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(u.Button,{variant:"outline",onClick:()=>s(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,b.jsx)(L.Search,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:f("topbar.searchPlaceholder")}),(0,b.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,b.jsx)(N,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{delay:500,render:(0,b.jsx)("button",{"data-tour":"open-assistant",onClick:k,"aria-label":f("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",j?"bg-accent text-foreground":""].join(" ")}),children:(0,b.jsx)(P,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{children:f("assistant.iconLabel")})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsxs)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{variant:"ghost",onClick:()=>i("zh"===h?"en":"zh"),className:"text-muted-foreground"}),children:[(0,b.jsx)(O.Globe,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===h?"EN":"中"})]}),(0,b.jsx)(t.TooltipContent,{children:f("settings.language")})]}),(0,b.jsxs)(t.Tooltip,{children:[(0,b.jsx)(t.TooltipTrigger,{render:(0,b.jsx)(u.Button,{ref:n,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===l?(0,b.jsx)(Q.Sun,{className:"h-4 w-4"}):(0,b.jsx)(R.Moon,{className:"h-4 w-4"})}),(0,b.jsx)(t.TooltipContent,{children:f("settings.theme")})]}),(0,b.jsx)("div",{className:"h-4 w-px bg-border"}),(0,b.jsxs)(u.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>y(!0),children:[(0,b.jsx)(o.FolderOpen,{className:"h-3.5 w-3.5"}),f("topbar.importProject")]}),(0,b.jsxs)(u.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>w(!0),children:[(0,b.jsx)(g.Plus,{className:"h-3.5 w-3.5"}),f("topbar.newProject")]}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsx)(q.DropdownMenuTrigger,{render:(0,b.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[e&&(0,b.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:e}),(0,b.jsx)(ai,{className:"h-7 w-7 ring-1 ring-border",children:(0,b.jsx)(aj,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:e?e.trim().split(/\s+/).filter(a=>a.length>0).slice(0,2).map(a=>a[0].toUpperCase()).join(""):"U"})})]})}),(0,b.jsx)(q.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,b.jsxs)(q.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,b.jsx)(M.Settings,{className:"mr-2 h-3.5 w-3.5"}),f("settings.title")]})})]})]})]}),(0,b.jsx)(av,{open:r,onOpenChange:s}),(0,b.jsx)(aM,{open:v,onOpenChange:w,onCreateProject:a}),(0,b.jsx)(aS,{open:x,onOpenChange:y,onCreateProject:a})]})}var aU=a.i(184083),aV=c,aW=a.i(145685);class aX extends aV.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,b.jsx)(aF.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,b.jsxs)(u.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,b.jsx)(aW.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}var aY=a.i(222292),aZ=a.i(357089),a$=a.i(354994);let a_=(0,aZ.default)(async()=>{},{loadableGenerated:{modules:[834880]},ssr:!1});function a0({mode:a}){let{isOpen:c,closeAssistant:d,sessions:e,activeSessionId:f,createNewSession:h,switchSession:j,removeSession:k}=aC(),{t:l}=(0,D.useI18n)(),m=e.find(a=>a.id===f),n=m?.title??l("assistant.newSession");return(0,b.jsxs)("div",{className:"sidebar"===a?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,b.jsx)(P,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,b.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:l("assistant.title")}),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsxs)(q.DropdownMenu,{children:[(0,b.jsxs)(q.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":l("assistant.sessionList"),children:[(0,b.jsx)("span",{className:"truncate",children:n}),(0,b.jsx)(a$.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,b.jsxs)(q.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===e.length?(0,b.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:l("assistant.noSessions")}):e.map(a=>(0,b.jsxs)(q.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>j(a.id),children:[(0,b.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,b.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:a.title}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/1e3);if(b<60)return`${b}s ago`;let c=Math.floor(b/60);if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d}h ago`;let e=Math.floor(d/24);return`${e}d ago`}(a.updatedAt)})]}),(0,b.jsx)(u.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:b=>{b.stopPropagation(),k(a.id)},"aria-label":l("assistant.deleteSession"),children:(0,b.jsx)(i.Trash2,{className:"h-3 w-3"})})]},a.id)),e.length>0&&(0,b.jsx)(q.DropdownMenuSeparator,{}),(0,b.jsxs)(q.DropdownMenuItem,{onClick:h,children:[(0,b.jsx)(g.Plus,{className:"h-3 w-3 mr-1"}),(0,b.jsx)("span",{className:"text-xs",children:l("assistant.newSession")})]})]})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:h,"aria-label":l("assistant.newSession"),children:(0,b.jsx)(g.Plus,{className:"h-4 w-4"})})]}),(0,b.jsx)(u.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:d,"aria-label":l("assistant.closeLabel"),children:(0,b.jsx)(ao.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden",children:c?(0,b.jsx)(a_,{}):null})]})}var a1=a.i(684262);function a2({onDismiss:a}){let{t:d}=(0,D.useI18n)(),[e,f]=(0,c.useState)(!1);(0,c.useEffect)(()=>{},[]);let g=async()=>{"default"!==await window.Notification.requestPermission()&&(f(!1),a?.())};return e?(0,b.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,b.jsx)(a1.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,b.jsx)("span",{className:"flex-1 text-sm",children:d("notification.permissionPrompt")}),(0,b.jsx)(u.Button,{size:"default",onClick:g,children:d("notification.allow")}),(0,b.jsx)(u.Button,{variant:"ghost",size:"default",onClick:()=>{f(!1),a?.()},children:d("notification.dismiss")})]}):null}w.callServer,w.findSourceMapURL;var a3=a.i(484802);let a4=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function a5({onComplete:a}){let{t:d}=(0,D.useI18n)(),[e,f]=(0,c.useState)(0),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(!1),k=(0,c.useRef)(null),l=a4[e],m=(0,c.useCallback)(async()=>{await (0,a3.setConfigValue)("onboarding.tourCompleted",!0),a()},[a]),n=(0,c.useCallback)(()=>l?document.querySelector(`[data-tour="${l.target}"]`):null,[l]),o=(0,c.useCallback)(()=>{let a=n();a?(h(a.getBoundingClientRect()),j(!0)):j(!1)},[n]);(0,c.useEffect)(()=>{o();let a=null;!i&&l?.waitForTarget&&(k.current=new MutationObserver(()=>{let b=n();b&&(h(b.getBoundingClientRect()),j(!0),k.current?.disconnect(),a&&clearTimeout(a))}),k.current.observe(document.body,{childList:!0,subtree:!0}),a=setTimeout(()=>{!n()&&(f(a=>{let b=a+1;return b<a4.length?b:a}),e>=a4.length-1&&m())},5e3));let b=()=>o();return window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{k.current?.disconnect(),a&&clearTimeout(a),window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[e,l,n,o,i,m]),(0,c.useEffect)(()=>{let a=setInterval(o,1e3);return()=>clearInterval(a)},[o]);let p=(0,c.useCallback)(()=>{e<a4.length-1?(f(a=>a+1),j(!1)):m()},[e]);return l?(0,b.jsx)(b.Fragment,{children:i&&g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
2
2
  ellipse at ${g.left+g.width/2}px ${g.top+g.height/2}px,
3
3
  transparent ${Math.max(g.width,g.height)}px,
4
4
  rgba(0,0,0,0.6) ${Math.max(g.width,g.height)+30}px
@@ -1,3 +1,3 @@
1
- module.exports=[57726,891903,a=>{"use strict";var b=a.i(65735);a.s(["CheckCircle2",()=>b.default],57726);let c=(0,a.i(302856).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);a.s(["XCircle",0,c],891903)},59711,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],59711)},515205,a=>{"use strict";var b=a.i(858360),c=a.i(759985),d=a.i(448287),e=a.i(59711),f=a.i(161604),g=a.i(986379),h=a.i(14180),i=a.i(584335);let j=[{key:"notes",icon:f.FileText},{key:"assets",icon:g.FolderOpen},{key:"archive",icon:h.Archive}];a.s(["SubPageNav",0,function({workspaceId:a}){let{t:f}=(0,i.useI18n)(),g=(0,d.usePathname)(),h=j.find(a=>g.includes(`/${a.key}`))?.key;return(0,b.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4 py-2",children:[(0,b.jsxs)(c.default,{href:`/workspaces/${a}`,className:"mr-2 flex items-center gap-1.5 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,b.jsx)(e.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:f("archive.backToBoard")})]}),(0,b.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),j.map(d=>{let e=d.icon,g=h===d.key;return(0,b.jsxs)(c.default,{href:`/workspaces/${a}/${d.key}`,className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${g?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,b.jsx)(e,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:f(`sidebar.${d.key}`)})]},d.key)})]})}])},573219,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(14180),e=a.i(57726),f=a.i(891903),g=a.i(109434),h=a.i(224372),i=a.i(584335),j=a.i(515205),k=a.i(879876);let l=(0,k.createServerReference)("40d005870d5c05474a4447139634a368c57c565b53",k.callServer,void 0,k.findSourceMapURL,"getArchivedTasks");function m(a){return new Date(a).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function n({priority:a}){return(0,b.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${{LOW:"bg-slate-400",MEDIUM:"bg-amber-400",HIGH:"bg-orange-500",CRITICAL:"bg-rose-500"}[a]??"bg-slate-400"}`})}a.s(["ArchivePageClient",0,function({allWorkspaces:a,initialWorkspaceId:k,initialProjectId:o,initialTasks:p}){let q,{t:r}=(0,i.useI18n)(),[s,t]=(0,c.useTransition)(),[u,v]=(0,c.useState)(k),[w,x]=(0,c.useState)(o),[y,z]=(0,c.useState)(p),A=a.find(a=>a.id===u),B=A?.projects??[],C=(0,c.useCallback)(a=>{a?t(async()=>{z(await l(a))}):z([])},[t]);return(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsx)(j.SubPageNav,{workspaceId:u}),(0,b.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,b.jsxs)(h.Select,{value:u,onValueChange:b=>b&&(b=>{if(b===u)return;v(b);let c=a.find(a=>a.id===b),d=c?.projects[0]??null;x(d?.id??null),C(d?.id??null)})(b),children:[(0,b.jsx)(h.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,b.jsx)("span",{className:"truncate",children:A?.name??u})}),(0,b.jsx)(h.SelectContent,{children:a.map(a=>(0,b.jsx)(h.SelectItem,{value:a.id,children:a.name},a.id))})]}),B.length>0&&(0,b.jsxs)(h.Select,{value:w??"",onValueChange:a=>a&&void(a!==w&&(x(a),C(a))),children:[(0,b.jsx)(h.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,b.jsx)("span",{className:"truncate",children:(q=B.find(a=>a.id===w))?q.alias?`${q.name} (${q.alias})`:q.name:""})}),(0,b.jsx)(h.SelectContent,{children:B.map(a=>(0,b.jsxs)(h.SelectItem,{value:a.id,children:[a.name,a.alias?` (${a.alias})`:""]},a.id))})]}),(0,b.jsxs)("span",{className:"ml-auto rounded-full bg-muted px-2.5 py-0.5 text-[11px] text-muted-foreground",children:[y.length," ",r("archive.tasksCount")]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,b.jsxs)("div",{className:`relative ${s?"opacity-40 pointer-events-none":""} transition-opacity`,children:[s&&(0,b.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,b.jsx)(g.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===y.length?(0,b.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,b.jsx)(d.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:r("archive.noTasks")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r("archive.noTasksDesc")})]}):(0,b.jsx)("div",{className:"space-y-2",children:y.map(a=>{let c="DONE"===a.status,d=a.executions[0];return(0,b.jsx)("div",{className:"group rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:border-border/80 hover:bg-accent/30",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:c?(0,b.jsx)(e.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}):(0,b.jsx)(f.XCircle,{className:"h-4 w-4 text-rose-500"})}),(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)(n,{priority:a.priority}),(0,b.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:a.title}),(0,b.jsx)("span",{className:`ml-1 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${c?"bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20":"bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20"}`,children:c?r("archive.status.done"):r("archive.status.cancelled")})]}),a.labels.length>0&&(0,b.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:a.labels.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`${a.label.color}20`,color:a.label.color,outline:`1px solid ${a.label.color}40`},children:a.label.name},a.label.id))}),(0,b.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[(0,b.jsxs)("span",{children:[r("archive.createdAt"),": ",m(a.createdAt)]}),(0,b.jsxs)("span",{children:[c?r("archive.completedAt"):r("archive.cancelledAt"),": ",m(a.updatedAt)]}),d&&(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[r("archive.lastExecution"),":"," ",(0,b.jsx)("span",{className:`rounded px-1 py-0.5 font-mono text-[10px] ${"COMPLETED"===d.status?"bg-emerald-500/10 text-emerald-400":"FAILED"===d.status?"bg-rose-500/10 text-rose-400":"bg-amber-500/10 text-amber-400"}`,children:d.status})]})]})]})]})},a.id)})})]})})]})}],573219)}];
1
+ module.exports=[57726,891903,a=>{"use strict";var b=a.i(65735);a.s(["CheckCircle2",()=>b.default],57726);let c=(0,a.i(302856).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);a.s(["XCircle",0,c],891903)},59711,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],59711)},515205,a=>{"use strict";var b=a.i(858360),c=a.i(759985),d=a.i(448287),e=a.i(59711),f=a.i(161604),g=a.i(986379),h=a.i(14180),i=a.i(584335);let j=[{key:"notes",icon:f.FileText},{key:"assets",icon:g.FolderOpen},{key:"archive",icon:h.Archive}];a.s(["SubPageNav",0,function({workspaceId:a}){let{t:f}=(0,i.useI18n)(),g=(0,d.usePathname)(),h=j.find(a=>g.includes(`/${a.key}`))?.key;return(0,b.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4 py-2",children:[(0,b.jsxs)(c.default,{href:`/workspaces/${a}`,className:"mr-2 flex items-center gap-1.5 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,b.jsx)(e.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:f("archive.backToBoard")})]}),(0,b.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),j.map(d=>{let e=d.icon,g=h===d.key;return(0,b.jsxs)(c.default,{href:`/workspaces/${a}/${d.key}`,className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${g?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,b.jsx)(e,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:f(`sidebar.${d.key}`)})]},d.key)})]})}])},573219,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(14180),e=a.i(57726),f=a.i(891903),g=a.i(109434),h=a.i(224372),i=a.i(584335),j=a.i(515205),k=a.i(879876);let l=(0,k.createServerReference)("40797e9d1436724d43844e4f1d0259fa5480bc4c5a",k.callServer,void 0,k.findSourceMapURL,"getArchivedTasks");function m(a){return new Date(a).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function n({priority:a}){return(0,b.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${{LOW:"bg-slate-400",MEDIUM:"bg-amber-400",HIGH:"bg-orange-500",CRITICAL:"bg-rose-500"}[a]??"bg-slate-400"}`})}a.s(["ArchivePageClient",0,function({allWorkspaces:a,initialWorkspaceId:k,initialProjectId:o,initialTasks:p}){let q,{t:r}=(0,i.useI18n)(),[s,t]=(0,c.useTransition)(),[u,v]=(0,c.useState)(k),[w,x]=(0,c.useState)(o),[y,z]=(0,c.useState)(p),A=a.find(a=>a.id===u),B=A?.projects??[],C=(0,c.useCallback)(a=>{a?t(async()=>{z(await l(a))}):z([])},[t]);return(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsx)(j.SubPageNav,{workspaceId:u}),(0,b.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,b.jsxs)(h.Select,{value:u,onValueChange:b=>b&&(b=>{if(b===u)return;v(b);let c=a.find(a=>a.id===b),d=c?.projects[0]??null;x(d?.id??null),C(d?.id??null)})(b),children:[(0,b.jsx)(h.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,b.jsx)("span",{className:"truncate",children:A?.name??u})}),(0,b.jsx)(h.SelectContent,{children:a.map(a=>(0,b.jsx)(h.SelectItem,{value:a.id,children:a.name},a.id))})]}),B.length>0&&(0,b.jsxs)(h.Select,{value:w??"",onValueChange:a=>a&&void(a!==w&&(x(a),C(a))),children:[(0,b.jsx)(h.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,b.jsx)("span",{className:"truncate",children:(q=B.find(a=>a.id===w))?q.alias?`${q.name} (${q.alias})`:q.name:""})}),(0,b.jsx)(h.SelectContent,{children:B.map(a=>(0,b.jsxs)(h.SelectItem,{value:a.id,children:[a.name,a.alias?` (${a.alias})`:""]},a.id))})]}),(0,b.jsxs)("span",{className:"ml-auto rounded-full bg-muted px-2.5 py-0.5 text-[11px] text-muted-foreground",children:[y.length," ",r("archive.tasksCount")]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,b.jsxs)("div",{className:`relative ${s?"opacity-40 pointer-events-none":""} transition-opacity`,children:[s&&(0,b.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,b.jsx)(g.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===y.length?(0,b.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,b.jsx)(d.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:r("archive.noTasks")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r("archive.noTasksDesc")})]}):(0,b.jsx)("div",{className:"space-y-2",children:y.map(a=>{let c="DONE"===a.status,d=a.executions[0];return(0,b.jsx)("div",{className:"group rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:border-border/80 hover:bg-accent/30",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"mt-0.5 shrink-0",children:c?(0,b.jsx)(e.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}):(0,b.jsx)(f.XCircle,{className:"h-4 w-4 text-rose-500"})}),(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)(n,{priority:a.priority}),(0,b.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:a.title}),(0,b.jsx)("span",{className:`ml-1 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${c?"bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20":"bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20"}`,children:c?r("archive.status.done"):r("archive.status.cancelled")})]}),a.labels.length>0&&(0,b.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:a.labels.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`${a.label.color}20`,color:a.label.color,outline:`1px solid ${a.label.color}40`},children:a.label.name},a.label.id))}),(0,b.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[(0,b.jsxs)("span",{children:[r("archive.createdAt"),": ",m(a.createdAt)]}),(0,b.jsxs)("span",{children:[c?r("archive.completedAt"):r("archive.cancelledAt"),": ",m(a.updatedAt)]}),d&&(0,b.jsxs)("span",{className:"flex items-center gap-1",children:[r("archive.lastExecution"),":"," ",(0,b.jsx)("span",{className:`rounded px-1 py-0.5 font-mono text-[10px] ${"COMPLETED"===d.status?"bg-emerald-500/10 text-emerald-400":"FAILED"===d.status?"bg-rose-500/10 text-rose-400":"bg-amber-500/10 text-amber-400"}`,children:d.status})]})]})]})]})},a.id)})})]})})]})}],573219)}];
2
2
 
3
3
  //# sourceMappingURL=project_f_tower_0ivvjwd._.js.map