tower-studio 0.2.46 → 0.2.47
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 +3 -3
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +82 -70
- package/.next/standalone/.next/server/app/_not-found/page.js +2 -1
- 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/browse-fs/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/tasks/[taskId]/merge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/harness/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/harness/page/server-reference-manifest.json +92 -80
- package/.next/standalone/.next/server/app/harness/page.js +2 -1
- package/.next/standalone/.next/server/app/harness/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/harness/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +150 -138
- package/.next/standalone/.next/server/app/missions/page.js +5 -4
- 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 +3 -3
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +82 -70
- package/.next/standalone/.next/server/app/onboarding/page.js +2 -1
- 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 +3 -3
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +82 -70
- package/.next/standalone/.next/server/app/page.js +2 -1
- 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 +3 -3
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +128 -116
- package/.next/standalone/.next/server/app/settings/page.js +4 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +190 -178
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +3 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +166 -154
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +3 -2
- 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]/groups/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/server-reference-manifest.json +86 -74
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js +2 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +150 -138
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +3 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +162 -162
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +4 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +82 -70
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +3 -2
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +140 -140
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +3 -2
- 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 +4 -4
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +182 -170
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +6 -5
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +108 -96
- package/.next/standalone/.next/server/app/workspaces/page.js +2 -1
- 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_0eh8dj_.js +7 -7
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esywxf._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kkrbn-._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0_w835g._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_05balzk._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0gif-f5._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0pg9w-x._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0vp6.co._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_11k6i~l._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +3 -3
- 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]__00qdvw7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07rk6ic._.js → [root-of-the-server]__0282989._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0hzwoy5._.js → [root-of-the-server]__03jikql._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0trmndk._.js → [root-of-the-server]__04dod9d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05tx27l._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m8m7vc._.js → [root-of-the-server]__07ha-7q._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07~giyb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0bx_h2u._.js → [root-of-the-server]__0872sqe._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090y_.y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b6hugs._.js → [root-of-the-server]__09qoc8v._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.0m12b._.js → [root-of-the-server]__0bl842b._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0br5e7w._.js → [root-of-the-server]__0c81jqz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dh0alq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0u3~-.g._.js → [root-of-the-server]__0fy8mj6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kqp70x._.js → [root-of-the-server]__0gsk~9d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h4ltpn._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hx2p17._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ie8~g5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n02kfa._.js → [root-of-the-server]__0j1w7ro._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0esg88l._.js → [root-of-the-server]__0jxfeb6._.js} +1 -1
- 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]__00qzvly._.js → [root-of-the-server]__0mi.v4q._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__06sew6r._.js → [root-of-the-server]__0nell0t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0odoa97._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12viys4._.js → [root-of-the-server]__0q8o5us._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b6fbjv._.js → [root-of-the-server]__0qjjy1r._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rg73f.._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t3q30a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tpho3f._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dhq_gl._.js → [root-of-the-server]__0tusyj0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~edc3d._.js → [root-of-the-server]__0x6eyvj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n3uc.v._.js → [root-of-the-server]__0xftcya._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xiiocg._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0x7br99._.js → [root-of-the-server]__0znl9us._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zsnp~d._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~fdua7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11fp64w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vyl8to._.js → [root-of-the-server]__1290yo~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12s3kky._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0s_q09t._.js → [root-of-the-server]__136sh9u._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0.-.0zk._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0..h3hk._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0b660g4._.js → _0111pr2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0czsddm._.js → _029yl-g._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0q2pep_._.js → _02mcoex._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_02t7f2_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0gomvsp._.js → _04brhyt._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_1118hto._.js → _08b3kyv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0-5.hgb._.js → _0a___34._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0ami9yt._.js → _0b4v~ls._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0bdyusg._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0hsuip_._.js → _0c8-9m9._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0j7m~u6._.js → _0gcox_6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0snv7nt._.js → _0gte_c4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0g~p9_x._.js → _0hyn4md._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0l6byg1._.js → _0lqjtwo._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0noar.v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0os43sb._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0o_c3b2._.js → _0rilhs1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0ak77.u._.js → _0sbkase._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_00_h2nx._.js → _0t-0.1o._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0mmy~98._.js → _0w~~xn0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0awn2mm._.js → _0xexuoi._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0xu906p._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_0z-z415._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0zx1ubq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0ty4xe6._.js → _0~2k74h._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0hx2o_8._.js → _0~rpgs_._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_10a_vqn._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0p5ft59._.js → _10or.ne._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_11.knhq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_12s8n8g._.js → _124j7aj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_13yv8at._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_11j0qlp._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_07_wts6._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_0rowjw~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0cld9rt._.js → src_lib_0-3zx.v._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0_px2pz._.js → src_lib_00ial55._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0a.zy31._.js → src_lib_01-0ix1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0b73q0a._.js → src_lib_01d~ml9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_04nzvfd._.js → src_lib_0278czx._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_07o.0r6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_09jpiip._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0bmg7ix._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0cb~2g1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fdsvpu._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fyrfen._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0dbf2qa._.js → src_lib_0gqe-g3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ixnmd0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0lpxsj~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0pgz5n6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0h2u7a0._.js → src_lib_0tq69ek._.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 +1146 -1068
- package/.next/standalone/.next/static/chunks/{0oyskd~8~j.j7.js → 00agq5_c-.llc.js} +1 -1
- package/.next/standalone/.next/static/chunks/015i97g3voot2.js +2 -0
- package/.next/standalone/.next/static/chunks/{02v-9v~885t9c.js → 01wvj~s3skc-5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0.gedys.tq.~k.js → 031br6.h-zycv.js} +1 -1
- package/.next/standalone/.next/static/chunks/{07qijq9o5jccu.js → 054ztat09k8d8.js} +1 -1
- package/.next/standalone/.next/static/chunks/07f592yv~pptf.js +1 -0
- package/.next/standalone/.next/static/chunks/{06x7oq8_iu~9d.js → 08j4ettv1zbmn.js} +1 -1
- package/.next/standalone/.next/static/chunks/{03uix~1ru.ovv.js → 08kc0~d-bpqxd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0j5olwb~d3~3j.js → 08s_oyki61yjf.js} +1 -1
- package/.next/standalone/.next/static/chunks/09bc_~h466~tj.js +1 -0
- package/.next/standalone/.next/static/chunks/{0q1872yhybt55.js → 0_hj_1l73v-on.js} +1 -1
- package/.next/standalone/.next/static/chunks/{00o_eiv12t~.1.js → 0a54zbhpg7-ql.js} +1 -1
- package/.next/standalone/.next/static/chunks/0c2po53wqe-op.js +1 -0
- package/.next/standalone/.next/static/chunks/0clhvl~13pwv2.js +1 -0
- package/.next/standalone/.next/static/chunks/0fi1kdxrc9m~d.js +1 -0
- package/.next/standalone/.next/static/chunks/0j56_.0_wup.m.js +1 -0
- package/.next/standalone/.next/static/chunks/{17z9uivez~kp3.js → 0lokkque~1fox.js} +1 -1
- package/.next/standalone/.next/static/chunks/0m5k~sgt78d8a.js +1 -0
- package/.next/standalone/.next/static/chunks/{0d9u2xspag~4h.js → 0mzzaly9-cwhd.js} +1 -1
- package/.next/standalone/.next/static/chunks/0pg~fc3o64-u0.js +1 -0
- package/.next/standalone/.next/static/chunks/{0-kkc.ibted8y.js → 0pvc93qomwhkq.js} +1 -1
- package/.next/standalone/.next/static/chunks/0smoiulyzysrc.js +2 -0
- package/.next/standalone/.next/static/chunks/0ufatfbq87c84.js +1 -0
- package/.next/standalone/.next/static/chunks/{09om2gfwimh7k.js → 0ujznvfinjpzn.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0cf7e1scao3zk.js → 0ux~8zee88x-j.js} +1 -1
- package/.next/standalone/.next/static/chunks/0vy01_a6xhhrr.js +1 -0
- package/.next/standalone/.next/static/chunks/0xd_tk4asn0qj.js +1 -0
- package/.next/standalone/.next/static/chunks/{12-mlz2vukuga.js → 0~l470bpaoz9f.js} +1 -1
- package/.next/standalone/.next/static/chunks/118j.0w2pbdea.js +1 -0
- package/.next/standalone/.next/static/chunks/13yfli6~6o4z~.js +1 -0
- package/.next/standalone/.next/static/chunks/{0t1awv68pnn-e.js → 15rlbf5rw1dd..js} +1 -1
- package/.next/standalone/package.json +1 -1
- package/dist/mcp-server.cjs +6 -0
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-geq20._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~hdzx._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h_pt4a._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0idkp76._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4m.1s._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kmonje._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lh3mlq._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0muf4wq._.js +0 -49
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o5ohqy._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta_mpj._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ws0_c1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~mhv4m._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1013v_g._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmn-._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/_05~lqg-._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_0771b4a._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0fmko25._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0hg~.4w._.js +0 -6
- package/.next/standalone/.next/server/chunks/ssr/_0nrxhfb._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0vkl7.h._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0x09t_o._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0zn.4bi._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_1086w4p._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0er7rzd._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0f0v8_~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fr6fzy._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0k04rl3._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sq6aqm._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ui-~7g._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0z-gn78._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_13c4a4g._.js +0 -3
- package/.next/standalone/.next/static/chunks/00g58.es_hxli.js +0 -1
- package/.next/standalone/.next/static/chunks/01qtgj0xv1fsm.js +0 -2
- package/.next/standalone/.next/static/chunks/024euw7po0d0w.js +0 -1
- package/.next/standalone/.next/static/chunks/03ct4d8znb7tp.js +0 -1
- package/.next/standalone/.next/static/chunks/0alhq.h4~iogi.js +0 -1
- package/.next/standalone/.next/static/chunks/0ck~sr0nkabl~.js +0 -1
- package/.next/standalone/.next/static/chunks/0d1ok-v-u-xe~.js +0 -1
- package/.next/standalone/.next/static/chunks/0ftptcpntzaux.js +0 -1
- package/.next/standalone/.next/static/chunks/0gk~m5bwgoafi.js +0 -1
- package/.next/standalone/.next/static/chunks/0in_7s8n4lmfr.js +0 -1
- package/.next/standalone/.next/static/chunks/0mtrtl-jl46in.js +0 -2
- package/.next/standalone/.next/static/chunks/0~2l3wz-gxs2j.js +0 -1
- package/.next/standalone/.next/static/chunks/0~7h_a_dofg-4.js +0 -1
- package/.next/standalone/.next/static/chunks/15gztq9f12uhe.js +0 -1
- package/.next/standalone/.next/static/chunks/15ue90qe1sh-9.js +0 -1
- /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,783426,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),r=e.i(210702),n=e.i(232545),l=e.i(738690),i=e.i(226145),o=e.i(486077),c=e.i(519455),d=e.i(793479),m=e.i(967489),x=e.i(746798),u=e.i(533499);function h({searchQuery:e,onSearchChange:s,versions:a=[],versionFilter:p="all",onVersionFilterChange:g,versionsHref:f,onCreateTask:j}){let b,{t:N}=(0,u.useI18n)(),v="all"===p?N("board.allVersions"):"backlog"===p?N("board.backlogFilter"):(b=a.find(e=>e.id===p))?`${b.number} ${b.name}`:N("board.allVersions");return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[g&&(0,t.jsxs)(m.Select,{value:p,onValueChange:e=>g(e||"all"),children:[(0,t.jsxs)(m.SelectTrigger,{className:"h-8 w-44 shrink-0 gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(i.GitBranch,{className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:v})]}),(0,t.jsxs)(m.SelectContent,{children:[(0,t.jsx)(m.SelectItem,{value:"all",children:N("board.allVersions")}),(0,t.jsx)(m.SelectItem,{value:"backlog",children:N("board.backlogFilter")}),a.map(e=>(0,t.jsxs)(m.SelectItem,{value:e.id,children:[(0,t.jsx)("span",{className:"font-mono",children:e.number})," ",e.name]},e.id))]})]}),(0,t.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,t.jsx)(l.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(d.Input,{type:"text",value:e,onChange:e=>s(e.target.value),placeholder:N("board.searchPlaceholder"),className:"pl-8 pr-3 text-xs"})]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",children:(0,t.jsx)(o.Lightbulb,{className:"h-4 w-4"})})}),(0,t.jsx)(x.TooltipContent,{side:"bottom",className:"max-w-xs",children:N("board.tipText")})]}),f&&(0,t.jsx)(r.default,{href:f,children:(0,t.jsxs)(c.Button,{variant:"outline",className:"h-8 gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(i.GitBranch,{className:"h-3.5 w-3.5"}),N("version.timeline")]})}),(0,t.jsxs)(c.Button,{"data-tour":"create-task",variant:"outline",className:"gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:j,children:[(0,t.jsx)(n.Plus,{className:"h-3.5 w-3.5"}),N("board.newTask")]})]})]})}var p=e.i(585012),g=e.i(597746),f=e.i(685149);function j({x:e,y:r,taskId:n,currentStatus:l,hasExecutions:i,workspaceId:o,onClose:c,onStatusChange:d,onLaunch:m}){let{t:x}=(0,u.useI18n)(),h=(0,a.useRouter)(),b=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&c()},t=e=>{"Escape"===e.key&&c()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[c]);let N="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",v=(0,t.jsxs)("div",{ref:b,style:{position:"fixed",top:r,left:e,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,t.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:x("board.contextMenu.changeStatus")}),f.BOARD_COLUMNS.map(e=>(0,t.jsxs)("button",{type:"button",className:N,onClick:()=>{d(n,e.id),c()},children:[l===e.id?(0,t.jsx)(g.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,t.jsx)("span",{className:"w-5 flex-shrink-0"}),e.label]},e.id)),(0,t.jsx)("hr",{className:"my-1 border-border"}),(0,t.jsx)("button",{type:"button",className:`${N} ${i?"opacity-50 cursor-not-allowed":""}`,disabled:i,onClick:()=>{i||(m(n),c())},children:x("board.contextMenu.launch")}),"DONE"!==l&&"CANCELLED"!==l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("hr",{className:"my-1 border-border"}),(0,t.jsx)("button",{type:"button",className:N,onClick:()=>{h.push(`/workspaces/${o}/tasks/${n}`),c()},children:x("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,p.createPortal)(v,document.body)}var b=e.i(720247),N=e.i(775712),v=e.i(469051),k=e.i(67013),w=e.i(49007),y=e.i(464249),C=e.i(998626),S=e.i(572989);let T=(0,S.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var P=e.i(487486),I=e.i(755146),E=e.i(35967);function D({task:e,onClick:s,onEdit:a,onDelete:r,onTogglePin:n,onContextMenu:l}){let{t:o}=(0,u.useI18n)(),{attributes:d,listeners:m,setNodeRef:h,transform:p,transition:g,isDragging:j}=(0,N.useSortable)({id:e.id,data:{type:"task",task:e}}),b={transform:k.CSS.Transform.toString(p),transition:g,opacity:j?.4:1},v=f.PRIORITY_CONFIG[e.priority],S=!!e.baseBranch;return(0,t.jsxs)("div",{ref:h,style:b,...d,...m,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:s,onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),l?.(e,t.clientX,t.clientY)},"data-testid":"task-card",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-foreground",children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${e.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:t=>{t.stopPropagation(),n?.(e.id)},"aria-label":o(e.pinned?"board.unpin":"board.pin"),children:(0,t.jsx)(T,{className:`h-3.5 w-3.5 ${e.pinned?"-rotate-45":""}`})}),(0,t.jsxs)(I.DropdownMenu,{children:[(0,t.jsx)(I.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(w.MoreHorizontal,{className:"h-4 w-4"})}),(0,t.jsxs)(I.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(I.DropdownMenuItem,{onClick:t=>{t.stopPropagation(),a?.(e)},children:[(0,t.jsx)(y.Pencil,{className:"mr-2 h-3.5 w-3.5"}),o("common.edit")]}),(0,t.jsxs)(I.DropdownMenuItem,{className:"text-rose-400",onClick:t=>{t.stopPropagation(),r?.(e.id)},children:[(0,t.jsx)(C.Trash2,{className:"mr-2 h-3.5 w-3.5"}),o("common.delete")]})]})]})]})]}),e.description&&(0,t.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,t.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)(P.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${v.color}`,children:v.label}),e.labels?.map(e=>(0,t.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},children:e.label.name},e.label.id)),(S||e.version)&&(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[S&&(0,t.jsxs)(x.Tooltip,{disableHoverablePopup:!0,children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)("span",{className:"inline-flex cursor-default items-center rounded-md border border-border bg-muted px-1 py-0.5 text-muted-foreground",onPointerDown:e=>e.stopPropagation(),children:(0,t.jsx)(i.GitBranch,{className:"h-2.5 w-2.5 shrink-0"})})}),(0,t.jsx)(x.TooltipContent,{side:"top",children:o("board.card.worktree",{branch:e.baseBranch??""})})]}),e.version&&(0,t.jsxs)(x.Tooltip,{disableHoverablePopup:!0,children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)("span",{className:"cursor-default",onPointerDown:e=>e.stopPropagation(),children:(0,t.jsx)(E.TaskVersionTag,{number:e.version.number,title:""})})}),(0,t.jsx)(x.TooltipContent,{side:"top",children:o("board.card.version",{number:e.version.number,name:e.version.name})})]})]})]})]})}var L=e.i(776639),B=e.i(759684);function F({open:e,onOpenChange:s,columnLabel:a,columnColor:r,tasks:n,onTaskClick:l}){let{t:i}=(0,u.useI18n)();return(0,t.jsx)(L.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(L.DialogContent,{className:"sm:max-w-6xl max-h-[80vh]",children:[(0,t.jsx)(L.DialogHeader,{children:(0,t.jsxs)(L.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${r}`}),(0,t.jsx)("span",{children:a}),(0,t.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:n.length})]})}),(0,t.jsx)(B.ScrollArea,{className:"max-h-[680px]",children:(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3 pr-3",children:[n.map(e=>{let a=f.PRIORITY_CONFIG[e.priority];return(0,t.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{l?.(e),s(!1)},children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:e.title}),e.description&&(0,t.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,t.jsx)(P.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${a.color}`,children:a.label}),e.labels?.map(e=>(0,t.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},children:e.label.name},e.label.id))]})]},e.id)}),0===n.length&&(0,t.jsx)("div",{className:"col-span-4 py-8 text-center text-sm text-muted-foreground",children:i("board.noTasks")})]})})]})})}function A({id:e,label:a,color:r,tasks:l,onTaskClick:i,onEditTask:o,onAddTask:d,onDeleteTask:m,onTogglePin:x,onContextMenu:h}){let{setNodeRef:p,isOver:g}=(0,b.useDroppable)({id:e}),[f,j]=(0,s.useState)(!1),{t:k}=(0,u.useI18n)();return(0,t.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${g?"bg-primary/[0.06]":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`h-2 w-2 rounded-full ${r}`}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:a}),(0,t.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:l.length})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:()=>j(!0),className:"text-muted-foreground","aria-label":k("board.viewAll"),children:(0,t.jsx)(v.LayoutGrid,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:d,className:"text-muted-foreground","aria-label":"add",children:(0,t.jsx)(n.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,t.jsx)(F,{open:f,onOpenChange:j,columnLabel:a,columnColor:r,tasks:l,onTaskClick:i}),(0,t.jsx)(B.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)("div",{ref:p,className:"flex flex-col gap-2 p-2",children:(0,t.jsx)(N.SortableContext,{items:l.map(e=>e.id),strategy:N.verticalListSortingStrategy,children:l.map(e=>(0,t.jsx)(D,{task:e,onClick:()=>i?.(e),onEdit:o,onDelete:m,onTogglePin:x,onContextMenu:h},e.id))})})})]})}function R({initialTasks:e,onTaskMove:a,onTaskClick:r,onEditTask:n,onAddTask:l,onDeleteTask:i,onTogglePin:o,onContextMenuStatusChange:c,onContextMenuLaunch:d,workspaceId:m}){let[x,u]=(0,s.useState)(e),[h,p]=(0,s.useState)(null),[g,N]=(0,s.useState)(null);(0,s.useEffect)(()=>{u(e)},[e]);let v=(0,b.useSensors)((0,b.useSensor)(b.PointerSensor,{activationConstraint:{distance:8}})),k=(0,s.useCallback)((e,t,s)=>{N({task:e,x:t,y:s})},[]),w=(0,s.useCallback)(e=>{let t=x.find(t=>t.id===e.active.id);t&&p(t)},[x]),y=(0,s.useCallback)(e=>{let t,{active:s,over:r}=e;if(p(null),!r)return;let n=s.id,l=r.id;if(f.BOARD_COLUMNS.some(e=>e.id===l))t=l;else{let e=x.find(e=>e.id===l);t=e?.status}t&&(u(e=>e.map(e=>e.id===n?{...e,status:t}:e)),a?.(n,t))},[x,a]);return(0,t.jsxs)(b.DndContext,{id:"kanban-board",sensors:v,collisionDetection:b.closestCorners,onDragStart:w,onDragEnd:y,children:[(0,t.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:f.BOARD_COLUMNS.map(e=>(0,t.jsx)(A,{id:e.id,label:e.label,color:e.color,tasks:x.filter(t=>t.status===e.id),onTaskClick:r,onEditTask:n,onAddTask:()=>l?.(e.id),onDeleteTask:i,onTogglePin:o,onContextMenu:k},e.id))}),(0,t.jsx)(b.DragOverlay,{children:h?(0,t.jsx)("div",{className:"rotate-3 scale-105",children:(0,t.jsx)(D,{task:h})}):null}),g&&(0,t.jsx)(j,{x:g.x,y:g.y,taskId:g.task.id,currentStatus:g.task.status,hasExecutions:(g.task._count?.executions??0)>0,workspaceId:m??"",onClose:()=>N(null),onStatusChange:(e,t)=>{c?.(e,t),N(null)},onLaunch:e=>{d?.(e),N(null)}})]})}var O=e.i(744798);function $(e,t,s){return Math.min(Math.max(e,t),s)}var M=e.i(232280),z=e.i(368490),U=e.i(645378),G=e.i(453889);let W=(0,S.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var H=e.i(938499),V=e.i(400355),_=e.i(233274),K=e.i(736061),X=e.i(460707),Y=e.i(567860),J=e.i(875840),q=e.i(624687),Q=e.i(514798);let Z=(0,Q.createServerReference)("60c07421cff1b8ce33eb98a3c351c3543ccfdf0dbb",Q.callServer,void 0,Q.findSourceMapURL,"updateProject");var ee=e.i(964092);let et=(0,Q.createServerReference)("407cec71f24fa6ee1e09ae4734807281e5c25c9cf6",Q.callServer,void 0,Q.findSourceMapURL,"deleteProject"),es=(0,Q.createServerReference)("4000be6ee04dad4eb6d9cc5687098fcfad75064576",Q.callServer,void 0,Q.findSourceMapURL,"getRecentLocalProjects"),ea=(0,Q.createServerReference)("408ee86f0a55dbf6c6dd7345f577df4101d14c0dac",Q.callServer,void 0,Q.findSourceMapURL,"getOrCreateTowerTaskId");var er=e.i(690027),en=e.i(415601),el=e.i(405367),ei=e.i(168367),eo=e.i(360112),ec=e.i(224277),ed=e.i(905455);function em({commits:e}){let{t:a}=(0,u.useI18n)(),[r,n]=(0,s.useState)(!1);return 0===e.length?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("button",{onClick:()=>n(!r),className:"flex w-full items-center gap-1 px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[r?(0,t.jsx)(M.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(z.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[a("git.commitLog")," (",e.length,")"]})]}),r&&(0,t.jsx)("div",{className:"mt-0.5 mb-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:e.map(e=>(0,t.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,t.jsx)(W,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:e.message}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,t.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(e.shortHash),eo.toast.success(`Copied ${e.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[e.shortHash,(0,t.jsx)(J.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.author}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m`;let s=Math.floor(t/60);if(s<24)return`${s}h`;let a=Math.floor(s/24);return a<30?`${a}d`:`${Math.floor(a/30)}mo`}(e.date)})]})]})]},e.hash))})]})}var ex=e.i(487278),eu=e.i(375306),eh=e.i(244354);function ep({localPath:e,stashes:a,hasChanges:r,onRefresh:n}){let{t:l}=(0,u.useI18n)(),[i,o]=(0,s.useState)(!1),[m,x]=(0,s.useState)(!1),[h,p]=(0,s.useState)(""),[g,f]=(0,s.useState)(null),j=async()=>{x(!0);try{await (0,eh.gitAction)(e,"stash-save",{message:h}),p(""),eo.toast.success(l("git.stashSaved")),await n()}catch(e){eo.toast.error(e instanceof Error?e.message:String(e))}finally{x(!1)}},b=async t=>{f(t);try{await (0,eh.gitAction)(e,"stash-pop",{index:t}),eo.toast.success(l("git.stashApplied")),await n()}catch(e){eo.toast.error(e instanceof Error?e.message:String(e))}finally{f(null)}},N=async t=>{f(t);try{await (0,eh.gitAction)(e,"stash-drop",{index:t}),eo.toast.success(l("git.stashDropped")),await n()}catch(e){eo.toast.error(e instanceof Error?e.message:String(e))}finally{f(null)}};return r||0!==a.length?(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("button",{onClick:()=>o(!i),className:"flex w-full items-center gap-1 px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[i?(0,t.jsx)(M.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(z.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[l("git.stash")," ",a.length>0&&`(${a.length})`]})]}),i&&(0,t.jsxs)("div",{className:"mt-0.5 mb-1.5 space-y-2",children:[r&&(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsx)(d.Input,{value:h,onChange:e=>p(e.target.value),placeholder:l("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:e=>"Enter"===e.key&&j()}),(0,t.jsx)(c.Button,{variant:"outline",size:"icon-sm",onClick:j,disabled:m,className:"shrink-0",children:m?(0,t.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(ex.Archive,{className:"h-3 w-3"})})]}),a.length>0&&(0,t.jsx)("div",{className:"space-y-0.5",children:a.map(e=>(0,t.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,t.jsx)(ex.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:e.message||`stash@{${e.index}}`}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:()=>b(e.index),disabled:g===e.index,className:"text-muted-foreground","aria-label":l("git.stashApply"),children:g===e.index?(0,t.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eu.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:()=>N(e.index),disabled:g===e.index,className:"text-rose-400","aria-label":l("git.stashDrop"),children:(0,t.jsx)(C.Trash2,{className:"h-3 w-3"})})]})]},e.index))})]})]}):null}var eg=e.i(515135),ef=e.i(113184),ej=e.i(307739);function eb({value:e,ariaLabel:a}){let{t:r}=(0,u.useI18n)(),[n,l]=(0,s.useState)(!1),i=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}l(!0),eo.toast.success(r("common.copied")),setTimeout(()=>l(!1),1500)}catch{eo.toast.error(r("common.copyFailed"))}};return(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/50 pl-3 pr-1 py-1.5",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:e,children:e}),(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":a,onClick:i,children:n?(0,t.jsx)(g.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(J.Copy,{className:"h-3 w-3"})})}),(0,t.jsx)(x.TooltipContent,{children:n?r("common.copied"):r("common.copy")})]})]})}function eN({project:e,workspaceId:r}){let{t:n,locale:l}=(0,u.useI18n)(),o=(0,a.useRouter)(),{width:m,isDragging:h,startResize:p}=function(e){let{storageKey:t,defaultWidth:a,minWidth:r,maxWidth:n,edge:l="left"}=e,[i,o]=(0,s.useState)(a),[c,d]=(0,s.useState)(!1),m=(0,s.useRef)(null);(0,s.useEffect)(()=>{try{let e=window.localStorage.getItem(t),s=null==e?NaN:Number(e);Number.isFinite(s)&&o($(s,r,n))}catch{}},[t,r,n]);let x=(0,s.useCallback)(e=>{let t=m.current;t&&o(function(e,t,s,a,r,n="left"){return $(e+("left"===n?t-s:s-t),a,r)}(t.width,t.x,e.clientX,r,n,l))},[r,n,l]),u=(0,s.useCallback)(()=>{m.current&&(m.current=null,d(!1),window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",u),o(e=>{try{window.localStorage.setItem(t,String(e))}catch{}return e}))},[x,t]),h=(0,s.useCallback)(e=>{e.preventDefault(),m.current={x:e.clientX,width:i},d(!0),window.addEventListener("pointermove",x),window.addEventListener("pointerup",u)},[i,x,u]);return(0,s.useEffect)(()=>()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",u)},[x,u]),{width:i,isDragging:c,startResize:h}}({storageKey:"tower:repo-sidebar-width",defaultWidth:288,minWidth:240,maxWidth:560,edge:"left"}),[g,f]=(0,s.useState)(!0),[j,b]=(0,s.useState)(!0),[N,v]=(0,s.useState)(!1),[k,w]=(0,s.useState)(!1),[S,T]=(0,s.useState)(""),[P,I]=(0,s.useState)(!1),[E,D]=(0,s.useState)(!1),[B,F]=(0,s.useState)(!1),[A,R]=(0,s.useState)(e.name),[O,J]=(0,s.useState)(e.alias??""),[Q,ex]=(0,s.useState)(e.description??""),[eu,eh]=(0,s.useState)(e.localPath??""),[ev,ek]=(0,s.useState)(e.projectType??"FRONTEND"),[ew,ey]=(0,s.useState)(e.groupId??""),[eC,eS]=(0,s.useState)([]);(0,s.useEffect)(()=>{es(100).then(eS)},[]);let[eT,eP]=(0,s.useState)(!1),[eI,eE]=(0,s.useState)(""),[eD,eL]=(0,s.useState)(""),[eB,eF]=(0,s.useState)(""),[eA,eR]=(0,s.useState)(""),[eO,e$]=(0,s.useState)("FRONTEND"),[eM,ez]=(0,s.useState)(!1),[eU,eG]=(0,s.useState)(!1),[eW,eH]=(0,s.useState)(null),[eV,e_]=(0,s.useState)(!1),[eK,eX]=(0,s.useState)(!1),eY=e=>{eo.toast.info(e)},eJ=(0,s.useCallback)(async()=>{if(e.localPath){e_(!0);try{let t=await fetch(`/api/git?path=${encodeURIComponent(e.localPath)}`);t.ok&&eH(await t.json())}catch{}finally{e_(!1)}}},[e.localPath]);(0,s.useEffect)(()=>{eJ()},[eJ]);let eq=async()=>{if(e.localPath){eX(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:e.localPath})})).ok?(eY(n("git.initSuccess")),await eJ()):eY(n("git.initFailed"))}catch{eY(n("git.initFailed"))}finally{eX(!1)}}},eQ=(e,t)=>{o.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1}),o.refresh()},eZ=async()=>{if(eD.trim()){ez(!0);try{let e=await (0,ee.createProject)({name:eD.trim(),alias:eB.trim()||void 0,description:eA.trim()||void 0,localPath:eI,projectType:eO,workspaceId:r});eP(!1),eQ(r,e.id)}catch(e){eo.toast.error(e instanceof Error?e.message:String(e))}finally{ez(!1)}}},e0=async()=>{if(eu&&!eU){eG(!0);try{let e=await (0,ei.analyzeProjectDirectory)(eu.trim(),l);ex(e)}catch{eo.toast.error(n("project.analyzeError"))}finally{eG(!1)}}},e1=async()=>{try{await Z(e.id,{name:A.trim(),alias:O.trim()||void 0,description:Q.trim()||void 0,localPath:eu.trim()||void 0,projectType:ev}),ew!==(e.groupId??"")&&await (0,ej.setProjectGroup)(e.id,ew||null),o.refresh(),v(!1)}catch(e){eo.toast.error(e instanceof Error?e.message:String(e))}};return(0,t.jsxs)("aside",{className:"relative flex-shrink-0 border-l border-border bg-sidebar",style:{width:m},children:[(0,t.jsx)("div",{onPointerDown:p,className:`absolute left-0 top-0 z-20 h-full w-1 -translate-x-1/2 cursor-col-resize transition-colors hover:bg-primary/20 ${h?"bg-primary/40":"bg-transparent"}`,role:"separator","aria-orientation":"vertical","aria-label":n("sidebar.right.resize")}),(0,t.jsxs)("div",{className:"h-full overflow-y-auto",children:[(0,t.jsxs)("div",{className:"border-b border-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e.name}),e.alias&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.alias})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{R(e.name),J(e.alias??""),ex(e.description??""),eh(e.localPath??""),ey(e.groupId??""),v(!0)},className:"text-muted-foreground",children:(0,t.jsx)(y.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{T(""),w(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,t.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})})]})]}),e.description&&(0,t.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:e.description}),(0,t.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,t.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===e.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===e.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.GitBranch,{className:"h-3 w-3"}),n("sidebar.right.gitType")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(U.FileText,{className:"h-3 w-3"}),n("sidebar.right.normalType")]})})}),e.gitUrl&&(0,t.jsx)("div",{className:"mt-3 space-y-1.5",children:(0,t.jsx)(eb,{value:e.gitUrl,ariaLabel:n("project.gitUrl")})}),e.localPath&&(0,t.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,er.openInFileManager)(e.localPath)}catch(e){console.error("openInFileManager failed:",e),eo.toast.error(n("git.openInFileManagerFailed"))}},children:(0,t.jsx)(K.FolderSearch,{className:"h-4 w-4"})})}),(0,t.jsx)(x.TooltipContent,{children:n("git.openInFileManager")})]}),(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,en.openInEditor)(e.localPath)}catch(e){console.error("openInEditor failed:",e),eo.toast.error(n("git.openInEditorFailed"))}},children:(0,t.jsx)(X.Code,{className:"h-4 w-4"})})}),(0,t.jsx)(x.TooltipContent,{children:n("git.openInEditor")})]}),(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,el.openInTerminal)(e.localPath)}catch(e){console.error("openInTerminal failed:",e),eo.toast.error(n("git.openInTerminalFailed"))}},children:(0,t.jsx)(Y.Terminal,{className:"h-4 w-4"})})}),(0,t.jsx)(x.TooltipContent,{children:n("git.openInTerminal")})]})]}),(0,t.jsxs)(c.Button,{variant:"outline",className:"w-full h-9 gap-1.5 text-xs",disabled:E,onClick:async()=>{D(!0);try{let t=await ea(e.id);o.push(`/workspaces/${r}/tasks/${t}`)}catch{eo.toast.error(n("git.openStudioFailed"))}finally{D(!1)}},children:[E?(0,t.jsx)(V.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(G.FolderOpen,{className:"h-3.5 w-3.5"}),n("git.openStudio")]})]})]}),(0,t.jsxs)("div",{className:"border-b border-border p-4",children:[(0,t.jsxs)(c.Button,{variant:"ghost",onClick:()=>f(!g),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("git.section")}),g?(0,t.jsx)(M.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(z.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),g&&(0,t.jsx)("div",{className:"mt-3",children:e.localPath?eV?(0,t.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,t.jsx)(V.Loader2,{className:"h-4 w-4 animate-spin"}),(0,t.jsx)("span",{className:"ml-2 text-xs",children:n("git.loading")})]}):eW&&!eW.isGit?(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(H.AlertCircle,{className:"h-3.5 w-3.5"}),(0,t.jsx)("p",{className:"text-xs",children:n("git.notInitialized")})]}),(0,t.jsxs)(c.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:eq,disabled:eK,children:[eK?(0,t.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(W,{className:"h-3 w-3"}),n("git.initRepo")]})]}):eW?.isGit?(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex flex-col",children:(0,t.jsx)(eg.EditorGitPanel,{localPath:e.localPath,mode:"project"})}),(0,t.jsx)(em,{commits:eW.commits??[]}),(0,t.jsx)(ep,{localPath:e.localPath,stashes:eW.stashes??[],hasChanges:(eW.changedFiles??[]).length>0,onRefresh:eJ})]}):null:(0,t.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(H.AlertCircle,{className:"h-3.5 w-3.5"}),(0,t.jsx)("p",{className:"text-xs",children:n("git.noLocalPath")})]})})})]}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)(c.Button,{variant:"ghost",onClick:()=>b(!j),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("sidebar.right.browseRepo")}),j?(0,t.jsx)(M.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(z.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),j&&(0,t.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,t.jsxs)(c.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>F(!0),children:[(0,t.jsx)(G.FolderOpen,{className:"h-3.5 w-3.5"}),n("sidebar.right.browseRepo")]}),eC.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:n("sidebar.right.recent")}),(0,t.jsx)("div",{className:"space-y-0.5",children:eC.map(s=>(0,t.jsxs)("button",{onClick:()=>{s.id!==e.id&&eQ(s.workspaceId,s.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${s.id===e.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===s.type?(0,t.jsx)(i.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,t.jsx)(G.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:s.name}),s.localPath&&(0,t.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:s.localPath})]})]},s.id))})]})]})]})]}),(0,t.jsx)(L.Dialog,{open:N,onOpenChange:v,children:(0,t.jsxs)(L.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(L.DialogHeader,{children:(0,t.jsx)(L.DialogTitle,{children:n("project.edit")})}),(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:n("project.name")}),(0,t.jsx)(d.Input,{value:A,onChange:e=>R(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(ed.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:ev,onChange:ek})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(d.Input,{value:O,onChange:e=>J(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.group")}),(0,t.jsx)(ef.GroupSelect,{workspaceId:r,value:ew,onChange:ey})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(c.Button,{type:"button",variant:"ghost",onClick:e0,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!eu||eU?"opacity-50":""}`,children:[eU?(0,t.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(_.Sparkles,{className:"h-3 w-3"}),eU?n("project.analyzing"):n("project.genDesc")]})]}),(0,t.jsx)(q.Textarea,{value:Q,onChange:e=>ex(e.target.value),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 max-h-[200px] overflow-y-auto"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("div",{className:"mt-1.5 break-all rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:eu||"—"})]})]}),(0,t.jsxs)(L.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>v(!1),children:n("common.cancel")}),(0,t.jsx)(c.Button,{onClick:e1,disabled:!A.trim()||eU,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("common.save")})]})]})}),(0,t.jsx)(ec.FolderBrowserDialog,{open:B,onOpenChange:F,onSelect:e=>{N?eh(e):(e=>{let t=eC.find(t=>t.localPath===e);if(t)return eQ(t.workspaceId,t.id);let s=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";eE(e),eL(s),eF(""),eR(""),eP(!0)})(e)}}),(0,t.jsx)(L.Dialog,{open:eT,onOpenChange:eP,children:(0,t.jsxs)(L.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(L.DialogHeader,{children:(0,t.jsx)(L.DialogTitle,{children:n("topbar.newProject")})}),(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:n("project.localPath")}),(0,t.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:eI})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(d.Input,{value:eD,onChange:e=>eL(e.target.value),placeholder:n("project.namePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(ed.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:eO,onChange:e$})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(d.Input,{value:eB,onChange:e=>eF(e.target.value),placeholder:n("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsx)(q.Textarea,{value:eA,onChange:e=>eR(e.target.value),placeholder:n("project.descPlaceholder"),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)(L.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>eP(!1),children:n("common.cancel")}),(0,t.jsxs)(c.Button,{onClick:eZ,disabled:!eD.trim()||eM,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[eM?(0,t.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,n("common.create")]})]})]})}),(0,t.jsx)(L.Dialog,{open:k,onOpenChange:e=>{w(e),e||T("")},children:(0,t.jsxs)(L.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(L.DialogHeader,{children:(0,t.jsx)(L.DialogTitle,{className:"text-rose-400",children:n("project.deleteTitle")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("project.deleteWarning",{name:e.name})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("project.deleteIrreversible")}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.deleteConfirmLabel")}),(0,t.jsx)(d.Input,{value:S,onChange:e=>T(e.target.value),placeholder:n("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,t.jsxs)(L.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>w(!1),children:n("common.cancel")}),(0,t.jsxs)(c.Button,{variant:"destructive",disabled:S!==n("project.deleteConfirmText")||P,onClick:async()=>{I(!0);try{await et(e.id),eo.toast.success(n("project.deleteSuccess")),o.push(`/workspaces/${r}`)}catch{eo.toast.error(n("project.deleteFailed"))}finally{I(!1),w(!1)}},children:[P&&(0,t.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),n("project.deleteButton")]})]})]})})]})}var ev=e.i(475958),ek=e.i(313029),ew=e.i(882651),ey=e.i(259846),eC=e.i(975157);function eS({title:e,description:s,branch:a,baseBranch:r,version:n,hasConversation:l,updatedAt:o,openDir:d,onBack:m}){let{t:h}=(0,u.useI18n)();return(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(_.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-primary",children:h("taskDetail.title")})]}),(0,t.jsxs)(c.Button,{variant:"ghost",onClick:m,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,t.jsx)(ey.ArrowLeft,{className:"h-3.5 w-3.5"}),h("taskDetail.back")]})]}),(0,t.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:e}),s&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:s}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[r?(0,t.jsxs)(P.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,t.jsx)(i.GitBranch,{className:"mr-1 h-3 w-3"}),r," · worktree"]}):a?(0,t.jsx)(P.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:h("taskDetail.directMode")}):null,n&&(0,t.jsx)(E.TaskVersionTag,{number:n.number,name:n.name,showName:!0}),l&&(0,t.jsx)(P.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:h("taskDetail.hasConversation")}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[h("taskDetail.updatedAt")," ",(0,eC.formatRelativeTime)(o)]}),d&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,er.openInFileManager)(d)}catch(e){console.error("openInFileManager failed:",e),eo.toast.error(h("git.openInFileManagerFailed"))}},children:(0,t.jsx)(K.FolderSearch,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{side:"bottom",children:h("git.openInFileManager")})]}),(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,en.openInEditor)(d)}catch(e){console.error("openInEditor failed:",e),eo.toast.error(h("git.openInEditorFailed"))}},children:(0,t.jsx)(X.Code,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{side:"bottom",children:h("git.openInEditor")})]}),(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,el.openInTerminal)(d)}catch(e){console.error("openInTerminal failed:",e),eo.toast.error(h("git.openInTerminalFailed"))}},children:(0,t.jsx)(Y.Terminal,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(x.TooltipContent,{side:"bottom",children:h("git.openInTerminal")})]})]})]})]})}var eT=e.i(14842),eP=e.i(865514),eI=e.i(83434),eE=e.i(810258),eD=e.i(666752),eL=e.i(743067),eB=e.i(335578),eF=e.i(889541),eA=e.i(82192),eR=e.i(907059),eO=e.i(208228),e$=e.i(574378),eM=e.i(326883),ez=e.i(631675),eU=e.i(297338),eG=e.i(657153),eW=e.i(867533),eH=e.i(120171),eV=e.i(706429),e_=e.i(365716),eK=e.i(108131),eX=e.i(237842),eY=e.i(903024),eJ=e.i(235357),eq=e.i(144640),eQ=e.i(997025),eZ=e.i(937304);let e0=/\.(txt|md|json)$/i;function e1({taskId:e,projectId:a}){let{t:r}=(0,u.useI18n)(),l=(0,s.useRef)(null),[i,o]=(0,s.useState)([]),[d,m]=(0,s.useState)([]),[x,h]=(0,s.useState)(!1),[p,g]=(0,s.useState)(""),[f,j]=(0,s.useState)(""),[b,N]=(0,s.useState)(!1),[v,k]=(0,s.useState)(null),[w,y]=(0,s.useState)(null);async function S(){p.trim()&&(await (0,eH.createNote)({title:p.trim(),content:f.trim(),projectId:a,taskId:e,category:"task"}),g(""),j(""),h(!1),(0,eV.getTaskNotes)(e).then(o))}async function T(e){await (0,e_.deleteNote)(e),o(t=>t.filter(t=>t.id!==e))}async function P(t){let s=t.target.files?.[0];if(s){N(!0);try{let t=new FormData;t.set("file",s),t.set("projectId",a),t.set("taskId",e),await (0,eX.uploadAsset)(t),(0,eK.getTaskAssets)(e).then(m)}finally{N(!1),l.current&&(l.current.value="")}}}async function I(e){await (0,eY.deleteAsset)(e),m(t=>t.filter(t=>t.id!==e))}function E(e){return(0,eZ.isImageAsset)(e.filename,e.mimeType)||e0.test(e.filename)}function D(e){E(e)?k(e):eo.toast.info(r("assets.previewNotSupported"))}async function L(e){try{let t=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path})});if(!t.ok){let e=await t.json().catch(()=>({}));eo.toast.error(e.error||"Failed to reveal file")}}catch{eo.toast.error("Failed to reveal file")}}(0,s.useEffect)(()=>{(0,eV.getTaskNotes)(e).then(o),(0,eK.getTaskAssets)(e).then(m)},[e]);let F=v?(0,eZ.isImageAsset)(v.filename,v.mimeType)?"image":e0.test(v.filename)?"text":null:null,A=d.filter(e=>(0,eZ.isImageAsset)(e.filename,e.mimeType)).map(e=>({id:e.id,url:(0,eZ.localPathToApiUrl)(e.path),filename:e.filename})),R=v?A.findIndex(e=>e.id===v.id):-1;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.ScrollArea,{className:"h-full",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,t.jsx)(U.FileText,{className:"h-3.5 w-3.5"}),r("taskPage.notes")]}),(0,t.jsxs)(c.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>h(!x),children:[x?(0,t.jsx)(eG.X,{className:"h-3 w-3"}):(0,t.jsx)(n.Plus,{className:"h-3 w-3"}),x?"":r("taskPage.addNote")]})]}),x&&(0,t.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:e=>g(e.target.value),placeholder:r("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,t.jsx)("textarea",{value:f,onChange:e=>j(e.target.value),placeholder:r("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,t.jsx)(c.Button,{className:"text-xs",onClick:S,disabled:!p.trim(),children:r("taskPage.addNote")})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[0===i.length&&!x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noNotes")}),i.map(e=>(0,t.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>y(e),className:"min-w-0 flex-1 cursor-pointer text-left",title:r("taskPage.previewNote"),children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate hover:underline",children:e.title}),e.content&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:e.content}),(0,t.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:()=>y(e),className:"text-muted-foreground hover:bg-accent",title:r("taskPage.previewNote"),children:(0,t.jsx)(eW.Eye,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:()=>T(e.id),className:"text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:r("taskPage.deleteNote"),children:(0,t.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})})]})]})},e.id))]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,t.jsx)(eU.Paperclip,{className:"h-3.5 w-3.5"}),r("taskPage.attachments")]}),(0,t.jsxs)(c.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>l.current?.click(),disabled:b,children:[(0,t.jsx)(ez.Upload,{className:"h-3 w-3"}),r("taskPage.uploadFile")]}),(0,t.jsx)("input",{ref:l,type:"file",className:"hidden",onChange:P})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===d.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noAttachments")}),d.map(e=>{var s;let a=E(e);return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,t.jsx)(eU.Paperclip,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("button",{type:"button",onClick:()=>D(e),disabled:!a,className:`min-w-0 flex-1 truncate text-left text-sm ${a?"cursor-pointer hover:underline":"cursor-default"}`,title:a?r("assets.preview"):e.filename,children:e.filename}),(0,t.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(s=e.size)?s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`:""}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[a&&(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:()=>D(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:r("assets.preview"),children:(0,t.jsx)(eW.Eye,{className:"h-3 w-3"})}),(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:()=>L(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:r("assets.revealInFinder"),children:(0,t.jsx)(G.FolderOpen,{className:"h-3 w-3"})}),(0,t.jsx)(c.Button,{variant:"ghost",size:"icon-xs",onClick:()=>I(e.id),className:"shrink-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:r("taskPage.deleteAttachment"),children:(0,t.jsx)(C.Trash2,{className:"h-3 w-3"})})]})]},e.id)})]})]})]})}),(0,t.jsx)(eJ.ImageLightbox,{imageUrl:"image"===F&&R>=0?A[R].url:null,filename:"image"===F&&R>=0?A[R].filename:"",open:"image"===F,onOpenChange:e=>{e||k(null)},assets:A.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:R>=0?R:void 0,onIndexChange:e=>{let t=A[e];if(!t)return;let s=d.find(e=>e.id===t.id);s&&k(s)}}),(0,t.jsx)(eq.TextPreviewDialog,{url:"text"===F&&v?(0,eZ.localPathToApiUrl)(v.path):null,filename:v?.filename??"",open:"text"===F,onOpenChange:e=>{e||k(null)}}),(0,t.jsx)(eQ.NotePreviewDialog,{note:w,open:null!==w,onOpenChange:e=>{e||y(null)}})]})}function e5({task:e,workspaceId:r,projectLocalPath:n,onClose:l}){let{t:i}=(0,u.useI18n)(),o=(0,a.useRouter)(),{removePortal:d}=(0,eI.useTerminalPortal)(),[h,p]=(0,s.useState)("terminal"),[g,f]=(0,s.useState)(null),[j,b]=(0,s.useState)(!1),[N,v]=(0,s.useState)(e.status);(0,s.useEffect)(()=>{v(e.status)},[e.status]);let[k,w]=(0,s.useState)(null),[y,C]=(0,s.useState)(!1),[S,T]=(0,s.useState)(!1),[P,I]=(0,s.useState)([]);(0,s.useEffect)(()=>{w(null),C(!1),T(!1),I([]),f(null),p("terminal")},[e.id]);let[E,D]=(0,s.useState)([]),[L,F]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=!1;return(0,e$.getPrompts)().then(t=>{if(e)return;D(t.map(e=>({id:e.id,name:e.name,isDefault:e.isDefault})));let s=t.find(e=>e.isDefault);s&&F(s.id)}),()=>{e=!0}},[]),(0,s.useEffect)(()=>{w(null),T(!1);let t=!1;return(0,eE.getTaskExecutions)(e.id).then(e=>{if(t)return;let s=e[0];if(s?.status==="RUNNING"){let e=s.worktreePath||n||null;e&&w(e)}I(e.filter(e=>"RUNNING"!==e.status)),T(!0)}),()=>{t=!0}},[e.id]),(0,s.useEffect)(()=>{if("changes"!==h||"TODO"===N||"CANCELLED"===N)return;let t=!1;return b(!0),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t||f(e?.files||e?.branchDeleted?e:null)}).catch(()=>{t||f(null)}).finally(()=>{t||b(!1)}),()=>{t=!0}},[h,N,e.id]);let A=(0,s.useCallback)(async()=>{if(!y){C(!0),d(e.id);try{let t=await (0,eD.startPtyExecutionSafe)(e.id,"",L);if(!t.ok){C(!1),eo.toast.error(t.error||i("terminal.startFailed"));return}w(t.worktreePath??null),v("IN_PROGRESS")}catch(e){C(!1),eo.toast.error(e instanceof Error&&e.message?e.message:i("terminal.startFailed"))}}},[e.id,y,L,i]),R=(0,s.useCallback)(t=>{C(!1),w(null),d(e.id),0===t&&v("IN_REVIEW"),(0,eE.getTaskExecutions)(e.id).then(e=>{I(e.filter(e=>"RUNNING"!==e.status))}),o.refresh()},[o,e.id]),O=(0,s.useCallback)(async()=>{await (0,eL.stopPtyExecution)(e.id),C(!1),d(e.id),w(null),v("IN_REVIEW"),(0,eE.getTaskExecutions)(e.id).then(e=>{I(e.filter(e=>"RUNNING"!==e.status))}),o.refresh()},[e.id,o]),$=(0,s.useCallback)(async t=>{C(!0),d(e.id),w(null);try{let{worktreePath:s}=await (0,eB.resumePtyExecution)(e.id,t);w(s),v("IN_PROGRESS")}catch{C(!1)}},[e.id,d]),M=(0,s.useCallback)(async()=>{C(!0),d(e.id),w(null);try{let{worktreePath:t}=await (0,eF.continueLatestPtyExecution)(e.id);w(t),v("IN_PROGRESS")}catch(e){C(!1),eo.toast.error(e instanceof Error?e.message:String(e))}},[e.id,d]),[z,G]=(0,s.useState)(!1),[W,H]=(0,s.useState)([]),_=(0,s.useCallback)(async()=>{try{let t=await (0,eR.checkWorktreeClean)(e.id);if(t.hasWorktree&&!t.clean)return void eo.toast.error(i("taskPage.uncommittedChanges",{count:String(t.files.length)}));if(t.hasWorktree&&t.clean&&!t.hasCommits)return void eo.toast.error(i("taskPage.noChangesToComplete"),{action:{label:i("taskPage.markAsCancelled"),onClick:()=>{(0,eA.updateTaskStatus)(e.id,"CANCELLED").then(()=>{v("CANCELLED"),eo.toast.success(i("taskPage.taskCancelled")),o.refresh()}).catch(()=>eo.toast.error("Failed to cancel task"))}}});if(t.hasWorktree&&t.hasCommits){H(t.commitLog),G(!0);return}await (0,eA.updateTaskStatus)(e.id,"DONE"),v("DONE"),eo.toast.success(i("taskPage.taskCompleted")),o.refresh()}catch{eo.toast.error("Failed to complete task")}},[e.id,o,i]),K=(0,s.useCallback)(()=>{v("DONE"),G(!1),eo.toast.success(i("taskPage.taskCompleted")),o.refresh()},[o,i]),X=(0,s.useCallback)(async t=>{try{let{hash:s}=await (0,eO.commitWorktreeChanges)(e.id,t);eo.toast.success(i("diff.commitSuccess",{hash:s})),o.refresh();let a=await fetch(`/api/tasks/${e.id}/diff`);if(a.ok){let e=await a.json();f(e?.files?e:null)}}catch(e){eo.toast.error(e instanceof Error?e.message:"Commit failed")}},[e.id,o,i]);return(0,t.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,t.jsx)(eS,{title:e.title,description:i("taskDetail.panelDescription"),branch:`task/${e.id}`,baseBranch:e.baseBranch,version:e.version??null,hasConversation:!1,updatedAt:e.updatedAt,openDir:k??(n?e.subPath?`${n}/${e.subPath}`:n:null),onBack:l}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsxs)("button",{onClick:()=>p("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===h?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(Y.Terminal,{className:"h-3 w-3"}),i("terminal.execute")]}),(0,t.jsx)("button",{onClick:()=>p("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===h?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:i("taskPage.changes")}),(0,t.jsxs)("button",{onClick:()=>p("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===h?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(U.FileText,{className:"h-3 w-3"}),i("taskPage.notes")]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===N&&(0,t.jsxs)(c.Button,{size:"sm",onClick:_,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,t.jsx)(ew.CheckCircle2,{className:"h-3 w-3"}),i("taskPage.completeTask")]}),"DONE"!==N&&"CANCELLED"!==N&&(0,t.jsxs)(c.Button,{variant:"ghost",size:"sm",onClick:()=>o.push(`/workspaces/${r}/tasks/${e.id}`),className:"text-muted-foreground",children:[(0,t.jsx)(ev.ExternalLink,{className:"h-3 w-3"}),i("taskPage.viewDetails")]})]})]}),"terminal"===h?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:S?k?(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),i("execution.running")]}),(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsxs)(x.TooltipTrigger,{onClick:O,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,t.jsx)(ek.Square,{className:"h-3 w-3"}),i("terminal.stopExecution")]}),(0,t.jsx)(x.TooltipContent,{side:"bottom",children:i("terminal.stopHint")})]})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:(0,t.jsx)(eI.TerminalOutlet,{taskId:e.id,worktreePath:k,onSessionEnd:R})})]}):"DONE"===N||"CANCELLED"===N?(0,t.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,t.jsx)(B.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)(eM.ExecutionTimeline,{executions:P})})}):(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[E.length>0&&(0,t.jsxs)(m.Select,{defaultValue:L??"none",onValueChange:e=>F("none"===e?null:e),children:[(0,t.jsx)(m.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,t.jsx)("span",{className:"text-left truncate",children:L?E.find(e=>e.id===L)?.name??i("terminal.noPrompt"):i("terminal.noPrompt")})}),(0,t.jsxs)(m.SelectContent,{className:"min-w-[200px]",children:[(0,t.jsx)(m.SelectItem,{value:"none",children:i("terminal.noPrompt")}),E.map(e=>(0,t.jsxs)(m.SelectItem,{value:e.id,children:[e.name,e.isDefault?" ★":""]},e.id))]})]},`prompt-${E.length}`),(0,t.jsxs)(c.Button,{onClick:A,disabled:y,size:"sm",className:"gap-2 px-4",children:[y?(0,t.jsx)(V.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(Y.Terminal,{className:"h-3.5 w-3.5"}),y?i("terminal.executing"):i("terminal.launch")]})]}),(0,t.jsx)(B.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)(eM.ExecutionTimeline,{executions:P,onResume:$,onContinueLatest:M})})]}):(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,t.jsx)(V.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,t.jsx)("span",{className:"text-xs text-neutral-500",children:i("execution.loading")})]})}):"changes"===h?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:j?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.loadingDiff")})}):g?.branchDeleted?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.branchDeleted")})}):g?(0,t.jsx)(eT.TaskDiffView,{taskId:e.id,files:g.files,totalAdded:g.totalAdded,totalRemoved:g.totalRemoved,hasConflicts:g.hasConflicts,conflictFiles:g.conflictFiles,onCommit:X,hasUncommitted:g.hasUncommitted}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.noChanges")})})}):"notes"===h?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,t.jsx)(e1,{taskId:e.id,projectId:e.projectId})}):null,(0,t.jsx)(eP.TaskMergeConfirmDialog,{open:z,onOpenChange:G,taskId:e.id,taskTitle:e.title,baseBranch:e.baseBranch??"main",fileCount:g?.files?.length??0,commitCount:g?.commitCount??0,commitLog:W,onMergeComplete:K})]})}var e3=e.i(569634),e2=e.i(769620);let e4=(0,Q.createServerReference)("40accff03f6e67a505e883e84e4685c72975d5af07",Q.callServer,void 0,Q.findSourceMapURL,"deleteTask"),e7=(0,Q.createServerReference)("40193aba4641c1cda3fb967a4d3196003b1f30a78f",Q.callServer,void 0,Q.findSourceMapURL,"toggleTaskPinned");var e8=e.i(720580),e6=e.i(213714),e9=e.i(889620),te=e.i(19671),tt=e.i(591540);function ts({project:e,isActive:r,workspaceId:n,onSelect:l}){let{t:i}=(0,u.useI18n)(),o=(0,a.useRouter)(),d=e.totalTasks,m=e.runningTasks,h=d>0?Math.round(m/d*100):0,[p,g]=(0,s.useState)(!1),[f,j]=(0,s.useState)(!1),b=async()=>{j(!0);try{let t=await ea(e.id);o.push(`/workspaces/${n}/tasks/${t}`)}catch{eo.toast.error(i("git.openStudioFailed"))}finally{j(!1)}},N=(0,t.jsxs)("button",{onClick:()=>{r||l(e.id)},className:`group flex w-[212px] shrink-0 items-center gap-2 rounded-lg border-b-2 px-3 py-1.5 text-left transition-colors ${r?"border-primary bg-primary/10 ring-1 ring-primary/20 cursor-default":`border-transparent cursor-pointer ${p?"bg-accent":"hover:bg-accent"}`}`,children:[(0,t.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:`w-full truncate text-sm font-medium leading-tight ${r?"text-primary":p?"text-foreground":"text-muted-foreground group-hover:text-foreground"}`,children:e.name}),e.alias&&(0,t.jsx)("span",{className:"w-full truncate text-[11px] font-normal leading-tight text-muted-foreground/70",children:e.alias})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-baseline rounded-md border border-border bg-card px-1.5 py-0.5 font-mono text-[11px] font-semibold leading-none",children:[(0,t.jsx)("span",{className:"text-amber-500 dark:text-amber-400",children:m}),(0,t.jsx)("span",{className:"mx-px text-muted-foreground/50",children:"/"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:d})]})]});return(0,t.jsxs)(x.Tooltip,{onOpenChange:g,children:[(0,t.jsx)(x.TooltipTrigger,{render:N}),(0,t.jsxs)(x.TooltipContent,{side:"bottom",hideArrow:!0,className:"flex w-[268px] max-w-none flex-col items-stretch gap-0 rounded-xl border border-border bg-card p-3.5 text-foreground shadow-lg",children:[(0,t.jsx)("div",{className:"text-[13px] font-bold leading-snug break-words",children:e.name}),e.alias&&(0,t.jsx)("div",{className:"mt-0.5 text-[11.5px] leading-relaxed text-muted-foreground break-words",children:e.alias}),(0,t.jsx)("div",{className:"my-2.5 h-px bg-border"}),(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-amber-500 dark:bg-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] font-semibold",children:i("board.running")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:i("board.runningDesc")}),(0,t.jsx)("span",{className:"ml-auto font-mono text-[15px] font-bold text-amber-500 dark:text-amber-400",children:m})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-sky-500 dark:bg-sky-400"}),(0,t.jsx)("span",{className:"text-[13px] font-semibold",children:i("board.overview")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground",children:i("board.totalDesc")}),(0,t.jsx)("span",{className:"ml-auto font-mono text-[15px] font-bold",children:d})]}),(0,t.jsx)("div",{className:"mt-2.5 h-[5px] overflow-hidden rounded-full bg-sky-500/15 dark:bg-sky-400/15",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500 dark:bg-amber-400",style:{width:`${h}%`}})}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:i("board.badgeFormatHint")}),(0,t.jsxs)(c.Button,{variant:"outline",disabled:f,onClick:b,className:"h-6 shrink-0 gap-1 px-2 text-[11px]",children:[f?(0,t.jsx)(V.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(G.FolderOpen,{className:"h-3 w-3"}),i("git.openStudio")]})]})]})]})}function ta({projects:e,activeProjectId:a,workspaceId:r,onSelect:n}){let l=(0,s.useRef)(null),{canScrollLeft:i,canScrollRight:o}=(0,tt.useScrollOverflow)(l,[e]),c=e=>{let t=l.current;t&&t.scrollBy({left:"left"===e?-150:150,behavior:"smooth"})};return(0,t.jsxs)("div",{className:"relative flex items-center",children:[i&&(0,t.jsx)("button",{onClick:()=>c("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,t.jsx)(te.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{ref:l,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>(0,t.jsx)(ts,{project:e,isActive:a===e.id,workspaceId:r,onSelect:n},e.id))}),o&&(0,t.jsx)("button",{onClick:()=>c("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,t.jsx)(z.ChevronRight,{className:"h-4 w-4"})})]})}var tr=e.i(759686);function tn({open:e,onOpenChange:s,taskTitle:a,uncommittedFiles:r,commitLog:n,onConfirm:l}){let{t:i}=(0,u.useI18n)(),o=r.length,d=n.length,m=0===o&&0===d;return(0,t.jsx)(L.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(L.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(L.DialogHeader,{children:(0,t.jsxs)(L.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(tr.AlertTriangle,{className:"h-4 w-4 text-amber-400"}),i("taskCancel.title")]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-3 space-y-1.5",children:[(0,t.jsx)("p",{className:"text-xs text-foreground",children:i("taskCancel.intro",{title:a})}),(0,t.jsx)("p",{className:"text-xs text-amber-300",children:i("taskCancel.irreversible")})]}),m?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("taskCancel.cleanNotice")}):(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:i("taskCancel.uncommittedFiles")}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:o})]}),(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:i("taskCancel.unmergedCommits")}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),o>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:i("taskCancel.filesList")}),(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:r.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),d>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:i("taskCancel.commitsList")}),(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:n.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1.5",children:i("taskCancel.reflogHint")})]})]}),(0,t.jsxs)(L.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>s(!1),children:i("taskCancel.keep")}),(0,t.jsxs)(c.Button,{variant:"destructive",onClick:l,className:"gap-2",children:[(0,t.jsx)(tr.AlertTriangle,{className:"h-4 w-4"}),i("taskCancel.confirm")]})]})]})})}e.s(["BoardPageClient",0,function({workspaceId:e,projectId:r,project:n,projects:l,initialTasks:i,labels:o,openTaskId:c}){let d=(0,a.useRouter)(),{t:m}=(0,u.useI18n)(),[,x]=(0,s.useTransition)(),[p,g]=(0,s.useState)(""),[j,b]=(0,s.useState)("all"),[N,v]=(0,s.useState)(!1),[k,w]=(0,s.useState)("TODO"),[y,C]=(0,s.useState)(c??null),[S,T]=(0,s.useState)([]),P=y?i.find(e=>e.id===y)??null:null,[I,E]=(0,s.useState)(null),[D,L]=(0,s.useState)(null),[B,F]=(0,s.useState)(null);(0,s.useEffect)(()=>{(0,e6.getVersionsForPicker)(r).then(T).catch(()=>T([]))},[r]),(0,s.useEffect)(()=>{(0,e9.setLastProjectId)(e,r)},[e,r]);let A=S.find(e=>e.isCurrent)?.id??null,$=(0,s.useCallback)(()=>{x(()=>{d.refresh()})},[d]);(0,s.useEffect)(()=>{if(N)return;let e=()=>{"hidden"!==document.visibilityState&&x(()=>{d.refresh()})},t=setInterval(e,5e3),s=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",s),()=>{clearInterval(t),document.removeEventListener("visibilitychange",s)}},[d,N]);let M=(0,s.useCallback)(e=>{g(e)},[]),z=(0,s.useCallback)(async e=>{let t=i.find(t=>t.id===e);if(t)try{let s=await (0,eR.checkWorktreeClean)(e);if(s.hasWorktree&&!s.clean){eo.toast.error(m("taskPage.uncommittedChanges",{count:String(s.files.length)})),$();return}if(s.hasWorktree&&s.clean&&!s.hasCommits){eo.toast.error(m("taskPage.noChangesToComplete"),{action:{label:m("taskPage.markAsCancelled"),onClick:()=>{(0,eA.updateTaskStatus)(e,"CANCELLED").then(()=>{eo.toast.success(m("taskPage.taskCancelled")),$()}).catch(()=>eo.toast.error("Failed to cancel task"))}}}),$();return}if(s.hasWorktree&&s.hasCommits){L({task:t,commitLog:s.commitLog,commitCount:s.commitLog.length}),$();return}await (0,eA.updateTaskStatus)(e,"DONE"),eo.toast.success(m("taskPage.taskCompleted")),$()}catch{eo.toast.error("Failed to complete task"),$()}},[i,$,m]),U=(0,s.useCallback)(async e=>{let t=i.find(t=>t.id===e);if(t)try{let s=await (0,eR.checkWorktreeClean)(e);if(!s.hasWorktree){await (0,eA.updateTaskStatus)(e,"CANCELLED"),eo.toast.success(m("taskPage.taskCancelled")),$();return}F({task:t,files:s.files,commitLog:s.commitLog}),$()}catch{eo.toast.error("Failed to cancel task"),$()}},[i,$,m]),G=(0,s.useCallback)(async(e,t)=>{"DONE"===t?await z(e):"CANCELLED"===t?await U(e):(await (0,eA.updateTaskStatus)(e,t),$())},[$,z,U]),W=(0,s.useCallback)(async e=>{let t=await (0,e3.createTask)({title:e.title,description:e.description,projectId:r,priority:e.priority,status:e.status,labelIds:e.labelIds,baseBranch:e.baseBranch,subPath:e.subPath,versionId:e.versionId??void 0});if(e.autoStart&&t?.id)try{await (0,e8.startPtyExecution)(t.id,""),C(t.id)}catch(e){eo.toast.error(e instanceof Error?e.message:String(e))}$()},[r,$]),H=(0,s.useCallback)(async(e,t)=>{await (0,e2.updateTask)(e,{...t,labelIds:t.labelIds}),E(null),$()},[$]),V=(0,s.useCallback)(async e=>{await e4(e),y===e&&C(null),$()},[$,y]),_=(0,s.useCallback)(async e=>{await e7(e),$()},[$]),K=(0,s.useCallback)(async t=>{try{await (0,e8.startPtyExecution)(t,"")}catch(e){eo.toast.error(e instanceof Error?e.message:String(e))}d.push(`/workspaces/${e}/tasks/${t}`)},[d,e]),X=(0,s.useCallback)(async(e,t)=>{"DONE"===t?await z(e):"CANCELLED"===t?await U(e):(await (0,eA.updateTaskStatus)(e,t),$())},[$,z,U]),Y=(0,s.useCallback)(e=>{w(e),E(null),v(!0)},[]),J=(0,s.useCallback)(e=>{E(e),v(!0)},[]),q=i.filter(e=>!e.labels?.some(e=>e.label.name===f.TOWER_LABEL_NAME&&e.label.isBuiltin)).filter(e=>{if("backlog"===j){if(e.versionId)return!1}else if("all"!==j&&e.versionId!==j)return!1;if(p.trim()){let t=p.toLowerCase();if(!e.title.toLowerCase().includes(t)&&!e.description?.toLowerCase().includes(t))return!1}return!0});return(0,t.jsxs)("div",{className:"flex h-full",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,t.jsx)(ta,{projects:l,activeProjectId:r,workspaceId:e,onSelect:t=>d.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1})})}),(0,t.jsx)(h,{searchQuery:p,onSearchChange:M,versions:S,versionFilter:j,onVersionFilterChange:b,versionsHref:`/workspaces/${e}/projects/${r}/versions`,onCreateTask:()=>{E(null),v(!0)}}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,t.jsx)(R,{initialTasks:q,onTaskMove:G,onTaskClick:e=>{C(e.id)},onEditTask:J,onAddTask:Y,onDeleteTask:V,onTogglePin:_,workspaceId:e,onContextMenuStatusChange:X,onContextMenuLaunch:K})}),(0,t.jsx)(O.CreateTaskDialog,{open:N,onOpenChange:e=>{v(e),e||E(null)},onSubmit:W,onUpdate:H,defaultStatus:k,editTask:I,editTaskLabelIds:I?.labels?I.labels.map(e=>e.labelId):[],labels:o.filter(e=>!(e.name===f.TOWER_LABEL_NAME&&e.isBuiltin)),projectType:n.type,projectLocalPath:n.localPath,versions:S,defaultVersionId:A})]}),P?(0,t.jsx)(e5,{task:P,workspaceId:e,projectLocalPath:n.localPath,onClose:()=>C(null)}):(0,t.jsx)(eN,{project:n,workspaceId:e}),D&&(0,t.jsx)(eP.TaskMergeConfirmDialog,{open:!0,onOpenChange:e=>{e||L(null)},taskId:D.task.id,taskTitle:D.task.title,baseBranch:D.task.baseBranch??"main",fileCount:0,commitCount:D.commitCount,commitLog:D.commitLog,onMergeComplete:()=>{L(null),eo.toast.success(m("taskPage.taskCompleted")),$()}}),B&&(0,t.jsx)(tn,{open:!0,onOpenChange:e=>{e||F(null)},taskTitle:B.task.title,uncommittedFiles:B.files,commitLog:B.commitLog,onConfirm:()=>{let e=B.task.id;F(null),(0,eA.updateTaskStatus)(e,"CANCELLED").then(()=>{eo.toast.success(m("taskPage.taskCancelled")),$()}).catch(()=>eo.toast.error("Failed to cancel task"))}})]})}],783426)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},912078,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40d83973e43b58905a590e6e82361b1dd9c6de3fe9",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,r])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},487486,e=>{"use strict";var t=e.i(565455),r=e.i(581263),a=e.i(294237),i=e.i(975157);let s=(0,a.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:a="default",render:n,...l}){var d;return d={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(s({variant:a}),e)},l),render:n,state:{slot:"badge",variant:a}},(0,r.useRenderElement)(d.defaultTagName??"div",d,d)}],487486)},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},875840,e=>{"use strict";let t=(0,e.i(572989).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],875840)},110204,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["Label",0,function({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}])},205829,e=>{"use strict";let t=(0,e.i(572989).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,t],205829)},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},591540,e=>{"use strict";var t=e.i(965652);e.s(["useScrollOverflow",0,function(e,r=[]){let[a,i]=(0,t.useState)({canScrollLeft:!1,canScrollRight:!1}),s=(0,t.useCallback)(()=>{let t=e.current;t&&i({canScrollLeft:t.scrollLeft>0,canScrollRight:t.scrollLeft<t.scrollWidth-t.clientWidth-1})},[e]);return(0,t.useEffect)(()=>{let t=e.current;if(!t)return;s(),t.addEventListener("scroll",s);let r=new ResizeObserver(s);return r.observe(t),window.addEventListener("resize",s),()=>{t.removeEventListener("scroll",s),r.disconnect(),window.removeEventListener("resize",s)}},[s,...r]),a}])},882651,960995,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],882651);let r=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",0,r],960995),e.s(["XCircle",0,r],181209)},574378,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("409ca1c6b55313919ac08fa17a459e37f90236f264",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},991838,e=>{"use strict";var t=e.i(965652),r=e.i(770303);e.s(["useExtension",0,function(e){let a=(0,t.useContext)(r.ExtensionContext);if(!a)throw Error("useExtension must be used inside <ExtensionProvider>");return{status:a.statusMap[e],loading:a.loading,isInstalling:a.installing.has(e),install:()=>a.install(e),uninstall:()=>a.uninstall(e),refresh:()=>a.refresh(e)}}])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},875840,e=>{"use strict";let t=(0,e.i(572989).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],875840)},254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},235357,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(585012),r=e.i(657153),n=e.i(19671),l=e.i(368490),i=e.i(902539);let o=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var c=e.i(922541),d=e.i(533499);function u({children:e,onClick:a,title:s,disabled:r,...n}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||a()},title:s,disabled:r,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...n,children:e})}e.s(["ImageLightbox",0,function({imageUrl:e,filename:m,open:x,onOpenChange:p,assets:h,currentIndex:f,onIndexChange:g}){let{t:b}=(0,d.useI18n)(),[v,j]=(0,a.useState)(1),[y,w]=(0,a.useState)({x:0,y:0}),[k,N]=(0,a.useState)(!1),C=(0,a.useRef)(null),[I,S]=(0,a.useState)(!1),P=!!h&&h.length>1&&"number"==typeof f&&!!g,R=P&&f>0,L=P&&f<h.length-1,z=P?h.length:0,T=z>0?Math.ceil(z/10):0,E=P?Math.floor(f/10):0,M=10*E,$=Math.min(M+10,z),A=T>1,U=P&&E>0,D=P&&E<T-1;(0,a.useEffect)(()=>{S(!0)},[]),(0,a.useEffect)(()=>{j(1),w({x:0,y:0})},[e]),(0,a.useEffect)(()=>{if(!x)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[x]);let O=(0,a.useCallback)(()=>p(!1),[p]),F=(0,a.useCallback)(()=>{P&&R&&g(f-1)},[P,R,g,f]),_=(0,a.useCallback)(()=>{P&&L&&g(f+1)},[P,L,g,f]),V=(0,a.useCallback)(()=>{P&&U&&g((E-1)*10)},[P,U,g,E]),B=(0,a.useCallback)(()=>{P&&D&&g(Math.min((E+1)*10,z-1))},[P,D,g,E,z]),X=(0,a.useCallback)(()=>{j(e=>Math.min(8,1.25*e))},[]),q=(0,a.useCallback)(()=>{j(e=>{let t=Math.max(.1,e/1.25);return t<=1&&w({x:0,y:0}),t})},[]),W=(0,a.useCallback)(()=>{j(1),w({x:0,y:0})},[]);(0,a.useEffect)(()=>{if(!x)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),O();break;case"ArrowLeft":P&&(e.preventDefault(),F());break;case"ArrowRight":P&&(e.preventDefault(),_());break;case"+":case"=":e.preventDefault(),X();break;case"-":case"_":e.preventDefault(),q();break;case"0":e.preventDefault(),W()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[x,P,O,F,_,X,q,W]);let H=(0,a.useRef)(!1),Y=()=>{k&&N(!1),C.current=null},K=k?"cursor-grabbing":"cursor-grab";if(!x||!I)return null;let G=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":b("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[m,P?` \xb7 ${f+1} / ${h.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${K}`,onClick:e=>{e.target===e.currentTarget&&O()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;j(e=>{let a=Math.min(8,Math.max(.1,e*t));return a<=1&&w({x:0,y:0}),a})},children:e&&(0,t.jsx)("img",{src:e,alt:m,onClick:e=>{e.stopPropagation(),H.current&&(H.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),H.current=!1,e.target.setPointerCapture?.(e.pointerId),C.current={x:e.clientX,y:e.clientY,panX:y.x,panY:y.y},N(!0))},onPointerMove:e=>{if(!C.current)return;let t=e.clientX-C.current.x,a=e.clientY-C.current.y;Math.abs(t)+Math.abs(a)>5&&(H.current=!0),k&&w({x:C.current.panX+t,y:C.current.panY+a})},onPointerUp:Y,onPointerLeave:Y,onPointerCancel:Y,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${y.x}px, ${y.y}px, 0) scale(${v})`,transformOrigin:"center center",transition:k?"none":"transform 120ms ease-out",willChange:k?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[P&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[A&&(0,t.jsx)(u,{onClick:V,title:`${b("assets.lightbox.prev")} (-10)`,"aria-label":`${b("assets.lightbox.prev")} (-10)`,disabled:!U,children:(0,t.jsx)(i.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(u,{onClick:F,title:b("assets.lightbox.prev"),"aria-label":b("assets.lightbox.prev"),disabled:!R,children:(0,t.jsx)(n.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:h.slice(M,$).map((e,a)=>{let s=M+a,r=s===f;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||g(s)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${r?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+s)})}),(0,t.jsx)(u,{onClick:_,title:b("assets.lightbox.next"),"aria-label":b("assets.lightbox.next"),disabled:!L,children:(0,t.jsx)(l.ChevronRight,{className:"h-4 w-4"})}),A&&(0,t.jsx)(u,{onClick:B,title:`${b("assets.lightbox.next")} (+10)`,"aria-label":`${b("assets.lightbox.next")} (+10)`,disabled:!D,children:(0,t.jsx)(o,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*v),"%"]}),(0,t.jsx)(u,{onClick:W,title:b("assets.lightbox.reset"),"aria-label":b("assets.lightbox.reset"),disabled:1===v&&0===y.x&&0===y.y,children:(0,t.jsx)(c.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(u,{onClick:O,title:b("assets.lightbox.close"),"aria-label":b("assets.lightbox.close"),children:(0,t.jsx)(r.X,{className:"h-4 w-4"})})]})]})]});return(0,s.createPortal)(G,document.body)}],235357)},144640,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(400355);e.i(254826);var r=e.i(309735),n=e.i(776639),l=e.i(533499);e.s(["TextPreviewDialog",0,function({url:e,filename:i,open:o,onOpenChange:c}){let{t:d}=(0,l.useI18n)(),[u,m]=(0,a.useState)(null),[x,p]=(0,a.useState)(!1),[h,f]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!o||!e){m(null),f(null);return}let t=!1;return p(!0),f(null),m(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(m(e),p(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?f(d("assets.fileTooLarge")):f(d("assets.previewError")),p(!1))}),()=>{t=!0}},[o,e,d]);let g=i.split(".").pop()?.toLowerCase();return(0,t.jsx)(n.Dialog,{open:o,onOpenChange:c,children:(0,t.jsxs)(n.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:i}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(x)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(s.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:d("assets.loadingPreview")})]});if(h)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:h});if(null===u)return null;if("md"===g)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(r.Streamdown,{children:u})});if("json"===g){let e;try{e=JSON.stringify(JSON.parse(u),null,2)}catch{e=u}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:u})})()})]})})}])},673984,e=>{"use strict";let t=(0,e.i(572989).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],673984)},313029,e=>{"use strict";let t=(0,e.i(572989).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],313029)},213714,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40679167b977a899bb5e92182c20234d20acfa9786",t.callServer,void 0,t.findSourceMapURL,"getVersionsForPicker");e.s(["getVersionsForPicker",0,a])},113627,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(989548),r=e.i(572989);let n=(0,r.default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);var l=e.i(275360),i=e.i(400355),o=e.i(232545),c=e.i(738690);let d=(0,r.default)("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);var u=e.i(313029);let m=(0,r.default)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);var x=e.i(759684),p=e.i(624687),h=e.i(519455),f=e.i(746798),g=e.i(533499),b=e.i(338187),v=e.i(967489),j=e.i(213714);let y="__none__";function w(){let{binding:e,setSessionBinding:s,workspaceTree:r}=(0,b.useAssistant)(),{t:n}=(0,g.useI18n)(),l=r.find(t=>t.id===e.workspaceId),i=l?.projects??[],[o,c]=(0,a.useState)([]);return(0,a.useEffect)(()=>{if(!e.projectId)return void c([]);let t=!1;return(0,j.getVersionsForPicker)(e.projectId).then(e=>{t||c(e)}).catch(()=>{t||c([])}),()=>{t=!0}},[e.projectId]),(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-1.5 border-t border-border bg-sidebar",children:[(0,t.jsxs)(v.Select,{value:e.workspaceId||y,onValueChange:e=>{if(!e||e===y)return void s({});let t=r.find(t=>t.id===e);t&&s({workspaceId:t.id,workspaceName:t.name})},children:[(0,t.jsx)(v.SelectTrigger,{className:"h-7 flex-1 min-w-0 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:e.workspaceName??e.workspaceId??n("assistant.binding.allWorkspaces")})}),(0,t.jsxs)(v.SelectContent,{children:[(0,t.jsx)(v.SelectItem,{value:y,children:n("assistant.binding.allWorkspaces")}),r.map(e=>(0,t.jsx)(v.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)(v.Select,{value:e.projectId||y,onValueChange:t=>{if(!t||t===y)return void s({workspaceId:e.workspaceId,workspaceName:e.workspaceName});let a=i.find(e=>e.id===t);a&&s({workspaceId:e.workspaceId,workspaceName:e.workspaceName,projectId:a.id,projectName:a.name})},disabled:!e.workspaceId,children:[(0,t.jsx)(v.SelectTrigger,{className:"h-7 flex-1 min-w-0 text-xs",disabled:!e.workspaceId,children:(0,t.jsx)("span",{className:"truncate",children:e.projectName??n(e.workspaceId?"assistant.binding.allProjects":"assistant.binding.pickWorkspaceFirst")})}),(0,t.jsxs)(v.SelectContent,{children:[(0,t.jsx)(v.SelectItem,{value:y,children:n("assistant.binding.allProjects")}),i.map(e=>(0,t.jsx)(v.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)(v.Select,{value:e.versionId||y,onValueChange:t=>{if(!t||t===y)return void s({workspaceId:e.workspaceId,workspaceName:e.workspaceName,projectId:e.projectId,projectName:e.projectName});let a=o.find(e=>e.id===t);if(!a)return;let r=a.name?`${a.number} ${a.name}`:a.number;s({workspaceId:e.workspaceId,workspaceName:e.workspaceName,projectId:e.projectId,projectName:e.projectName,versionId:a.id,versionName:r})},disabled:!e.projectId,children:[(0,t.jsx)(v.SelectTrigger,{className:"h-7 flex-1 min-w-0 text-xs",disabled:!e.projectId,children:(0,t.jsx)("span",{className:"truncate",children:e.versionName??n(e.projectId?"assistant.binding.allVersions":"assistant.binding.pickProjectFirst")})}),(0,t.jsxs)(v.SelectContent,{children:[(0,t.jsx)(v.SelectItem,{value:y,children:n("assistant.binding.allVersions")}),o.map(e=>(0,t.jsx)(v.SelectItem,{value:e.id,children:e.name?`${e.number} ${e.name}`:e.number},e.id))]})]})]})}var k=e.i(597746),N=e.i(368490),C=e.i(875840),I=e.i(645378);let S=(0,r.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);var P=e.i(673984);let R=["jpg","jpeg","png","gif","webp"],L=["md","txt","json","csv"],z=[...R,...L].join("|"),T=RegExp(`^\\d{4}-\\d{2}/(images|files)/[^/]+\\.(${z})$`,"i");function E(e){let t=e.replace(/^\./,"").toLowerCase();return R.includes(t)?"image":L.includes(t)?"text":null}let M=[...R.map(e=>`.${e}`),...L.map(e=>`.${e}`),"image/*"].join(",");e.i(254826);var $=e.i(309735);function A({content:e,isStreaming:a}){return(0,t.jsx)($.Streamdown,{className:"text-sm leading-relaxed break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_td]:whitespace-nowrap [&_:not(pre)>code]:whitespace-pre-wrap [&_:not(pre)>code]:break-all",mode:a?"streaming":"static",animated:!0,isAnimating:a,caret:a?"block":void 0,children:e})}function U({text:e,className:s}){let[r,n]=(0,a.useState)(!1),{t:l}=(0,g.useI18n)(),i=async t=>{t.stopPropagation();try{if(navigator.clipboard)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}n(!0),setTimeout(()=>n(!1),1500)}catch{}};return(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:`text-muted-foreground ${s??""}`,"aria-label":l("assistant.copy"),children:r?(0,t.jsx)(k.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(C.Copy,{className:"h-3 w-3"})})}function D({filename:e,onPreview:s}){let{t:r}=(0,g.useI18n)(),[n,l]=(0,a.useState)(!1),i=`/api/internal/cache/${e}`;return n?(0,t.jsx)("div",{className:"size-16 rounded-md bg-muted flex items-center justify-center",title:r("assistant.brokenImage"),children:(0,t.jsx)(S,{className:"size-4 text-muted-foreground"})}):(0,t.jsx)("button",{type:"button",className:"relative size-16 rounded-md overflow-hidden bg-muted shrink-0",onClick:()=>s?.(i),children:(0,t.jsx)("img",{src:i,alt:"",loading:"lazy",className:"size-16 rounded-md object-cover cursor-pointer hover:opacity-80 transition-opacity",onError:()=>l(!0)})})}function O({filename:e,onPreview:a}){let s=`/api/internal/cache/${e}`,r=e.split("/").pop()??e;return(0,t.jsxs)("button",{type:"button",onClick:()=>a?.(s,r),className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-md bg-primary-foreground/10 text-primary-foreground hover:bg-primary-foreground/20 transition-colors max-w-[180px]",title:r,children:[(0,t.jsx)(I.FileText,{className:"size-3.5 shrink-0"}),(0,t.jsx)("span",{className:"text-xs truncate",children:r})]})}function F({content:e,attachmentFilenames:a,onImagePreview:s,onFilePreview:r}){let n=[],l=[];if(a)for(let e of a){let t=function(e){if(!T.test(e))return null;let t=e.lastIndexOf(".");return t<0?null:E(e.slice(t+1))}(e);"image"===t?n.push(e):"text"===t&&l.push(e)}return(0,t.jsxs)("div",{className:"flex justify-end gap-2 animate-in fade-in slide-in-from-bottom-2 duration-200","aria-label":"You",children:[(0,t.jsxs)("div",{className:"bg-primary text-primary-foreground max-w-[80%] rounded-2xl rounded-br-sm px-3 py-2 text-sm whitespace-pre-wrap break-words",children:[n.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",style:{maxWidth:"calc(4 * 64px + 3 * 6px)"},children:n.map(e=>(0,t.jsx)(D,{filename:e,onPreview:s},e))}),l.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:l.map(e=>(0,t.jsx)(O,{filename:e,onPreview:r},e))}),e]}),(0,t.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted mt-1",children:(0,t.jsx)(P.User,{className:"size-3.5 text-muted-foreground"})})]})}function _({content:e,isStreaming:a}){return(0,t.jsxs)("div",{className:"group/bubble flex justify-start gap-2 animate-in fade-in slide-in-from-bottom-2 duration-200","aria-label":"Assistant",children:[(0,t.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-primary/10 mt-1",children:(0,t.jsx)(s.Bot,{className:"size-3.5 text-primary"})}),(0,t.jsxs)("div",{className:"max-w-[85%] min-w-0",children:[(0,t.jsx)("div",{className:"bg-muted text-foreground rounded-2xl rounded-bl-sm px-3 py-2",children:(0,t.jsx)(A,{content:e,isStreaming:a})}),(0,t.jsx)("div",{className:"flex items-center gap-0.5 mt-0.5 opacity-0 group-hover/bubble:opacity-100 transition-opacity",children:(0,t.jsx)(U,{text:e})})]})]})}function V(){let{t:e}=(0,g.useI18n)();return(0,t.jsxs)("div",{className:"flex justify-start gap-2 animate-in fade-in slide-in-from-bottom-2 duration-200",role:"status","aria-live":"polite","aria-label":e("assistant.thinking"),children:[(0,t.jsx)("div",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-primary/10 mt-1",children:(0,t.jsx)(s.Bot,{className:"size-3.5 text-primary"})}),(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground max-w-[200px] rounded-2xl rounded-bl-sm px-3 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"size-1.5 rounded-full bg-primary/60 animate-pulse",style:{animationDelay:"0ms"}}),(0,t.jsx)("span",{className:"size-1.5 rounded-full bg-primary/60 animate-pulse",style:{animationDelay:"150ms"}}),(0,t.jsx)("span",{className:"size-1.5 rounded-full bg-primary/60 animate-pulse",style:{animationDelay:"300ms"}})]})})]})}function B({content:e,toolName:s}){let[r,n]=(0,a.useState)(!1),{t:l}=(0,g.useI18n)(),i=s??l("assistant.toolLabel");return(0,t.jsxs)("div",{className:"group/tool flex justify-start gap-2 animate-in fade-in slide-in-from-bottom-2 duration-200",children:[(0,t.jsx)("div",{className:"size-7 shrink-0"}),(0,t.jsxs)("div",{className:"bg-muted/60 border border-border max-w-[90%] rounded-lg px-3 py-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 w-full text-left py-0.5 cursor-pointer",onClick:()=>n(e=>!e),role:"button","aria-expanded":r,"aria-label":l("assistant.expandTool"),children:[(0,t.jsx)(N.ChevronRight,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0 transition-transform duration-150 ${r?"rotate-90":""}`}),(0,t.jsx)("span",{className:"text-xs font-semibold text-foreground truncate",children:i}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)(U,{text:e,className:"opacity-0 group-hover/tool:opacity-100"}),(0,t.jsx)("span",{className:"bg-muted text-muted-foreground text-[10px] px-1.5 rounded shrink-0",children:l("assistant.toolLabel")})]}),r&&(0,t.jsx)("div",{className:"mt-1 mb-1 rounded-md bg-background/60 border border-border/60 px-2.5 py-1.5",children:(0,t.jsx)("pre",{className:"font-mono text-[12px] leading-relaxed max-h-[240px] overflow-auto whitespace-pre-wrap break-all text-muted-foreground",children:e})})]})]})}function X({message:e,onImagePreview:a,onFilePreview:s}){switch(e.role){case"user":return(0,t.jsx)(F,{content:e.content,attachmentFilenames:e.attachmentFilenames,onImagePreview:a,onFilePreview:s});case"assistant":return(0,t.jsx)(_,{content:e.content,isStreaming:e.isStreaming});case"thinking":return(0,t.jsx)(V,{});case"tool":return(0,t.jsx)(B,{content:e.content,toolName:e.toolName});default:return null}}var q=e.i(938499),W=e.i(657153);function H(e){let t=0;for(let a of e){let e=a.codePointAt(0)??0;e>=12288&&e<=40959||e>=44032&&e<=55215||e>=65280&&e<=65519||e>=131072?t+=2:t+=1}return t}function Y(e,t){let a=0,s="";for(let r of e){let e=H(r);if(a+e>t)break;s+=r,a+=e}return s}function K({pendingAttachments:e,onRemove:a,onPreview:s}){let{t:r}=(0,g.useI18n)(),n=e.filter(e=>"image"===e.kind);return 0===n.length?null:(0,t.jsx)("div",{className:"flex flex-row flex-wrap items-center gap-2 px-3 py-2 border-b border-border/60",children:n.map(e=>(0,t.jsx)(J,{item:e,onRemove:a,onPreview:s,t:r},e.id))})}function G({pendingAttachments:e,onRemove:a,onPreview:s}){let{t:r}=(0,g.useI18n)(),n=e.filter(e=>"text"===e.kind);return 0===n.length?null:(0,t.jsx)("div",{className:"flex flex-row flex-wrap items-center gap-2 px-3 py-2 border-b border-border/60",children:n.map(e=>(0,t.jsx)(Q,{item:e,onRemove:a,onPreview:s,t:r},e.id))})}function J({item:e,onRemove:a,onPreview:s,t:r}){return(0,t.jsxs)("div",{className:"group relative h-9 w-9 shrink-0",children:[(0,t.jsxs)("div",{className:`relative h-full w-full overflow-hidden rounded-md border ${"error"===e.status?"border-destructive":"border-border"} bg-muted`,children:[(0,t.jsx)("button",{type:"button",className:`h-full w-full p-0 border-0 bg-transparent ${"uploading"===e.status?"cursor-wait":"cursor-pointer"}`,disabled:"uploading"===e.status,"aria-label":r("assistant.previewImage"),onClick:()=>s(e),children:e.blobUrl&&(0,t.jsx)("img",{src:e.blobUrl,className:"h-full w-full object-cover",alt:""})}),"uploading"===e.status&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 h-0.5 bg-primary/20",children:(0,t.jsx)("div",{role:"progressbar","aria-valuenow":e.progress,"aria-valuemin":0,"aria-valuemax":100,className:"h-full bg-primary transition-all duration-150",style:{width:`${e.progress}%`}})}),"error"===e.status&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:(0,t.jsx)(q.AlertCircle,{className:"h-3.5 w-3.5 text-white"})})]}),(0,t.jsx)(Z,{item:e,onRemove:a,t:r})]})}function Q({item:e,onRemove:a,onPreview:s,t:r}){let n=function(e,t=22){if(H(e)<=t)return e;let a=e.lastIndexOf("."),s=a>0&&e.length-a<=8,r=s?e.slice(a):"",n=s?e.slice(0,a):e,l=t-H(r)-1;if(l<4)return Y(e,t-1)+"…";let i=Math.ceil(l/2);return Y(n,i)+"…"+function(e,t){let a=Array.from(e),s=0,r="";for(let e=a.length-1;e>=0;e--){let n=H(a[e]);if(s+n>t)break;r=a[e]+r,s+=n}return r}(n,l-i)+r}(e.file.name,22),l="done"===e.status;return(0,t.jsxs)("div",{className:`group relative flex items-center h-7 w-[200px] shrink-0 rounded-md border bg-background overflow-hidden transition-colors ${"error"===e.status?"border-destructive":"border-border hover:bg-accent/40"}`,title:e.file.name,children:[(0,t.jsx)("button",{type:"button",className:"flex h-full w-7 shrink-0 items-center justify-center text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors","aria-label":r("assistant.removeAttachment"),onClick:t=>{t.stopPropagation(),a(e.id)},children:(0,t.jsx)(W.X,{className:"h-3 w-3"})}),(0,t.jsx)("div",{className:"h-4 w-px bg-border shrink-0"}),(0,t.jsx)("button",{type:"button",disabled:!l,onClick:()=>l&&s(e),className:"min-w-0 flex-1 px-2 text-left text-xs text-foreground tabular-nums truncate enabled:cursor-pointer enabled:hover:text-primary",title:e.file.name,children:n}),"uploading"===e.status&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-0.5 overflow-hidden",children:(0,t.jsx)("div",{role:"progressbar","aria-valuenow":e.progress,"aria-valuemin":0,"aria-valuemax":100,className:"h-full bg-primary transition-all duration-150",style:{width:`${e.progress}%`}})}),"error"===e.status&&(0,t.jsx)(q.AlertCircle,{className:"ml-auto mr-2 h-3 w-3 shrink-0 text-destructive"})]})}function Z({item:e,onRemove:a,t:s}){return(0,t.jsx)("button",{type:"button",className:"absolute -top-1.5 -right-1.5 h-4 w-4 rounded-full bg-foreground text-background shadow-sm opacity-0 group-hover:opacity-90 hover:!opacity-100 transition-opacity flex items-center justify-center","aria-label":s("assistant.removeAttachment"),title:"error"===e.status?s("assistant.uploadFailedRemoveHint"):void 0,onClick:t=>{t.stopPropagation(),a(e.id)},children:(0,t.jsx)(W.X,{className:"h-2.5 w-2.5",strokeWidth:3})})}var ee=e.i(235357),et=e.i(144640);e.s(["AssistantChat",0,function(){let[e,r]=(0,a.useState)(""),v=(0,a.useRef)(null),j=(0,a.useRef)(null),y=(0,a.useRef)(null),{t:k}=(0,g.useI18n)(),{chatMessages:N,isChatThinking:C,isLoadingHistory:I,sendChatMessage:S,cancelChat:P,inputFocusSignal:z}=(0,b.useAssistant)(),{pendingAttachments:T,addAttachments:$,removeAttachment:A,clearAll:U,hasUploading:D}=function(){let[e,t]=(0,a.useState)([]),s=(0,a.useRef)(new Map),r=(0,a.useRef)([]);(0,a.useEffect)(()=>{r.current=e},[e]),(0,a.useEffect)(()=>()=>{r.current.forEach(e=>{e.blobUrl&&URL.revokeObjectURL(e.blobUrl)}),s.current.forEach(e=>e.abort()),s.current.clear()},[]);let n=(0,a.useCallback)(e=>{let a=[];for(let t of e){let e=E(function(e){let t=e.name.lastIndexOf(".");return t>=0?e.name.slice(t):""}(t));e&&a.push({id:crypto.randomUUID(),file:t,kind:e,blobUrl:"image"===e?URL.createObjectURL(t):null,status:"uploading",progress:0})}if(0!==a.length)for(let e of(r.current=[...r.current,...a],t(e=>[...e,...a]),a)){let a=new XMLHttpRequest;s.current.set(e.id,a),a.upload.onprogress=a=>{if(a.lengthComputable){let s=Math.round(a.loaded/a.total*100);t(t=>t.map(t=>t.id===e.id?{...t,progress:s}:t))}},a.onload=()=>{if(s.current.delete(e.id),200===a.status)try{let s=JSON.parse(a.responseText),r="string"==typeof s.filename&&s.filename?s.filename:null;if(!r)throw Error("Invalid upload response");t(t=>t.map(t=>t.id===e.id?{...t,status:"done",progress:100,filename:r}:t))}catch{t(t=>t.map(t=>t.id===e.id?{...t,status:"error"}:t))}else t(t=>t.map(t=>t.id===e.id?{...t,status:"error"}:t))},a.onerror=()=>{s.current.delete(e.id),t(t=>t.map(t=>t.id===e.id?{...t,status:"error"}:t))};let r=new FormData;r.append("file",e.file),a.open("POST","/api/internal/assistant/attachments"),a.send(r)}},[]),l=(0,a.useCallback)(e=>{let a=s.current.get(e);a&&(a.abort(),s.current.delete(e)),t(t=>{let a=t.find(t=>t.id===e);return a?.blobUrl&&URL.revokeObjectURL(a.blobUrl),t.filter(t=>t.id!==e)})},[]),i=(0,a.useCallback)(()=>{t(e=>(e.forEach(e=>{let t=s.current.get(e.id);t&&(t.abort(),s.current.delete(e.id)),e.blobUrl&&URL.revokeObjectURL(e.blobUrl)}),s.current.clear(),[]))},[]),o=e.some(e=>"uploading"===e.status);return{pendingAttachments:e,addAttachments:n,removeAttachment:l,clearAll:i,hasUploading:o}}(),[O,F]=(0,a.useState)(null),[_,V]=(0,a.useState)(null),[B,q]=(0,a.useState)(null);(0,a.useEffect)(()=>{v.current?.focus()},[]),(0,a.useEffect)(()=>{z>0&&v.current?.focus()},[z]),(0,a.useEffect)(()=>{let e=v.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,160)}px`)},[e]);let W=(0,a.useRef)(!1),H=(0,a.useRef)(!1),Y=N[N.length-1]?.content.length??0;(0,a.useEffect)(()=>{let e=!H.current;H.current=!0;let t=e||I||W.current?"instant":"smooth";W.current=I,y.current?.scrollIntoView({behavior:t})},[N.length,Y,I]);let J=10-T.length,[Q,Z]=(0,a.useState)(!1),ea=(0,a.useCallback)(e=>{let t=e.lastIndexOf(".");return null!==E(t>=0?e.slice(t):"")},[]),es=(0,a.useCallback)(e=>{if(0===e.length||J<=0)return;let t=e.filter(e=>{let t=e.name.lastIndexOf(".");return null!==E(t>=0?e.name.slice(t):"")}).slice(0,J);t.length>0&&$(t)},[$,J]),er=(0,a.useCallback)(e=>{let t=Array.from(e.clipboardData.items),a=[];for(let e of t){if("file"!==e.kind)continue;let t=e.getAsFile();t&&(e.type.startsWith("image/")||ea(t.name))&&a.push(t)}a.length>0&&es(a)},[es,ea]),en=(0,a.useCallback)(e=>{let t=e.target.files?Array.from(e.target.files):[];t.length>0&&es(t),j.current&&(j.current.value="")},[es]),el=(0,a.useRef)(0),ei=(0,a.useCallback)(e=>{Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),el.current+=1,Z(!0))},[]),eo=(0,a.useCallback)(e=>{Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},[]),ec=(0,a.useCallback)(e=>{Array.from(e.dataTransfer.types).includes("Files")&&(el.current=Math.max(0,el.current-1),0===el.current&&Z(!1))},[]),ed=(0,a.useCallback)(e=>{if(!Array.from(e.dataTransfer.types).includes("Files"))return;e.preventDefault(),el.current=0,Z(!1);let t=Array.from(e.dataTransfer.files).filter(e=>ea(e.name));t.length>0&&es(t)},[ea,es]),eu=()=>{let t=e.trim(),a=T.filter(e=>"done"===e.status).map(e=>e.filename);!t&&0===a.length||C||D||(S(t,{attachmentFilenames:a}),r(""),U(),v.current?.focus())},em=()=>{let e=P();e&&r(e),v.current?.focus()},ex=T.some(e=>"done"===e.status),ep=!e.trim()&&!ex||C||D;return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsx)(x.ScrollArea,{className:"flex-1 overflow-hidden",children:(0,t.jsxs)("div",{className:`flex flex-col gap-3 p-4 min-h-full ${I||0===N.length?"justify-center":""}`,role:"log","aria-live":"polite",children:[I?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,t.jsx)(i.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:k("assistant.loading")})]}):0===N.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 px-6",children:[(0,t.jsx)(s.Bot,{className:"size-8 text-muted-foreground/40"}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:k("assistant.emptyTitle")}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-2 w-full max-w-[280px]",children:[{icon:l.FolderPlus,label:k("assistant.suggestion.createProject")},{icon:n,label:k("assistant.suggestion.createTask")},{icon:c.Search,label:k("assistant.suggestion.checkProgress")},{icon:m,label:k("assistant.suggestion.dailySummary")}].map(({icon:e,label:a})=>(0,t.jsxs)(h.Button,{variant:"outline",className:"flex items-center gap-2 rounded-lg px-3 py-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground text-left justify-start h-auto",onClick:()=>{r(a),v.current?.focus()},children:[(0,t.jsx)(e,{className:"size-3.5 shrink-0"}),a]},a))})]}):N.map(e=>(0,t.jsx)(X,{message:e,onImagePreview:e=>V(e),onFilePreview:(e,t)=>q({url:e,filename:t})},e.id)),(0,t.jsx)("div",{ref:y})]})}),(0,t.jsxs)("div",{className:`relative bg-sidebar transition-colors ${T.length>0?"border-t border-border/60":""} ${Q?"ring-3 ring-inset ring-primary/40":""}`,onDragEnter:ei,onDragOver:eo,onDragLeave:ec,onDrop:ed,children:[Q&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-primary/10 text-xs font-medium text-primary",children:k("assistant.dropToUpload")}),(0,t.jsx)(K,{pendingAttachments:T,onRemove:A,onPreview:e=>F(e)}),(0,t.jsx)(G,{pendingAttachments:T,onRemove:A,onPreview:e=>{e.filename&&q({url:`/api/internal/cache/${e.filename}`,filename:e.file.name})}}),(0,t.jsx)(w,{}),(0,t.jsx)(p.Textarea,{ref:v,"data-assistant-input":!0,value:e,onChange:e=>r(e.target.value),onKeyDown:e=>{!e.nativeEvent.isComposing&&("Enter"!==e.key||e.shiftKey||(e.preventDefault(),eu()),"Escape"===e.key&&C&&(e.preventDefault(),em()))},onPaste:er,placeholder:k("assistant.inputPlaceholder"),className:"!field-sizing-fixed min-h-[72px] max-h-[160px] w-full resize-none rounded-none border-0 focus-visible:ring-0 focus-visible:border-0 bg-transparent dark:bg-transparent px-4 pt-3 text-sm",rows:3}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 pb-2 pt-1",children:[(0,t.jsx)("input",{ref:j,type:"file",accept:M,multiple:!0,hidden:!0,onChange:en}),(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{onClick:()=>j.current?.click(),disabled:J<=0,"aria-label":k("assistant.addAttachment"),className:"inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40 disabled:pointer-events-none transition-colors",children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(f.TooltipContent,{side:"top",align:"start",className:"max-w-xs",children:J<=0?(0,t.jsx)("span",{className:"text-xs",children:k("assistant.attachmentLimitReached")}):(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:k("assistant.addAttachment")}),(0,t.jsxs)("div",{className:"opacity-80",children:[(0,t.jsxs)("span",{children:[k("assistant.attachmentTypeImages"),": "]}),(0,t.jsx)("span",{className:"font-mono",children:R.map(e=>`.${e}`).join(" ")})]}),(0,t.jsxs)("div",{className:"opacity-80",children:[(0,t.jsxs)("span",{children:[k("assistant.attachmentTypeText"),": "]}),(0,t.jsx)("span",{className:"font-mono",children:L.map(e=>`.${e}`).join(" ")})]})]})})]}),C?(0,t.jsx)(h.Button,{variant:"outline",size:"icon",className:"h-7 w-7 border-destructive/50 text-destructive transition-colors hover:bg-destructive/20 hover:text-destructive hover:border-destructive",onClick:em,"aria-label":k("assistant.cancelLabel"),children:(0,t.jsx)(u.Square,{className:"h-3 w-3 fill-current"})}):(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground transition-colors hover:bg-primary/10 hover:text-primary",onClick:eu,disabled:ep,"aria-label":k("assistant.sendLabel"),children:(0,t.jsx)(d,{className:"h-4 w-4"})})]})]}),(0,t.jsx)(ee.ImageLightbox,{imageUrl:O?.blobUrl??null,filename:O?.filename??"",open:null!==O&&"image"===O.kind,onOpenChange:e=>{e||F(null)}}),(0,t.jsx)(ee.ImageLightbox,{imageUrl:_,filename:_?.split("/").pop()?.split("?")[0]??"",open:null!==_,onOpenChange:e=>{e||V(null)}}),(0,t.jsx)(et.TextPreviewDialog,{url:B?.url??null,filename:B?.filename??"",open:null!==B,onOpenChange:e=>{e||q(null)}})]})}],113627)},103363,e=>{e.n(e.i(113627))},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)))}]);
|