tower-studio 0.2.33 → 0.2.35
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 +34 -34
- package/.next/standalone/.next/server/app/_not-found/page.js +8 -7
- 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.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js +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.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 +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 +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/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +2 -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]/start/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/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]/merge/route.js +1 -1
- 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 +67 -67
- package/.next/standalone/.next/server/app/missions/page.js +8 -7
- 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 +34 -34
- package/.next/standalone/.next/server/app/onboarding/page.js +8 -7
- 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 +34 -34
- package/.next/standalone/.next/server/app/page.js +8 -7
- 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 +51 -51
- package/.next/standalone/.next/server/app/settings/page.js +9 -8
- 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 +228 -144
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +9 -8
- 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 +158 -134
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +9 -8
- 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 +210 -102
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +10 -7
- 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 +127 -67
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +9 -8
- 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 +34 -34
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +9 -8
- 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 +148 -124
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +9 -8
- 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 +81 -81
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +10 -9
- 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 +50 -50
- package/.next/standalone/.next/server/app/workspaces/page.js +8 -7
- 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/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yp430z.js +3 -0
- package/.next/standalone/.next/server/chunks/{[externals]__12mj_bs._.js → [externals]__0o6dym7._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00llstz._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01n7exm._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0kay2~d._.js → [root-of-the-server]__01yu.gw._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__01_h-re._.js → [root-of-the-server]__05nz.tg._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08u6wg.._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d2japj._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0122.hq._.js → [root-of-the-server]__0j7565a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0omyrab._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qif839._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~foo~5._.js +4 -0
- package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
- 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/[root-of-the-server]__0-tolks._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.5ug08._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__037nnpo._.js → [root-of-the-server]__00~jawi._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ohx~.q._.js → [root-of-the-server]__02ur64h._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0tjczqw._.js → [root-of-the-server]__04rp1ck._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0bs_c.t._.js → [root-of-the-server]__05sv58d._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__062b.yt._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0azyv7l._.js → [root-of-the-server]__07_o.al._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__093tt4a._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09l2kmt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0hg-fwv._.js → [root-of-the-server]__09s~cme._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0wm~yai._.js → [root-of-the-server]__0_1zewr._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0mv64fw._.js → [root-of-the-server]__0_i7zpd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b.ej5q._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bgr0ql._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0-b8f6d._.js → [root-of-the-server]__0f88ua~._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0guqcva._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gzafdq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ikeoh.._.js +3 -0
- 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]__0u7n6kw._.js → [root-of-the-server]__0k-mx8r._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ymqgu_._.js → [root-of-the-server]__0lozqxc._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0p8otw1._.js → [root-of-the-server]__0lz4wdp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0m4nvu~._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0d76zys._.js → [root-of-the-server]__0m7ydqb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__127.0d7._.js → [root-of-the-server]__0m80~su._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__06ubi1g._.js → [root-of-the-server]__0na8eiv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p0te97._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qnzkj3._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qqbb31._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s7yk4_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0scj6ed._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0siyg1p._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s~4y3y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t6f4lq._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0th-t1a._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wofia_._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wt83kv._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y~ooou._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12m4ujm._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_00t6138._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_02encue._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/_02ugk48._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0np9y-t._.js → _07fnvnm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_079_ku8._.js → _0_hnt09._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0_ipj7e._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0clhm~f._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/_0cxhub8._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0vcbjph._.js → _0e-zyn2._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{_0qfin2p._.js → _0e_ak8~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0eca65n._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0_~od6x._.js → _0gvyd.f._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0hh17jg._.js +17 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hlar46._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hu0tyg._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0tf~vm8._.js → _0k9b94s._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0u1ybm2._.js → _0keo81q._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0l3l_d6._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0n1j319._.js → _0mjxq4v._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0mpce0d._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_0muaopo._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0w2xtk9._.js → _0mzwe90._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/_0n1l7yo._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0xl~whi._.js → _0n54odq._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0nk7qd4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0ocdt49._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0q44.3o._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0s36tuu._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0s7ke7u._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_134pkit._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_03r.9go._.js +3 -0
- 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 +3 -0
- 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_09vospx._.js → src_lib_01xtio2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0-t3s4k._.js → src_lib_03p6skw._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_007-dd1._.js → src_lib_05mu4f0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_09bjxpu._.js → src_lib_06nbc41._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_06okbb2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0741dos._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0cbuy0_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0e27xy7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0n5-vk5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0rk2hla._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0t5xz2y._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0u5_gf2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0v6s6se._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_constants_ts_0_7xt06._.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 +655 -499
- package/.next/standalone/.next/static/chunks/0.65.u3zhwau~.js +12 -0
- package/.next/standalone/.next/static/chunks/0.nsmn6shzidu.js +2 -0
- package/.next/standalone/.next/static/chunks/0.z88xlskrvd-.js +1 -0
- package/.next/standalone/.next/static/chunks/00.7wudyszp3y.css +1 -0
- package/.next/standalone/.next/static/chunks/00bgq.z2led_g.js +1 -0
- package/.next/standalone/.next/static/chunks/01agfbg-55.3l.js +1 -0
- package/.next/standalone/.next/static/chunks/01r_kvw6fe~.z.js +1 -0
- package/.next/standalone/.next/static/chunks/01yoibobkdz3x.js +1 -0
- package/.next/standalone/.next/static/chunks/026c8pffxl6wa.js +2 -0
- package/.next/standalone/.next/static/chunks/060cca-172m5j.js +1 -0
- package/.next/standalone/.next/static/chunks/07a3_u.yr179w.js +1 -0
- package/.next/standalone/.next/static/chunks/0b31xip8xb_cv.js +1 -0
- package/.next/standalone/.next/static/chunks/0gf~0e3xpa0fj.js +5 -0
- package/.next/standalone/.next/static/chunks/0kia6x73z7qhq.js +1 -0
- package/.next/standalone/.next/static/chunks/0msy9p40r_u_j.js +1 -0
- package/.next/standalone/.next/static/chunks/0p4w5b_p_yju8.js +1 -0
- package/.next/standalone/.next/static/chunks/0qonpqhvpg-tt.js +1 -0
- package/.next/standalone/.next/static/chunks/0vync155t_v71.js +1 -0
- package/.next/standalone/.next/static/chunks/0ws5ujnb5coco.js +1 -0
- package/.next/standalone/.next/static/chunks/0x5r51ae1bmdl.js +1 -0
- package/.next/standalone/.next/static/chunks/0xdbwwjkc3enx.js +1 -0
- package/.next/standalone/.next/static/chunks/0xg8ukff1-y32.js +1 -0
- package/.next/standalone/.next/static/chunks/0z-fh29~rncne.js +1 -0
- package/.next/standalone/.next/static/chunks/0zq8pqszpa37-.js +1 -0
- package/.next/standalone/.next/static/chunks/0~uo_7-sxehxf.js +1 -0
- package/.next/standalone/.next/static/chunks/10mwqzqdpi9d5.js +1 -0
- package/.next/standalone/.next/static/chunks/{0v1z8vez.wkfb.js → 12qumm~rdb~ls.js} +1 -1
- package/.next/standalone/.next/static/chunks/13n8ln7v6z4vc.js +5 -0
- package/.next/standalone/.next/static/chunks/{0up~e.7wnmlbs.js → 14-eiet1ypb3e.js} +1 -1
- package/.next/standalone/.next/static/chunks/{056a8z0wds522.js → 144hr38h72193.js} +1 -1
- package/.next/standalone/.next/static/chunks/14~li4os2yoi2.js +1 -0
- package/.next/standalone/.next/static/chunks/15gytx~096xul.js +1 -0
- package/.next/standalone/.next/static/chunks/16fbv7zz-.kse.js +1 -0
- package/.next/standalone/.next/static/chunks/{0558t1hlvaoxh.js → 16och4~epx6jk.js} +3 -3
- package/.next/standalone/.next/static/chunks/{11qzw.-vwkk5g.js → 1768nvsy3akwy.js} +1 -1
- package/.next/standalone/package.json +5 -1
- package/bin/tower.mjs +58 -18
- package/dist/mcp-server.cjs +25088 -21099
- package/package.json +5 -1
- package/prisma/schema.prisma +16 -0
- package/scripts/migrations/0001-insight-category.ts +22 -0
- package/scripts/run-migrations.ts +73 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0541-er._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clvf~t._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gk6ftq._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/12k._sonner_dist_index_mjs_0-vmpk5._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01pn3ol._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02p4lry._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05-t-8s._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07ptf-z._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0_r3qx7._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b77ayk._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cle18b._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e25s-_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ew4gqf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lx7sf8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rara9.._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rumact._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rv7-_r._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uq_0mc._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12w_sm_._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/_0-mid6~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0-sia69._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_0.sfgns._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_04ia97a._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0533im8._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/_06akrwh._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_06~9axc._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0_dt8gs._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0_kfemp._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0bkb_.9._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0eln2ih._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0ex2yo6._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0f.zny.._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0fuoov5._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0njo37o._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/_0r5h7cr._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/_0s02eu9._.js +0 -43
- package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +0 -17
- package/.next/standalone/.next/server/chunks/ssr/_0wown2f._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_0x9phlk._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_0xs_.j1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0~_.0md._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1083dzh._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0dbdb7l._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0dypzt_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0f948rt._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0h1rnc.._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0lcvt1c._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0mao-of._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0qlnl~c._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0qt5bft._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0z75cue._.js +0 -3
- package/.next/standalone/.next/static/chunks/021pojk-jcnw0.js +0 -1
- package/.next/standalone/.next/static/chunks/05qdpgnpb_7mk.js +0 -1
- package/.next/standalone/.next/static/chunks/06-e8wuosb00v.js +0 -1
- package/.next/standalone/.next/static/chunks/076x3dc258jv8.js +0 -1
- package/.next/standalone/.next/static/chunks/08rlai_d171x4.js +0 -1
- package/.next/standalone/.next/static/chunks/0_3q9.2g3z23l.js +0 -5
- package/.next/standalone/.next/static/chunks/0_~520q._qkjj.js +0 -2
- package/.next/standalone/.next/static/chunks/0c_2jxrtu.h6z.js +0 -1
- package/.next/standalone/.next/static/chunks/0f-n0eqe6x.4c.js +0 -1
- package/.next/standalone/.next/static/chunks/0fqp8_2f2v3lv.js +0 -1
- package/.next/standalone/.next/static/chunks/0gk2y6_okaodm.js +0 -1
- package/.next/standalone/.next/static/chunks/0i4.0h5fn9_pg.js +0 -1
- package/.next/standalone/.next/static/chunks/0imk_sv~a.wkh.js +0 -1
- package/.next/standalone/.next/static/chunks/0ktahv77jdq60.css +0 -1
- package/.next/standalone/.next/static/chunks/0m.k-orls2qu4.js +0 -1
- package/.next/standalone/.next/static/chunks/0n52vvco8hy2h.js +0 -1
- package/.next/standalone/.next/static/chunks/0nidfrkdx7qps.js +0 -5
- package/.next/standalone/.next/static/chunks/0qwt~eu3x658b.js +0 -1
- package/.next/standalone/.next/static/chunks/0wyjnhk_5g3.8.js +0 -12
- package/.next/standalone/.next/static/chunks/0x.tfkgl9nu-f.js +0 -1
- package/.next/standalone/.next/static/chunks/0x2ca5v0k2cns.js +0 -5
- package/.next/standalone/.next/static/chunks/0x~em7v37r~0r.js +0 -1
- package/.next/standalone/.next/static/chunks/0ygoq7i41ir8a.js +0 -1
- package/.next/standalone/.next/static/chunks/0yzl3zug_rpw-.js +0 -2
- package/.next/standalone/.next/static/chunks/0~5kdq-~kgsbt.js +0 -1
- package/.next/standalone/.next/static/chunks/116ssnh5k8ad9.js +0 -1
- package/.next/standalone/.next/static/chunks/13.pi0v53g-4n.js +0 -1
- package/.next/standalone/.next/static/chunks/148644k53ubh..js +0 -1
- package/.next/standalone/.next/static/chunks/14gyvwctfte0-.js +0 -5
- package/.next/standalone/.next/static/chunks/15hxafqqvgizt.js +0 -1
- /package/.next/standalone/.next/static/{m8-LaeVMTc5jjKuT9Jh1M → desYDJ6TQllFzzfGYPb6V}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{m8-LaeVMTc5jjKuT9Jh1M → desYDJ6TQllFzzfGYPb6V}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{m8-LaeVMTc5jjKuT9Jh1M → desYDJ6TQllFzzfGYPb6V}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},244354,e=>{"use strict";async function t(e,s,r={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!a.ok)throw Error((await a.json()).error||`${s} failed`);return a.json()}e.s(["gitAction",0,t])},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let a=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,a],755696);let n=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,n],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let l=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,l],719493);let o=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,o],436539)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),a=e.i(48019),n=e.i(782516),i=e.i(755696),l=e.i(886156),o=e.i(400355),c=e.i(586564),d=e.i(719493),h=e.i(597746),m=e.i(368490),x=e.i(232280),u=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),M=e.i(755146),D=e.i(759684),L=e.i(337822),A=e.i(746798),F=e.i(776639),T=e.i(793479),B=e.i(624687),I=e.i(533499);function E({open:e,onOpenChange:r,branches:a,currentBranch:n,localPath:i,onCreated:l,onError:c}){let{t:d}=(0,I.useI18n)(),[m,u]=(0,s.useState)(""),[f,p]=(0,s.useState)(n),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,M]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(u(""),p(n),j(""),k(""))},[e,n]);let D=[...new Set(a)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),L=async()=>{if(m.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:m.trim(),baseBranch:f})});if(e.ok)r(!1),l();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(F.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(F.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(F.DialogHeader,{children:(0,t.jsx)(F.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(T.Input,{value:m,onChange:e=>u(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&L()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>M(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(x.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:D.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),M(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(B.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(F.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:L,disabled:!m.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var $=e.i(360112),P=e.i(244354);let R={modified:l.FileEdit,added:a.FilePlus,deleted:n.FileMinus,untracked:i.FileQuestion,renamed:l.FileEdit},z={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},U={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function G(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/").filter(Boolean);if(0===e.length)continue;let r=t;for(let t=0;t<e.length;t++){let a=e[t],n=t===e.length-1,i=e.slice(0,t+1).join("/");if(n)r.children.push({name:a,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function O({scroll:e,children:s}){return e?(0,t.jsx)(D.ScrollArea,{className:"flex-1 min-h-0",children:s}):(0,t.jsx)("div",{children:s})}function H({label:e,count:r,labelColor:a,tree:n,batchAction:i,batchLabel:l,batchIcon:o,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:u,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(x.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${a}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:n.map(e=>(0,t.jsx)(W,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:u,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function W({node:e,depth:a,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${a} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(x.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(u.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(W,{node:e,depth:a+1,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h},e.path))]});let j=e.file,b=R[j.status]||r.File,w=z[j.status]||"text-muted-foreground",N=U[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>n(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":h??"",children:d}),h&&(0,t.jsx)(A.TooltipContent,{side:"bottom",children:h})]}),(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":o??"",children:l}),o&&(0,t.jsx)(A.TooltipContent,{side:"bottom",children:o})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:a="project"}){let n="task"===a,{t:i}=(0,I.useI18n)(),[l,m]=(0,s.useState)(null),[u,D]=(0,s.useState)(!0),[F,T]=(0,s.useState)(""),[B,R]=(0,s.useState)(!1),[z,U]=(0,s.useState)(!1),[W,V]=(0,s.useState)(!1),[K,q]=(0,s.useState)(!1),[J,Q]=(0,s.useState)(!1),[X,Y]=(0,s.useState)(""),[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();m({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{D(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,P.gitAction)(e,"stage",{files:t}),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,P.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(F.trim()){R(!0);try{await (0,P.gitAction)(e,"commit",{message:F}),T(""),$.toast.success(i("git.commitSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{R(!1)}}},ea=async t=>{U(!0);try{await (0,P.gitAction)(e,"pull",t?{branch:t}:{}),$.toast.success(i("git.pullSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{U(!1)}},en=async t=>{V(!0);try{await (0,P.gitAction)(e,"push",t?{branch:t}:{}),$.toast.success(i("git.pushSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{V(!1)}},ei=async()=>{q(!0);try{await (0,P.gitAction)(e,"fetch"),$.toast.success(i("git.fetchSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{q(!1)}},el=async t=>{try{await (0,P.gitAction)(e,"checkout",{branch:t}),Q(!1),$.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},eo=async()=>{try{await (0,P.gitAction)(e,"stash-save",{message:F||void 0}),T(""),$.toast.success(i("git.stashSaved")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,P.gitAction)(e,"stash-pop",{index:0}),$.toast.success(i("git.stashApplied")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,P.gitAction)(e,"discard-file",{file:t}),$.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},eh=async()=>{try{await (0,P.gitAction)(e,"discard-all"),$.toast.success(i("git.discardSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},em=async t=>{if("deleted"===t.status)return;let s=l?.topLevel??e;try{let a=await (0,P.gitAction)(e,"show",{file:t.file});r?.(t.file,a.content??"",s)}catch{r?.(t.file,"",s)}},ex=l?.changedFiles.filter(e=>e.staged)??[],eu=l?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>G(ex),[ex]),ep=(0,s.useMemo)(()=>G(eu),[eu]);if(u)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!l)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...l?.branches??[],...(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e))],eb=X?ej.filter(e=>e.toLowerCase().includes(X.toLowerCase())):ej;return(0,t.jsxs)("div",{className:n?"flex flex-col h-full overflow-hidden":"flex flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[n?(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:l?.currentBranch||"—"})]})}),(0,t.jsx)(A.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:l?.currentBranch||"—"})]}):(0,t.jsxs)(L.Popover,{open:J,onOpenChange:e=>{Q(e),e&&Y("")},children:[(0,t.jsxs)(L.PopoverTrigger,{className:"flex flex-1 min-w-0 items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l?.currentBranch||void 0,children:l?.currentBranch||"—"})]}),(0,t.jsx)(x.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${J?"rotate-180":""}`})]}),(0,t.jsxs)(L.PopoverContent,{align:"start",sideOffset:4,className:"w-max min-w-[var(--anchor-width)] max-w-[320px] gap-0 overflow-hidden p-0",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:X,onChange:e=>Y(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(l?.branches??[]).filter(e=>e.toLowerCase().includes(X.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(l?.branches??[]).filter(e=>e.toLowerCase().includes(X.toLowerCase())).map(e=>{let s=e===l?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?Q(!1):el(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(X.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(X.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>el(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{onClick:ei,disabled:K,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${K?"animate-spin":""}`})}),(0,t.jsx)(A.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{onClick:()=>{Q(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(A.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:F,onChange:e=>T(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:B||!F.trim()||0===ex.length,children:[B?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(h.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(M.DropdownMenu,{children:[(0,t.jsx)(M.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(M.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:er,disabled:!F.trim()||0===ex.length,children:[(0,t.jsx)(h.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===eu.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===ex.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eh,disabled:0===eu.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),disabled:z,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),disabled:W,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:z,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",l.behind]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:W,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",l.ahead]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ei,disabled:K,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${K?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eo,disabled:0===l.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),l.currentBranch]})]})]})]})]}),(0,t.jsxs)(O,{scroll:n,children:[(0,t.jsx)(H,{label:i("git.stagedChanges"),count:ex.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(H,{label:i("git.unstagedChanges"),count:eu.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===l.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(h.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...l?.branches??[],...l?.remoteBranches??[]],currentBranch:l?.currentBranch??"",localPath:e,onCreated:async()=>{$.toast.success(i("git.createSuccess")),await ee()},onError:e=>$.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},14842,865514,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),a=e.i(232280),n=e.i(759686),i=e.i(960518),l=e.i(340873),o=e.i(400355),c=e.i(519455),d=e.i(912505),h=e.i(487486),m=e.i(776639),x=e.i(624687),u=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:a}=(0,u.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:a("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:a("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:a("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,u.useI18n)(),r=e.split("\n"),a=r.length>500,n=a?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:n.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),a&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:o,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,u.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[M,D]=(0,s.useState)(!1),[L,A]=(0,s.useState)(""),[F,T]=(0,s.useState)(!1),B=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[o.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>D(!0),className:"gap-2",children:[(0,t.jsx)(l.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===o.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:o.map(e=>{let s=v.has(e.filename),n=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&B(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(h.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:n,isLargeFold:!n&&i>200,onLoad:()=>B(e.filename)})})]},e.filename)})})}),(0,t.jsx)(m.Dialog,{open:M,onOpenChange:D,children:(0,t.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsx)(m.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(x.Textarea,{value:L,onChange:e=>A(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>D(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(L.trim()&&w){T(!0);try{await w(L.trim()),A(""),D(!1)}finally{T(!1)}}},disabled:!L.trim()||F,children:F?"...":y("diff.commit")})]})]})})]})}],14842);var g=e.i(538059);let j=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:r,taskId:a,taskTitle:n,baseBranch:i,fileCount:l,commitCount:d,commitLog:h=[],onMergeComplete:x}){let u=(0,g.useRouter)(),[f,p]=(0,s.useState)(!1),[b,w]=(0,s.useState)(null),N=async()=>{p(!0),w(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){r(!1),x(),u.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?w(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):w(t.error??"Merge failed")}catch{w("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(m.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(j,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:i})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),h.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:h.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>r(!1),disabled:f,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:N,disabled:f,className:"gap-2",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},279447,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40a30d3bf150126d3c9ee744d9f98e096ef0f0de33",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},97716,107477,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c8f3ba1721e02719282f561290eb4ae9c83e7bee0",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],97716);let r=(0,t.createServerReference)("4065fc7caaaa0530a443c7629138334df97ba17ce3",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],107477)},777073,986326,310329,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60b9b794a17c8a4779acfeed1ea371f6f742a236a1",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,s],777073);let r=(0,t.createServerReference)("40916a393dba228f866d0438ec4ad5685814d474e5",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,r],986326);let a=(0,t.createServerReference)("6006d1baad4701e4916f7a6c1c07570bde181060e1",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],310329)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),a=e.i(472074),n=e.i(882651),i=e.i(181209),l=e.i(400355),o=e.i(989383),c=e.i(12659),d=e.i(922541),h=e.i(486077),m=e.i(769824),x=e.i(519455),u=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(n.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:n,onContinueLatest:i}){let{t:l,locale:o}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(u.EmptyState,{icon:m.History,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(s=>{let m=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),u=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let a=Math.floor(r/60);if(a<60)return`${a}m ${r%60}s`;let n=Math.floor(a/60);return`${n}h ${a%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",n=s.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===r?n:1===r?"zh"===t?`昨天 ${n}`:`Yesterday ${n}`:r<7?"zh"===t?`${r}天前 ${n}`:`${r}d ago ${n}`:s.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+n}(s.startedAt??null,o)}),u&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",u,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||l("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,t.jsxs)("span",{children:[m.commits," ",l("execution.commits")]}):null,m.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[m.filesChanged," ",l("execution.files")]})]}):null,m.insertions||m.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),m.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(h.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&n?(0,t.jsxs)(x.Button,{size:"sm",onClick:()=>n(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(x.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(x.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])},926933,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("6066325eb350a72dd75bf17983c62fa54de2d1ffc2",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},244354,e=>{"use strict";async function t(e,s,r={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!a.ok)throw Error((await a.json()).error||`${s} failed`);return a.json()}e.s(["gitAction",0,t])},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let a=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,a],755696);let n=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,n],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let l=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,l],719493);let o=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,o],436539)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),a=e.i(48019),n=e.i(782516),i=e.i(755696),l=e.i(886156),o=e.i(400355),c=e.i(586564),d=e.i(719493),h=e.i(597746),m=e.i(368490),x=e.i(232280),u=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),M=e.i(755146),D=e.i(759684),L=e.i(337822),A=e.i(746798),F=e.i(776639),T=e.i(793479),B=e.i(624687),I=e.i(533499);function E({open:e,onOpenChange:r,branches:a,currentBranch:n,localPath:i,onCreated:l,onError:c}){let{t:d}=(0,I.useI18n)(),[m,u]=(0,s.useState)(""),[f,p]=(0,s.useState)(n),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,M]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(u(""),p(n),j(""),k(""))},[e,n]);let D=[...new Set(a)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),L=async()=>{if(m.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:m.trim(),baseBranch:f})});if(e.ok)r(!1),l();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(F.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(F.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(F.DialogHeader,{children:(0,t.jsx)(F.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(T.Input,{value:m,onChange:e=>u(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&L()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>M(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(x.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:D.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),M(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(B.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(F.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:L,disabled:!m.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var $=e.i(360112),P=e.i(244354);let R={modified:l.FileEdit,added:a.FilePlus,deleted:n.FileMinus,untracked:i.FileQuestion,renamed:l.FileEdit},z={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},U={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function G(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/").filter(Boolean);if(0===e.length)continue;let r=t;for(let t=0;t<e.length;t++){let a=e[t],n=t===e.length-1,i=e.slice(0,t+1).join("/");if(n)r.children.push({name:a,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function O({scroll:e,children:s}){return e?(0,t.jsx)(D.ScrollArea,{className:"flex-1 min-h-0",children:s}):(0,t.jsx)("div",{children:s})}function H({label:e,count:r,labelColor:a,tree:n,batchAction:i,batchLabel:l,batchIcon:o,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:u,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(x.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${a}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:n.map(e=>(0,t.jsx)(W,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:u,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function W({node:e,depth:a,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${a} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(x.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(u.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(W,{node:e,depth:a+1,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h},e.path))]});let j=e.file,b=R[j.status]||r.File,w=z[j.status]||"text-muted-foreground",N=U[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>n(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":h??"",children:d}),h&&(0,t.jsx)(A.TooltipContent,{side:"bottom",children:h})]}),(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":o??"",children:l}),o&&(0,t.jsx)(A.TooltipContent,{side:"bottom",children:o})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:a="project"}){let n="task"===a,{t:i}=(0,I.useI18n)(),[l,m]=(0,s.useState)(null),[u,D]=(0,s.useState)(!0),[F,T]=(0,s.useState)(""),[B,R]=(0,s.useState)(!1),[z,U]=(0,s.useState)(!1),[W,V]=(0,s.useState)(!1),[K,q]=(0,s.useState)(!1),[J,Q]=(0,s.useState)(!1),[X,Y]=(0,s.useState)(""),[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();m({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{D(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,P.gitAction)(e,"stage",{files:t}),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,P.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(F.trim()){R(!0);try{await (0,P.gitAction)(e,"commit",{message:F}),T(""),$.toast.success(i("git.commitSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{R(!1)}}},ea=async t=>{U(!0);try{await (0,P.gitAction)(e,"pull",t?{branch:t}:{}),$.toast.success(i("git.pullSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{U(!1)}},en=async t=>{V(!0);try{await (0,P.gitAction)(e,"push",t?{branch:t}:{}),$.toast.success(i("git.pushSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{V(!1)}},ei=async()=>{q(!0);try{await (0,P.gitAction)(e,"fetch"),$.toast.success(i("git.fetchSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}finally{q(!1)}},el=async t=>{try{await (0,P.gitAction)(e,"checkout",{branch:t}),Q(!1),$.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},eo=async()=>{try{await (0,P.gitAction)(e,"stash-save",{message:F||void 0}),T(""),$.toast.success(i("git.stashSaved")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,P.gitAction)(e,"stash-pop",{index:0}),$.toast.success(i("git.stashApplied")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,P.gitAction)(e,"discard-file",{file:t}),$.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},eh=async()=>{try{await (0,P.gitAction)(e,"discard-all"),$.toast.success(i("git.discardSuccess")),await ee()}catch(e){$.toast.error(e instanceof Error?e.message:String(e))}},em=async t=>{if("deleted"===t.status)return;let s=l?.topLevel??e;try{let a=await (0,P.gitAction)(e,"show",{file:t.file});r?.(t.file,a.content??"",s)}catch{r?.(t.file,"",s)}},ex=l?.changedFiles.filter(e=>e.staged)??[],eu=l?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>G(ex),[ex]),ep=(0,s.useMemo)(()=>G(eu),[eu]);if(u)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!l)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...l?.branches??[],...(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e))],eb=X?ej.filter(e=>e.toLowerCase().includes(X.toLowerCase())):ej;return(0,t.jsxs)("div",{className:n?"flex flex-col h-full overflow-hidden":"flex flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[n?(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:l?.currentBranch||"—"})]})}),(0,t.jsx)(A.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:l?.currentBranch||"—"})]}):(0,t.jsxs)(L.Popover,{open:J,onOpenChange:e=>{Q(e),e&&Y("")},children:[(0,t.jsxs)(L.PopoverTrigger,{className:"flex flex-1 min-w-0 items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l?.currentBranch||void 0,children:l?.currentBranch||"—"})]}),(0,t.jsx)(x.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${J?"rotate-180":""}`})]}),(0,t.jsxs)(L.PopoverContent,{align:"start",sideOffset:4,className:"w-max min-w-[var(--anchor-width)] max-w-[320px] gap-0 overflow-hidden p-0",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:X,onChange:e=>Y(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(l?.branches??[]).filter(e=>e.toLowerCase().includes(X.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(l?.branches??[]).filter(e=>e.toLowerCase().includes(X.toLowerCase())).map(e=>{let s=e===l?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?Q(!1):el(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(X.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(X.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>el(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{onClick:ei,disabled:K,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${K?"animate-spin":""}`})}),(0,t.jsx)(A.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(A.Tooltip,{children:[(0,t.jsx)(A.TooltipTrigger,{onClick:()=>{Q(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(A.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:F,onChange:e=>T(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:B||!F.trim()||0===ex.length,children:[B?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(h.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(M.DropdownMenu,{children:[(0,t.jsx)(M.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(M.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:er,disabled:!F.trim()||0===ex.length,children:[(0,t.jsx)(h.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===eu.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===ex.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eh,disabled:0===eu.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),disabled:z,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),disabled:W,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:z,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",l.behind]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:W,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",l.ahead]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ei,disabled:K,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${K?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eo,disabled:0===l.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),l.currentBranch]})]})]})]})]}),(0,t.jsxs)(O,{scroll:n,children:[(0,t.jsx)(H,{label:i("git.stagedChanges"),count:ex.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(H,{label:i("git.unstagedChanges"),count:eu.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===l.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(h.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...l?.branches??[],...l?.remoteBranches??[]],currentBranch:l?.currentBranch??"",localPath:e,onCreated:async()=>{$.toast.success(i("git.createSuccess")),await ee()},onError:e=>$.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},14842,865514,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),a=e.i(232280),n=e.i(759686),i=e.i(960518),l=e.i(340873),o=e.i(400355),c=e.i(519455),d=e.i(912505),h=e.i(487486),m=e.i(776639),x=e.i(624687),u=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:a}=(0,u.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:a("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:a("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:a("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,u.useI18n)(),r=e.split("\n"),a=r.length>500,n=a?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:n.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),a&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:o,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,u.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[M,D]=(0,s.useState)(!1),[L,A]=(0,s.useState)(""),[F,T]=(0,s.useState)(!1),B=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[o.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>D(!0),className:"gap-2",children:[(0,t.jsx)(l.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===o.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:o.map(e=>{let s=v.has(e.filename),n=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&B(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(h.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:n,isLargeFold:!n&&i>200,onLoad:()=>B(e.filename)})})]},e.filename)})})}),(0,t.jsx)(m.Dialog,{open:M,onOpenChange:D,children:(0,t.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsx)(m.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(x.Textarea,{value:L,onChange:e=>A(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>D(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(L.trim()&&w){T(!0);try{await w(L.trim()),A(""),D(!1)}finally{T(!1)}}},disabled:!L.trim()||F,children:F?"...":y("diff.commit")})]})]})})]})}],14842);var g=e.i(538059);let j=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:r,taskId:a,taskTitle:n,baseBranch:i,fileCount:l,commitCount:d,commitLog:h=[],onMergeComplete:x}){let u=(0,g.useRouter)(),[f,p]=(0,s.useState)(!1),[b,w]=(0,s.useState)(null),N=async()=>{p(!0),w(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){r(!1),x(),u.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?w(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):w(t.error??"Merge failed")}catch{w("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(m.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(j,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:i})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),h.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:h.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>r(!1),disabled:f,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:N,disabled:f,className:"gap-2",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},387302,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40e06831163bbca5963715711214d5a3d177192683",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},841279,229011,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c6143afde74b50093dbd95f796cbcfc288755bb5b",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],841279);let r=(0,t.createServerReference)("40ef268477c40d3bb03340fa54040ed9d6a89a8c9a",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],229011)},921414,268518,506884,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("608df3d0878f7400b442253b6be02933d22d191194",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,s],921414);let r=(0,t.createServerReference)("404c188a2cdefd761e4f48d17ea85e83fcecb94f0a",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,r],268518);let a=(0,t.createServerReference)("60e4f680fa563ad0d3e0918dadd2c37e15f752f1c9",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],506884)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),a=e.i(472074),n=e.i(882651),i=e.i(181209),l=e.i(400355),o=e.i(989383),c=e.i(12659),d=e.i(922541),h=e.i(486077),m=e.i(769824),x=e.i(519455),u=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(n.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:n,onContinueLatest:i}){let{t:l,locale:o}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(u.EmptyState,{icon:m.History,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(s=>{let m=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),u=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let a=Math.floor(r/60);if(a<60)return`${a}m ${r%60}s`;let n=Math.floor(a/60);return`${n}h ${a%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",n=s.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===r?n:1===r?"zh"===t?`昨天 ${n}`:`Yesterday ${n}`:r<7?"zh"===t?`${r}天前 ${n}`:`${r}d ago ${n}`:s.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+n}(s.startedAt??null,o)}),u&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",u,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||l("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,t.jsxs)("span",{children:[m.commits," ",l("execution.commits")]}):null,m.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[m.filesChanged," ",l("execution.files")]})]}):null,m.insertions||m.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),m.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(h.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&n?(0,t.jsxs)(x.Button,{size:"sm",onClick:()=>n(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(x.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(x.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])},699617,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("6047926187e64397462204feca044aaee9e57ba57a",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,280027,673313,e=>{"use strict";var t=e.i(289721);e.s([],648333),e.i(648333);var r=e.i(965652),n=e.i(416369),l=e.i(362891),o=e.i(903224),i=e.i(528796),s=e.i(314757),a=e.i(804849),u=e.i(887642),c=e.i(20746),d=e.i(812901),p=e.i(956741),f=e.i(430557),m=e.i(594640),g=e.i(592604),h=e.i(306296),v=e.i(234951),S=e.i(471959);e.i(708878);var b=e.i(462902);let x=r.createContext(null),y=r.createContext(null);function w(){let e=r.useContext(x);if(null===e)throw Error((0,b.default)(60));return e}function E(){let e=r.useContext(y);if(null===e)throw Error((0,b.default)(61));return e}var R=e.i(890514),M=e.i(103353),I=e.i(193214),A=e.i(596290);let C=(e,t)=>Object.is(e,t);function T(e,t,r){return null==e||null==t?Object.is(e,t):r(e,t)}function P(e,t,r){return e&&0!==e.length?e.findIndex(e=>void 0!==e&&T(e,t,r)):-1}function j(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function V(e){return null!=e&&e.length>0&&"object"==typeof e[0]&&null!=e[0]&&"items"in e[0]}function L(e,t){return t&&null!=e?t(e)??"":e&&"object"==typeof e&&"value"in e&&"label"in e?j(e.value):j(e)}function k(e,t,r){function n(){if(r&&null!=e)return r(e)??"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return j(e)}if(r&&null!=e)return r(e);if(e&&"object"==typeof e&&"label"in e&&null!=e.label)return e.label;if(t&&!Array.isArray(t))return t[e]??n();if(Array.isArray(t)){let r=V(t)?t.flatMap(e=>e.items):t;if(null==e||"object"!=typeof e){let t=r.find(t=>t.value===e);return t&&null!=t.label?t.label:n()}if("value"in e){let t=r.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return n()}let O={id:(0,A.createSelector)(e=>e.id),labelId:(0,A.createSelector)(e=>e.labelId),modal:(0,A.createSelector)(e=>e.modal),multiple:(0,A.createSelector)(e=>e.multiple),items:(0,A.createSelector)(e=>e.items),itemToStringLabel:(0,A.createSelector)(e=>e.itemToStringLabel),itemToStringValue:(0,A.createSelector)(e=>e.itemToStringValue),isItemEqualToValue:(0,A.createSelector)(e=>e.isItemEqualToValue),value:(0,A.createSelector)(e=>e.value),hasSelectedValue:(0,A.createSelector)(e=>{let{value:t,multiple:r,itemToStringValue:n}=e;return null!=t&&(r&&Array.isArray(t)?t.length>0:""!==L(t,n))}),hasNullItemLabel:(0,A.createSelector)((e,t)=>!!t&&function(e){if(!Array.isArray(e))return null!=e&&"null"in e;if(V(e)){for(let t of e)for(let e of t.items)if(e&&null==e.value&&null!=e.label)return!0;return!1}for(let t of e)if(t&&null==t.value&&null!=t.label)return!0;return!1}(e.items)),open:(0,A.createSelector)(e=>e.open),mounted:(0,A.createSelector)(e=>e.mounted),forceMount:(0,A.createSelector)(e=>e.forceMount),transitionStatus:(0,A.createSelector)(e=>e.transitionStatus),openMethod:(0,A.createSelector)(e=>e.openMethod),activeIndex:(0,A.createSelector)(e=>e.activeIndex),selectedIndex:(0,A.createSelector)(e=>e.selectedIndex),isActive:(0,A.createSelector)((e,t)=>e.activeIndex===t),isSelected:(0,A.createSelector)((e,t,r)=>{let n=e.isItemEqualToValue,l=e.value;return e.multiple?Array.isArray(l)&&l.some(e=>T(r,e,n)):e.selectedIndex===t&&null!==e.selectedIndex||T(r,l,n)}),isSelectedByFocus:(0,A.createSelector)((e,t)=>e.selectedIndex===t),popupProps:(0,A.createSelector)(e=>e.popupProps),triggerProps:(0,A.createSelector)(e=>e.triggerProps),triggerElement:(0,A.createSelector)(e=>e.triggerElement),positionerElement:(0,A.createSelector)(e=>e.positionerElement),listElement:(0,A.createSelector)(e=>e.listElement),scrollUpArrowVisible:(0,A.createSelector)(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:(0,A.createSelector)(e=>e.scrollDownArrowVisible),hasScrollArrows:(0,A.createSelector)(e=>e.hasScrollArrows)};var D=e.i(67077),U=e.i(586622),N=e.i(504068),H=e.i(571870),F=e.i(421689),B=e.i(954588),z=e.i(353052),_=e.i(892069),Y=e.i(565455),$=e.i(581263),q=e.i(551974),W=e.i(397791);let K=r.forwardRef(function(e,t){let{render:r,className:n,...l}=e;delete l.id;let o=(0,R.useFieldRootContext)(),{store:i}=w(),s=(0,d.useStore)(i,O.triggerElement),a=(0,d.useStore)(i,O.id),u=null==a?void 0:`${a}-label`,c=(0,W.useLabel)({id:u,fallbackControlId:s?.id??a,setLabelId(e){i.set("labelId",e)}});return(0,$.useRenderElement)("div",e,{ref:t,state:o.state,props:[c,l],stateAttributesMapping:q.fieldValidityMapping})});var X=e.i(102094),G=e.i(161476),J=e.i(179279),Q=e.i(845756),Z=e.i(748299),ee=e.i(682354),et=e.i(282109);let er={...Q.pressableTriggerOpenStateMapping,...q.fieldValidityMapping,value:()=>null},en=r.forwardRef(function(e,t){let{render:n,className:o,id:i,disabled:s=!1,nativeButton:a=!0,...p}=e,{setTouched:f,setFocused:m,validationMode:g,state:h,disabled:v}=(0,R.useFieldRootContext)(),{labelId:S}=(0,J.useLabelableContext)(),{store:b,setOpen:x,selectionRef:y,validation:E,readOnly:I,required:A,alignItemWithTriggerActiveRef:C,disabled:T,keyboardActiveRef:P}=w(),j=v||T||s,V=(0,d.useStore)(b,O.open),L=(0,d.useStore)(b,O.value),k=(0,d.useStore)(b,O.triggerProps),N=(0,d.useStore)(b,O.positionerElement),H=(0,d.useStore)(b,O.listElement),F=(0,d.useStore)(b,O.id),B=(0,d.useStore)(b,O.labelId),z=(0,d.useStore)(b,O.hasSelectedValue),_=!z&&V,q=(0,d.useStore)(b,O.hasNullItemLabel,_),W=i??F;(0,M.useLabelableId)({id:W});let K=(0,c.useValueAsRef)(N),Q=r.useRef(null),{getButtonProps:en,buttonRef:el}=(0,et.useButton)({disabled:j,native:a}),eo=(0,u.useStableCallback)(e=>{b.set("triggerElement",e)}),ei=(0,l.useMergedRefs)(t,Q,el,eo),es=(0,G.useTimeout)(),ea=(0,G.useTimeout)(),eu=(0,G.useTimeout)(),ec=(0,G.useTimeout)();r.useEffect(()=>{if(V)return z||q?ec.start(200,()=>{y.current.allowUnselectedMouseUp=!0,eu.start(200,()=>{y.current.allowSelectedMouseUp=!0})}):eu.start(400,()=>{y.current.allowUnselectedMouseUp=!0,y.current.allowSelectedMouseUp=!0}),()=>{eu.clear(),ec.clear()};y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},ea.clear()},[V,z,q,y,ea,eu,ec]);let ed=r.useMemo(()=>H?.id??(0,ee.getFloatingFocusElement)(N)?.id,[H,N]),ep=(0,Y.mergeProps)(k,{id:W,role:"combobox","aria-expanded":V?"true":"false","aria-haspopup":"listbox","aria-controls":V?ed:void 0,"aria-labelledby":S??B,"aria-readonly":I||void 0,"aria-required":A||void 0,tabIndex:j?-1:0,ref:ei,onFocus(e){m(!0),V&&C.current&&x(!1,(0,D.createChangeEventDetails)(U.REASONS.none,e.nativeEvent)),es.start(0,()=>{b.set("forceMount",!0)})},onBlur(e){(0,ee.contains)(N,e.relatedTarget)||(f(!0),m(!1),"onBlur"===g&&E.commit(L))},onPointerMove(){P.current=!1},onKeyDown(){P.current=!0},onMouseDown(e){if(V)return;let t=(0,X.ownerDocument)(e.currentTarget);function r(e){if(!Q.current)return;let t=e.target;if((0,ee.contains)(Q.current,t)||(0,ee.contains)(K.current,t)||t===Q.current)return;let r=(0,Z.getPseudoElementBounds)(Q.current);e.clientX>=r.left-2&&e.clientX<=r.right+2&&e.clientY>=r.top-2&&e.clientY<=r.bottom+2||x(!1,(0,D.createChangeEventDetails)(U.REASONS.cancelOpen,e))}ea.start(0,()=>{t.addEventListener("mouseup",r,{once:!0})})}},E.getValidationProps,p,en);ep.role="combobox";let ef={...h,open:V,disabled:j,value:L,readOnly:I,placeholder:!z};return(0,$.useRenderElement)("button",e,{ref:[t,Q],state:ef,stateAttributesMapping:er,props:ep})}),el={value:()=>null},eo=r.forwardRef(function(e,n){let{className:l,render:o,children:i,placeholder:s,...a}=e,{store:u,valueRef:c}=w(),p=(0,d.useStore)(u,O.value),f=(0,d.useStore)(u,O.items),m=(0,d.useStore)(u,O.itemToStringLabel),g=(0,d.useStore)(u,O.hasSelectedValue),h=(0,d.useStore)(u,O.hasNullItemLabel,!g&&null!=s&&null==i),v=null;if("function"==typeof i)v=i(p);else if(null!=i)v=i;else if(g||null==s||h)if(Array.isArray(p))v=p.reduce((e,n,l)=>(l>0&&e.push(", "),e.push((0,t.jsx)(r.Fragment,{children:k(n,f,m)},l)),e),[]);else v=k(p,f,m);else v=s;return(0,$.useRenderElement)("span",e,{state:{value:p,placeholder:!g},ref:[n,c],props:[{children:v},a],stateAttributesMapping:el})}),ei=r.forwardRef(function(e,t){let{className:r,render:n,...l}=e,{store:o}=w(),i=(0,d.useStore)(o,O.open);return(0,$.useRenderElement)("span",e,{state:{open:i},ref:t,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:Q.triggerOpenStateMapping})});var es=e.i(888393);let ea=r.createContext(void 0),eu=r.forwardRef(function(e,r){let{store:n}=w(),l=(0,d.useStore)(n,O.mounted),o=(0,d.useStore)(n,O.forceMount);return l||o?(0,t.jsx)(ea.Provider,{value:!0,children:(0,t.jsx)(es.FloatingPortal,{ref:r,...e})}):null});var ec=e.i(809058);let ed={...Q.popupStateMapping,...ec.transitionStatusMapping},ep=r.forwardRef(function(e,t){let{className:r,render:n,...l}=e,{store:o}=w(),i=(0,d.useStore)(o,O.open),s=(0,d.useStore)(o,O.mounted),a=(0,d.useStore)(o,O.transitionStatus);return(0,$.useRenderElement)("div",e,{state:{open:i,transitionStatus:a},ref:t,props:[{role:"presentation",hidden:!s,style:{userSelect:"none",WebkitUserSelect:"none"}},l],stateAttributesMapping:ed})});var ef=e.i(831766),em=e.i(620163),eg=e.i(579028),eh=e.i(887943);let ev=r.createContext(void 0);function eS(){let e=r.useContext(ev);if(!e)throw Error((0,b.default)(59));return e}var eb=e.i(72287),ex=e.i(693354),ey=e.i(808754);function ew(e,t){e&&Object.assign(e.style,t)}let eE={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},eR={position:"fixed"},eM=r.forwardRef(function(e,n){let{anchor:l,positionMethod:o="absolute",className:i,render:s,side:c="bottom",align:p="center",sideOffset:f=0,alignOffset:m=0,collisionBoundary:g="clipping-ancestors",collisionPadding:h,arrowPadding:v=5,sticky:S=!1,disableAnchorTracking:b,alignItemWithTrigger:x=!0,collisionAvoidance:y=ex.DROPDOWN_COLLISION_AVOIDANCE,...R}=e,{store:M,listRef:I,labelsRef:A,alignItemWithTriggerActiveRef:C,selectedItemTextRef:j,valuesRef:V,initialValueRef:L,popupRef:k,setValue:N}=w(),H=E(),F=(0,d.useStore)(M,O.open),B=(0,d.useStore)(M,O.mounted),z=(0,d.useStore)(M,O.modal),_=(0,d.useStore)(M,O.value),Y=(0,d.useStore)(M,O.openMethod),q=(0,d.useStore)(M,O.positionerElement),W=(0,d.useStore)(M,O.triggerElement),K=(0,d.useStore)(M,O.isItemEqualToValue),X=(0,d.useStore)(M,O.transitionStatus),G=r.useRef(null),J=r.useRef(null),[Z,ee]=r.useState(x),et=B&&Z&&"touch"!==Y;B||Z===x||ee(x),(0,a.useIsoLayoutEffect)(()=>{!B&&(O.scrollUpArrowVisible(M.state)&&M.set("scrollUpArrowVisible",!1),O.scrollDownArrowVisible(M.state)&&M.set("scrollDownArrowVisible",!1))},[M,B]),r.useImperativeHandle(C,()=>et),(0,em.useScrollLock)((et||z)&&F&&"touch"!==Y,W);let er=(0,eh.useAnchorPositioning)({anchor:l,floatingRootContext:H,positionMethod:o,mounted:B,side:c,sideOffset:f,align:p,alignOffset:m,arrowPadding:v,collisionBoundary:g,collisionPadding:h,sticky:S,disableAnchorTracking:b??et,collisionAvoidance:y,keepMounted:!0}),en=et?"none":er.side,el=et?eR:er.positionerStyles,eo=r.useMemo(()=>{let e={};return F||(e.pointerEvents="none"),{role:"presentation",hidden:!B,style:{...el,...e}}},[F,B,el]),ei={open:F,side:en,align:er.align,anchorHidden:er.anchorHidden},es=(0,u.useStableCallback)(e=>{M.set("positionerElement",e)}),ea=(0,$.useRenderElement)("div",e,{ref:[n,es],state:ei,stateAttributesMapping:Q.popupStateMapping,props:[eo,(0,ey.getDisabledMountTransitionStyles)(X),R]}),eu=r.useRef(0),ec=(0,u.useStableCallback)(e=>{if(0===e.size&&0===eu.current||0===V.current.length)return;let t=eu.current;if(eu.current=e.size,e.size===t)return;let r=(0,D.createChangeEventDetails)(U.REASONS.none);if(0!==t&&!M.state.multiple&&null!==_&&-1===P(V.current,_,K)){let e=L.current,t=null!=e&&-1!==P(V.current,e,K)?e:null;N(t,r),null===t&&(M.set("selectedIndex",null),j.current=null)}if(0!==t&&M.state.multiple&&Array.isArray(_)){let e=_.filter(e=>-1!==P(V.current,e,K));(e.length!==_.length||e.some(e=>!(_&&0!==_.length&&_.some(t=>void 0!==t&&T(e,t,K)))))&&(N(e,r),0===e.length&&(M.set("selectedIndex",null),j.current=null))}if(F&&et){M.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:""};ew(q,e),ew(k.current,e)}}),ed=r.useMemo(()=>({...er,side:en,alignItemWithTriggerActive:et,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:G,scrollDownArrowRef:J}),[er,en,et,ee]);return(0,t.jsx)(eg.CompositeList,{elementsRef:I,labelsRef:A,onMapChange:ec,children:(0,t.jsxs)(ev.Provider,{value:ed,children:[B&&z&&(0,t.jsx)(eb.InternalBackdrop,{inert:(0,ef.inertValue)(!F),cutout:W}),ea]})})});var eI=e.i(585012),eA=e.i(641645),eC=e.i(442383),eT=e.i(285182);function eP(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var ej=e.i(946467),eV=e.i(11931),eL=e.i(278928),ek=e.i(685668),eO=e.i(196368),eD=e.i(197920),eU=e.i(867467),eN=e.i(743945);let eH={...Q.popupStateMapping,...ec.transitionStatusMapping},eF=r.forwardRef(function(e,n){let{render:l,className:o,finalFocus:i,...s}=e,{store:c,popupRef:p,onOpenChangeComplete:f,setOpen:m,valueRef:g,selectedItemTextRef:h,keyboardActiveRef:v,multiple:S,handleScrollArrowVisibility:b,scrollHandlerRef:x,highlightItemOnHover:y}=w(),{side:R,align:M,alignItemWithTriggerActive:I,setControlledAlignItemWithTrigger:A,scrollDownArrowRef:C,scrollUpArrowRef:T}=eS(),P=null!=(0,eO.useToolbarRootContext)(!0),j=E(),{nonce:V,disableStyleElements:L}=(0,eN.useCSPContext)(),k=(0,G.useTimeout)(),H=(0,d.useStore)(c,O.id),F=(0,d.useStore)(c,O.open),B=(0,d.useStore)(c,O.mounted),z=(0,d.useStore)(c,O.popupProps),_=(0,d.useStore)(c,O.transitionStatus),Y=(0,d.useStore)(c,O.triggerElement),q=(0,d.useStore)(c,O.positionerElement),W=(0,d.useStore)(c,O.listElement),K=r.useRef(0),J=r.useRef(!1),Q=r.useRef(0),Z=r.useRef(!1),ee=r.useRef({}),et=(0,ej.useAnimationFrame)(),er=(0,u.useStableCallback)(e=>{if(!q||!p.current||!Z.current)return;if(J.current||!I)return void b();let t="0px"===q.style.top,r="0px"===q.style.bottom,n=q.getBoundingClientRect().height,l=(0,X.ownerDocument)(q),o=getComputedStyle(q),i=parseFloat(o.marginTop),s=parseFloat(o.marginBottom),a=eB(getComputedStyle(p.current)),u=Math.min(l.documentElement.clientHeight-i-s,a),c=e.scrollTop,d=ez(e),f=0,m=null,g=!1,h=!1,v=e=>{q.style.height=`${e}px`},S=(t,r)=>{let l=(0,eU.clamp)(t,0,u-n);l>0&&v(n+l),e.scrollTop=r,u-(n+l)<=1&&(J.current=!0),b()};if(t){let e=d-c,t=Math.min(n+e,u);if(f=t,e<=1)return void S(e,d);u-t>1?h=!0:g=!0}else if(r){let e=n+c,t=Math.min(e,u);if(f=t,c<=1)return void S(c,0);u-t>1?m=0:(g=!0,c<d&&(m=c-(c-(e-u))))}if(0!==(f=Math.ceil(f))&&v(f),h||null!=m){let t=ez(e),r=h?t:(0,eU.clamp)(m,0,t);Math.abs(e.scrollTop-r)>1&&(e.scrollTop=r)}(g||f>=u-1)&&(J.current=!0),b()});r.useImperativeHandle(x,()=>er,[er]),(0,N.useOpenChangeComplete)({open:F,ref:p,onComplete(){F&&f?.(!0)}}),(0,a.useIsoLayoutEffect)(()=>{q&&p.current&&!Object.keys(ee.current).length&&(ee.current={top:q.style.top||"0",left:q.style.left||"0",right:q.style.right,height:q.style.height,bottom:q.style.bottom,minHeight:q.style.minHeight,maxHeight:q.style.maxHeight,marginTop:q.style.marginTop,marginBottom:q.style.marginBottom})},[p,q]),(0,a.useIsoLayoutEffect)(()=>{F||I||(Z.current=!1,J.current=!1,K.current=0,Q.current=0,ew(q,ee.current))},[F,I,q,p]),(0,a.useIsoLayoutEffect)(()=>{let e=p.current;if(F&&Y&&q&&e&&"ending"!==c.state.transitionStatus){if(!I){Z.current=!0,et.request(b),e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{let t=function(e){let{style:t}=e,r={};for(let[e,n]of eY)r[e]=t.getPropertyValue(e),t.setProperty(e,n,"important");return()=>{for(let[e]of eY){let n=r[e];n?t.setProperty(e,n):t.removeProperty(e)}}}(e);e.style.removeProperty("--transform-origin");try{var r;let t,n=getComputedStyle(q),l=getComputedStyle(e),o=(0,X.ownerDocument)(Y),i=(0,eT.ownerWindow)(q),s=(r=Y,eL.platform.getScale(r)),a=e_(Y.getBoundingClientRect(),s),u=e_(q.getBoundingClientRect(),s),c=a.left,d=a.height,p=W||e,f=p.scrollHeight,m=parseFloat(l.borderBottomWidth),v=parseFloat(n.marginTop)||10,S=parseFloat(n.marginBottom)||10,x=parseFloat(n.minHeight)||100,y=eB(l),w=o.documentElement.clientHeight-v-S,E=o.documentElement.clientWidth,R=w-a.bottom+d,M=h.current,I=g.current,C=0,T=0;if(M&&I){let e=e_(I.getBoundingClientRect(),s);t=e_(M.getBoundingClientRect(),s);let r=e.left-c,n=t.left-u.left,l=e.top-a.top+e.height/2,o=t.top-u.top+t.height/2;C=r-n,T=o-l}let P=R+T+S+m,j=Math.min(w,P),V=w-v-S,L=P-j,k=Math.max(5,c+C),O=Math.max(0,k+u.width-(E-5));q.style.left=`${k-O}px`,q.style.height=`${j}px`,q.style.maxHeight="auto",q.style.marginTop=`${v}px`,q.style.marginBottom=`${S}px`,e.style.height="100%";let D=ez(p),U=L>=D-1;U&&(j=Math.min(w,u.height)-(L-D));let N=a.top<20||a.bottom>w-20||Math.ceil(j)+1<Math.min(f,x),H=(i.visualViewport?.scale??1)!==1&&eC.isWebKit;if(N||H){Z.current=!0,ew(q,ee.current),eI.flushSync(()=>A(!1));return}if(U){let e=Math.max(0,w-P);q.style.top=u.height>=V?"0":`${e}px`,q.style.height=`${j}px`,p.scrollTop=ez(p),K.current=Math.max(x,j)}else q.style.bottom="0",K.current=Math.max(x,j),p.scrollTop=L;if(t){let r=u.top,n=u.height,l=t.top+t.height/2,o=(0,eU.clamp)(n>0?(l-r)/n*100:50,0,100);e.style.setProperty("--transform-origin",`50% ${o}%`)}(K.current===w||j>=y)&&(J.current=!0),b(),setTimeout(()=>{Z.current=!0})}finally{t()}})}},[c,F,q,Y,g,h,p,b,I,A,et,C,T,W]),r.useEffect(()=>{if(!I||!q||!F)return;let e=(0,eT.ownerWindow)(q);function t(e){m(!1,(0,D.createChangeEventDetails)(U.REASONS.windowResize,e))}return e.addEventListener("resize",t),()=>{e.removeEventListener("resize",t)}},[m,I,q,F]);let en={...W?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${H}-list`},onKeyDown(e){v.current=!0,P&&eD.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()},onMouseMove(){v.current=!1},onPointerLeave(e){if(!y||eP(e)||"touch"===e.pointerType)return;let t=e.currentTarget;k.start(0,()=>{c.set("activeIndex",null),t.focus({preventScroll:!0})})},onScroll(e){W||er(e.currentTarget)},...I&&{style:W?{height:"100%"}:eE}},el=(0,$.useRenderElement)("div",e,{ref:[n,p],state:{open:F,transitionStatus:_,side:R,align:M},stateAttributesMapping:eH,props:[z,en,(0,ey.getDisabledMountTransitionStyles)(_),{className:!W&&I?ek.styleDisableScrollbar.className:void 0},s]});return(0,t.jsxs)(r.Fragment,{children:[!L&&ek.styleDisableScrollbar.getElement(V),(0,t.jsx)(eV.FloatingFocusManager,{context:j,modal:!1,disabled:!B,returnFocus:i,restoreFocus:!0,children:el})]})});function eB(e){let t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function ez(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function e_(e,t){return(0,eA.rectToClientRect)({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}let eY=[["transform","none"],["scale","1"],["translate","0 0"]],e$=r.forwardRef(function(e,t){let{className:r,render:n,...l}=e,{store:o,scrollHandlerRef:i}=w(),{alignItemWithTriggerActive:s}=eS(),a=(0,d.useStore)(o,O.hasScrollArrows),c=(0,d.useStore)(o,O.openMethod),p=(0,d.useStore)(o,O.multiple),f=(0,d.useStore)(o,O.id),m={id:`${f}-list`,role:"listbox","aria-multiselectable":p||void 0,onScroll(e){i.current?.(e.currentTarget)},...s&&{style:eE},className:a&&"touch"!==c?ek.styleDisableScrollbar.className:void 0},g=(0,u.useStableCallback)(e=>{o.set("listElement",e)});return(0,$.useRenderElement)("div",e,{ref:[t,g],props:[m,l]})});var eq=e.i(655728);let eW=r.createContext(void 0);function eK(){let e=r.useContext(eW);if(!e)throw Error((0,b.default)(57));return e}let eX=r.memo(r.forwardRef(function(e,n){let{render:l,className:o,value:i=null,label:s,disabled:u=!1,nativeButton:p=!1,...f}=e,m=r.useRef(null),g=(0,eq.useCompositeListItem)({label:s,textRef:m,indexGuessBehavior:eq.IndexGuessBehavior.GuessFromOrder}),{store:h,getItemProps:v,setOpen:S,setValue:b,selectionRef:x,typingRef:y,valuesRef:E,keyboardActiveRef:R,multiple:M,highlightItemOnHover:I}=w(),A=(0,G.useTimeout)(),C=(0,d.useStore)(h,O.isActive,g.index),P=(0,d.useStore)(h,O.isSelected,g.index,i),j=(0,d.useStore)(h,O.isSelectedByFocus,g.index),V=(0,d.useStore)(h,O.isItemEqualToValue),L=g.index,k=-1!==L,N=r.useRef(null),H=(0,c.useValueAsRef)(L);(0,a.useIsoLayoutEffect)(()=>{if(!k)return;let e=E.current;return e[L]=i,()=>{delete e[L]}},[k,L,i,E]),(0,a.useIsoLayoutEffect)(()=>{if(!k)return;let e=h.state.value,t=e;M&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),void 0!==t&&T(i,t,V)&&h.set("selectedIndex",L)},[k,L,M,V,h,i]);let F=v({active:C,selected:P});F.onFocus=void 0,F.id=void 0;let B=r.useRef(null),z=r.useRef("mouse"),_=r.useRef(!1),{getButtonProps:Y,buttonRef:q}=(0,et.useButton)({disabled:u,focusableWhenDisabled:!0,native:p,composite:!0}),W=(0,$.useRenderElement)("div",e,{ref:[q,n,g.ref,N],state:{disabled:u,selected:P,highlighted:C},props:[F,{role:"option","aria-selected":P,tabIndex:C?0:-1,onFocus(){h.set("activeIndex",L)},onMouseEnter(){!R.current&&null===h.state.selectedIndex&&I&&h.set("activeIndex",L)},onMouseMove(){I&&h.set("activeIndex",L)},onMouseLeave(e){!I||R.current||eP(e)||A.start(0,()=>{h.state.activeIndex===L&&h.set("activeIndex",null)})},onTouchStart(){x.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){B.current=e.key,h.set("activeIndex",L)," "===e.key&&y.current&&e.preventDefault()},onClick(e){_.current=!1,"keydown"===e.type&&null===B.current||u||"keydown"===e.type&&" "===B.current&&y.current||"touch"!==z.current&&!C||(B.current=null,function(e){let t=h.state.value;if(M){let r=Array.isArray(t)?t:[];b(P?r.filter(e=>!T(i,e,V)):[...r,i],(0,D.createChangeEventDetails)(U.REASONS.itemPress,e))}else b(i,(0,D.createChangeEventDetails)(U.REASONS.itemPress,e)),S(!1,(0,D.createChangeEventDetails)(U.REASONS.itemPress,e))}(e.nativeEvent))},onPointerEnter(e){z.current=e.pointerType},onPointerDown(e){z.current=e.pointerType,_.current=!0},onMouseUp(){if(u)return;if(_.current){_.current=!1;return}let e=!x.current.allowSelectedMouseUp&&P,t=!x.current.allowUnselectedMouseUp&&!P;e||t||"touch"!==z.current&&!C||N.current?.click()}},f,Y]}),K=r.useMemo(()=>({selected:P,indexRef:H,textRef:m,selectedByFocus:j,hasRegistered:k}),[P,H,m,j,k]);return(0,t.jsx)(eW.Provider,{value:K,children:W})})),eG=r.forwardRef(function(e,r){let n=e.keepMounted??!1,{selected:l}=eK();return n||l?(0,t.jsx)(eJ,{...e,ref:r}):null}),eJ=r.memo(r.forwardRef((e,t)=>{let{render:n,className:l,keepMounted:o,...i}=e,{selected:s}=eK(),a=r.useRef(null),{transitionStatus:u,setMounted:c}=(0,I.useTransitionStatus)(s),d=(0,$.useRenderElement)("span",e,{ref:[t,a],state:{selected:s,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:ec.transitionStatusMapping});return(0,N.useOpenChangeComplete)({open:s,ref:a,onComplete(){s||c(!1)}}),d})),eQ=r.memo(r.forwardRef(function(e,t){let{indexRef:n,textRef:l,selectedByFocus:o,hasRegistered:i}=eK(),{selectedItemTextRef:s}=w(),{className:a,render:u,...c}=e,d=r.useCallback(e=>{if(!e||!i)return;let t=null===s.current||!s.current.isConnected;(o||t&&0===n.current)&&(s.current=e)},[s,n,o,i]);return(0,$.useRenderElement)("div",e,{ref:[d,t,l],props:c})})),eZ={...Q.popupStateMapping,...ec.transitionStatusMapping},e0=r.forwardRef(function(e,t){let{className:r,render:n,...l}=e,{store:o}=w(),{side:i,align:s,arrowRef:a,arrowStyles:u,arrowUncentered:c,alignItemWithTriggerActive:p}=eS(),f=(0,d.useStore)(o,O.open,!0),m=(0,$.useRenderElement)("div",e,{state:{open:f,side:i,align:s,uncentered:c},ref:[a,t],props:[{style:u,"aria-hidden":!0},l],stateAttributesMapping:eZ});return p?null:m}),e1=r.forwardRef(function(e,t){let{render:r,className:n,direction:l,keepMounted:o=!1,...i}=e,{store:s,popupRef:u,listRef:c,handleScrollArrowVisibility:p,scrollArrowsMountedCountRef:f}=w(),{side:m,scrollDownArrowRef:g,scrollUpArrowRef:h}=eS(),v="up"===l?O.scrollUpArrowVisible:O.scrollDownArrowVisible,S=(0,d.useStore)(s,v),b=(0,d.useStore)(s,O.openMethod),x=S&&"touch"!==b,y=(0,G.useTimeout)(),E="up"===l?h:g,{transitionStatus:R,setMounted:M}=(0,I.useTransitionStatus)(x);(0,a.useIsoLayoutEffect)(()=>(f.current+=1,s.state.hasScrollArrows||s.set("hasScrollArrows",!0),()=>{f.current=Math.max(0,f.current-1),0===f.current&&s.state.hasScrollArrows&&s.set("hasScrollArrows",!1)}),[s,f]),(0,N.useOpenChangeComplete)({open:x,ref:E,onComplete(){x||M(!1)}});let A=(0,$.useRenderElement)("div",e,{ref:[t,E],state:{direction:l,visible:x,side:m,transitionStatus:R},props:[{"aria-hidden":!0,children:"up"===l?"▲":"▼",style:{position:"absolute"},onMouseMove(e){0===e.movementX&&0===e.movementY||y.isStarted()||(s.set("activeIndex",null),y.start(40,function e(){let t=s.state.listElement??u.current;if(!t)return;s.set("activeIndex",null),p();let r=0===t.scrollTop,n=Math.round(t.scrollTop+t.clientHeight)>=t.scrollHeight;if(0===c.current.length&&("up"===l?s.set("scrollUpArrowVisible",!r):s.set("scrollDownArrowVisible",!n)),"up"===l&&r||"down"===l&&n)return void y.clear();if((s.state.listElement||u.current)&&c.current&&c.current.length>0){let e=c.current,r=E.current?.offsetHeight||0;if("up"===l){let n=0,l=t.scrollTop+r;for(let t=0;t<e.length;t+=1){let r=e[t];if(r&&r.offsetTop>=l){n=t;break}}let o=Math.max(0,n-1);if(o<n){let n=e[o];n&&(t.scrollTop=Math.max(0,n.offsetTop-r))}else t.scrollTop=0}else{let n=e.length-1,l=t.scrollTop+t.clientHeight-r;for(let t=0;t<e.length;t+=1){let r=e[t];if(r&&r.offsetTop+r.offsetHeight>l){n=Math.max(0,t-1);break}}let o=Math.min(e.length-1,n+1);if(o>n){let n=e[o];n&&(t.scrollTop=n.offsetTop+n.offsetHeight-t.clientHeight+r)}else t.scrollTop=t.scrollHeight-t.clientHeight}}y.start(40,e)}))},onMouseLeave(){y.clear()}},i]});return x||o?A:null}),e2=r.forwardRef(function(e,r){return(0,t.jsx)(e1,{...e,ref:r,direction:"down"})}),e5=r.forwardRef(function(e,r){return(0,t.jsx)(e1,{...e,ref:r,direction:"up"})}),e8=r.createContext(void 0),e6=r.forwardRef(function(e,n){let{className:l,render:o,...i}=e,[s,a]=r.useState(),u=r.useMemo(()=>({labelId:s,setLabelId:a}),[s,a]),c=(0,$.useRenderElement)("div",e,{ref:n,props:[{role:"group","aria-labelledby":s},i]});return(0,t.jsx)(e8.Provider,{value:u,children:c})});var e4=e.i(207516);let e3=r.forwardRef(function(e,t){let{className:n,render:l,id:o,...i}=e,{setLabelId:s}=function(){let e=r.useContext(e8);if(void 0===e)throw Error((0,b.default)(56));return e}(),u=(0,e4.useBaseUiId)(o);return(0,a.useIsoLayoutEffect)(()=>{s(u)},[u,s]),(0,$.useRenderElement)("div",e,{ref:t,props:[{id:u},i]})});var e7=e.i(983640);e.s(["Arrow",0,e0,"Backdrop",0,ep,"Group",0,e6,"GroupLabel",0,e3,"Icon",0,ei,"Item",0,eX,"ItemIndicator",0,eG,"ItemText",0,eQ,"Label",0,K,"List",0,e$,"Popup",0,eF,"Portal",0,eu,"Positioner",0,eM,"Root",0,function(e){let{id:b,value:w,defaultValue:E=null,onValueChange:A,open:T,defaultOpen:j=!1,onOpenChange:V,name:k,autoComplete:$,disabled:q=!1,readOnly:W=!1,required:K=!1,modal:X=!0,actionsRef:G,inputRef:J,onOpenChangeComplete:Q,items:Z,multiple:ee=!1,itemToStringLabel:et,itemToStringValue:er,isItemEqualToValue:en=C,highlightItemOnHover:el=!0,children:eo}=e,{clearErrors:ei}=(0,H.useFormContext)(),{setDirty:es,setTouched:ea,setFocused:eu,shouldValidateOnChange:ec,validityData:ed,setFilled:ep,name:ef,disabled:em,validation:eg,validationMode:eh}=(0,R.useFieldRootContext)(),ev=(0,M.useLabelableId)({id:b}),eS=em||q,eb=ef??k,[ex,ey]=(0,s.useControlled)({controlled:w,default:ee?E??B.EMPTY_ARRAY:E,name:"Select",state:"value"}),[ew,eE]=(0,s.useControlled)({controlled:T,default:j,name:"Select",state:"open"}),eR=r.useRef([]),eM=r.useRef([]),eI=r.useRef(null),eA=r.useRef(null),eC=r.useRef(0),eT=r.useRef(null),eP=r.useRef([]),ej=r.useRef(!1),eV=r.useRef(!1),eL=r.useRef(null),ek=r.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),eO=r.useRef(!1),{mounted:eD,setMounted:eU,transitionStatus:eN}=(0,I.useTransitionStatus)(ew),{openMethod:eH,triggerProps:eF}=(0,_.useOpenInteractionType)(ew),eB=(0,o.useRefWithInit)(()=>new p.Store({id:ev,labelId:void 0,modal:X,multiple:ee,itemToStringLabel:et,itemToStringValue:er,isItemEqualToValue:en,value:ex,open:ew,mounted:eD,transitionStatus:eN,items:Z,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ez=(0,d.useStore)(eB,O.activeIndex),e_=(0,d.useStore)(eB,O.selectedIndex),eY=(0,d.useStore)(eB,O.triggerElement),e$=(0,d.useStore)(eB,O.positionerElement),eq=r.useMemo(()=>ee&&Array.isArray(ex)&&0===ex.length?"":L(ex,er),[ee,ex,er]),eW=r.useMemo(()=>ee&&Array.isArray(ex)?ex.map(e=>L(e,er)):L(ex,er),[ee,ex,er]),eK=(0,c.useValueAsRef)(eB.state.triggerElement);(0,F.useField)({id:ev,commit:eg.commit,value:ex,controlRef:eK,name:eb,getValue:()=>eW});let eX=r.useRef(ex);(0,a.useIsoLayoutEffect)(()=>{ex!==eX.current&&eB.set("forceMount",!0)},[eB,ex]),(0,a.useIsoLayoutEffect)(()=>{ep(ee?Array.isArray(ex)&&ex.length>0:null!=ex)},[ee,ex,ep]),(0,a.useIsoLayoutEffect)(function(){if(ew)return;let e=eP.current;if(ee){let t=Array.isArray(ex)?ex:[];if(0===t.length)return void eB.set("selectedIndex",null);let r=P(e,t[t.length-1],en);return void eB.set("selectedIndex",-1===r?null:r)}let t=P(e,ex,en);eB.set("selectedIndex",-1===t?null:t)},[ee,ew,ex,eP,en,eB]),(0,z.useValueChanged)(ex,()=>{ei(eb),es(ex!==ed.initialValue),ec()?eg.commit(ex):eg.commit(ex,!0)});let eG=(0,u.useStableCallback)((e,t)=>{if(V?.(e,t),!t.isCanceled&&(eE(e),e||t.reason!==U.REASONS.focusOut&&t.reason!==U.REASONS.outsidePress||(ea(!0),eu(!1),"onBlur"===eh&&eg.commit(ex)),!e&&null!==eB.state.activeIndex)){let e=eR.current[eB.state.activeIndex];queueMicrotask(()=>{e?.setAttribute("tabindex","-1")})}}),eJ=(0,u.useStableCallback)(()=>{eU(!1),eB.set("activeIndex",null),Q?.(!1)});(0,N.useOpenChangeComplete)({enabled:!G,open:ew,ref:eI,onComplete(){ew||eJ()}}),r.useImperativeHandle(G,()=>({unmount:eJ}),[eJ]);let eQ=(0,u.useStableCallback)((e,t)=>{A?.(e,t),t.isCanceled||ey(e)}),eZ=(0,u.useStableCallback)(()=>{let e=eB.state.listElement||eI.current;if(!e)return;let t=e.scrollTop,r=e.scrollTop+e.clientHeight,n=t>1,l=r<e.scrollHeight-1;eB.state.scrollUpArrowVisible!==n&&eB.set("scrollUpArrowVisible",n),eB.state.scrollDownArrowVisible!==l&&eB.set("scrollDownArrowVisible",l)}),e0=(0,g.useFloatingRootContext)({open:ew,onOpenChange:eG,elements:{reference:eY,floating:e$}}),e1=(0,f.useClick)(e0,{enabled:!W&&!eS,event:"mousedown"}),e2=(0,m.useDismiss)(e0,{bubbles:!1}),e5=(0,v.useListNavigation)(e0,{enabled:!W&&!eS,listRef:eR,activeIndex:ez,selectedIndex:e_,disabledIndices:B.EMPTY_ARRAY,onNavigate(e){(null!==e||ew)&&eB.set("activeIndex",e)},focusItemOnHover:!1}),e8=(0,S.useTypeahead)(e0,{enabled:!W&&!eS&&(ew||!ee),listRef:eM,activeIndex:ez,selectedIndex:e_,onMatch(e){ew?eB.set("activeIndex",e):eQ(eP.current[e],(0,D.createChangeEventDetails)("none"))},onTypingChange(e){ej.current=e}}),{getReferenceProps:e6,getFloatingProps:e4,getItemProps:e3}=(0,h.useInteractions)([e1,e2,e5,e8]),e7=r.useMemo(()=>(0,Y.mergeProps)(e6(),eF,ev?{id:ev}:B.EMPTY_OBJECT),[e6,eF,ev]);(0,i.useOnFirstRender)(()=>{eB.update({popupProps:e4(),triggerProps:e7})}),(0,a.useIsoLayoutEffect)(()=>{eB.update({id:ev,modal:X,multiple:ee,value:ex,open:ew,mounted:eD,transitionStatus:eN,popupProps:e4(),triggerProps:e7,items:Z,itemToStringLabel:et,itemToStringValue:er,isItemEqualToValue:en,openMethod:eH})},[eB,ev,X,ee,ex,ew,eD,eN,e4,e7,Z,et,er,en,eH]);let e9=r.useMemo(()=>({store:eB,name:eb,required:K,disabled:eS,readOnly:W,multiple:ee,itemToStringLabel:et,itemToStringValue:er,highlightItemOnHover:el,setValue:eQ,setOpen:eG,listRef:eR,popupRef:eI,scrollHandlerRef:eA,handleScrollArrowVisibility:eZ,scrollArrowsMountedCountRef:eC,getItemProps:e3,events:e0.context.events,valueRef:eT,valuesRef:eP,labelsRef:eM,typingRef:ej,selectionRef:ek,selectedItemTextRef:eL,validation:eg,onOpenChangeComplete:Q,keyboardActiveRef:eV,alignItemWithTriggerActiveRef:eO,initialValueRef:eX}),[eB,eb,K,eS,W,ee,et,er,el,eQ,eG,e3,e0.context.events,eg,Q,eZ]),te=(0,l.useMergedRefs)(J,eg.inputRef),tt=ee&&Array.isArray(ex)&&ex.length>0,tr=ee?void 0:eb,tn=r.useMemo(()=>ee&&Array.isArray(ex)&&eb?ex.map(e=>{let r=L(e,er);return(0,t.jsx)("input",{type:"hidden",name:eb,value:r},r)}):null,[ee,ex,eb,er]);return(0,t.jsx)(x.Provider,{value:e9,children:(0,t.jsxs)(y.Provider,{value:e0,children:[eo,(0,t.jsx)("input",{...eg.getInputValidationProps({onFocus(){eB.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.value,r=(0,D.createChangeEventDetails)(U.REASONS.none,e.nativeEvent);eB.set("forceMount",!0),queueMicrotask(function(){if(ee)return;let e=eP.current.find(e=>L(e,er).toLowerCase()===t.toLowerCase());null!=e&&(es(e!==ed.initialValue),eQ(e,r),ec()&&eg.commit(e))})}}),id:ev&&null==tr?`${ev}-hidden-input`:void 0,name:tr,autoComplete:$,value:eq,disabled:eS,required:K&&!tt,readOnly:W,ref:te,style:eb?n.visuallyHiddenInput:n.visuallyHidden,tabIndex:-1,"aria-hidden":!0}),tn]})})},"ScrollDownArrow",0,e2,"ScrollUpArrow",0,e5,"Separator",()=>e7.Separator,"Trigger",0,en,"Value",0,eo],278289);var e9=e.i(278289),e9=e9,te=e.i(975157),tt=e.i(314338),tt=tt,tr=e.i(533133),tn=e.i(792566),tn=tn;function tl({className:e,...r}){return(0,t.jsx)(e9.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:(0,te.cn)("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...r,children:(0,t.jsx)(tn.default,{})})}function to({className:e,...r}){return(0,t.jsx)(e9.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:(0,te.cn)("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...r,children:(0,t.jsx)(tt.default,{})})}e.s(["Select",0,function(e){return(0,t.jsx)(e9.Root,{modal:!1,...e})},"SelectContent",0,function({className:e,children:r,side:n="bottom",sideOffset:l=4,align:o="start",alignOffset:i=0,alignItemWithTrigger:s=!1,...a}){return(0,t.jsxs)(e9.Portal,{children:[(0,t.jsx)(e9.Backdrop,{className:"fixed inset-0 z-50"}),(0,t.jsx)(e9.Positioner,{side:n,sideOffset:l,align:o,alignOffset:i,alignItemWithTrigger:s,className:"isolate z-50",children:(0,t.jsxs)(e9.Popup,{"data-slot":"select-content","data-align-trigger":s,className:(0,te.cn)("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[(0,t.jsx)(tl,{}),(0,t.jsx)(e9.List,{children:r}),(0,t.jsx)(to,{})]})})]})},"SelectItem",0,function({className:e,children:r,...n}){return(0,t.jsxs)(e9.Item,{"data-slot":"select-item",className:(0,te.cn)("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[(0,t.jsx)(e9.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:r}),(0,t.jsx)(e9.ItemIndicator,{render:(0,t.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:(0,t.jsx)(tr.CheckIcon,{className:"pointer-events-none"})})]})},"SelectTrigger",0,function({className:e,size:r="default",children:n,...l}){return(0,t.jsxs)(e9.Trigger,{"data-slot":"select-trigger","data-size":r,className:(0,te.cn)("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...l,children:[n,(0,t.jsx)(e9.Icon,{render:(0,t.jsx)(tt.default,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}],280027);var ti=e.i(514798);let ts=(0,ti.createServerReference)("4072ee321bec04ea755b3a5dafa468be71b006e766",ti.callServer,void 0,ti.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,ts],673313)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:r,description:a,action:n,className:l}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",l),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:r}),a&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a}),n&&(0,t.jsx)("div",{className:"mt-2",children:n})]})}])},236967,e=>{"use strict";var t=e.i(289721),s=e.i(210702),r=e.i(538059),a=e.i(259846),n=e.i(645378),l=e.i(453889),i=e.i(487278),c=e.i(533499);let o=[{key:"notes",icon:n.FileText},{key:"assets",icon:l.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:n}=(0,c.useI18n)(),l=(0,r.usePathname)(),i=o.find(e=>l.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(s.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(a.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),o.map(r=>{let a=r.icon,l=i===r.key;return(0,t.jsxs)(s.default,{href:`/workspaces/${e}/${r.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${l?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(a,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n(`sidebar.${r.key}`)})]},r.key)})]})}])},848801,151180,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("400ec21e6b6760bd6cf648405c31b0487ad58be269",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,s],848801);let r=(0,t.createServerReference)("407839de9589da90e0a6b3197cc99f81c73e23570a",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,r],151180)},497732,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232545),a=e.i(400355),n=e.i(738690),l=e.i(236967),i=e.i(533499),c=e.i(685149),o=e.i(848801),d=e.i(514798);let u=(0,d.createServerReference)("608847b67549fae99feca62d0cc3a34322951e62d4",d.callServer,void 0,d.findSourceMapURL,"updateNote");var x=e.i(151180);let m=(0,d.createServerReference)("60cb885e858518501bbc1db219c07d14963f164153",d.callServer,void 0,d.findSourceMapURL,"getProjectNotes");var h=e.i(975157);function p({active:e,onSelect:s}){let{t:r}=(0,i.useI18n)();return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>s("all"),className:(0,h.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===e?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:r("notes.allCategories")}),c.NOTE_CATEGORIES_PRESET.map(r=>(0,t.jsx)("button",{onClick:()=>s(r),className:(0,h.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",e===r?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:r},r))]})}var g=e.i(519455),f=e.i(280027),j=e.i(645378),v=e.i(912505),N=e.i(464249),b=e.i(998626);let y=(0,e.i(572989).default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);e.i(254826);var S=e.i(309735);function w({note:e,onEdit:s,onDelete:r,onPreview:a,onTaskClick:n}){let{t:l}=(0,i.useI18n)(),c=e.content.slice(0,300);return(0,t.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,t.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>s(e),className:"text-muted-foreground","aria-label":l("notes.edit"),children:(0,t.jsx)(N.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>r(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":l("notes.delete"),children:(0,t.jsx)(b.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"mb-2 pr-16",children:(0,t.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:e.title})}),(0,t.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("span",{className:"inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:e.category}),e.taskId&&e.taskTitle&&(0,t.jsxs)("button",{type:"button",onClick:()=>e.taskId&&n?.(e.taskId),disabled:!n,className:`inline-flex max-w-[160px] items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary ${n?"cursor-pointer hover:bg-primary/15":"cursor-default"}`,title:e.taskTitle,children:[(0,t.jsx)(y,{className:"h-2.5 w-2.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.taskTitle})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>a?.(e),disabled:!a,className:`block w-full text-left ${a?"cursor-pointer":"cursor-default"}`,title:a?l("notes.previewNote"):void 0,children:(0,t.jsx)("div",{className:"max-h-24 overflow-hidden text-sm leading-relaxed text-muted-foreground",children:(0,t.jsx)(S.Streamdown,{children:c})})})]})}function k({notes:e,onEdit:s,onDelete:r,onPreview:a,onTaskClick:n}){let{t:l}=(0,i.useI18n)();return 0===e.length?(0,t.jsx)(v.EmptyState,{icon:j.FileText,title:l("notes.empty"),description:l("notes.emptyHint")}):(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,t.jsx)(w,{note:e,onEdit:s,onDelete:r,onPreview:a,onTaskClick:n},e.id))})}var C=e.i(624687);function T({value:e,onChange:s}){return(0,t.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,t.jsx)(C.Textarea,{value:e,onChange:e=>s(e.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,t.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,t.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border text-sm leading-relaxed",children:(0,t.jsx)(S.Streamdown,{children:e})})})]})}var E=e.i(997025),I=e.i(605005);e.s(["NotesPageClient",0,function({allWorkspaces:e,initialWorkspaceId:d,initialProjectId:h,initialNotes:j}){let v,N,{t:b}=(0,i.useI18n)(),[y,S]=(0,s.useTransition)(),[w,C]=(0,s.useState)(d),[P,R]=(0,s.useState)(h),[$,O]=(0,s.useState)(j),[A,_]=(0,s.useState)("all"),[L,B]=(0,s.useState)(""),[z,M]=(0,s.useState)(null),[U,D]=(0,s.useState)(null),[V,F]=(0,s.useState)(null),[G,H]=(0,s.useState)(!1),[K,q]=(0,s.useState)(""),[W,J]=(0,s.useState)(""),[Q,X]=(0,s.useState)(c.NOTE_CATEGORIES_PRESET[3]),[Y,Z]=(0,s.useState)(d),[ee,et]=(0,s.useState)(h),es=e.find(e=>e.id===w),er=es?.projects??[],ea=e.find(e=>e.id===Y),en=ea?.projects??[],el=(0,s.useCallback)(e=>{e?S(async()=>{O(await m(e))}):O([])},[S]),ei=async()=>{ee&&K.trim()&&(await (0,o.createNote)({title:K.trim(),content:W,category:Q,projectId:ee}),H(!1),ee===P&&el(P))},ec=async()=>{V&&K.trim()&&(await u(V.id,{title:K.trim(),content:W,category:Q}),F(null),el(P))},eo=async e=>{let t=$.find(t=>t.id===e);!t||confirm(b("notes.deleteConfirm",{title:t.title}))&&(await (0,x.deleteNote)(e),el(P))},ed=L.trim().toLowerCase(),eu=$.filter(e=>"all"===A||e.category===A).filter(e=>!ed||e.title.toLowerCase().includes(ed)).map(e=>({id:e.id,title:e.title,content:e.content,category:e.category,updatedAt:new Date(e.updatedAt),taskId:e.taskId,taskTitle:e.task?.title??null})),ex=G||null!==V;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(l.SubPageNav,{workspaceId:w}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(f.Select,{value:w,onValueChange:t=>t&&(t=>{if(t===w)return;C(t);let s=e.find(e=>e.id===t),r=s?.projects[0]??null;R(r?.id??null),_("all"),el(r?.id??null)})(t),children:[(0,t.jsx)(f.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===w)?.name??w})}),(0,t.jsx)(f.SelectContent,{children:e.map(e=>(0,t.jsx)(f.SelectItem,{value:e.id,children:e.name},e.id))})]}),er.length>0&&(0,t.jsxs)(f.Select,{value:P??"",onValueChange:e=>e&&void(e!==P&&(R(e),_("all"),el(e))),children:[(0,t.jsx)(f.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(v=er.find(e=>e.id===P))?v.alias?`${v.name} (${v.alias})`:v.name:""})}),(0,t.jsx)(f.SelectContent,{children:er.map(e=>(0,t.jsxs)(f.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),!ex&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative ml-auto",children:[(0,t.jsx)(n.Search,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)("input",{type:"text",value:L,onChange:e=>B(e.target.value),placeholder:b("notes.searchPlaceholder"),className:"h-8 w-48 rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),(0,t.jsxs)(g.Button,{onClick:()=>{q(""),J(""),X(c.NOTE_CATEGORIES_PRESET[3]),Z(w),et(P),F(null),H(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(r.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:b("notes.newNote")})]})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:ex?(0,t.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!V&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.workspace")}),(0,t.jsxs)(f.Select,{value:Y,onValueChange:t=>t&&(t=>{if(t===Y)return;Z(t);let s=e.find(e=>e.id===t),r=s?.projects[0]??null;et(r?.id??null)})(t),children:[(0,t.jsx)(f.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===Y)?.name??Y})}),(0,t.jsx)(f.SelectContent,{children:e.map(e=>(0,t.jsx)(f.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),!V&&en.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.project")}),(0,t.jsxs)(f.Select,{value:ee??"",onValueChange:e=>e&&et(e),children:[(0,t.jsx)(f.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(N=en.find(e=>e.id===ee))?N.alias?`${N.name} (${N.alias})`:N.name:""})}),(0,t.jsx)(f.SelectContent,{children:en.map(e=>(0,t.jsxs)(f.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:b("notes.categoryLabel")}),(0,t.jsxs)(f.Select,{value:Q,onValueChange:e=>e&&X(e),children:[(0,t.jsx)(f.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:Q})}),(0,t.jsx)(f.SelectContent,{children:c.NOTE_CATEGORIES_PRESET.map(e=>(0,t.jsx)(f.SelectItem,{value:e,children:e},e))})]})]})]}),(0,t.jsx)("input",{type:"text",value:K,onChange:e=>q(e.target.value),placeholder:b("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,t.jsx)(T,{value:W,onChange:J}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,t.jsx)(g.Button,{variant:"outline",onClick:()=>{H(!1),F(null)},children:b("notes.cancel")}),(0,t.jsx)(g.Button,{onClick:V?ec:ei,disabled:!K.trim()||!V&&!ee,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:b("notes.save")})]})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(p,{active:A,onSelect:_}),(0,t.jsxs)("div",{className:`relative ${y?"opacity-40 pointer-events-none":""} transition-opacity`,children:[y&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(a.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===er.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:b("notes.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:b("notes.noProjectHint")})]}):(0,t.jsx)(k,{notes:eu,onEdit:e=>{q(e.title),J(e.content),X(e.category),F(e),H(!1)},onDelete:eo,onPreview:M,onTaskClick:D})]})]})}),(0,t.jsx)(E.NotePreviewDialog,{note:z,open:null!==z,onOpenChange:e=>{e||M(null)}}),(0,t.jsx)(I.TaskOverviewDrawer,{open:null!==U,onOpenChange:e=>{e||D(null)},taskId:U})]})}],497732)},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,882651,181209,e=>{"use strict";var s=e.i(59737);e.s(["CheckCircle2",()=>s.default],882651);let t=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,t],181209)},236967,e=>{"use strict";var s=e.i(289721),t=e.i(210702),a=e.i(538059),r=e.i(259846),n=e.i(645378),l=e.i(453889),i=e.i(487278),c=e.i(533499);let o=[{key:"notes",icon:n.FileText},{key:"assets",icon:l.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:n}=(0,c.useI18n)(),l=(0,a.usePathname)(),i=o.find(e=>l.includes(`/${e.key}`))?.key;return(0,s.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,s.jsxs)(t.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,s.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:n("archive.backToBoard")})]}),(0,s.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),o.map(a=>{let r=a.icon,l=i===a.key;return(0,s.jsxs)(t.default,{href:`/workspaces/${e}/${a.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${l?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,s.jsx)(r,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:n(`sidebar.${a.key}`)})]},a.key)})]})}])},107830,e=>{"use strict";var s=e.i(289721),t=e.i(965652),a=e.i(487278),r=e.i(882651),n=e.i(181209),l=e.i(400355),i=e.i(738690),c=e.i(280027),o=e.i(533499),d=e.i(236967),u=e.i(514798);let m=(0,u.createServerReference)("407ddd198c37ddc7daf3fd4f5bf0c2d028a2a41cd1",u.callServer,void 0,u.findSourceMapURL,"getArchivedTasks");var x=e.i(605005),h=e.i(35967);function p(e){return new Date(e).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function f({priority:e}){return(0,s.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${{LOW:"bg-slate-400",MEDIUM:"bg-amber-400",HIGH:"bg-orange-500",CRITICAL:"bg-rose-500"}[e]??"bg-slate-400"}`})}e.s(["ArchivePageClient",0,function({allWorkspaces:e,initialWorkspaceId:u,initialProjectId:g,initialTasks:v}){let j,{t:b}=(0,o.useI18n)(),[N,k]=(0,t.useTransition)(),[y,w]=(0,t.useState)(u),[C,S]=(0,t.useState)(g),[T,$]=(0,t.useState)(v),[A,I]=(0,t.useState)(null),[D,L]=(0,t.useState)(""),P=e.find(e=>e.id===y),O=P?.projects??[],z=D.trim().toLowerCase(),E=z?T.filter(e=>e.title.toLowerCase().includes(z)):T,R=(0,t.useCallback)(e=>{e?k(async()=>{$(await m(e))}):$([])},[k]);return(0,s.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,s.jsx)(d.SubPageNav,{workspaceId:y}),(0,s.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,s.jsxs)(c.Select,{value:y,onValueChange:s=>s&&(s=>{if(s===y)return;w(s);let t=e.find(e=>e.id===s),a=t?.projects[0]??null;S(a?.id??null),R(a?.id??null)})(s),children:[(0,s.jsx)(c.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,s.jsx)("span",{className:"truncate",children:P?.name??y})}),(0,s.jsx)(c.SelectContent,{children:e.map(e=>(0,s.jsx)(c.SelectItem,{value:e.id,children:e.name},e.id))})]}),O.length>0&&(0,s.jsxs)(c.Select,{value:C??"",onValueChange:e=>e&&void(e!==C&&(S(e),R(e))),children:[(0,s.jsx)(c.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,s.jsx)("span",{className:"truncate",children:(j=O.find(e=>e.id===C))?j.alias?`${j.name} (${j.alias})`:j.name:""})}),(0,s.jsx)(c.SelectContent,{children:O.map(e=>(0,s.jsxs)(c.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,s.jsxs)("div",{className:"relative ml-auto",children:[(0,s.jsx)(i.Search,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)("input",{type:"text",value:D,onChange:e=>L(e.target.value),placeholder:b("archive.searchPlaceholder"),className:"h-8 w-48 rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),(0,s.jsxs)("span",{className:"rounded-full bg-muted px-2.5 py-0.5 text-[11px] text-muted-foreground",children:[E.length," ",b("archive.tasksCount")]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,s.jsxs)("div",{className:`relative ${N?"opacity-40 pointer-events-none":""} transition-opacity`,children:[N&&(0,s.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,s.jsx)(l.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===E.length?(0,s.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,s.jsx)(a.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,s.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:z?b("archive.noSearchResults"):b("archive.noTasks")}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60",children:z?b("archive.noSearchResultsDesc"):b("archive.noTasksDesc")})]}):(0,s.jsx)("div",{className:"space-y-2",children:E.map(e=>{let t="DONE"===e.status,a=e.executions[0];return(0,s.jsx)("div",{role:"button",tabIndex:0,onClick:()=>I(e.id),onKeyDown:s=>{("Enter"===s.key||" "===s.key)&&(s.preventDefault(),I(e.id))},className:"group cursor-pointer rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:border-border/80 hover:bg-accent/30 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 shrink-0",children:t?(0,s.jsx)(r.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}):(0,s.jsx)(n.XCircle,{className:"h-4 w-4 text-rose-500"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(f,{priority:e.priority}),(0,s.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.title}),(0,s.jsx)("span",{className:`ml-1 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${t?"bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20":"bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20"}`,children:t?b("archive.status.done"):b("archive.status.cancelled")}),e.version&&(0,s.jsx)(h.TaskVersionTag,{number:e.version.number,name:e.version.name,showName:!0,className:"shrink-0"})]}),e.labels.length>0&&(0,s.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,s.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,outline:`1px solid ${e.label.color}40`},children:e.label.name},e.label.id))}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{children:[b("archive.createdAt"),": ",p(e.createdAt)]}),(0,s.jsxs)("span",{children:[t?b("archive.completedAt"):b("archive.cancelledAt"),": ",p(e.updatedAt)]}),a&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[b("archive.lastExecution"),":"," ",(0,s.jsx)("span",{className:`rounded px-1 py-0.5 font-mono text-[10px] ${"COMPLETED"===a.status?"bg-emerald-500/10 text-emerald-400":"FAILED"===a.status?"bg-rose-500/10 text-rose-400":"bg-amber-500/10 text-amber-400"}`,children:a.status})]})]})]})]})},e.id)})})]})}),(0,s.jsx)(x.TaskOverviewDrawer,{open:!!A,onOpenChange:e=>{e||I(null)},taskId:A})]})}],107830)},244455,e=>{e.v(s=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(s=>e.l(s))).then(()=>s(629495)))},800307,e=>{e.v(s=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(s=>e.l(s))).then(()=>s(267483)))}]);
|