tower-studio 0.2.43 → 0.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +35 -35
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/adapters/test/route.js +2 -2
- package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js +3 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +4 -5
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js +3 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +3 -2
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +72 -72
- package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +35 -35
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +35 -35
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +52 -52
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +103 -103
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +90 -90
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +69 -69
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +83 -83
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +35 -35
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +71 -71
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +91 -91
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +48 -48
- package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/{_0keginv._.js → 0se9_next_0cuhhky._.js} +3 -3
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_03qwlhl.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_09pca3o.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +3 -0
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0m8aavq.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yp430z.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yzw48x.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-z_a1d._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.zmhk-._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04--bs7._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04m2l8a._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04r193~._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06ndn7a._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08yqoti._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09arklv._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_d.s7s._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0ajay8_._.js → [root-of-the-server]__0_zfnj0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clptds._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g.k9o~._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gn0ubd._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gwztza._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i34gbs._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i~3dwq._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k-5ag7._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l1-djp._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pl.c5.._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0r~9.7c._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t31ba_._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t_weyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uptkzd._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xot7fu._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y8w5di._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__075a0hk._.js → [root-of-the-server]__0zi3~a8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~g6-c~._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1189rd1._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0qk_esg._.js +2 -2
- package/.next/standalone/.next/server/chunks/_0t31z6q._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0fq3zjg._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0wlyw0g._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0~ey84y._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0se9_next_11h0sx_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0xr45lx._.js → [root-of-the-server]__01fmnse._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01vm_46._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__025ol9g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__08k-xb7._.js → [root-of-the-server]__049n47u._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07xkj1s._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12ko8p6._.js → [root-of-the-server]__081e5n~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ecd_1d._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0iln7n_._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lws68d._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oamph.._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00dh103._.js → [root-of-the-server]__0ugledi._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0stlq2_._.js → [root-of-the-server]__0vxlsec._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__065f3ii._.js → [root-of-the-server]__0w0.sdz._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xwzk2.._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yby8pl._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0gkid_a._.js → _02vz78l._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_00odlgv._.js → _04~mjmb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_05a2u03._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_07q06~v._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_08bq4g8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0rrs.-d._.js → _0_nhdgs._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0_q41~z._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0dxbp89._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_047dh-f._.js → _0foto06._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_05k76ur._.js → _0i4xdso._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0uryq~z._.js → _0kojxno._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0oeih09._.js → _0r4_qn~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_00l85fp._.js → _0u3yt.5._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0wqcz3w._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0463zy~._.js → _0ye1-r-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0syb503._.js → _0zr81mw._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0b7smy6._.js → _11osha9._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +290 -290
- package/.next/standalone/.next/static/chunks/{0~prx0ure_1i6.js → 0-tuek2jqf0el.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0evfu1ozaw5ak.js → 0.-.jc~0b~hy0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0rnitheqdpd1..js → 0.~03w.uxge40.js} +1 -1
- package/.next/standalone/.next/static/chunks/01hdj_kw4z2zq.js +2 -0
- package/.next/standalone/.next/static/chunks/{08i9.47-_mxro.js → 0346xrw6i2bwo.js} +1 -1
- package/.next/standalone/.next/static/chunks/041o.dh2lc-k3.js +1 -0
- package/.next/standalone/.next/static/chunks/{070fs6rmafi.i.js → 08ooaq~-.8fzu.js} +1 -1
- package/.next/standalone/.next/static/chunks/{05v-c3ir3ik_1.js → 0bylodlncwfpb.js} +1 -1
- package/.next/standalone/.next/static/chunks/{00z.kuqsfrxq5.js → 0clewc5ifaruu.js} +2 -2
- package/.next/standalone/.next/static/chunks/0cpwtqzrjdgvs.js +1 -0
- package/.next/standalone/.next/static/chunks/0c~e1-nst-ze-.js +1 -0
- package/.next/standalone/.next/static/chunks/{0_yp-y9l0upp~.js → 0dv4anj-j523o.js} +1 -1
- package/.next/standalone/.next/static/chunks/{04op7bjge~n4l.js → 0gvfb.b8m_i8t.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0hk3lmsij2x1c.js → 0h77-u2vvr-a1.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0rfq8fy71hj7c.js → 0lqp~-dlfenad.js} +1 -1
- package/.next/standalone/.next/static/chunks/0qkr26yz3bocs.js +1 -0
- package/.next/standalone/.next/static/chunks/{0sr-m2t6vck14.js → 0rcuiuax31_uh.js} +1 -1
- package/.next/standalone/.next/static/chunks/0uf~7eqel0zra.js +1 -0
- package/.next/standalone/.next/static/chunks/{0ts___1ygewqp.js → 0uj-3ckujwaiy.js} +1 -1
- package/.next/standalone/.next/static/chunks/0w71r_sj_fibx.js +1 -0
- package/.next/standalone/.next/static/chunks/{0rjt_ddd~6t8r.js → 0xg6rcq6g4bbh.js} +1 -1
- package/.next/standalone/.next/static/chunks/0yff8rwmrl5m4.js +1 -0
- package/.next/standalone/.next/static/chunks/{0gq65t6au55oa.js → 0ymipmkk2uqby.js} +1 -1
- package/.next/standalone/.next/static/chunks/0znfclapbniaa.js +1 -0
- package/.next/standalone/.next/static/chunks/{0-vgfstmpuwnx.js → 11pe3kpxuj33f.js} +1 -1
- package/.next/standalone/.next/static/chunks/172s9cg35qt7i.js +1 -0
- package/.next/standalone/.next/static/chunks/{11p.r-9wyh7_2.js → 17m4o~gdsvuo3.js} +1 -1
- package/.next/standalone/.next/static/chunks/184-zu89wwa4u.js +1 -0
- package/.next/standalone/package.json +1 -1
- package/dist/mcp-server.cjs +21 -2
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__0m6hc.0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05abzth._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b25v3p._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h6bl6t._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q~uf3u._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wkjqrd._.js +0 -3
- package/.next/standalone/.next/static/chunks/0.lyp-cx3zt9..js +0 -2
- package/.next/standalone/.next/static/chunks/01rbl6a8z.tuw.js +0 -1
- package/.next/standalone/.next/static/chunks/0gz71w_~yw2iu.js +0 -1
- package/.next/standalone/.next/static/chunks/0j1hqwmeaqnn2.js +0 -1
- package/.next/standalone/.next/static/chunks/0prrt_bws8ml6.js +0 -1
- package/.next/standalone/.next/static/chunks/0qgqjy.9.-qpi.js +0 -1
- package/.next/standalone/.next/static/chunks/0vmy6tsqy.xf4.js +0 -1
- package/.next/standalone/.next/static/chunks/0wbq-_8jyxjxm.js +0 -1
- package/.next/standalone/.next/static/chunks/1107zshxaajt9.js +0 -1
- package/.next/standalone/.next/static/chunks/11x3_612u8w~9.js +0 -1
- package/.next/standalone/.next/static/chunks/14mk_a0k99wbg.js +0 -1
- /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,465536,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},930787,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var h="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===h.length?h+="..":h+="/..");return h.length>0?h+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},756502,e=>{"use strict";let t=(0,e.i(572989).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"}]]);e.s(["default",0,t])},914935,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(210702),n=e.i(487278),o=e.i(232545),i=e.i(464249),l=e.i(998626),c=e.i(49007),d=e.i(902539),u=e.i(263938),m=e.i(645378),h=e.i(453889),x=e.i(572989);let p=(0,x.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 g=e.i(755146),f=e.i(759684),j=e.i(776639),b=e.i(746798),v=e.i(519455),w=e.i(793479),N=e.i(514798);let y=(0,N.createServerReference)("40c3a6dcbb03f11569db001e3b132552b10a72fea9",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("608cc89fce68d1da6f133d468e7b41a7c8665552a0",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("40f77cd5d0c96883d82efae9f85a919c92327aa676",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("403651d5b793a2a371871255e62b6877e3e50b7908",N.callServer,void 0,N.findSourceMapURL,"reorderWorkspaces");var T=e.i(949461);let P=(0,N.createServerReference)("40fb19a75d39fed103c0532d01dfec687e96c1c0c0",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("40ccf2e3cf9b0c89396aa3d82ffd8b1cff14418314",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var O=e.i(889620),M=e.i(533499),I=e.i(360112),$=e.i(720247),A=e.i(775712),L=e.i(67013);let R=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function E({workspaces:e}){let i,l=(0,s.useRouter)(),c=(0,s.usePathname)(),{t:u}=(0,M.useI18n)(),[x,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&g(!0)},[]);let[j,w]=(0,r.useState)(!1),[N,T]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[L,F]=(0,r.useState)(null),[W,U]=(0,r.useState)(""),[H,K]=(0,r.useState)(R[0]),[V,G]=(0,r.useState)(null),[q,X]=(0,r.useState)(e);(0,r.useEffect)(()=>{X(e)},[e]);let J=(0,$.useSensors)((0,$.useSensor)($.PointerSensor,{activationConstraint:{distance:8}})),Y=(0,r.useCallback)(t=>{let{active:r,over:s}=t;if(!s||r.id===s.id)return;let a=q.findIndex(e=>e.id===r.id),n=q.findIndex(e=>e.id===s.id);if(-1===a||-1===n)return;let o=(0,A.arrayMove)(q,a,n);X(o),S(o.map(e=>e.id)).then(()=>l.refresh()).catch(()=>{X(e),I.toast.error(u("sidebar.reorderError"))})},[q,e,l,u]),Z=c.split("/workspaces/")[1]?.split("/")[0],Q=(0,r.useCallback)(e=>{if(Z===e)return;let t=(0,O.getLastProjectId)(e);l.push(t?`/workspaces/${e}?projectId=${t}`:`/workspaces/${e}`)},[Z,l]),ee=(0,r.useCallback)(()=>{g(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),et=(0,r.useCallback)(async()=>{if(!W.trim())return;let e=await y({name:W.trim(),description:H});U(""),K(R[0]),w(!1),l.refresh(),l.push(`/workspaces/${e.id}`)},[W,H,l]),er=(0,r.useCallback)(async()=>{W.trim()&&V&&(await k(V,{name:W.trim(),description:H}),U(""),T(!1),G(null),l.refresh())},[W,H,V,l]),es=(0,r.useCallback)(e=>{G(e.id),U(e.name),K(e.description&&R.includes(e.description)?e.description:R[0]),T(!0)},[]),ea=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void I.toast.error(u("sidebar.lastWorkspaceError"));if(confirm(u("sidebar.deleteConfirm",{name:r})))try{await C(t),l.refresh(),Z===t&&l.push("/workspaces")}catch{I.toast.error(u("sidebar.lastWorkspaceError"))}},[Z,l,u,e.length]),en=(0,r.useCallback)(e=>{F(e),D(!0)},[]),eo=e=>e.description&&R.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(x){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:ee,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,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.expand")})]}),(0,t.jsx)(f.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=Z===e.id,s=eo(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>Q(e.id),className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>w(!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,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===c?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("missions.navLabel")})]}),(r=Z||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${c.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(m.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${c.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(h.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${c.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.archive")})]})]}):null]}),(0,t.jsx)(B,{open:j,onOpenChange:w,title:u("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:et,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:ee,className:"text-muted-foreground",title:u("sidebar.collapse"),children:(0,t.jsx)(d.ChevronsLeft,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:u("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{U(""),K(R[0]),w(!0)},title:u("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(f.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:(0,t.jsx)($.DndContext,{id:"workspace-sidebar",sensors:J,collisionDetection:$.closestCenter,onDragEnd:Y,children:(0,t.jsx)(A.SortableContext,{items:q.map(e=>e.id),strategy:A.verticalListSortingStrategy,children:q.map(e=>(0,t.jsx)(z,{ws:e,isActive:Z===e.id,icon:eo(e),disableDelete:q.length<=1,t:u,onSelect:()=>Q(e.id),onEdit:()=>es(e),onManageLabels:()=>en(e.id),onDelete:()=>ea(e.id,e.name)},e.id))})})})}),(0,t.jsxs)(a.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"===c?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("missions.navLabel")})]}),(i=Z||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${i}/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,t.jsx)(m.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/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,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/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,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.archive")})]})]}):null,(0,t.jsx)(B,{open:j,onOpenChange:w,title:u("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:et,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),(0,t.jsx)(B,{open:N,onOpenChange:e=>{T(e),e||G(null)},title:u("workspace.edit"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:er,submitLabel:u("common.save"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),L&&(0,t.jsx)(_,{open:P,onOpenChange:e=>{D(e),e||F(null)},workspaceId:L})]})}function z({ws:e,isActive:r,icon:s,disableDelete:a,t:n,onSelect:o,onEdit:d,onManageLabels:m,onDelete:h}){var x;let p,f,j,{attributes:b,listeners:v,setNodeRef:w,transform:N,transition:y,isDragging:k}=(0,A.useSortable)({id:e.id}),C={transform:L.CSS.Transform.toString(N),transition:y,opacity:k?.4:1};return(0,t.jsxs)("div",{ref:w,style:C,...b,...v,className:`group relative flex touch-none items-center rounded-lg transition-all ${r?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:o,className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${r?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:s})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${r?"text-foreground":"text-secondary-foreground"}`,children:e.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(x=e.updatedAt,f=Math.floor((p=Date.now()-new Date(x).getTime())/6e4),j=Math.floor(p/36e5),f<60?`${f}m ago`:j<24?`${j}h ago`:`${Math.floor(j/24)}d ago`)})]})]}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsx)(g.DropdownMenuTrigger,{render:(0,t.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:e=>e.stopPropagation()}),children:(0,t.jsx)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(g.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(g.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.rename")]}),(0,t.jsxs)(g.DropdownMenuItem,{onClick:m,children:[(0,t.jsx)(u.Tag,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.manageLabels")]}),(0,t.jsxs)(g.DropdownMenuItem,{className:a?"text-muted-foreground opacity-50":"text-rose-400",disabled:a,onClick:h,children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.delete")]})]})]})]})}function B({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:h}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:R.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:h}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let F=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function _({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,M.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(F[0]);(0,r.useEffect)(()=>{e&&(0,T.getLabelsForWorkspace)(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await P({name:l.trim(),color:d,workspaceId:a}),i(await (0,T.getLabelsForWorkspace)(a)),c(""))},h=async e=>{await D(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>h(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:F.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}e.i(508271);var W=e.i(841359),U=e.i(289813);let H=(0,U.create)(e=>({createProjectOpen:!1,importProjectOpen:!1,setCreateProjectOpen:t=>e({createProjectOpen:t}),setImportProjectOpen:t=>e({importProjectOpen:t})}));var K=e.i(821957),V=e.i(738690),G=e.i(386343);let q=(0,x.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 X=e.i(242941),J=e.i(989548),Y=e.i(387091),Z=e.i(15299);e.s([],678787),e.i(678787),e.i(708878);var Q=e.i(581263),ee=e.i(462902);let et=r.createContext(void 0);function er(){let e=r.useContext(et);if(void 0===e)throw Error((0,ee.default)(13));return e}let es={imageLoadingStatus:()=>null},ea=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,Q.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:es});return(0,t.jsx)(et.Provider,{value:c,children:d})});var en=e.i(887642),eo=e.i(804849),ei=e.i(504068),el=e.i(809058),ec=e.i(193214),ed=e.i(954588);let eu={...es,...el.transitionStatusMapping},em=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=er(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,eo.useIsoLayoutEffect)(()=>{if(!e)return n("error"),ed.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:h,setMounted:x}=(0,ec.useTransitionStatus)(u),p=r.useRef(null),g=(0,en.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,eo.useIsoLayoutEffect)(()=>{"idle"!==d&&g(d)},[d,g]),(0,ei.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||x(!1)}});let f=(0,Q.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:h},ref:[t,p],props:l,stateAttributesMapping:eu,enabled:m});return m?f:null});var eh=e.i(161476);let ex=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=er(),[l,c]=r.useState(void 0===n),d=(0,eh.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,Q.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:es,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,ex,"Image",0,em,"Root",0,ea],129448);var ep=e.i(129448),ep=ep,eg=e.i(975157);function ef({className:e,size:r="default",...s}){return(0,t.jsx)(ep.Root,{"data-slot":"avatar","data-size":r,className:(0,eg.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",e),...s})}function ej({className:e,...r}){return(0,t.jsx)(ep.Fallback,{"data-slot":"avatar-fallback",className:(0,eg.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let eb=(0,x.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 ev=e.i(226145);let ew=(0,x.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"}]]),eN=(0,x.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 ey=e.i(657153);let ek=(0,N.createServerReference)("606e7bede5ad9dc694bd0f8d5727d1972f645dbbea",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var eC=e.i(121157);let eS=[{id:"all",key:"search.all",icon:V.Search},{id:"task",key:"search.task",icon:m.FileText},{id:"project",key:"search.project",icon:eb},{id:"repository",key:"search.repository",icon:ev.GitBranch},{id:"note",key:"search.note",icon:ew},{id:"asset",key:"search.asset",icon:eN}],eT=["task","project","repository","note","asset"],eP={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function eD({result:e,onSelect:r}){let s=eS.find(t=>t.id===e.type)?.icon??m.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),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,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function eO({open:e,onOpenChange:a}){let n,{t:o}=(0,M.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,h]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1),[g,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,eC.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),h([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){h([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ek(l,d);e||(h(t),p(!1))},g),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,g]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(V.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),h([])},className:"text-muted-foreground",children:(0,t.jsx)(ey.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eS.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(f.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!x&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),eT.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(eP[e])}),n[e].map(e=>(0,t.jsx)(eD,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(eD,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eM=e.i(338187),eI=e.i(400355),e$=e.i(597746),eA=e.i(938499),eL=e.i(233274),eR=e.i(905455),eE=e.i(624687);function ez(e){return e.replace(/\.git\/?$/,"")}e.i(465536),e.i(930787);let eB=(0,N.createServerReference)("40eab69fb4f73280d38bebc1b1323c62c776f0f31e",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPathWithSource");var eF=e.i(980745),e_=e.i(224277);function eW({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,M.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("empty"),[S,T]=(0,r.useState)("FRONTEND"),[P,D]=(0,r.useState)("idle"),[O,$]=(0,r.useState)(""),[A,L]=(0,r.useState)(!1),[R,E]=(0,r.useState)(!1),z=()=>{l(""),d(""),m(""),p(""),f(""),y(!1),C("empty"),T("FRONTEND"),D("idle"),$(""),L(!1)},B=async()=>{if(g.trim()&&!A&&"success"===P){L(!0);try{let e=await (0,eF.analyzeProjectDirectory)(g.trim(),o);m(e)}catch{I.toast.error(n("project.analyzeError"))}finally{L(!1)}}},F=async e=>{p(e),D("idle"),$("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:ez(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:ez(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);if(t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),!N){let{path:t,source:r}=await eB(e);f(t),C(r)}},_=async()=>{if(x.trim()&&g.trim()){D("cloning"),$("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(x.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:g.trim()})}),r=await t.json();if(!t.ok){D("error"),$(r.error||"Clone failed");return}D("success")}catch{D("error"),$("Network error")}}},W=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:g.trim()||void 0,projectType:S}),z(),s(!1))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||z()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:x,onChange:e=>F(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:g,onChange:e=>{f(e.target.value),y(!0)},className:"flex-1 min-w-0 font-mono text-xs"}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"outline",onClick:()=>E(!0),className:"shrink-0 gap-1.5 px-2.5 text-xs text-muted-foreground"}),children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("folder.browse")})]}),(0,t.jsx)(b.TooltipContent,{children:n("folder.selectFolder")})]})]}),g.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),!N&&"fallback"===k&&x.trim()&&g.trim()&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-muted-foreground",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3 shrink-0"}),n("project.gitPathFallbackHint")]}),x.trim()&&g.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===P||"success"===P,onClick:_,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"===P?(0,t.jsx)(eI.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===P?(0,t.jsx)(e$.Check,{className:"h-3 w-3"}):(0,t.jsx)(ev.GitBranch,{className:"h-3 w-3"}),"cloning"===P?n("git.cloning"):"success"===P?n("git.cloned"):n("git.clone")]}),"error"===P&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),O]}),"success"===P&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eR.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:S,onChange:T})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:B,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!g.trim()||A?"opacity-50":""}`}),children:[A?(0,t.jsx)(eI.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eL.Sparkles,{className:"h-3 w-3"}),A?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:g.trim()?"success"!==P?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eE.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.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,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),z()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:W,disabled:!i.trim()||A,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})}),(0,t.jsx)(e_.FolderBrowserDialog,{open:R,onOpenChange:E,onSelect:e=>{if(f(e),y(!0),!i.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";t&&l(t)}}})]})}var eU=e.i(756502),eU=eU,eH=e.i(699375);let eK=(0,N.createServerReference)("400b6e70fbbc54225b8a8e0e2cbd3af9f5dd1b36b1",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath"),eV=(0,N.createServerReference)("60c7699f2795431c507a04054e1c1fcd76b4eeb75f",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eG=(0,N.createServerReference)("40bfb0f245ac48ca05cb6dbd017f61a0d35281cf5b",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eq({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,M.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[O,$]=(0,r.useState)(""),[A,L]=(0,r.useState)(!1),[R,E]=(0,r.useState)(""),[z,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[W,U]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),f(""),C("FRONTEND"),T(!1),D(!1),$(""),L(!1),E(""),B(""),_(!1),U(!1)},K=async e=>{f(e),T(!1),D(!1),$(""),E(""),B(""),_(!1),l(e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(D(e),E(""),B(""),_(!1),!e)return void $("");if(x)try{let e=await eK(x);e&&($(e),e===g&&_(!0))}catch{}if(g)try{let e=await fetch(`/api/git?path=${encodeURIComponent(g)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[x,g]),G=async()=>{if(g&&!W){U(!0);try{let e=await (0,eF.analyzeProjectDirectory)(g.trim(),o);m(e)}catch{I.toast.error(n("project.analyzeError"))}finally{U(!1)}}},q=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:g.trim()||void 0,projectType:k},t=await a?.(e);if(P&&O&&O!==g&&t&&"id"in t){L(!0),E("");try{let e=await eG(t.id);if(!e.safe)return void E(e.reason);let r=await eV(t.id,O);if(!r.success)return void E(r.error??n("project.migrateError"));I.toast.success(n("project.migrateSuccess"))}catch(t){let e=t instanceof Error?t.message:String(t);E(`${n("project.migrateError")}:${e}`);return}finally{L(!1)}}H(),s(!1)},X=!i.trim()||!g.trim()||A||W||P&&!!z;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:g,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),x&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:x,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&g&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eH.Switch,{checked:P,onCheckedChange:e=>V(e)})]}),P&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:O,onChange:e=>{$(e.target.value),_(e.target.value===g)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(eU.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),z&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),z]}),R&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),R]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eR.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:G,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!g||W?"opacity-50":""}`}),children:[W?(0,t.jsx)(eI.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eL.Sparkles,{className:"h-3 w-3"}),W?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:g?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eE.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.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,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:q,disabled:X,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:A?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(e_.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eX({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:(0,t.jsx)("path",{d:"M12 .5C5.65.5.5 5.65.5 12.02c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2c-3.2.7-3.87-1.36-3.87-1.36-.52-1.34-1.27-1.7-1.27-1.7-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.34.96.1-.74.4-1.25.72-1.54-2.56-.29-5.25-1.28-5.25-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.04 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.18-1.18 3.18-1.18.62 1.58.23 2.75.11 3.04.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.4-5.25 5.69.41.36.78 1.05.78 2.12v3.14c0 .31.21.68.79.56A11.52 11.52 0 0 0 23.5 12.02C23.5 5.65 18.35.5 12 .5Z"})})}function eJ({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,M.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eM.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:x}=function(){let{resolvedTheme:e,setTheme:t}=(0,K.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[f,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);(0,W.useActionShortcut)("global.search",()=>j(!0));let C=H(e=>e.createProjectOpen),S=H(e=>e.importProjectOpen),T=H(e=>e.setCreateProjectOpen),P=H(e=>e.setImportProjectOpen);return(0,r.useEffect)(()=>{C&&N(!0)},[C]),(0,r.useEffect)(()=>{S&&k(!0)},[S]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(V.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.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,t.jsx)(q,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(J.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(X.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"中"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:x,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(Y.Sun,{className:"h-4 w-4"}):(0,t.jsx)(Z.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>window.open("https://github.com/jp-liu/tower","_blank","noopener,noreferrer"),className:"text-muted-foreground","aria-label":n("topbar.github")}),children:(0,t.jsx)(eX,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("topbar.github")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsx)(g.DropdownMenuTrigger,{render:(0,t.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:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(ef,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ej,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(g.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(g.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(G.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(eO,{open:f,onOpenChange:j}),(0,t.jsx)(eW,{open:w,onOpenChange:e=>{N(e),e||T(!1)},onCreateProject:e}),(0,t.jsx)(eq,{open:y,onOpenChange:e=>{k(e),e||P(!1)},onCreateProject:e})]})}var eY=e.i(83434),eZ=e.i(966001),eQ=e.i(274818),e0=e.i(19578),e1=e.i(232280);let e2=(0,e0.default)(()=>e.A(427768).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[103363]},ssr:!1});function e5({mode:e}){let{isOpen:s,closeAssistant:a,sessions:n,activeSessionId:c,createNewSession:d,switchSession:u,removeSession:m,renameSession:h}=(0,eM.useAssistant)(),{t:x}=(0,M.useI18n)(),[p,f]=(0,r.useState)(null),[b,N]=(0,r.useState)(""),y=()=>{f(null),N("")},k=n.find(e=>e.id===c),C=k?.title??x("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"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,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(J.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:x("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsxs)(g.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":x("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:C}),(0,t.jsx)(e1.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(g.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,className:"w-[280px]",children:[0===n.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:x("assistant.noSessions")}):(0,t.jsx)("div",{className:"max-h-[min(440px,50vh)] overflow-y-auto",children:n.map(e=>(0,t.jsxs)(g.DropdownMenuItem,{className:"flex items-center justify-between gap-1 pr-1",onClick:()=>u(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100",onClick:t=>{var r;t.stopPropagation(),f({id:e.id,title:r=e.title}),N(r)},"aria-label":x("assistant.renameSession"),children:(0,t.jsx)(i.Pencil,{className:"h-3 w-3"})}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),m(e.id)},"aria-label":x("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id))}),n.length>0&&(0,t.jsx)(g.DropdownMenuSeparator,{}),(0,t.jsxs)(g.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:x("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:d,"aria-label":x("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:a,"aria-label":x("assistant.closeLabel"),children:(0,t.jsx)(ey.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:s?(0,t.jsx)(e2,{}):null}),(0,t.jsx)(j.Dialog,{open:null!==p,onOpenChange:e=>{e||y()},children:(0,t.jsxs)(j.DialogContent,{children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:x("assistant.renameSessionTitle")})}),(0,t.jsx)(w.Input,{autoFocus:!0,value:b,onChange:e=>N(e.target.value),placeholder:x("assistant.renameSessionPlaceholder")}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:y,children:x("common.cancel")}),(0,t.jsx)(v.Button,{onClick:()=>{p&&b.trim()&&(h(p.id,b),y())},disabled:!b.trim(),children:x("common.save")})]})]})})]})}var e4=e.i(125177);function e3({onDismiss:e}){let{t:s}=(0,M.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.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,t.jsx)(e4.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var e8=e.i(243572),e6=e.i(623258);let e7=[{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 e9({onComplete:e}){let{t:s}=(0,M.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=e7[a],m=(0,r.useCallback)(async()=>{await (0,e6.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),h=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),x=(0,r.useCallback)(()=>{let e=h();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[h]);(0,r.useEffect)(()=>{x();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=h();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!h()&&(n(e=>{let t=e+1;return t<e7.length?t:e}),a>=e7.length-1&&m())},5e3));let t=()=>x();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,h,x,l,m]),(0,r.useEffect)(()=>{let e=setInterval(x,1e3);return()=>clearInterval(e)},[x]);let p=(0,r.useCallback)(()=>{a<e7.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,465536,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},930787,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var h="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===h.length?h+="..":h+="/..");return h.length>0?h+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},756502,e=>{"use strict";let t=(0,e.i(572989).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"}]]);e.s(["default",0,t])},914935,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(210702),n=e.i(487278),o=e.i(232545),i=e.i(464249),l=e.i(998626),c=e.i(49007),d=e.i(902539),u=e.i(263938),m=e.i(645378),h=e.i(453889),x=e.i(572989);let p=(0,x.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 g=e.i(755146),f=e.i(759684),j=e.i(776639),b=e.i(746798),v=e.i(519455),w=e.i(793479),N=e.i(514798);let y=(0,N.createServerReference)("4073b6aed6f0cf2cc15c3c9ee26879266ab292dadb",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("60b7ba6b5939f2412c541f416a9d70652d8104f30a",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("40a959290e2953edc71f754770c46e3191f47f2a6f",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("40cac7bd5f30279431c77b3ac457b584502e8a346c",N.callServer,void 0,N.findSourceMapURL,"reorderWorkspaces");var T=e.i(960793);let P=(0,N.createServerReference)("40887bdb36e2122964eea1db15e0be1868c081c4da",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("400ce9acdefe7899d80e3a397501626b8ceb77ed52",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var O=e.i(889620),M=e.i(533499),I=e.i(360112),$=e.i(720247),A=e.i(775712),L=e.i(67013);let R=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function E({workspaces:e}){let i,l=(0,s.useRouter)(),c=(0,s.usePathname)(),{t:u}=(0,M.useI18n)(),[x,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&g(!0)},[]);let[j,w]=(0,r.useState)(!1),[N,T]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[L,F]=(0,r.useState)(null),[W,U]=(0,r.useState)(""),[H,K]=(0,r.useState)(R[0]),[V,G]=(0,r.useState)(null),[q,X]=(0,r.useState)(e);(0,r.useEffect)(()=>{X(e)},[e]);let J=(0,$.useSensors)((0,$.useSensor)($.PointerSensor,{activationConstraint:{distance:8}})),Y=(0,r.useCallback)(t=>{let{active:r,over:s}=t;if(!s||r.id===s.id)return;let a=q.findIndex(e=>e.id===r.id),n=q.findIndex(e=>e.id===s.id);if(-1===a||-1===n)return;let o=(0,A.arrayMove)(q,a,n);X(o),S(o.map(e=>e.id)).then(()=>l.refresh()).catch(()=>{X(e),I.toast.error(u("sidebar.reorderError"))})},[q,e,l,u]),Z=c.split("/workspaces/")[1]?.split("/")[0],Q=(0,r.useCallback)(e=>{if(Z===e)return;let t=(0,O.getLastProjectId)(e);l.push(t?`/workspaces/${e}?projectId=${t}`:`/workspaces/${e}`)},[Z,l]),ee=(0,r.useCallback)(()=>{g(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),et=(0,r.useCallback)(async()=>{if(!W.trim())return;let e=await y({name:W.trim(),description:H});U(""),K(R[0]),w(!1),l.refresh(),l.push(`/workspaces/${e.id}`)},[W,H,l]),er=(0,r.useCallback)(async()=>{W.trim()&&V&&(await k(V,{name:W.trim(),description:H}),U(""),T(!1),G(null),l.refresh())},[W,H,V,l]),es=(0,r.useCallback)(e=>{G(e.id),U(e.name),K(e.description&&R.includes(e.description)?e.description:R[0]),T(!0)},[]),ea=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void I.toast.error(u("sidebar.lastWorkspaceError"));if(confirm(u("sidebar.deleteConfirm",{name:r})))try{await C(t),l.refresh(),Z===t&&l.push("/workspaces")}catch{I.toast.error(u("sidebar.lastWorkspaceError"))}},[Z,l,u,e.length]),en=(0,r.useCallback)(e=>{F(e),D(!0)},[]),eo=e=>e.description&&R.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(x){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:ee,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,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.expand")})]}),(0,t.jsx)(f.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=Z===e.id,s=eo(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>Q(e.id),className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>w(!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,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===c?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("missions.navLabel")})]}),(r=Z||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${c.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(m.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${c.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(h.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${c.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.archive")})]})]}):null]}),(0,t.jsx)(B,{open:j,onOpenChange:w,title:u("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:et,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:ee,className:"text-muted-foreground",title:u("sidebar.collapse"),children:(0,t.jsx)(d.ChevronsLeft,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:u("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{U(""),K(R[0]),w(!0)},title:u("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(f.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:(0,t.jsx)($.DndContext,{id:"workspace-sidebar",sensors:J,collisionDetection:$.closestCenter,onDragEnd:Y,children:(0,t.jsx)(A.SortableContext,{items:q.map(e=>e.id),strategy:A.verticalListSortingStrategy,children:q.map(e=>(0,t.jsx)(z,{ws:e,isActive:Z===e.id,icon:eo(e),disableDelete:q.length<=1,t:u,onSelect:()=>Q(e.id),onEdit:()=>es(e),onManageLabels:()=>en(e.id),onDelete:()=>ea(e.id,e.name)},e.id))})})})}),(0,t.jsxs)(a.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"===c?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("missions.navLabel")})]}),(i=Z||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${i}/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,t.jsx)(m.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/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,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/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,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.archive")})]})]}):null,(0,t.jsx)(B,{open:j,onOpenChange:w,title:u("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:et,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),(0,t.jsx)(B,{open:N,onOpenChange:e=>{T(e),e||G(null)},title:u("workspace.edit"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:er,submitLabel:u("common.save"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),L&&(0,t.jsx)(_,{open:P,onOpenChange:e=>{D(e),e||F(null)},workspaceId:L})]})}function z({ws:e,isActive:r,icon:s,disableDelete:a,t:n,onSelect:o,onEdit:d,onManageLabels:m,onDelete:h}){var x;let p,f,j,{attributes:b,listeners:v,setNodeRef:w,transform:N,transition:y,isDragging:k}=(0,A.useSortable)({id:e.id}),C={transform:L.CSS.Transform.toString(N),transition:y,opacity:k?.4:1};return(0,t.jsxs)("div",{ref:w,style:C,...b,...v,className:`group relative flex touch-none items-center rounded-lg transition-all ${r?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:o,className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${r?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:s})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${r?"text-foreground":"text-secondary-foreground"}`,children:e.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(x=e.updatedAt,f=Math.floor((p=Date.now()-new Date(x).getTime())/6e4),j=Math.floor(p/36e5),f<60?`${f}m ago`:j<24?`${j}h ago`:`${Math.floor(j/24)}d ago`)})]})]}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsx)(g.DropdownMenuTrigger,{render:(0,t.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:e=>e.stopPropagation()}),children:(0,t.jsx)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(g.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(g.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.rename")]}),(0,t.jsxs)(g.DropdownMenuItem,{onClick:m,children:[(0,t.jsx)(u.Tag,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.manageLabels")]}),(0,t.jsxs)(g.DropdownMenuItem,{className:a?"text-muted-foreground opacity-50":"text-rose-400",disabled:a,onClick:h,children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.delete")]})]})]})]})}function B({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:h}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:R.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:h}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let F=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function _({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,M.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(F[0]);(0,r.useEffect)(()=>{e&&(0,T.getLabelsForWorkspace)(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await P({name:l.trim(),color:d,workspaceId:a}),i(await (0,T.getLabelsForWorkspace)(a)),c(""))},h=async e=>{await D(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>h(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:F.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}e.i(508271);var W=e.i(841359),U=e.i(289813);let H=(0,U.create)(e=>({createProjectOpen:!1,importProjectOpen:!1,setCreateProjectOpen:t=>e({createProjectOpen:t}),setImportProjectOpen:t=>e({importProjectOpen:t})}));var K=e.i(821957),V=e.i(738690),G=e.i(386343);let q=(0,x.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 X=e.i(242941),J=e.i(989548),Y=e.i(387091),Z=e.i(15299);e.s([],678787),e.i(678787),e.i(708878);var Q=e.i(581263),ee=e.i(462902);let et=r.createContext(void 0);function er(){let e=r.useContext(et);if(void 0===e)throw Error((0,ee.default)(13));return e}let es={imageLoadingStatus:()=>null},ea=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,Q.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:es});return(0,t.jsx)(et.Provider,{value:c,children:d})});var en=e.i(887642),eo=e.i(804849),ei=e.i(504068),el=e.i(809058),ec=e.i(193214),ed=e.i(954588);let eu={...es,...el.transitionStatusMapping},em=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=er(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,eo.useIsoLayoutEffect)(()=>{if(!e)return n("error"),ed.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:h,setMounted:x}=(0,ec.useTransitionStatus)(u),p=r.useRef(null),g=(0,en.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,eo.useIsoLayoutEffect)(()=>{"idle"!==d&&g(d)},[d,g]),(0,ei.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||x(!1)}});let f=(0,Q.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:h},ref:[t,p],props:l,stateAttributesMapping:eu,enabled:m});return m?f:null});var eh=e.i(161476);let ex=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=er(),[l,c]=r.useState(void 0===n),d=(0,eh.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,Q.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:es,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,ex,"Image",0,em,"Root",0,ea],129448);var ep=e.i(129448),ep=ep,eg=e.i(975157);function ef({className:e,size:r="default",...s}){return(0,t.jsx)(ep.Root,{"data-slot":"avatar","data-size":r,className:(0,eg.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",e),...s})}function ej({className:e,...r}){return(0,t.jsx)(ep.Fallback,{"data-slot":"avatar-fallback",className:(0,eg.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let eb=(0,x.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 ev=e.i(226145);let ew=(0,x.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"}]]),eN=(0,x.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 ey=e.i(657153);let ek=(0,N.createServerReference)("600fe4665d4e6fc8cd80863079f1206fc73a4eb6ed",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var eC=e.i(386443);let eS=[{id:"all",key:"search.all",icon:V.Search},{id:"task",key:"search.task",icon:m.FileText},{id:"project",key:"search.project",icon:eb},{id:"repository",key:"search.repository",icon:ev.GitBranch},{id:"note",key:"search.note",icon:ew},{id:"asset",key:"search.asset",icon:eN}],eT=["task","project","repository","note","asset"],eP={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function eD({result:e,onSelect:r}){let s=eS.find(t=>t.id===e.type)?.icon??m.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),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,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function eO({open:e,onOpenChange:a}){let n,{t:o}=(0,M.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,h]=(0,r.useState)([]),[x,p]=(0,r.useState)(!1),[g,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,eC.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),h([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){h([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ek(l,d);e||(h(t),p(!1))},g),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,g]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(V.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),h([])},className:"text-muted-foreground",children:(0,t.jsx)(ey.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eS.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(f.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!x&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),eT.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(eP[e])}),n[e].map(e=>(0,t.jsx)(eD,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(eD,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eM=e.i(338187),eI=e.i(400355),e$=e.i(597746),eA=e.i(938499),eL=e.i(233274),eR=e.i(905455),eE=e.i(624687);function ez(e){return e.replace(/\.git\/?$/,"")}e.i(465536),e.i(930787);let eB=(0,N.createServerReference)("40cd8986fe033e986fd37131f7586d8531eb9088e4",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPathWithSource");var eF=e.i(624486),e_=e.i(224277);function eW({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,M.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("empty"),[S,T]=(0,r.useState)("FRONTEND"),[P,D]=(0,r.useState)("idle"),[O,$]=(0,r.useState)(""),[A,L]=(0,r.useState)(!1),[R,E]=(0,r.useState)(!1),z=()=>{l(""),d(""),m(""),p(""),f(""),y(!1),C("empty"),T("FRONTEND"),D("idle"),$(""),L(!1)},B=async()=>{if(g.trim()&&!A&&"success"===P){L(!0);try{let e=await (0,eF.analyzeProjectDirectory)(g.trim(),o);m(e)}catch{I.toast.error(n("project.analyzeError"))}finally{L(!1)}}},F=async e=>{p(e),D("idle"),$("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:ez(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:ez(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);if(t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),!N){let{path:t,source:r}=await eB(e);f(t),C(r)}},_=async()=>{if(x.trim()&&g.trim()){D("cloning"),$("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(x.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:g.trim()})}),r=await t.json();if(!t.ok){D("error"),$(r.error||"Clone failed");return}D("success")}catch{D("error"),$("Network error")}}},W=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:g.trim()||void 0,projectType:S}),z(),s(!1))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||z()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:x,onChange:e=>F(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:g,onChange:e=>{f(e.target.value),y(!0)},className:"flex-1 min-w-0 font-mono text-xs"}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"outline",onClick:()=>E(!0),className:"shrink-0 gap-1.5 px-2.5 text-xs text-muted-foreground"}),children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("folder.browse")})]}),(0,t.jsx)(b.TooltipContent,{children:n("folder.selectFolder")})]})]}),g.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),!N&&"fallback"===k&&x.trim()&&g.trim()&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-muted-foreground",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3 shrink-0"}),n("project.gitPathFallbackHint")]}),x.trim()&&g.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===P||"success"===P,onClick:_,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"===P?(0,t.jsx)(eI.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===P?(0,t.jsx)(e$.Check,{className:"h-3 w-3"}):(0,t.jsx)(ev.GitBranch,{className:"h-3 w-3"}),"cloning"===P?n("git.cloning"):"success"===P?n("git.cloned"):n("git.clone")]}),"error"===P&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),O]}),"success"===P&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eR.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:S,onChange:T})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:B,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!g.trim()||A?"opacity-50":""}`}),children:[A?(0,t.jsx)(eI.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eL.Sparkles,{className:"h-3 w-3"}),A?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:g.trim()?"success"!==P?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eE.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.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,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),z()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:W,disabled:!i.trim()||A,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})}),(0,t.jsx)(e_.FolderBrowserDialog,{open:R,onOpenChange:E,onSelect:e=>{if(f(e),y(!0),!i.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";t&&l(t)}}})]})}var eU=e.i(756502),eU=eU,eH=e.i(699375);let eK=(0,N.createServerReference)("401b2f95e3cce5930ded602c9fd3e9e135e02a054d",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath"),eV=(0,N.createServerReference)("60798d486148e4a4b63876f699e382bde537c86c7a",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eG=(0,N.createServerReference)("4060c6d6aaff8835d0f5ade772b0632192ac0a9430",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eq({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,M.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[x,p]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[O,$]=(0,r.useState)(""),[A,L]=(0,r.useState)(!1),[R,E]=(0,r.useState)(""),[z,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[W,U]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),f(""),C("FRONTEND"),T(!1),D(!1),$(""),L(!1),E(""),B(""),_(!1),U(!1)},K=async e=>{f(e),T(!1),D(!1),$(""),E(""),B(""),_(!1),l(e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(D(e),E(""),B(""),_(!1),!e)return void $("");if(x)try{let e=await eK(x);e&&($(e),e===g&&_(!0))}catch{}if(g)try{let e=await fetch(`/api/git?path=${encodeURIComponent(g)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[x,g]),G=async()=>{if(g&&!W){U(!0);try{let e=await (0,eF.analyzeProjectDirectory)(g.trim(),o);m(e)}catch{I.toast.error(n("project.analyzeError"))}finally{U(!1)}}},q=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:x.trim()||void 0,localPath:g.trim()||void 0,projectType:k},t=await a?.(e);if(P&&O&&O!==g&&t&&"id"in t){L(!0),E("");try{let e=await eG(t.id);if(!e.safe)return void E(e.reason);let r=await eV(t.id,O);if(!r.success)return void E(r.error??n("project.migrateError"));I.toast.success(n("project.migrateSuccess"))}catch(t){let e=t instanceof Error?t.message:String(t);E(`${n("project.migrateError")}:${e}`);return}finally{L(!1)}}H(),s(!1)},X=!i.trim()||!g.trim()||A||W||P&&!!z;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:g,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),x&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:x,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&g&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eH.Switch,{checked:P,onCheckedChange:e=>V(e)})]}),P&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:O,onChange:e=>{$(e.target.value),_(e.target.value===g)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(eU.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),z&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),z]}),R&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eA.AlertCircle,{className:"h-3 w-3"}),R]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eR.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:G,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!g||W?"opacity-50":""}`}),children:[W?(0,t.jsx)(eI.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eL.Sparkles,{className:"h-3 w-3"}),W?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:g?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eE.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.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,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:q,disabled:X,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:A?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(e_.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eX({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:(0,t.jsx)("path",{d:"M12 .5C5.65.5.5 5.65.5 12.02c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2c-3.2.7-3.87-1.36-3.87-1.36-.52-1.34-1.27-1.7-1.27-1.7-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.34.96.1-.74.4-1.25.72-1.54-2.56-.29-5.25-1.28-5.25-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.04 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.18-1.18 3.18-1.18.62 1.58.23 2.75.11 3.04.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.4-5.25 5.69.41.36.78 1.05.78 2.12v3.14c0 .31.21.68.79.56A11.52 11.52 0 0 0 23.5 12.02C23.5 5.65 18.35.5 12 .5Z"})})}function eJ({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,M.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eM.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:x}=function(){let{resolvedTheme:e,setTheme:t}=(0,K.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[f,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);(0,W.useActionShortcut)("global.search",()=>j(!0));let C=H(e=>e.createProjectOpen),S=H(e=>e.importProjectOpen),T=H(e=>e.setCreateProjectOpen),P=H(e=>e.setImportProjectOpen);return(0,r.useEffect)(()=>{C&&N(!0)},[C]),(0,r.useEffect)(()=>{S&&k(!0)},[S]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(V.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.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,t.jsx)(q,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(J.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(X.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"中"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:x,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(Y.Sun,{className:"h-4 w-4"}):(0,t.jsx)(Z.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>window.open("https://github.com/jp-liu/tower","_blank","noopener,noreferrer"),className:"text-muted-foreground","aria-label":n("topbar.github")}),children:(0,t.jsx)(eX,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("topbar.github")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(h.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsx)(g.DropdownMenuTrigger,{render:(0,t.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:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(ef,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ej,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(g.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(g.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(G.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(eO,{open:f,onOpenChange:j}),(0,t.jsx)(eW,{open:w,onOpenChange:e=>{N(e),e||T(!1)},onCreateProject:e}),(0,t.jsx)(eq,{open:y,onOpenChange:e=>{k(e),e||P(!1)},onCreateProject:e})]})}var eY=e.i(83434),eZ=e.i(966001),eQ=e.i(41188),e0=e.i(19578),e1=e.i(232280);let e2=(0,e0.default)(()=>e.A(427768).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[103363]},ssr:!1});function e5({mode:e}){let{isOpen:s,closeAssistant:a,sessions:n,activeSessionId:c,createNewSession:d,switchSession:u,removeSession:m,renameSession:h}=(0,eM.useAssistant)(),{t:x}=(0,M.useI18n)(),[p,f]=(0,r.useState)(null),[b,N]=(0,r.useState)(""),y=()=>{f(null),N("")},k=n.find(e=>e.id===c),C=k?.title??x("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"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,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(J.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:x("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(g.DropdownMenu,{children:[(0,t.jsxs)(g.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":x("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:C}),(0,t.jsx)(e1.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(g.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,className:"w-[280px]",children:[0===n.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:x("assistant.noSessions")}):(0,t.jsx)("div",{className:"max-h-[min(440px,50vh)] overflow-y-auto",children:n.map(e=>(0,t.jsxs)(g.DropdownMenuItem,{className:"flex items-center justify-between gap-1 pr-1",onClick:()=>u(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100",onClick:t=>{var r;t.stopPropagation(),f({id:e.id,title:r=e.title}),N(r)},"aria-label":x("assistant.renameSession"),children:(0,t.jsx)(i.Pencil,{className:"h-3 w-3"})}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),m(e.id)},"aria-label":x("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id))}),n.length>0&&(0,t.jsx)(g.DropdownMenuSeparator,{}),(0,t.jsxs)(g.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:x("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:d,"aria-label":x("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:a,"aria-label":x("assistant.closeLabel"),children:(0,t.jsx)(ey.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:s?(0,t.jsx)(e2,{}):null}),(0,t.jsx)(j.Dialog,{open:null!==p,onOpenChange:e=>{e||y()},children:(0,t.jsxs)(j.DialogContent,{children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:x("assistant.renameSessionTitle")})}),(0,t.jsx)(w.Input,{autoFocus:!0,value:b,onChange:e=>N(e.target.value),placeholder:x("assistant.renameSessionPlaceholder")}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:y,children:x("common.cancel")}),(0,t.jsx)(v.Button,{onClick:()=>{p&&b.trim()&&(h(p.id,b),y())},disabled:!b.trim(),children:x("common.save")})]})]})})]})}var e4=e.i(125177);function e3({onDismiss:e}){let{t:s}=(0,M.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.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,t.jsx)(e4.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var e8=e.i(138261),e6=e.i(191210);let e7=[{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 e9({onComplete:e}){let{t:s}=(0,M.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=e7[a],m=(0,r.useCallback)(async()=>{await (0,e6.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),h=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),x=(0,r.useCallback)(()=>{let e=h();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[h]);(0,r.useEffect)(()=>{x();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=h();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!h()&&(n(e=>{let t=e+1;return t<e7.length?t:e}),a>=e7.length-1&&m())},5e3));let t=()=>x();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,h,x,l,m]),(0,r.useEffect)(()=>{let e=setInterval(x,1e3);return()=>clearInterval(e)},[x]);let p=(0,r.useCallback)(()=>{a<e7.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
|
|
2
2
|
ellipse at ${o.left+o.width/2}px ${o.top+o.height/2}px,
|
|
3
3
|
transparent ${Math.max(o.width,o.height)}px,
|
|
4
4
|
rgba(0,0,0,0.6) ${Math.max(o.width,o.height)+30}px
|