tower-studio 0.2.45 → 0.2.46
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/app-path-routes-manifest.json +1 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +8 -0
- package/.next/standalone/.next/server/app/_global-error/page.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- 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 +129 -81
- package/.next/standalone/.next/server/app/_not-found/page.js +7 -8
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/adapters/test/route.js +2 -2
- package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js +2 -4
- package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +2 -2
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/route.js +5 -4
- package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +3 -5
- package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/harness/ask/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/harness/notify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/harness/pending/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/harness/reply/route.js +4 -4
- package/.next/standalone/.next/server/app/api/internal/harness/reply/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js +4 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +4 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js +4 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +5 -3
- 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 +152 -104
- package/.next/standalone/.next/server/app/harness/page.js +7 -8
- 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 -2
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +246 -162
- package/.next/standalone/.next/server/app/missions/page.js +10 -10
- 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 +129 -81
- package/.next/standalone/.next/server/app/onboarding/page.js +7 -8
- 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 +129 -81
- package/.next/standalone/.next/server/app/page.js +7 -8
- 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 +225 -141
- package/.next/standalone/.next/server/app/settings/page.js +9 -11
- 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 +258 -222
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +8 -9
- 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 +231 -195
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +8 -9
- 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/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/build-manifest.json +18 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/react-loadable-manifest.json +18 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/server-reference-manifest.json +401 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js +24 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page_client-reference-manifest.js +3 -0
- 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 +216 -180
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +8 -9
- 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 +243 -195
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +9 -11
- 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 +129 -81
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +8 -9
- 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 +215 -167
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +8 -9
- 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 +269 -221
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +10 -12
- 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 +159 -123
- package/.next/standalone/.next/server/app/workspaces/page.js +7 -8
- 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/app-paths-manifest.json +1 -0
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_09ikw5j.js +5 -0
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +9 -5
- 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]__0-1~xqo._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.3n3t.._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.wsvr6._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0y3adwk._.js → [root-of-the-server]__0.yf1mx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0o6i1wy._.js → [root-of-the-server]__00xe-t8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0vh3112._.js → [root-of-the-server]__02yvm55._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__09arklv._.js → [root-of-the-server]__04-ty51._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0v98a~t._.js → [root-of-the-server]__065hi6e._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0k9rz_z._.js → [root-of-the-server]__06iuq17._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06x1zwj._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06~wmlx._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__092475e._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0atap--._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c3je91._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dz.knv._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ehwsa1._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esywxf._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fd9z.r._.js +30 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gcg7i.._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iyp~.k._.js +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__07xsu6m._.js → [root-of-the-server]__0j7565a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kkrbn-._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0m8t3vi._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nv83.p._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0squ613._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u8tl88._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wugb-9._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yeg1kp._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zchqv1._.js +43 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_~s0z4._.js → [root-of-the-server]__0zcy11y._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~1-i5h._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~ju4-d._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10qclz-._.js +3 -0
- package/.next/standalone/.next/server/chunks/_02hac5p._.js +25 -2
- package/.next/standalone/.next/server/chunks/_0_w835g._.js +4 -0
- package/.next/standalone/.next/server/chunks/_0je3dz2._.js +25 -2
- package/.next/standalone/.next/server/chunks/_0tidm8l._.js +25 -2
- package/.next/standalone/.next/server/chunks/_0zok2an._.js +25 -2
- package/.next/standalone/.next/server/chunks/src_05balzk._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0aygchu._.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 +3 -0
- 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/src_lib_0d~1~wz._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_0ylel_1._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_config-defaults_ts_10ayktg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_0i5qmqd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0se9_next_dist_esm_build_templates_app-page_04~dhws.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{0ws9_lucide-react_dist_esm_icons_0r~ty--._.js → 0ws9_lucide-react_dist_esm_icons_0gv_cwy._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-geq20._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__051tpij._.js → [root-of-the-server]__0.0m12b._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__096w7g2._.js → [root-of-the-server]__00qzvly._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01bz3_g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~hdzx._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0lau3k_._.js → [root-of-the-server]__06sew6r._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dmjt7o._.js → [root-of-the-server]__07rk6ic._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090y_.y._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b.ej5q._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0fl0l82._.js → [root-of-the-server]__0b6fbjv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0tb.1li._.js → [root-of-the-server]__0b6hugs._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vi-5xg._.js → [root-of-the-server]__0br5e7w._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bx_h2u._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dfqa5a._.js → [root-of-the-server]__0dhq_gl._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e79g0v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0g2wrd2._.js → [root-of-the-server]__0esg88l._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h_pt4a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ixgha6._.js → [root-of-the-server]__0hzwoy5._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0iaw1ms._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0idkp76._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4m.1s._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kmonje._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0i0k_zi._.js → [root-of-the-server]__0kqp70x._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l0~scn._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lh3mlq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~s8otw._.js → [root-of-the-server]__0m8m7vc._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0muf4wq._.js +49 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dv.-zu._.js → [root-of-the-server]__0n02kfa._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n3uc.v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o5ohqy._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ydiu_y._.js → [root-of-the-server]__0s_q09t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s~4y3y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0s~ak20._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta_mpj._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0t_zq~v._.js → [root-of-the-server]__0trmndk._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__08etd~v._.js → [root-of-the-server]__0u3~-.g._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vyl8to._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ws0_c1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x7br99._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xnuz05._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zsnp~d._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__06s-_gx._.js → [root-of-the-server]__0~edc3d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~mhv4m._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1013v_g._.js +47 -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]__123rmn-._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0o9jkew._.js → [root-of-the-server]__12viys4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0-5.hgb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0dye20y._.js → _0-wp_zu._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0..h3hk._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_08bq4g8._.js → _00_h2nx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_02p-udo._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_05~lqg-._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_0771b4a._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{_078cdw~._.js → _0ak77.u._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0ljrvyt._.js → _0ami9yt._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_12la163._.js → _0awn2mm._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_09rq08e._.js → _0b660g4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0~6pqk.._.js → _0czsddm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0fmko25._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0gomvsp._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0g~p9_x._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hg~.4w._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hsuip_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0hx2o_8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0xnn~jq._.js → _0j7m~u6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_13_b8hh._.js → _0l6byg1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0mmy~98._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0nrxhfb._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_0o_c3b2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0os43sb._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0h0b46r._.js → _0p5ft59._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0q2pep_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_01fdzzv._.js → _0snv7nt._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0ty4xe6._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/_0vkl7.h._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0x09t_o._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_0z5~opf._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0zn.4bi._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/_1086w4p._.js +47 -0
- package/.next/standalone/.next/server/chunks/ssr/{_09z-55_._.js → _10q2mbe._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_11.knhq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1118hto._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0ytcm0j._.js → _12s8n8g._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_11j0qlp._.js +3 -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 +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0bndp1~._.js → src_components_ui_popover_tsx_0a78wqo._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_04y-65j._.js → src_lib_04nzvfd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_03xtona._.js → src_lib_0_px2pz._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0a.zy31._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0b73q0a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0cld9rt._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0-x.wbd._.js → src_lib_0dbf2qa._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0er7rzd._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0f0v8_~._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fr6fzy._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_00p-ir2._.js → src_lib_0h2u7a0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0k04rl3._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0lpxsj~._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sq6aqm._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ui-~7g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0y5zzg-._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0z-gn78._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_13c4a4g._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_pty_11~ojr2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_pty_orphan-reaper_ts_0a0qmlo._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0ng0eku._.js → src_lib_schemas_ts_0ph~1ak._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
- package/.next/standalone/.next/server/functions-config-manifest.json +1 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.json +4 -0
- 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 +2174 -1586
- package/.next/standalone/.next/static/chunks/0-kkc.ibted8y.js +1 -0
- package/.next/standalone/.next/static/chunks/0.2y9uc38xso-.js +1 -0
- package/.next/standalone/.next/static/chunks/{0c4-6qdhi645s.js → 0.gedys.tq.~k.js} +1 -1
- package/.next/standalone/.next/static/chunks/00g58.es_hxli.js +1 -0
- package/.next/standalone/.next/static/chunks/00o_eiv12t~.1.js +1 -0
- package/.next/standalone/.next/static/chunks/01qtgj0xv1fsm.js +2 -0
- package/.next/standalone/.next/static/chunks/024euw7po0d0w.js +1 -0
- package/.next/standalone/.next/static/chunks/02v-9v~885t9c.js +1 -0
- package/.next/standalone/.next/static/chunks/03ct4d8znb7tp.js +1 -0
- package/.next/standalone/.next/static/chunks/03uix~1ru.ovv.js +1 -0
- package/.next/standalone/.next/static/chunks/04.2m8l~ws19v.js +1 -0
- package/.next/standalone/.next/static/chunks/{0bvhkgitn__gl.js → 06x7oq8_iu~9d.js} +1 -1
- package/.next/standalone/.next/static/chunks/07c4b1kp_85qg.js +1 -0
- package/.next/standalone/.next/static/chunks/07qijq9o5jccu.js +1 -0
- package/.next/standalone/.next/static/chunks/{09bezwcb__18t.js → 09om2gfwimh7k.js} +1 -1
- package/.next/standalone/.next/static/chunks/0alhq.h4~iogi.js +1 -0
- package/.next/standalone/.next/static/chunks/{02xqrfqu.s8-i.js → 0cf7e1scao3zk.js} +1 -1
- package/.next/standalone/.next/static/chunks/0ck~sr0nkabl~.js +1 -0
- package/.next/standalone/.next/static/chunks/0d1ok-v-u-xe~.js +1 -0
- package/.next/standalone/.next/static/chunks/0d9u2xspag~4h.js +5 -0
- package/.next/standalone/.next/static/chunks/0ftptcpntzaux.js +1 -0
- package/.next/standalone/.next/static/chunks/0gk~m5bwgoafi.js +1 -0
- package/.next/standalone/.next/static/chunks/0in_7s8n4lmfr.js +1 -0
- package/.next/standalone/.next/static/chunks/0ix28r65.7o_r.js +12 -0
- package/.next/standalone/.next/static/chunks/{0c.t.evwah_m4.js → 0j5olwb~d3~3j.js} +1 -1
- package/.next/standalone/.next/static/chunks/0mtrtl-jl46in.js +2 -0
- package/.next/standalone/.next/static/chunks/0ov_akpudbv96.js +5 -0
- package/.next/standalone/.next/static/chunks/0oyskd~8~j.j7.js +1 -0
- package/.next/standalone/.next/static/chunks/0q1872yhybt55.js +1 -0
- package/.next/standalone/.next/static/chunks/0seo-lerjdkbn.js +1 -0
- package/.next/standalone/.next/static/chunks/0t1awv68pnn-e.js +1 -0
- package/.next/standalone/.next/static/chunks/0wl8cpmvyhv0l.js +1 -0
- package/.next/standalone/.next/static/chunks/0~2l3wz-gxs2j.js +1 -0
- package/.next/standalone/.next/static/chunks/0~7h_a_dofg-4.js +1 -0
- package/.next/standalone/.next/static/chunks/11yhe31en~dvt.js +1 -0
- package/.next/standalone/.next/static/chunks/12-mlz2vukuga.js +1 -0
- package/.next/standalone/.next/static/chunks/14fch6~swodjf.css +1 -0
- package/.next/standalone/.next/static/chunks/15gztq9f12uhe.js +1 -0
- package/.next/standalone/.next/static/chunks/15ue90qe1sh-9.js +1 -0
- package/.next/standalone/.next/static/chunks/17z9uivez~kp3.js +1 -0
- package/.next/standalone/package.json +1 -2
- package/dist/mcp-server.cjs +1199 -4330
- package/package.json +1 -2
- package/prisma/schema.prisma +46 -5
- package/scripts/migrations/0006-project-knowledge.ts +58 -0
- package/scripts/migrations/0007-product-group.ts +67 -0
- package/skills/tower/SKILL.md +22 -92
- package/skills/tower/references/task-source.md +80 -0
- package/.next/standalone/.next/server/chunks/[externals]__0x_wqa7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__034jopu._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08-s.nv._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__098.3z2._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ehx6q.._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iggiij._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pmamzv._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pzyjqf._.js +0 -20
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0tplo5s._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0tpzojh._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xasom7._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xy1t4x._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y~y6sh._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10jnn26._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__116v_bx._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__119rbly._.js +0 -3
- package/.next/standalone/.next/server/chunks/_0qk_esg._.js +0 -4
- package/.next/standalone/.next/server/chunks/_0t31z6q._.js +0 -5
- package/.next/standalone/.next/server/chunks/src_0aqjfcv._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_lib_0nw5n~t._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.q~~2p._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01zrinc._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03x8axh._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06t.cx~._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0__klx0._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ccy_gg._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cjmeyl._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dx9sp-._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0f57j8r._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j1dx6p._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kn~asi._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0m.hayd._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mpjat-._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0sg4fde._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w24qox._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wq~4aj._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yihqy6._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zouyfp._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1184s~q._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0.iq8t8._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_00.myc6._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_00eymu8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_03-we0p._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_04szgc6._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0kd_tda._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0ktexki._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0lo1nei._.js +0 -6
- package/.next/standalone/.next/server/chunks/ssr/_0mdd702._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0n0q6~9._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0pab_al._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0pg6-.y._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0pvp63a._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0qi4x-5._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0qnobd-._.js +0 -43
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0ts~td3._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0y0_4zs._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0yva1-.._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0yz5dmq._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_11w13--._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_09eeb85._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_0vv366l._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_03x1i~1._.js +0 -5
- package/.next/standalone/.next/server/chunks/ssr/src_lib_08gthaz._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_090~6pq._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0k8dkbn._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0knbpxk._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0p_iehl._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0qve1ri._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0s35u~4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0x2ui80._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ypc5_d._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_10jh2mz._.js +0 -3
- package/.next/standalone/.next/static/chunks/0-nppzqp-r.9c.js +0 -1
- package/.next/standalone/.next/static/chunks/0-te2tg6~a23u.js +0 -1
- package/.next/standalone/.next/static/chunks/0.64.6c1mh7d2.js +0 -1
- package/.next/standalone/.next/static/chunks/0.8n1ce9lggg4.js +0 -1
- package/.next/standalone/.next/static/chunks/0.nsmn6shzidu.js +0 -2
- package/.next/standalone/.next/static/chunks/0.zgqz~m3sjej.js +0 -1
- package/.next/standalone/.next/static/chunks/00.eotegra08r.js +0 -1
- package/.next/standalone/.next/static/chunks/01j9m895w64zn.js +0 -1
- package/.next/standalone/.next/static/chunks/03y272e6e9o8i.js +0 -1
- package/.next/standalone/.next/static/chunks/08eyd7sq064r0.js +0 -1
- package/.next/standalone/.next/static/chunks/09b33znj4m__c.js +0 -1
- package/.next/standalone/.next/static/chunks/0d0zm8viq3ol4.js +0 -12
- package/.next/standalone/.next/static/chunks/0dktl5t_dtxu..js +0 -1
- package/.next/standalone/.next/static/chunks/0e5~nzt657k92.js +0 -1
- package/.next/standalone/.next/static/chunks/0erwxvpb9w29_.js +0 -1
- package/.next/standalone/.next/static/chunks/0gf~0e3xpa0fj.js +0 -5
- package/.next/standalone/.next/static/chunks/0gy79dfi~lnig.js +0 -1
- package/.next/standalone/.next/static/chunks/0gz3xwb5_8xwv.js +0 -1
- package/.next/standalone/.next/static/chunks/0i75~pu.bp20..js +0 -1
- package/.next/standalone/.next/static/chunks/0jn_w5b9r~beu.js +0 -1
- package/.next/standalone/.next/static/chunks/0l59z2mf1ouxu.js +0 -1
- package/.next/standalone/.next/static/chunks/0m4xd-ie7j.hx.js +0 -1
- package/.next/standalone/.next/static/chunks/0mx9ebe6we4z0.js +0 -1
- package/.next/standalone/.next/static/chunks/0nsggimu5je3g.js +0 -1
- package/.next/standalone/.next/static/chunks/0nw8nx8kafy79.js +0 -1
- package/.next/standalone/.next/static/chunks/0pzjryav9pm7p.js +0 -1
- package/.next/standalone/.next/static/chunks/0q-rl50zskr35.js +0 -1
- package/.next/standalone/.next/static/chunks/0qqy2x-fsmmmx.js +0 -1
- package/.next/standalone/.next/static/chunks/0t59wpux0g1~l.js +0 -1
- package/.next/standalone/.next/static/chunks/0uezq8wiwkq8d.js +0 -1
- package/.next/standalone/.next/static/chunks/0vrc~7m1_cuvl.js +0 -1
- package/.next/standalone/.next/static/chunks/0xbh24-hxrt~m.css +0 -1
- package/.next/standalone/.next/static/chunks/0xkkmruo8p.l_.js +0 -1
- package/.next/standalone/.next/static/chunks/0xx0pe_j2kmr9.js +0 -2
- package/.next/standalone/.next/static/chunks/0zqjqiqmorenw.js +0 -5
- package/.next/standalone/.next/static/chunks/136l78utn~v08.js +0 -1
- package/.next/standalone/.next/static/chunks/171x9kw9wcyk4.js +0 -1
- package/.next/standalone/.next/static/chunks/17m4o~gdsvuo3.js +0 -1
- package/next.config.ts +0 -18
- /package/.next/standalone/.next/static/{f1860bJqnbYj-1WLMj7F- → Pf_z-PYy0CJhvcyPEi-LM}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{f1860bJqnbYj-1WLMj7F- → Pf_z-PYy0CJhvcyPEi-LM}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{f1860bJqnbYj-1WLMj7F- → Pf_z-PYy0CJhvcyPEi-LM}/_ssgManifest.js +0 -0
|
@@ -63,4 +63,4 @@ out vec4 outColor;
|
|
|
63
63
|
|
|
64
64
|
void main() {
|
|
65
65
|
outColor = v_color;
|
|
66
|
-
}`,tu=8*Float32Array.BYTES_PER_ELEMENT,t_=class{constructor(){this.attributes=new Float32Array(160),this.count=0}},tf=0,tg=0,tv=0,tp=0,tm=0,tx=0,tw=0,tC=class extends R{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new t_,this._verticesCursor=new t_;let r=this._gl;this._program=ee(e7(r,tc,td)),this._register(S(()=>r.deleteProgram(this._program))),this._projectionLocation=ee(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(S(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(S(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=ee(r.createBuffer()),this._register(S(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,tu,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,tu,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,tu,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,e6),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,h,l,c,d,u,_,f;for(r=0;r<t.rows;r++){for(o=-1,a=0,h=0,l=!1,n=0;n<t.cols;n++)c=(r*t.cols+n)*4,d=e.cells[c+1],_=!!(0x4000000&(u=e.cells[c+2])),(d!==a||u!==h&&(l||_))&&((0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,n,r)),o=n,a=d,h=u,l=_);(0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||"block"===i.style){t.count=0;return}let s,r=0;("bar"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,"bar"===i.style?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),("underline"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),"outline"===i.style&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=8*r++,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(0x4000000&i)switch(0x3000000&i){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&i].rgba;break;case 0x3000000:tf=(0xffffff&i)<<8;break;default:tf=this._themeService.colors.foreground.rgba}else switch(0x3000000&s){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&s].rgba;break;case 0x3000000:tf=(0xffffff&s)<<8;break;default:tf=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=function(e,t){let i=new Float32Array(Math.min(2*e.length,t));for(let t=0;t<e.length;t++)i[t]=e[t];return i}(e.attributes,this._terminal.rows*this._terminal.cols*8)),tg=r*this._dimensions.device.cell.width,tv=o*this._dimensions.device.cell.height,tp=(tf>>24&255)/255,tm=(tf>>16&255)/255,tx=(tf>>8&255)/255,tw=1,this._addRectangle(e.attributes,t,tg,tv,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,tp,tm,tx,tw)}_addRectangle(e,t,i,s,r,n,o,a,h,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=h,e[t+7]=l}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}},tb=class extends R{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(S(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ee(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=e1(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=ep,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},tL=class extends tb{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(s.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){var t;if(257===e.fg?this._ctx.fillStyle=this._themeService.colors.background.css:void 0!==e.fg&&((0x3000000&(t=e.fg))==0x1000000||(0x3000000&t)==0x2000000)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},ty="object"==typeof window?window:globalThis,tM=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new eV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new eV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(i,e),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToFullScreen.set(i,e),this._onDidChangeFullscreen.fire(i)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};tM.INSTANCE=new tM,tM.INSTANCE.onDidChangeZoomLevel,tM.INSTANCE.onDidChangeFullscreen;var tS="object"==typeof navigator?navigator.userAgent:"";tS.indexOf("Firefox"),tS.indexOf("AppleWebKit"),tS.indexOf("Chrome")>=0||tS.indexOf("Safari"),tS.indexOf("Electron/"),tS.indexOf("Android");var tA=!1;if("function"==typeof ty.matchMedia){let e=ty.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ty.matchMedia("(display-mode: fullscreen)");tA=e.matches,tR=e,"string"==typeof tR&&(tR=ty.matchMedia(tR)),tR.addEventListener("change",({matches:e})=>{tA&&t.matches||(tA=e)})}var tR,tT,tk,tE=!1,tB=!1,tP="en",t$=globalThis;"u">typeof t$.vscode&&"u">typeof t$.vscode.process?tk=t$.vscode.process:"u">typeof _.default&&"string"==typeof _.default?.versions?.node&&(tk=_.default);var tD="string"==typeof tk?.versions?.electron&&tk?.type==="renderer";if("object"==typeof tk){tk.platform,tk.platform,"linux"===tk.platform&&tk.env.SNAP&&tk.env.SNAP_REVISION,tk.env.CI||tk.env.BUILD_ARTIFACTSTAGINGDIRECTORY,tP="en";let e=tk.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,tP=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}tE=!0}else"object"!=typeof navigator||tD?console.error("Unable to resolve platform."):((tT=navigator.userAgent).indexOf("Windows"),tT.indexOf("Macintosh"),(tT.indexOf("Macintosh")>=0||tT.indexOf("iPad")>=0||tT.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,tT.indexOf("Linux"),tT?.indexOf("Mobi"),tB=!0,tP=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());var tF=tE;tB&&"function"==typeof t$.importScripts&&t$.origin;var tW,tI=tT,tO=tP;(tY=tW||={}).value=function(){return tO},tY.isDefaultVariant=function(){return 2===tO.length?"en"===tO:tO.length>=3&&"e"===tO[0]&&"n"===tO[1]&&"-"===tO[2]},tY.isDefault=function(){return"en"===tO};var tz="function"==typeof t$.postMessage&&!t$.importScripts,tU=(()=>{if(tz){let e=[];t$.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),t$.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),tN=!!(tI&&tI.indexOf("Chrome")>=0);tI&&tI.indexOf("Firefox"),!tN&&tI&&tI.indexOf("Safari"),tI&&tI.indexOf("Edg/"),tI&&tI.indexOf("Android");var tq="object"==typeof navigator?navigator:{};tF||document.queryCommandSupported&&document.queryCommandSupported("copy")||tq&&tq.clipboard&&tq.clipboard.writeText,tF||tq&&tq.clipboard&&tq.clipboard.readText,tF||tA||tq.keyboard,"ontouchstart"in ty||tq.maxTouchPoints,ty.PointerEvent&&("ontouchstart"in ty||navigator.maxTouchPoints);var tG=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},tH=new tG,tj=new tG,tV=new tG;(tX=tZ||={}).toString=function(e){return tH.keyCodeToStr(e)},tX.fromString=function(e){return tH.strToKeyCode(e)},tX.toUserSettingsUS=function(e){return tj.keyCodeToStr(e)},tX.toUserSettingsGeneral=function(e){return tV.keyCodeToStr(e)},tX.fromUserSettings=function(e){return tj.strToKeyCode(e)||tV.strToKeyCode(e)},tX.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return tH.keyCodeToStr(e)};var tY,tX,tZ,tQ,tK=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(o=tQ||={}).isCancellationToken=function(e){return e===o.None||e===o.Cancelled||e instanceof tJ||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eO.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tK});var tJ=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tK:(this._emitter||(this._emitter=new eV),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};Symbol("MicrotaskDelay"),(a=h||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},a.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var t0=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new eV,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await eO.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};t0.EMPTY=t0.fromArray([]);function t5(e,t){return(t<<5)-t+e|0}function t1(e,t){t=t5(149417,t);for(let i=0,s=e.length;i<s;i++)t=t5(e.charCodeAt(i),t);return t}new DataView(new ArrayBuffer(320));var{registerWindow:t2,getWindow:t3,getDocument:t4,getWindows:t8,getWindowsCount:t6,getWindowId:t7,getWindowById:t9,hasWindow:ie,onDidRegisterWindow:it,onWillUnregisterWindow:ii,onDidUnregisterWindow:is}=(t=new Map,i={window:ty,disposables:new A},t.set(ty.vscodeWindowId,i),s=new eV,r=new eV,n=new eV,{onDidRegisterWindow:s.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:r.event,registerWindow(e){var i,o;if(t.has(e.vscodeWindowId))return R.None;let a=new A,h={window:e,disposables:a.add(new A)};return t.set(e.vscodeWindowId,h),a.add(S(()=>{t.delete(e.vscodeWindowId),r.fire(e)})),a.add((i=e,o=ia.BEFORE_UNLOAD,new ir(i,o,()=>{n.fire(e)},void 0))),s.fire(h),a},getWindows:()=>t.values(),getWindowsCount:()=>t.size,getWindowId:e=>e.vscodeWindowId,hasWindow:e=>t.has(e),getWindowById:function(e,s){return("number"==typeof e?t.get(e):void 0)??(s?i:void 0)},getWindow:e=>e?.ownerDocument?.defaultView?e.ownerDocument.defaultView.window:e?.view?e.view.window:ty,getDocument:e=>t3(e).document}),ir=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}},io=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new e(t,i):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t||!!e&&!!t&&e.width===t.width&&e.height===t.height}};io.None=new io(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=function e(t,i){switch(typeof t){case"object":var s,r,n,o;return null===t?t5(349,i):Array.isArray(t)?(s=t,r=t5(104579,r=i),s.reduce((t,i)=>e(i,t),r)):(n=t,o=t5(181387,o=i),Object.keys(n).sort().reduce((t,i)=>(t=t1(i,t),e(n[i],t)),o));case"string":return t1(t,i);case"boolean":return t5(t?433:863,i);case"number":return t5(t,i);case"undefined":return t5(937,i);default:return t5(617,i)}}(i,0),n=s.get(r);if(n)n.users+=1;else{let o=new eV,a=new MutationObserver(e=>o.fire(e));a.observe(e,i);let h=n={users:1,observer:a,onDidMutate:o.event};t.add(S(()=>{h.users-=1,0===h.users&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}};var ia={BEFORE_UNLOAD:"beforeunload"},ih=class extends R{constructor(e,t,i,s,r,n,o,a,h){if(super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new T,this._charAtlasDisposable=this._register(new T),this._observerDisposable=this._register(new T),this._model=new tl,this._workCell=new e8,this._workCell2=new e8,this._rectangleRenderer=this._register(new T),this._glyphRenderer=this._register(new T),this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new eV),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._gl=this._canvas.getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:h}),!this._gl)throw Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ev(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new tL(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions={css:{canvas:es(),cell:es()},device:{canvas:es(),cell:es(),char:{width:0,height:0,left:0,top:0}}},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextlost",e=>{console.log("webglcontextlost event received"),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(e)},3e3)})),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextrestored",e=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,e2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=e4(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=e4(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(S(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),e2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){for(let e of(this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows),this._renderLayers))e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new tC(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new ta(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=e1(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=M(eO.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),eO.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){for(let e of(this._clearModel(!0),this._renderLayers))e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(!this._core.screenElement?.isConnected||!this._charSizeService.width||!this._charSizeService.height)return;else this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new e3(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,h,l,c=0,d=!0,u,_,f,g,v,p,m,x,w;e=ic(e,i.rows-1,0),t=ic(t,i.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",b=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,L=b-i.buffer.ydisp,y=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),M=-1,S=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let A=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,f=b===o,c=0,h=this._characterJoinerService.getJoinedCharacters(o),x=0;x<i.cols;x++){if(r=this._cellColorResolver.result.bg,a.loadCell(x,s),0===x&&(r=this._cellColorResolver.result.bg),l=!1,d=x>=c,u=x,h.length>0&&x===h[0][0]&&d){_=h.shift();let e=this._model.selection.isCellSelected(this._terminal,_[0],o);for(m=_[0]+1;m<_[1];m++)d&&=e===this._model.selection.isCellSelected(this._terminal,m,o);(d&&=!f||y<_[0]||y>=_[1])?(l=!0,s=new il(s,a.translateToString(!0,_[0],_[1]),_[1]-_[0]),u=_[1]-1):c=_[1]}if(g=s.getChars(),v=s.getCode(),m=(n*i.cols+x)*4,this._cellColorResolver.resolve(s,x,o,this.dimensions.device.cell.width),S&&o===b&&(x===y&&(this._model.cursor={x:y,y:L,width:s.getWidth(),style:this._coreBrowserService.isFocused?C:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},M=y+s.getWidth()-1),x>=y&&x<=M&&(this._coreBrowserService.isFocused&&"block"===C||!1===this._coreBrowserService.isFocused&&"block"===i.options.cursorInactiveStyle)&&(this._cellColorResolver.result.fg=0x3000000|this._themeService.colors.cursorAccent.rgba>>8&0xffffff,this._cellColorResolver.result.bg=0x3000000|this._themeService.colors.cursor.rgba>>8&0xffffff)),0!==v&&(this._model.lineLengths[n]=x+1),(this._model.cells[m]!==v||this._model.cells[m+1]!==this._cellColorResolver.result.bg||this._model.cells[m+2]!==this._cellColorResolver.result.fg||this._model.cells[m+3]!==this._cellColorResolver.result.ext)&&(A=!0,g.length>1&&(v|=0x80000000),this._model.cells[m]=v,this._model.cells[m+1]=this._cellColorResolver.result.bg,this._model.cells[m+2]=this._cellColorResolver.result.fg,this._model.cells[m+3]=this._cellColorResolver.result.ext,p=s.getWidth(),this._glyphRenderer.value.updateCell(x,n,v,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,g,p,r),l)){for(s=this._workCell,x++;x<=u;x++)w=(n*i.cols+x)*4,this._glyphRenderer.value.updateCell(x,n,0,0,0,0,"",0,0),this._model.cells[w]=0,this._model.cells[w+1]=this._cellColorResolver.result.bg,this._model.cells[w+2]=this._cellColorResolver.result.fg,this._model.cells[w+3]=this._cellColorResolver.result.ext;x--}}A&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},il=class extends eB{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function ic(e,t,i=0){return Math.max(Math.min(e,t),i)}var id="di$target",iu="di$dependencies",i_=new Map;function ig(e){if(i_.has(e))return i_.get(e);let t=function(e,i,s){var r,n,o;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");r=t,n=e,o=s,n[id]===n?n[iu].push({id:r,index:o}):(n[iu]=[{id:r,index:o}],n[id]=n)};return t._id=e,i_.set(e,t),t}ig("BufferService"),ig("CoreMouseService"),ig("CoreService"),ig("CharsetService"),ig("InstantiationService"),ig("LogService");var iv=ig("OptionsService");ig("OscLinkService"),ig("UnicodeService"),ig("DecorationService");var ip={trace:0,debug:1,info:2,warn:3,error:4,off:5},im=class extends R{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ip[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};im=((e,t,i,s)=>{for(var r,n=s>1?void 0:s?g(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&f(t,i,n),n})([(e,t)=>iv(e,t,0)],im);var ix=class extends R{constructor(e){if(D&&16>function(){if(!D)return 0;let e=E.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])}()&&!document.createElement("canvas").getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element)return void this._register(t.onWillOpen(()=>this.activate(e)));this._terminal=e;let i=t.coreService,s=t.optionsService,r=t._renderService,n=t._characterJoinerService,o=t._charSizeService,a=t._coreBrowserService,h=t._decorationService,l=t._logService,c=t._themeService;this._renderer=this._register(new ih(e,n,o,a,i,h,s,c,this._preserveDrawingBuffer)),this._register(eO.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(eO.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(eO.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(eO.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this._register(S(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},iw=e.i(821957),iC=e.i(360112),ib=e.i(533499),iL=e.i(507971),iy=e.i(740081);e.s(["TaskTerminal",0,function({taskId:e,worktreePath:t,onSessionEnd:i,useCanvasRenderer:s=!1,onReady:r}){let{t:n}=(0,ib.useI18n)(),{resolvedTheme:o}=(0,iw.useTheme)(),a=(0,c.useRef)(null),h=(0,c.useRef)(null),_=(0,c.useRef)(null),f=(0,c.useRef)(null),g=(0,c.useRef)(i);g.current=i;let v=(0,c.useRef)(r);v.current=r;let[p,m]=(0,c.useState)("connecting"),[x,w]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{if(!t||!a.current)return;let i="light"!==o,r=new d.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:13,scrollback:2e3,cursorBlink:!0,allowTransparency:!1,rescaleOverlappingGlyphs:!0,theme:i?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),l=new u.FitAddon;r.loadAddon(l),r.open(a.current);let c=a.current.querySelector(".xterm-helper-textarea");c&&(c.style.opacity="0");let p=a.current,x=e=>{let t=e.clipboardData?.items;if(!t)return;let i=null;for(let e=0;e<t.length;e++){let s=t[e];if("file"===s.kind&&s.type.startsWith("image/")){i=s.getAsFile();break}}i&&(e.preventDefault(),e.stopPropagation(),C(i))};async function C(t){let i=iC.toast.loading(n("terminal.pasteImageUploading"));try{var s;let r=(await new Promise((e,i)=>{let s=new FileReader;s.onload=()=>e(s.result),s.onerror=()=>i(s.error),s.readAsDataURL(t)})).split(",")[1]??"",o=await fetch(`/api/internal/terminal/${encodeURIComponent(e)}/paste-image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mime:t.type,base64:r,name:t.name})}),a=await o.json().catch(()=>null);if(!o.ok||!a?.path)return void iC.toast.error(n("terminal.pasteImageFailed"),{id:i});let l=_.current;if(l?.readyState!==WebSocket.OPEN)return void iC.toast.error(n("terminal.pasteImageFailed"),{id:i});l.send((s=a.path,/\s/.test(s)?`"${s}" `:`${s} `)),h.current?.focus(),iC.toast.success(n("terminal.pasteImageInserted"),{id:i})}catch{iC.toast.error(n("terminal.pasteImageFailed"),{id:i})}}p.addEventListener("paste",x,!0);let b=null;if(!s)try{(b=new ix).onContextLoss(()=>{b?.dispose(),b=null}),r.loadAddon(b)}catch{}l.fit(),r.focus();let L=null,y=null,M=!1,S=null,A=!1;return(0,iy.getConfigValues)(["terminal.fontSize","terminal.fontFamily"]).then(e=>{if(M)return;let t=Number(e["terminal.fontSize"]),i=e["terminal.fontFamily"];Number.isFinite(t)&&t>0&&(r.options.fontSize=t),"string"==typeof i&&i.trim()&&(r.options.fontFamily=i);try{l.fit()}catch{}}).catch(()=>{}),(0,iL.getActualWsPort)().then(t=>{M||function t(i){if(M||A)return;m("connecting");let s=new WebSocket(`ws://localhost:${i}/terminal?taskId=${encodeURIComponent(e)}`);L=s,s.addEventListener("open",()=>{s.send(JSON.stringify({type:"resize",cols:r.cols,rows:r.rows})),r.focus(),m("connected"),w(!0),setTimeout(()=>w(!1),2e3)}),s.addEventListener("message",e=>{let t=e.data;"string"==typeof t?r.write(t):t instanceof Blob?t.text().then(e=>r.write(e)):t instanceof ArrayBuffer&&r.write(new Uint8Array(t))}),y?.dispose(),y=r.onData(e=>{s.readyState===WebSocket.OPEN&&s.send(e)}),s.addEventListener("close",e=>{if(e.code>=4e3){A=!0,m("disconnected"),g.current?.(e.code-4e3);return}m("disconnected"),M||A||(S=setTimeout(()=>t(i),3e3))}),s.addEventListener("error",()=>{}),_.current=s}(t)}),h.current=r,f.current=l,v.current?.({focus:()=>r.focus(),blur:()=>r.blur()}),()=>{M=!0,v.current?.(null),p.removeEventListener("paste",x,!0),S&&clearTimeout(S),y?.dispose(),b?.dispose(),l.dispose(),r.dispose(),L?.close(),h.current=null,_.current=null,f.current=null}},[e,t]),(0,c.useEffect)(()=>{if(!t||!a.current)return;let e=f.current,i=_.current,s=h.current;e&&s&&requestAnimationFrame(()=>{e.fit(),i?.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"resize",cols:s.cols,rows:s.rows}))});let r=null,n=a.current,o=new ResizeObserver(()=>{r&&clearTimeout(r),r=setTimeout(()=>{let e=f.current,t=_.current,i=h.current;e&&i&&(e.fit(),t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"resize",cols:i.cols,rows:i.rows})))},100)});return o.observe(n),()=>{r&&clearTimeout(r),o.disconnect()}},[e,t]),(0,c.useEffect)(()=>{let e=h.current;if(!e)return;let t="light"!==o;e.options.theme=t?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}},[o]),!t)return(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center bg-[#fafafa] dark:bg-[#0a0a0a] text-center",children:[(0,l.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:n("terminal.noWorktree")}),(0,l.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-600 mt-1",children:n("terminal.noWorktreeDesc")})]});let C="connected"===p?n("terminal.connected"):"connecting"===p?n("terminal.connecting"):n("terminal.disconnected");return(0,l.jsxs)("div",{className:"relative h-full w-full bg-[#fafafa] dark:bg-[#0a0a0a]",children:[(0,l.jsxs)("div",{className:["absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded px-2 py-0.5 text-xs transition-opacity duration-500","connected"===p&&!x?"opacity-0 pointer-events-none":"opacity-100","bg-white/60 dark:bg-black/40 backdrop-blur-sm"].join(" "),title:C,children:[(0,l.jsx)("span",{className:`h-2 w-2 rounded-full ${"connected"===p?"bg-green-500":"connecting"===p?"bg-yellow-500":"bg-red-500"}`}),(0,l.jsx)("span",{className:"text-neutral-600 dark:text-neutral-300",children:C})]}),(0,l.jsx)("div",{ref:a,className:"h-full w-full overflow-hidden"})]})}],85890)},346069,e=>{e.n(e.i(85890))}]);
|
|
66
|
+
}`,tu=8*Float32Array.BYTES_PER_ELEMENT,t_=class{constructor(){this.attributes=new Float32Array(160),this.count=0}},tf=0,tg=0,tv=0,tp=0,tm=0,tx=0,tw=0,tC=class extends R{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new t_,this._verticesCursor=new t_;let r=this._gl;this._program=ee(e7(r,tc,td)),this._register(S(()=>r.deleteProgram(this._program))),this._projectionLocation=ee(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(S(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(S(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=ee(r.createBuffer()),this._register(S(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,tu,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,tu,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,tu,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,e6),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,h,l,c,d,u,_,f;for(r=0;r<t.rows;r++){for(o=-1,a=0,h=0,l=!1,n=0;n<t.cols;n++)c=(r*t.cols+n)*4,d=e.cells[c+1],_=!!(0x4000000&(u=e.cells[c+2])),(d!==a||u!==h&&(l||_))&&((0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,n,r)),o=n,a=d,h=u,l=_);(0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||"block"===i.style){t.count=0;return}let s,r=0;("bar"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,"bar"===i.style?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),("underline"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),"outline"===i.style&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=8*r++,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(0x4000000&i)switch(0x3000000&i){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&i].rgba;break;case 0x3000000:tf=(0xffffff&i)<<8;break;default:tf=this._themeService.colors.foreground.rgba}else switch(0x3000000&s){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&s].rgba;break;case 0x3000000:tf=(0xffffff&s)<<8;break;default:tf=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=function(e,t){let i=new Float32Array(Math.min(2*e.length,t));for(let t=0;t<e.length;t++)i[t]=e[t];return i}(e.attributes,this._terminal.rows*this._terminal.cols*8)),tg=r*this._dimensions.device.cell.width,tv=o*this._dimensions.device.cell.height,tp=(tf>>24&255)/255,tm=(tf>>16&255)/255,tx=(tf>>8&255)/255,tw=1,this._addRectangle(e.attributes,t,tg,tv,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,tp,tm,tx,tw)}_addRectangle(e,t,i,s,r,n,o,a,h,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=h,e[t+7]=l}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}},tb=class extends R{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(S(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ee(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=e1(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=ep,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},tL=class extends tb{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(s.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){var t;if(257===e.fg?this._ctx.fillStyle=this._themeService.colors.background.css:void 0!==e.fg&&((0x3000000&(t=e.fg))==0x1000000||(0x3000000&t)==0x2000000)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},ty="object"==typeof window?window:globalThis,tM=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new eV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new eV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(i,e),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToFullScreen.set(i,e),this._onDidChangeFullscreen.fire(i)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};tM.INSTANCE=new tM,tM.INSTANCE.onDidChangeZoomLevel,tM.INSTANCE.onDidChangeFullscreen;var tS="object"==typeof navigator?navigator.userAgent:"";tS.indexOf("Firefox"),tS.indexOf("AppleWebKit"),tS.indexOf("Chrome")>=0||tS.indexOf("Safari"),tS.indexOf("Electron/"),tS.indexOf("Android");var tA=!1;if("function"==typeof ty.matchMedia){let e=ty.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ty.matchMedia("(display-mode: fullscreen)");tA=e.matches,tR=e,"string"==typeof tR&&(tR=ty.matchMedia(tR)),tR.addEventListener("change",({matches:e})=>{tA&&t.matches||(tA=e)})}var tR,tT,tk,tE=!1,tB=!1,tP="en",t$=globalThis;"u">typeof t$.vscode&&"u">typeof t$.vscode.process?tk=t$.vscode.process:"u">typeof _.default&&"string"==typeof _.default?.versions?.node&&(tk=_.default);var tD="string"==typeof tk?.versions?.electron&&tk?.type==="renderer";if("object"==typeof tk){tk.platform,tk.platform,"linux"===tk.platform&&tk.env.SNAP&&tk.env.SNAP_REVISION,tk.env.CI||tk.env.BUILD_ARTIFACTSTAGINGDIRECTORY,tP="en";let e=tk.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,tP=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}tE=!0}else"object"!=typeof navigator||tD?console.error("Unable to resolve platform."):((tT=navigator.userAgent).indexOf("Windows"),tT.indexOf("Macintosh"),(tT.indexOf("Macintosh")>=0||tT.indexOf("iPad")>=0||tT.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,tT.indexOf("Linux"),tT?.indexOf("Mobi"),tB=!0,tP=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());var tF=tE;tB&&"function"==typeof t$.importScripts&&t$.origin;var tW,tI=tT,tO=tP;(tY=tW||={}).value=function(){return tO},tY.isDefaultVariant=function(){return 2===tO.length?"en"===tO:tO.length>=3&&"e"===tO[0]&&"n"===tO[1]&&"-"===tO[2]},tY.isDefault=function(){return"en"===tO};var tz="function"==typeof t$.postMessage&&!t$.importScripts,tU=(()=>{if(tz){let e=[];t$.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),t$.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),tN=!!(tI&&tI.indexOf("Chrome")>=0);tI&&tI.indexOf("Firefox"),!tN&&tI&&tI.indexOf("Safari"),tI&&tI.indexOf("Edg/"),tI&&tI.indexOf("Android");var tq="object"==typeof navigator?navigator:{};tF||document.queryCommandSupported&&document.queryCommandSupported("copy")||tq&&tq.clipboard&&tq.clipboard.writeText,tF||tq&&tq.clipboard&&tq.clipboard.readText,tF||tA||tq.keyboard,"ontouchstart"in ty||tq.maxTouchPoints,ty.PointerEvent&&("ontouchstart"in ty||navigator.maxTouchPoints);var tG=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},tH=new tG,tj=new tG,tV=new tG;(tX=tZ||={}).toString=function(e){return tH.keyCodeToStr(e)},tX.fromString=function(e){return tH.strToKeyCode(e)},tX.toUserSettingsUS=function(e){return tj.keyCodeToStr(e)},tX.toUserSettingsGeneral=function(e){return tV.keyCodeToStr(e)},tX.fromUserSettings=function(e){return tj.strToKeyCode(e)||tV.strToKeyCode(e)},tX.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return tH.keyCodeToStr(e)};var tY,tX,tZ,tQ,tK=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(o=tQ||={}).isCancellationToken=function(e){return e===o.None||e===o.Cancelled||e instanceof tJ||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eO.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tK});var tJ=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tK:(this._emitter||(this._emitter=new eV),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};Symbol("MicrotaskDelay"),(a=h||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},a.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var t0=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new eV,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await eO.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};t0.EMPTY=t0.fromArray([]);function t5(e,t){return(t<<5)-t+e|0}function t1(e,t){t=t5(149417,t);for(let i=0,s=e.length;i<s;i++)t=t5(e.charCodeAt(i),t);return t}new DataView(new ArrayBuffer(320));var{registerWindow:t2,getWindow:t3,getDocument:t4,getWindows:t8,getWindowsCount:t6,getWindowId:t7,getWindowById:t9,hasWindow:ie,onDidRegisterWindow:it,onWillUnregisterWindow:ii,onDidUnregisterWindow:is}=(t=new Map,i={window:ty,disposables:new A},t.set(ty.vscodeWindowId,i),s=new eV,r=new eV,n=new eV,{onDidRegisterWindow:s.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:r.event,registerWindow(e){var i,o;if(t.has(e.vscodeWindowId))return R.None;let a=new A,h={window:e,disposables:a.add(new A)};return t.set(e.vscodeWindowId,h),a.add(S(()=>{t.delete(e.vscodeWindowId),r.fire(e)})),a.add((i=e,o=ia.BEFORE_UNLOAD,new ir(i,o,()=>{n.fire(e)},void 0))),s.fire(h),a},getWindows:()=>t.values(),getWindowsCount:()=>t.size,getWindowId:e=>e.vscodeWindowId,hasWindow:e=>t.has(e),getWindowById:function(e,s){return("number"==typeof e?t.get(e):void 0)??(s?i:void 0)},getWindow:e=>e?.ownerDocument?.defaultView?e.ownerDocument.defaultView.window:e?.view?e.view.window:ty,getDocument:e=>t3(e).document}),ir=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}},io=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new e(t,i):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t||!!e&&!!t&&e.width===t.width&&e.height===t.height}};io.None=new io(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=function e(t,i){switch(typeof t){case"object":var s,r,n,o;return null===t?t5(349,i):Array.isArray(t)?(s=t,r=t5(104579,r=i),s.reduce((t,i)=>e(i,t),r)):(n=t,o=t5(181387,o=i),Object.keys(n).sort().reduce((t,i)=>(t=t1(i,t),e(n[i],t)),o));case"string":return t1(t,i);case"boolean":return t5(t?433:863,i);case"number":return t5(t,i);case"undefined":return t5(937,i);default:return t5(617,i)}}(i,0),n=s.get(r);if(n)n.users+=1;else{let o=new eV,a=new MutationObserver(e=>o.fire(e));a.observe(e,i);let h=n={users:1,observer:a,onDidMutate:o.event};t.add(S(()=>{h.users-=1,0===h.users&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}};var ia={BEFORE_UNLOAD:"beforeunload"},ih=class extends R{constructor(e,t,i,s,r,n,o,a,h){if(super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new T,this._charAtlasDisposable=this._register(new T),this._observerDisposable=this._register(new T),this._model=new tl,this._workCell=new e8,this._workCell2=new e8,this._rectangleRenderer=this._register(new T),this._glyphRenderer=this._register(new T),this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new eV),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._gl=this._canvas.getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:h}),!this._gl)throw Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ev(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new tL(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions={css:{canvas:es(),cell:es()},device:{canvas:es(),cell:es(),char:{width:0,height:0,left:0,top:0}}},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextlost",e=>{console.log("webglcontextlost event received"),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(e)},3e3)})),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextrestored",e=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,e2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=e4(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=e4(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(S(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),e2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){for(let e of(this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows),this._renderLayers))e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new tC(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new ta(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=e1(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=M(eO.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),eO.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){for(let e of(this._clearModel(!0),this._renderLayers))e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(!this._core.screenElement?.isConnected||!this._charSizeService.width||!this._charSizeService.height)return;else this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new e3(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,h,l,c=0,d=!0,u,_,f,g,v,p,m,x,w;e=ic(e,i.rows-1,0),t=ic(t,i.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",b=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,L=b-i.buffer.ydisp,y=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),M=-1,S=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let A=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,f=b===o,c=0,h=this._characterJoinerService.getJoinedCharacters(o),x=0;x<i.cols;x++){if(r=this._cellColorResolver.result.bg,a.loadCell(x,s),0===x&&(r=this._cellColorResolver.result.bg),l=!1,d=x>=c,u=x,h.length>0&&x===h[0][0]&&d){_=h.shift();let e=this._model.selection.isCellSelected(this._terminal,_[0],o);for(m=_[0]+1;m<_[1];m++)d&&=e===this._model.selection.isCellSelected(this._terminal,m,o);(d&&=!f||y<_[0]||y>=_[1])?(l=!0,s=new il(s,a.translateToString(!0,_[0],_[1]),_[1]-_[0]),u=_[1]-1):c=_[1]}if(g=s.getChars(),v=s.getCode(),m=(n*i.cols+x)*4,this._cellColorResolver.resolve(s,x,o,this.dimensions.device.cell.width),S&&o===b&&(x===y&&(this._model.cursor={x:y,y:L,width:s.getWidth(),style:this._coreBrowserService.isFocused?C:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},M=y+s.getWidth()-1),x>=y&&x<=M&&(this._coreBrowserService.isFocused&&"block"===C||!1===this._coreBrowserService.isFocused&&"block"===i.options.cursorInactiveStyle)&&(this._cellColorResolver.result.fg=0x3000000|this._themeService.colors.cursorAccent.rgba>>8&0xffffff,this._cellColorResolver.result.bg=0x3000000|this._themeService.colors.cursor.rgba>>8&0xffffff)),0!==v&&(this._model.lineLengths[n]=x+1),(this._model.cells[m]!==v||this._model.cells[m+1]!==this._cellColorResolver.result.bg||this._model.cells[m+2]!==this._cellColorResolver.result.fg||this._model.cells[m+3]!==this._cellColorResolver.result.ext)&&(A=!0,g.length>1&&(v|=0x80000000),this._model.cells[m]=v,this._model.cells[m+1]=this._cellColorResolver.result.bg,this._model.cells[m+2]=this._cellColorResolver.result.fg,this._model.cells[m+3]=this._cellColorResolver.result.ext,p=s.getWidth(),this._glyphRenderer.value.updateCell(x,n,v,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,g,p,r),l)){for(s=this._workCell,x++;x<=u;x++)w=(n*i.cols+x)*4,this._glyphRenderer.value.updateCell(x,n,0,0,0,0,"",0,0),this._model.cells[w]=0,this._model.cells[w+1]=this._cellColorResolver.result.bg,this._model.cells[w+2]=this._cellColorResolver.result.fg,this._model.cells[w+3]=this._cellColorResolver.result.ext;x--}}A&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},il=class extends eB{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function ic(e,t,i=0){return Math.max(Math.min(e,t),i)}var id="di$target",iu="di$dependencies",i_=new Map;function ig(e){if(i_.has(e))return i_.get(e);let t=function(e,i,s){var r,n,o;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");r=t,n=e,o=s,n[id]===n?n[iu].push({id:r,index:o}):(n[iu]=[{id:r,index:o}],n[id]=n)};return t._id=e,i_.set(e,t),t}ig("BufferService"),ig("CoreMouseService"),ig("CoreService"),ig("CharsetService"),ig("InstantiationService"),ig("LogService");var iv=ig("OptionsService");ig("OscLinkService"),ig("UnicodeService"),ig("DecorationService");var ip={trace:0,debug:1,info:2,warn:3,error:4,off:5},im=class extends R{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ip[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};im=((e,t,i,s)=>{for(var r,n=s>1?void 0:s?g(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&f(t,i,n),n})([(e,t)=>iv(e,t,0)],im);var ix=class extends R{constructor(e){if(D&&16>function(){if(!D)return 0;let e=E.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])}()&&!document.createElement("canvas").getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element)return void this._register(t.onWillOpen(()=>this.activate(e)));this._terminal=e;let i=t.coreService,s=t.optionsService,r=t._renderService,n=t._characterJoinerService,o=t._charSizeService,a=t._coreBrowserService,h=t._decorationService,l=t._logService,c=t._themeService;this._renderer=this._register(new ih(e,n,o,a,i,h,s,c,this._preserveDrawingBuffer)),this._register(eO.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(eO.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(eO.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(eO.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this._register(S(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},iw=e.i(821957),iC=e.i(360112),ib=e.i(533499),iL=e.i(729739),iy=e.i(404122);function iM(e,t,i,s,r){if(!e||!t||!i||0===e.offsetWidth||0===e.offsetHeight)return;try{t.fit()}catch{return}if(s?.readyState!==WebSocket.OPEN)return;let{cols:n,rows:o}=i;(r.current?.cols!==n||r.current?.rows!==o)&&(r.current={cols:n,rows:o},s.send(JSON.stringify({type:"resize",cols:n,rows:o})))}e.s(["TaskTerminal",0,function({taskId:e,worktreePath:t,onSessionEnd:i,useCanvasRenderer:s=!1,onReady:r}){let{t:n}=(0,ib.useI18n)(),{resolvedTheme:o}=(0,iw.useTheme)(),a=(0,c.useRef)(null),h=(0,c.useRef)(null),_=(0,c.useRef)(null),f=(0,c.useRef)(null),g=(0,c.useRef)(null),v=(0,c.useRef)(i);v.current=i;let p=(0,c.useRef)(r);p.current=r;let[m,x]=(0,c.useState)("connecting"),[w,C]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{if(!t||!a.current)return;let i="light"!==o,r=new d.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:13,scrollback:2e3,cursorBlink:!0,allowTransparency:!1,rescaleOverlappingGlyphs:!0,theme:i?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),l=new u.FitAddon;r.loadAddon(l),r.open(a.current);let c=a.current.querySelector(".xterm-helper-textarea");c&&(c.style.opacity="0");let m=a.current,w=e=>{let t=e.clipboardData?.items;if(!t)return;let i=null;for(let e=0;e<t.length;e++){let s=t[e];if("file"===s.kind&&s.type.startsWith("image/")){i=s.getAsFile();break}}i&&(e.preventDefault(),e.stopPropagation(),b(i))};async function b(t){let i=iC.toast.loading(n("terminal.pasteImageUploading"));try{var s;let r=(await new Promise((e,i)=>{let s=new FileReader;s.onload=()=>e(s.result),s.onerror=()=>i(s.error),s.readAsDataURL(t)})).split(",")[1]??"",o=await fetch(`/api/internal/terminal/${encodeURIComponent(e)}/paste-image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mime:t.type,base64:r,name:t.name})}),a=await o.json().catch(()=>null);if(!o.ok||!a?.path)return void iC.toast.error(n("terminal.pasteImageFailed"),{id:i});let l=_.current;if(l?.readyState!==WebSocket.OPEN)return void iC.toast.error(n("terminal.pasteImageFailed"),{id:i});l.send((s=a.path,/\s/.test(s)?`"${s}" `:`${s} `)),h.current?.focus(),iC.toast.success(n("terminal.pasteImageInserted"),{id:i})}catch{iC.toast.error(n("terminal.pasteImageFailed"),{id:i})}}m.addEventListener("paste",w,!0);let L=null;if(!s)try{(L=new ix).onContextLoss(()=>{L?.dispose(),L=null}),r.loadAddon(L)}catch{}iM(a.current,l,r,null,g),r.focus();let y=null,M=null,S=!1,A=null,R=!1;return(0,iy.getConfigValues)(["terminal.fontSize","terminal.fontFamily"]).then(e=>{if(S)return;let t=Number(e["terminal.fontSize"]),i=e["terminal.fontFamily"];Number.isFinite(t)&&t>0&&(r.options.fontSize=t),"string"==typeof i&&i.trim()&&(r.options.fontFamily=i),iM(a.current,l,r,_.current,g)}).catch(()=>{}),(0,iL.getActualWsPort)().then(t=>{S||function t(i){if(S||R)return;x("connecting");let s=new WebSocket(`ws://localhost:${i}/terminal?taskId=${encodeURIComponent(e)}`);y=s,s.addEventListener("open",()=>{iM(a.current,l,r,s,g),r.focus(),x("connected"),C(!0),setTimeout(()=>C(!1),2e3)}),s.addEventListener("message",e=>{let t=e.data;"string"==typeof t?r.write(t):t instanceof Blob?t.text().then(e=>r.write(e)):t instanceof ArrayBuffer&&r.write(new Uint8Array(t))}),M?.dispose(),M=r.onData(e=>{s.readyState===WebSocket.OPEN&&s.send(e)}),s.addEventListener("close",e=>{if(e.code>=4e3){R=!0,x("disconnected"),v.current?.(e.code-4e3);return}x("disconnected"),S||R||(A=setTimeout(()=>t(i),3e3))}),s.addEventListener("error",()=>{}),_.current=s}(t)}),h.current=r,f.current=l,p.current?.({focus:()=>r.focus(),blur:()=>r.blur()}),()=>{S=!0,p.current?.(null),m.removeEventListener("paste",w,!0),A&&clearTimeout(A),M?.dispose(),L?.dispose(),l.dispose(),r.dispose(),y?.close(),h.current=null,_.current=null,f.current=null}},[e,t]),(0,c.useEffect)(()=>{if(!t||!a.current)return;requestAnimationFrame(()=>{iM(a.current,f.current,h.current,_.current,g)});let e=null,i=a.current,s=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(()=>{iM(a.current,f.current,h.current,_.current,g)},100)});return s.observe(i),()=>{e&&clearTimeout(e),s.disconnect()}},[e,t]),(0,c.useEffect)(()=>{let e=h.current;if(!e)return;let t="light"!==o;e.options.theme=t?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}},[o]),!t)return(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center bg-[#fafafa] dark:bg-[#0a0a0a] text-center",children:[(0,l.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:n("terminal.noWorktree")}),(0,l.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-600 mt-1",children:n("terminal.noWorktreeDesc")})]});let b="connected"===m?n("terminal.connected"):"connecting"===m?n("terminal.connecting"):n("terminal.disconnected");return(0,l.jsxs)("div",{className:"relative h-full w-full bg-[#fafafa] dark:bg-[#0a0a0a]",children:[(0,l.jsxs)("div",{className:["absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded px-2 py-0.5 text-xs transition-opacity duration-500","connected"===m&&!w?"opacity-0 pointer-events-none":"opacity-100","bg-white/60 dark:bg-black/40 backdrop-blur-sm"].join(" "),title:b,children:[(0,l.jsx)("span",{className:`h-2 w-2 rounded-full ${"connected"===m?"bg-green-500":"connecting"===m?"bg-yellow-500":"bg-red-500"}`}),(0,l.jsx)("span",{className:"text-neutral-600 dark:text-neutral-300",children:b})]}),(0,l.jsx)("div",{ref:a,className:"h-full w-full overflow-hidden"})]})}],85890)},346069,e=>{e.n(e.i(85890))}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69466,e=>{"use strict";e.s([],386333),e.i(386333),e.i(673087),e.i(947679),e.i(915083),e.i(972088),e.i(437116),e.i(73191),e.i(818873),e.i(7267),e.i(744220),e.i(767664);var i=e.i(514798);let r=(0,i.createServerReference)("60555989b683c5a72f2fc7fd34c0373bad439208b7",i.callServer,void 0,i.findSourceMapURL,"revealInFinder");e.s(["revealInFinder",0,r],69466)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,404122,e=>{"use strict";var c=e.i(514798);let r=(0,c.createServerReference)("4075ec4df24bd89711034f15cca9eb240df9f3f473",c.callServer,void 0,c.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,r])}]);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,465536,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},930787,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var h="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===h.length?h+="..":h+="/..");return h.length>0?h+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},914935,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(210702),n=e.i(487278),o=e.i(232545),i=e.i(464249),l=e.i(998626),c=e.i(911219),d=e.i(49007),u=e.i(902539),m=e.i(263938),h=e.i(645378),p=e.i(453889),x=e.i(572989);let g=(0,x.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(468443);let j=(0,x.default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);var b=e.i(386343),v=e.i(755146),w=e.i(337822),N=e.i(759684),y=e.i(776639),k=e.i(746798),C=e.i(519455),S=e.i(793479),T=e.i(514798);let P=(0,T.createServerReference)("4036232b529af0e5d065629d1878dc1a6e82f9ab45",T.callServer,void 0,T.findSourceMapURL,"createWorkspace"),D=(0,T.createServerReference)("60bc9436cec7b2f26cf49b181625cda9710fd3e4cc",T.callServer,void 0,T.findSourceMapURL,"updateWorkspace"),I=(0,T.createServerReference)("404f73addc943bb8455a63e7ceecb59ca89b3e445c",T.callServer,void 0,T.findSourceMapURL,"deleteWorkspace"),O=(0,T.createServerReference)("40da1ea17360e58bedf2e6bf6d1f53246b673da623",T.callServer,void 0,T.findSourceMapURL,"reorderWorkspaces");var M=e.i(242407);let $=(0,T.createServerReference)("403508781c13bf9d40b2fa51d399f5ca275af8be45",T.callServer,void 0,T.findSourceMapURL,"createLabel"),L=(0,T.createServerReference)("403629f8c3d76ad7fbefdd04b8cdbe84c9ffc95758",T.callServer,void 0,T.findSourceMapURL,"deleteLabel");var R=e.i(889620),A=e.i(533499),E=e.i(360112),B=e.i(720247),z=e.i(775712),F=e.i(67013);let W=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function _({workspaces:e}){let n=(0,s.useRouter)(),i=(0,s.usePathname)(),{t:l}=(0,A.useI18n)(),[c,d]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&d(!0)},[]);let[m,h]=(0,r.useState)(!1),[p,x]=(0,r.useState)(!1),[j,b]=(0,r.useState)(!1),[v,w]=(0,r.useState)(null),[y,S]=(0,r.useState)(""),[T,M]=(0,r.useState)(W[0]),[$,L]=(0,r.useState)(null),[F,V]=(0,r.useState)(e);(0,r.useEffect)(()=>{V(e)},[e]);let q=(0,B.useSensors)((0,B.useSensor)(B.PointerSensor,{activationConstraint:{distance:8}})),X=(0,r.useCallback)(t=>{let{active:r,over:s}=t;if(!s||r.id===s.id)return;let a=F.findIndex(e=>e.id===r.id),o=F.findIndex(e=>e.id===s.id);if(-1===a||-1===o)return;let i=(0,z.arrayMove)(F,a,o);V(i),O(i.map(e=>e.id)).then(()=>n.refresh()).catch(()=>{V(e),E.toast.error(l("sidebar.reorderError"))})},[F,e,n,l]),J=i.split("/workspaces/")[1]?.split("/")[0],Y=(0,r.useCallback)(e=>{if(J===e)return;let t=(0,R.getLastProjectId)(e);n.push(t?`/workspaces/${e}?projectId=${t}`:`/workspaces/${e}`)},[J,n]),Z=(0,r.useCallback)(()=>{d(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),Q=(0,r.useCallback)(async()=>{if(!y.trim())return;let e=await P({name:y.trim(),description:T});S(""),M(W[0]),h(!1),n.refresh(),n.push(`/workspaces/${e.id}`)},[y,T,n]),ee=(0,r.useCallback)(async()=>{y.trim()&&$&&(await D($,{name:y.trim(),description:T}),S(""),x(!1),L(null),n.refresh())},[y,T,$,n]),et=(0,r.useCallback)(e=>{L(e.id),S(e.name),M(e.description&&W.includes(e.description)?e.description:W[0]),x(!0)},[]),er=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void E.toast.error(l("sidebar.lastWorkspaceError"));if(confirm(l("sidebar.deleteConfirm",{name:r})))try{await I(t),n.refresh(),J===t&&n.push("/workspaces")}catch{E.toast.error(l("sidebar.lastWorkspaceError"))}},[J,n,l,e.length]),es=(0,r.useCallback)(e=>{w(e),b(!0)},[]),ea=e=>e.description&&W.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();return c?(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:Z,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(k.TooltipContent,{side:"right",sideOffset:8,children:l("sidebar.expand")})]}),(0,t.jsx)(N.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=J===e.id,s=ea(e);return(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>Y(e.id),className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:W.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(k.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>h(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(k.TooltipContent,{side:"right",sideOffset:8,children:l("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>n.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===i?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(g,{className:"h-4 w-4"})}),(0,t.jsx)(k.TooltipContent,{side:"right",sideOffset:8,children:l("missions.navLabel")})]}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>n.push("/harness"),className:`rounded-lg p-2 transition-colors ${"/harness"===i?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(f.BellRing,{className:"h-4 w-4"})}),(0,t.jsx)(k.TooltipContent,{side:"right",sideOffset:8,children:l("harness.navLabel")})]}),(0,t.jsx)(U,{wsId:J||e[0]?.id,pathname:i,t:l,collapsed:!0})]}),(0,t.jsx)(K,{open:m,onOpenChange:h,title:l("workspace.create"),name:y,onNameChange:S,icon:T,onIconChange:M,onSubmit:Q,submitLabel:l("common.create"),nameLabel:l("workspace.name"),iconLabel:l("workspace.icon"),namePlaceholder:l("workspace.namePlaceholder"),cancelLabel:l("common.cancel")})]}):(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(C.Button,{variant:"ghost",size:"icon-xs",onClick:Z,className:"text-muted-foreground",title:l("sidebar.collapse"),children:(0,t.jsx)(u.ChevronsLeft,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("sidebar.workspace")}),(0,t.jsx)(C.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{S(""),M(W[0]),h(!0)},title:l("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(N.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:(0,t.jsx)(B.DndContext,{id:"workspace-sidebar",sensors:q,collisionDetection:B.closestCenter,onDragEnd:X,children:(0,t.jsx)(z.SortableContext,{items:F.map(e=>e.id),strategy:z.verticalListSortingStrategy,children:F.map(e=>(0,t.jsx)(H,{ws:e,isActive:J===e.id,icon:ea(e),disableDelete:F.length<=1,t:l,onSelect:()=>Y(e.id),onEdit:()=>et(e),onManageLabels:()=>es(e.id),onDelete:()=>er(e.id,e.name)},e.id))})})})}),(0,t.jsxs)(a.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===i?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(g,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("missions.navLabel")})]}),(0,t.jsxs)(a.default,{href:"/harness",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/harness"===i?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(f.BellRing,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("harness.navLabel")})]}),(0,t.jsx)(U,{wsId:J||e[0]?.id,pathname:i,t:l,collapsed:!1}),(0,t.jsx)(K,{open:m,onOpenChange:h,title:l("workspace.create"),name:y,onNameChange:S,icon:T,onIconChange:M,onSubmit:Q,submitLabel:l("common.create"),nameLabel:l("workspace.name"),iconLabel:l("workspace.icon"),namePlaceholder:l("workspace.namePlaceholder"),cancelLabel:l("common.cancel")}),(0,t.jsx)(K,{open:p,onOpenChange:e=>{x(e),e||L(null)},title:l("workspace.edit"),name:y,onNameChange:S,icon:T,onIconChange:M,onSubmit:ee,submitLabel:l("common.save"),nameLabel:l("workspace.name"),iconLabel:l("workspace.icon"),namePlaceholder:l("workspace.namePlaceholder"),cancelLabel:l("common.cancel")}),v&&(0,t.jsx)(G,{open:j,onOpenChange:e=>{b(e),e||w(null)},workspaceId:v})]})}function U({wsId:e,pathname:s,t:o,collapsed:i}){let[l,d]=(0,r.useState)(!1),u=[...e?[{href:`/workspaces/${e}/groups`,icon:c.Boxes,label:o("sidebar.groups"),active:s.includes("/groups")},null,{href:`/workspaces/${e}/notes`,icon:h.FileText,label:o("sidebar.notes"),active:s.includes("/notes")},{href:`/workspaces/${e}/assets`,icon:p.FolderOpen,label:o("sidebar.assets"),active:s.includes("/assets")},{href:`/workspaces/${e}/archive`,icon:n.Archive,label:o("sidebar.archive"),active:s.includes("/archive")},null]:[],{href:"/settings",icon:b.Settings,label:o("settings.title"),active:s.startsWith("/settings")}],m=i?(0,t.jsx)("button",{"aria-label":o("sidebar.more"),className:`rounded-lg p-2 transition-colors ${l?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}):(0,t.jsx)("button",{"aria-label":o("sidebar.more"),className:"relative z-10 flex w-full items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors"});return(0,t.jsxs)(w.Popover,{open:l,onOpenChange:d,children:[(0,t.jsxs)(w.PopoverTrigger,{openOnHover:!0,delay:120,closeDelay:250,render:m,children:[(0,t.jsx)(j,{className:i?"h-4 w-4":"h-3.5 w-3.5"}),!i&&(0,t.jsx)("span",{children:o("sidebar.more")})]}),(0,t.jsx)(w.PopoverContent,{side:"right",align:"end",sideOffset:8,className:"w-52 gap-0.5 p-1.5",children:u.map((e,r)=>null===e?(0,t.jsx)("div",{className:"my-1 h-px bg-border"},`sep-${r}`):(0,t.jsxs)(a.default,{href:e.href,onClick:()=>d(!1),className:`flex items-center gap-2.5 rounded-md px-2.5 py-2 text-sm transition-colors ${e.active?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(e.icon,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:e.label})]},e.href))})]})}function H({ws:e,isActive:r,icon:s,disableDelete:a,t:n,onSelect:o,onEdit:c,onManageLabels:u,onDelete:h}){var p;let x,g,f,{attributes:j,listeners:b,setNodeRef:w,transform:N,transition:y,isDragging:k}=(0,z.useSortable)({id:e.id}),C={transform:F.CSS.Transform.toString(N),transition:y,opacity:k?.4:1};return(0,t.jsxs)("div",{ref:w,style:C,...j,...b,className:`group relative flex touch-none items-center rounded-lg transition-all ${r?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:o,className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${r?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:W.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:s})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${r?"text-foreground":"text-secondary-foreground"}`,children:e.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(p=e.updatedAt,g=Math.floor((x=Date.now()-new Date(p).getTime())/6e4),f=Math.floor(x/36e5),g<60?`${g}m ago`:f<24?`${f}h ago`:`${Math.floor(f/24)}d ago`)})]})]}),(0,t.jsxs)(v.DropdownMenu,{children:[(0,t.jsx)(v.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(d.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(v.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(v.DropdownMenuItem,{onClick:c,children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.rename")]}),(0,t.jsxs)(v.DropdownMenuItem,{onClick:u,children:[(0,t.jsx)(m.Tag,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.manageLabels")]}),(0,t.jsxs)(v.DropdownMenuItem,{className:a?"text-muted-foreground opacity-50":"text-rose-400",disabled:a,onClick:h,children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.delete")]})]})]})]})}function K({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:h}){return(0,t.jsx)(y.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(y.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(y.DialogHeader,{children:(0,t.jsx)(y.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(S.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:W.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(y.DialogFooter,{children:[(0,t.jsx)(C.Button,{variant:"outline",onClick:()=>r(!1),children:h}),(0,t.jsx)(C.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let V=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function G({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,A.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(V[0]);(0,r.useEffect)(()=>{e&&(0,M.getLabelsForWorkspace)(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await $({name:l.trim(),color:d,workspaceId:a}),i(await (0,M.getLabelsForWorkspace)(a)),c(""))},h=async e=>{await L(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(y.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(y.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(y.DialogHeader,{children:(0,t.jsx)(y.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>h(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(S.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(C.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:V.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}e.i(508271);var q=e.i(841359),X=e.i(289813);let J=(0,X.create)(e=>({createProjectOpen:!1,importProjectOpen:!1,setCreateProjectOpen:t=>e({createProjectOpen:t}),setImportProjectOpen:t=>e({importProjectOpen:t})}));var Y=e.i(821957),Z=e.i(738690);let Q=(0,x.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var ee=e.i(242941),et=e.i(989548),er=e.i(387091),es=e.i(15299);e.s([],678787),e.i(678787),e.i(708878);var ea=e.i(581263),en=e.i(462902);let eo=r.createContext(void 0);function ei(){let e=r.useContext(eo);if(void 0===e)throw Error((0,en.default)(13));return e}let el={imageLoadingStatus:()=>null},ec=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,ea.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:el});return(0,t.jsx)(eo.Provider,{value:c,children:d})});var ed=e.i(887642),eu=e.i(804849),em=e.i(504068),eh=e.i(809058),ep=e.i(193214),ex=e.i(954588);let eg={...el,...eh.transitionStatusMapping},ef=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=ei(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,eu.useIsoLayoutEffect)(()=>{if(!e)return n("error"),ex.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:h,setMounted:p}=(0,ep.useTransitionStatus)(u),x=r.useRef(null),g=(0,ed.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,eu.useIsoLayoutEffect)(()=>{"idle"!==d&&g(d)},[d,g]),(0,em.useOpenChangeComplete)({open:u,ref:x,onComplete(){u||p(!1)}});let f=(0,ea.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:h},ref:[t,x],props:l,stateAttributesMapping:eg,enabled:m});return m?f:null});var ej=e.i(161476);let eb=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=ei(),[l,c]=r.useState(void 0===n),d=(0,ej.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,ea.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:el,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,eb,"Image",0,ef,"Root",0,ec],129448);var ev=e.i(129448),ev=ev,ew=e.i(975157);function eN({className:e,size:r="default",...s}){return(0,t.jsx)(ev.Root,{"data-slot":"avatar","data-size":r,className:(0,ew.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...s})}function ey({className:e,...r}){return(0,t.jsx)(ev.Fallback,{"data-slot":"avatar-fallback",className:(0,ew.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let ek=(0,x.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var eC=e.i(226145);let eS=(0,x.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),eT=(0,x.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var eP=e.i(657153);let eD=(0,T.createServerReference)("60307d44ba04bf0330743c985bf6cc4ce0876e8b49",T.callServer,void 0,T.findSourceMapURL,"globalSearch");var eI=e.i(240095);let eO=[{id:"all",key:"search.all",icon:Z.Search},{id:"task",key:"search.task",icon:h.FileText},{id:"project",key:"search.project",icon:ek},{id:"repository",key:"search.repository",icon:eC.GitBranch},{id:"note",key:"search.note",icon:eS},{id:"asset",key:"search.asset",icon:eT}],eM=["task","project","repository","note","asset"],e$={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function eL({result:e,onSelect:r}){let s=eO.find(t=>t.id===e.type)?.icon??h.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function eR({open:e,onOpenChange:a}){let n,{t:o}=(0,A.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,h]=(0,r.useState)([]),[p,x]=(0,r.useState)(!1),[g,f]=(0,r.useState)(250),j=(0,r.useRef)(null),b=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,eI.getConfigValue)("search.debounceMs",250).then(f),setTimeout(()=>j.current?.focus(),100),c(""),h([]))},[e]),(0,r.useEffect)(()=>{if(b.current&&clearTimeout(b.current),!l.trim()){h([]),x(!1);return}x(!0);let e=!1;return b.current=setTimeout(async()=>{let t=await eD(l,d);e||(h(t),x(!1))},g),()=>{b.current&&clearTimeout(b.current),e=!0}},[l,d,g]);let v=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(y.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(y.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(Z.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:j,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(C.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),h([])},className:"text-muted-foreground",children:(0,t.jsx)(eP.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eO.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(N.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!p&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),eM.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(e$[e])}),n[e].map(e=>(0,t.jsx)(eL,{result:e,onSelect:v},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(eL,{result:e,onSelect:v},`${e.type}-${e.id}`))]})]})})}var eA=e.i(338187),eE=e.i(400355),eB=e.i(597746),ez=e.i(938499),eF=e.i(233274),eW=e.i(905455),e_=e.i(967489),eU=e.i(624687);function eH(e){return e.replace(/\.git\/?$/,"")}e.i(465536),e.i(930787);let eK=(0,T.createServerReference)("40adbba8c12c1bdb8072b324eb5ae7afff35a67271",T.callServer,void 0,T.findSourceMapURL,"resolveGitLocalPathWithSource");var eV=e.i(19919),eG=e.i(224277),eq=e.i(113184),eX=e.i(359562);function eJ({open:e,onOpenChange:s,onCreateProject:a,workspaces:n=[],defaultWorkspaceId:o}){let{t:i,locale:l}=(0,A.useI18n)(),[c,d]=(0,r.useState)(o??""),[u,m]=(0,r.useState)(""),[h,x]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[j,b]=(0,r.useState)(""),[v,w]=(0,r.useState)(""),[N,T]=(0,r.useState)(""),[P,D]=(0,r.useState)(!1),[I,O]=(0,r.useState)("empty"),[M,$]=(0,r.useState)("FRONTEND"),[L,R]=(0,r.useState)("idle"),[B,z]=(0,r.useState)(""),[F,W]=(0,r.useState)(!1),[_,U]=(0,r.useState)(!1),H=()=>{x(""),f(""),b(""),w(""),T(""),D(!1),O("empty"),$("FRONTEND"),R("idle"),z(""),W(!1),d(o??""),m("")};(0,r.useEffect)(()=>{e&&(d(o??""),m(""))},[e,o]);let K=async()=>{if(N.trim()&&!F&&"success"===L){W(!0);try{let e=await (0,eV.analyzeProjectDirectory)(N.trim(),l);b(e)}catch{E.toast.error(i("project.analyzeError"))}finally{W(!1)}}},V=async e=>{w(e),R("idle"),z("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eH(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eH(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);if(t&&t.pathSegments.length>0&&x(t.pathSegments[t.pathSegments.length-1]),!P){let{path:t,source:r}=await eK(e);T(t),O(r)}},G=async()=>{if(v.trim()&&N.trim()){R("cloning"),z("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(v.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:N.trim()})}),r=await t.json();if(!t.ok){R("error"),z(r.error||"Clone failed");return}R("success")}catch{R("error"),z("Network error")}}},q=async()=>{if(h.trim()){let e=await a?.({name:h.trim(),alias:g.trim()||void 0,description:j.trim()||void 0,gitUrl:v.trim()||void 0,localPath:N.trim()||void 0,projectType:M,workspaceId:c||void 0});if(u&&e&&"id"in e)try{await (0,eX.setProjectGroup)(e.id,u)}catch(e){E.toast.error(e instanceof Error?e.message:i("group.createError"))}H(),s(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(y.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(y.DialogHeader,{children:(0,t.jsx)(y.DialogTitle,{children:i("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[n.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.workspace")}),(0,t.jsxs)(e_.Select,{value:c,onValueChange:e=>{d(e??""),m("")},children:[(0,t.jsx)(e_.SelectTrigger,{className:"mt-1.5 w-full",children:(0,t.jsx)("span",{className:"truncate",children:n.find(e=>e.id===c)?.name??i("project.workspacePlaceholder")})}),(0,t.jsx)(e_.SelectContent,{children:n.map(e=>(0,t.jsx)(e_.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),c&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.group")}),(0,t.jsx)(eq.GroupSelect,{workspaceId:c,value:u,onChange:m})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:i("project.gitUrlHint")}),(0,t.jsx)(S.Input,{placeholder:i("project.gitPlaceholder"),value:v,onChange:e=>V(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:i("project.localPathHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(S.Input,{placeholder:i("project.localPathPlaceholder"),value:N,onChange:e=>{T(e.target.value),D(!0)},className:"flex-1 min-w-0 font-mono text-xs"}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsxs)(k.TooltipTrigger,{render:(0,t.jsx)(C.Button,{type:"button",variant:"outline",onClick:()=>U(!0),className:"shrink-0 gap-1.5 px-2.5 text-xs text-muted-foreground"}),children:[(0,t.jsx)(p.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i("folder.browse")})]}),(0,t.jsx)(k.TooltipContent,{children:i("folder.selectFolder")})]})]}),N.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(ez.AlertCircle,{className:"h-3 w-3"}),i("project.tildeWarning")]}),!P&&"fallback"===I&&v.trim()&&N.trim()&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-muted-foreground",children:[(0,t.jsx)(ez.AlertCircle,{className:"h-3 w-3 shrink-0"}),i("project.gitPathFallbackHint")]}),v.trim()&&N.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(C.Button,{type:"button",disabled:"cloning"===L||"success"===L,onClick:G,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===L?(0,t.jsx)(eE.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===L?(0,t.jsx)(eB.Check,{className:"h-3 w-3"}):(0,t.jsx)(eC.GitBranch,{className:"h-3 w-3"}),"cloning"===L?i("git.cloning"):"success"===L?i("git.cloned"):i("git.clone")]}),"error"===L&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(ez.AlertCircle,{className:"h-3 w-3"}),B]}),"success"===L&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:i("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.name")}),(0,t.jsx)(S.Input,{placeholder:i("project.namePlaceholder"),value:h,onChange:e=>x(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:i("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eW.SegmentedControl,{options:[{value:"FRONTEND",label:i("project.type.frontend")},{value:"BACKEND",label:i("project.type.backend")}],value:M,onChange:$})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.alias")}),(0,t.jsx)(S.Input,{placeholder:i("project.aliasPlaceholder"),value:g,onChange:e=>f(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.description")}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsxs)(k.TooltipTrigger,{render:(0,t.jsx)(C.Button,{type:"button",variant:"ghost",onClick:K,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!N.trim()||F?"opacity-50":""}`}),children:[F?(0,t.jsx)(eE.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eF.Sparkles,{className:"h-3 w-3"}),F?i("project.analyzing"):i("project.genDesc")]}),(0,t.jsx)(k.TooltipContent,{children:N.trim()?"success"!==L?i("project.genDescNotCloned"):i("project.genDescReady"):i("project.genDescNoPath")})]})]}),(0,t.jsx)(eU.Textarea,{placeholder:i("project.descPlaceholder"),value:j,onChange:e=>b(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(y.DialogFooter,{children:[(0,t.jsx)(C.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:i("common.cancel")}),(0,t.jsx)(C.Button,{onClick:q,disabled:!h.trim()||F,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:i("common.create")})]})]})}),(0,t.jsx)(eG.FolderBrowserDialog,{open:_,onOpenChange:U,onSelect:e=>{if(T(e),D(!0),!h.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";t&&x(t)}}})]})}var eY=e.i(579157),eZ=e.i(699375);let eQ=(0,T.createServerReference)("404b88257c253f72e32b690fbfdc864cdbe54233e3",T.callServer,void 0,T.findSourceMapURL,"resolveGitLocalPath"),e0=(0,T.createServerReference)("609c9417a5d51517e959d27ee390da88a7c0542bbc",T.callServer,void 0,T.findSourceMapURL,"migrateProjectPath"),e1=(0,T.createServerReference)("4064146185600ce222e9bc8e2316f49c9603a85346",T.callServer,void 0,T.findSourceMapURL,"checkMigrationSafety");function e2({open:e,onOpenChange:s,onCreateProject:a,workspaces:n=[],defaultWorkspaceId:o}){let{t:i,locale:l}=(0,A.useI18n)(),[c,d]=(0,r.useState)(o??""),[u,m]=(0,r.useState)(""),[h,x]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),[j,b]=(0,r.useState)(""),[v,w]=(0,r.useState)(""),[N,T]=(0,r.useState)(""),[P,D]=(0,r.useState)(!1),[I,O]=(0,r.useState)("FRONTEND"),[M,$]=(0,r.useState)(!1),[L,R]=(0,r.useState)(!1),[B,z]=(0,r.useState)(""),[F,W]=(0,r.useState)(!1),[_,U]=(0,r.useState)(""),[H,K]=(0,r.useState)(""),[V,G]=(0,r.useState)(!1),[q,X]=(0,r.useState)(!1),J=()=>{x(""),f(""),b(""),w(""),T(""),O("FRONTEND"),$(!1),R(!1),z(""),W(!1),U(""),K(""),G(!1),X(!1),d(o??""),m("")};(0,r.useEffect)(()=>{e&&(d(o??""),m(""))},[e,o]);let Y=async e=>{T(e),$(!1),R(!1),z(""),U(""),K(""),G(!1),x(e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){w(e.remoteUrl),$(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&x(t[1])}}}catch{}},Z=(0,r.useCallback)(async e=>{if(R(e),U(""),K(""),G(!1),!e)return void z("");if(v)try{let e=await eQ(v);e&&(z(e),e===N&&G(!0))}catch{}if(N)try{let e=await fetch(`/api/git?path=${encodeURIComponent(N)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&K(i("project.worktreeWarning"))}catch{}},[v,N]),Q=async()=>{if(N&&!q){X(!0);try{let e=await (0,eV.analyzeProjectDirectory)(N.trim(),l);b(e)}catch{E.toast.error(i("project.analyzeError"))}finally{X(!1)}}},ee=async()=>{if(!h.trim())return;let e={name:h.trim(),alias:g.trim()||void 0,description:j.trim()||void 0,gitUrl:v.trim()||void 0,localPath:N.trim()||void 0,projectType:I,workspaceId:c||void 0},t=await a?.(e);if(u&&t&&"id"in t)try{await (0,eX.setProjectGroup)(t.id,u)}catch(e){E.toast.error(e instanceof Error?e.message:i("group.createError"))}if(L&&B&&B!==N&&t&&"id"in t){W(!0),U("");try{let e=await e1(t.id);if(!e.safe)return void U(e.reason);let r=await e0(t.id,B);if(!r.success)return void U(r.error??i("project.migrateError"));E.toast.success(i("project.migrateSuccess"))}catch(t){let e=t instanceof Error?t.message:String(t);U(`${i("project.migrateError")}:${e}`);return}finally{W(!1)}}J(),s(!1)},et=!h.trim()||!N.trim()||F||q||L&&!!H;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.Dialog,{open:e,onOpenChange:e=>{s(e),e||J()},disablePointerDismissal:!0,children:(0,t.jsxs)(y.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(y.DialogHeader,{children:(0,t.jsx)(y.DialogTitle,{children:i("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[n.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.workspace")}),(0,t.jsxs)(e_.Select,{value:c,onValueChange:e=>{d(e??""),m("")},children:[(0,t.jsx)(e_.SelectTrigger,{className:"mt-1.5 w-full",children:(0,t.jsx)("span",{className:"truncate",children:n.find(e=>e.id===c)?.name??i("project.workspacePlaceholder")})}),(0,t.jsx)(e_.SelectContent,{children:n.map(e=>(0,t.jsx)(e_.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),c&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.group")}),(0,t.jsx)(eq.GroupSelect,{workspaceId:c,value:u,onChange:m})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:i("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(S.Input,{value:N,readOnly:!0,placeholder:i("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(C.Button,{type:"button",variant:"outline",onClick:()=>D(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(p.FolderOpen,{className:"h-3.5 w-3.5"}),i("folder.browse")]})]}),M&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:i("project.autoDetected")})]}),v&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.gitUrl")}),(0,t.jsx)(S.Input,{value:v,onChange:e=>w(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),M&&N&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:i("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:i("project.migrateHint")})]}),(0,t.jsx)(eZ.Switch,{checked:L,onCheckedChange:e=>Z(e)})]}),L&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:i("project.targetPath")}),(0,t.jsx)(S.Input,{value:B,onChange:e=>{z(e.target.value),G(e.target.value===N)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),V&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(eY.Info,{className:"h-3 w-3"}),i("project.samePathInfo")]}),H&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(ez.AlertCircle,{className:"h-3 w-3"}),H]}),_&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(ez.AlertCircle,{className:"h-3 w-3"}),_]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.name")}),(0,t.jsx)(S.Input,{placeholder:i("project.namePlaceholder"),value:h,onChange:e=>x(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:i("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eW.SegmentedControl,{options:[{value:"FRONTEND",label:i("project.type.frontend")},{value:"BACKEND",label:i("project.type.backend")}],value:I,onChange:O})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.alias")}),(0,t.jsx)(S.Input,{placeholder:i("project.aliasPlaceholder"),value:g,onChange:e=>f(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:i("project.description")}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsxs)(k.TooltipTrigger,{render:(0,t.jsx)(C.Button,{type:"button",variant:"ghost",onClick:Q,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!N||q?"opacity-50":""}`}),children:[q?(0,t.jsx)(eE.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eF.Sparkles,{className:"h-3 w-3"}),q?i("project.analyzing"):i("project.genDesc")]}),(0,t.jsx)(k.TooltipContent,{children:N?i("project.genDescReady"):i("project.genDescNoPath")})]})]}),(0,t.jsx)(eU.Textarea,{placeholder:i("project.descPlaceholder"),value:j,onChange:e=>b(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(y.DialogFooter,{children:[(0,t.jsx)(C.Button,{variant:"outline",onClick:()=>{s(!1),J()},children:i("common.cancel")}),(0,t.jsx)(C.Button,{onClick:ee,disabled:et,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:F?i("project.migrating"):i("common.create")})]})]})}),(0,t.jsx)(eG.FolderBrowserDialog,{open:P,onOpenChange:D,onSelect:e=>Y(e)})]})}function e5({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:(0,t.jsx)("path",{d:"M12 .5C5.65.5.5 5.65.5 12.02c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2c-3.2.7-3.87-1.36-3.87-1.36-.52-1.34-1.27-1.7-1.27-1.7-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.34.96.1-.74.4-1.25.72-1.54-2.56-.29-5.25-1.28-5.25-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.04 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.18-1.18 3.18-1.18.62 1.58.23 2.75.11 3.04.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.4-5.25 5.69.41.36.78 1.05.78 2.12v3.14c0 .31.21.68.79.56A11.52 11.52 0 0 0 23.5 12.02C23.5 5.65 18.35.5 12 .5Z"})})}function e4({onCreateProject:e,username:a,workspaces:n,defaultWorkspaceId:i}){let{t:l,locale:c,setLocale:d}=(0,A.useI18n)(),{isOpen:u,toggleAssistant:m}=(0,eA.useAssistant)(),{resolvedTheme:h,toggleTheme:x,triggerRef:g}=function(){let{resolvedTheme:e,setTheme:t}=(0,Y.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),f=(0,s.useRouter)(),[j,w]=(0,r.useState)(!1),[N,y]=(0,r.useState)(!1),[S,T]=(0,r.useState)(!1);(0,q.useActionShortcut)("global.search",()=>w(!0));let P=J(e=>e.createProjectOpen),D=J(e=>e.importProjectOpen),I=J(e=>e.setCreateProjectOpen),O=J(e=>e.setImportProjectOpen);return(0,r.useEffect)(()=>{P&&y(!0)},[P]),(0,r.useEffect)(()=>{D&&T(!0)},[D]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(C.Button,{variant:"outline",onClick:()=>w(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(Z.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:l("topbar.searchPlaceholder")}),(0,t.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,t.jsx)(Q,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:m,"aria-label":l("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",u?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(et.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(k.TooltipContent,{children:l("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsxs)(k.TooltipTrigger,{render:(0,t.jsx)(C.Button,{variant:"ghost",onClick:()=>d("zh"===c?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(ee.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===c?"EN":"中"})]}),(0,t.jsx)(k.TooltipContent,{children:l("settings.language")})]}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{render:(0,t.jsx)(C.Button,{ref:g,variant:"ghost",size:"icon",onClick:x,className:"text-muted-foreground"}),children:"dark"===h?(0,t.jsx)(er.Sun,{className:"h-4 w-4"}):(0,t.jsx)(es.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(k.TooltipContent,{children:l("settings.theme")})]}),(0,t.jsxs)(k.Tooltip,{children:[(0,t.jsx)(k.TooltipTrigger,{render:(0,t.jsx)(C.Button,{variant:"ghost",size:"icon",onClick:()=>window.open("https://github.com/jp-liu/tower","_blank","noopener,noreferrer"),className:"text-muted-foreground","aria-label":l("topbar.github")}),children:(0,t.jsx)(e5,{className:"h-4 w-4"})}),(0,t.jsx)(k.TooltipContent,{children:l("topbar.github")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(C.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>T(!0),children:[(0,t.jsx)(p.FolderOpen,{className:"h-3.5 w-3.5"}),l("topbar.importProject")]}),(0,t.jsxs)(C.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>y(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),l("topbar.newProject")]}),(0,t.jsxs)(v.DropdownMenu,{children:[(0,t.jsx)(v.DropdownMenuTrigger,{render:(0,t.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(eN,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ey,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(v.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(v.DropdownMenuItem,{onClick:()=>f.push("/settings"),children:[(0,t.jsx)(b.Settings,{className:"mr-2 h-3.5 w-3.5"}),l("settings.title")]})})]})]})]}),(0,t.jsx)(eR,{open:j,onOpenChange:w}),(0,t.jsx)(eJ,{open:N,onOpenChange:e=>{y(e),e||I(!1)},onCreateProject:e,workspaces:n,defaultWorkspaceId:i}),(0,t.jsx)(e2,{open:S,onOpenChange:e=>{T(e),e||O(!1)},onCreateProject:e,workspaces:n,defaultWorkspaceId:i})]})}var e3=e.i(83434),e8=e.i(966001),e6=e.i(121318),e7=e.i(19578),e9=e.i(232280);let te=(0,e7.default)(()=>e.A(427768).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[103363]},ssr:!1});function tt({mode:e}){let{isOpen:s,closeAssistant:a,sessions:n,activeSessionId:c,createNewSession:d,switchSession:u,removeSession:m,renameSession:h}=(0,eA.useAssistant)(),{t:p}=(0,A.useI18n)(),[x,g]=(0,r.useState)(null),[f,j]=(0,r.useState)(""),b=()=>{g(null),j("")},w=n.find(e=>e.id===c),N=w?.title??p("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(et.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:p("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(v.DropdownMenu,{children:[(0,t.jsxs)(v.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":p("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:N}),(0,t.jsx)(e9.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(v.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,className:"w-[280px]",children:[0===n.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:p("assistant.noSessions")}):(0,t.jsx)("div",{className:"max-h-[min(440px,50vh)] overflow-y-auto",children:n.map(e=>(0,t.jsxs)(v.DropdownMenuItem,{className:"flex items-center justify-between gap-1 pr-1",onClick:()=>u(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(C.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100",onClick:t=>{var r;t.stopPropagation(),g({id:e.id,title:r=e.title}),j(r)},"aria-label":p("assistant.renameSession"),children:(0,t.jsx)(i.Pencil,{className:"h-3 w-3"})}),(0,t.jsx)(C.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),m(e.id)},"aria-label":p("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id))}),n.length>0&&(0,t.jsx)(v.DropdownMenuSeparator,{}),(0,t.jsxs)(v.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:p("assistant.newSession")})]})]})]}),(0,t.jsx)(C.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:d,"aria-label":p("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(C.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:a,"aria-label":p("assistant.closeLabel"),children:(0,t.jsx)(eP.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:s?(0,t.jsx)(te,{}):null}),(0,t.jsx)(y.Dialog,{open:null!==x,onOpenChange:e=>{e||b()},children:(0,t.jsxs)(y.DialogContent,{children:[(0,t.jsx)(y.DialogHeader,{children:(0,t.jsx)(y.DialogTitle,{children:p("assistant.renameSessionTitle")})}),(0,t.jsx)(S.Input,{autoFocus:!0,value:f,onChange:e=>j(e.target.value),placeholder:p("assistant.renameSessionPlaceholder")}),(0,t.jsxs)(y.DialogFooter,{children:[(0,t.jsx)(C.Button,{variant:"outline",onClick:b,children:p("common.cancel")}),(0,t.jsx)(C.Button,{onClick:()=>{x&&f.trim()&&(h(x.id,f),b())},disabled:!f.trim(),children:p("common.save")})]})]})})]})}var tr=e.i(125177);function ts({onDismiss:e}){let{t:s}=(0,A.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,t.jsx)(tr.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(C.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(C.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var ta=e.i(729739),tn=e.i(206781);let to=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function ti({onComplete:e}){let{t:s}=(0,A.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=to[a],m=(0,r.useCallback)(async()=>{await (0,tn.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),h=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),p=(0,r.useCallback)(()=>{let e=h();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[h]);(0,r.useEffect)(()=>{p();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=h();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!h()&&(n(e=>{let t=e+1;return t<to.length?t:e}),a>=to.length-1&&m())},5e3));let t=()=>p();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,h,p,l,m]),(0,r.useEffect)(()=>{let e=setInterval(p,1e3);return()=>clearInterval(e)},[p]);let x=(0,r.useCallback)(()=>{a<to.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
|
|
2
|
+
ellipse at ${o.left+o.width/2}px ${o.top+o.height/2}px,
|
|
3
|
+
transparent ${Math.max(o.width,o.height)}px,
|
|
4
|
+
rgba(0,0,0,0.6) ${Math.max(o.width,o.height)+30}px
|
|
5
|
+
)`},onClick:x}),(0,t.jsx)("div",{className:"pointer-events-none fixed z-[10001] rounded-lg ring-2 ring-amber-400 ring-offset-2 ring-offset-background",style:{left:o.left-4,top:o.top-4,width:o.width+8,height:o.height+8}}),(0,t.jsxs)("div",{className:"fixed z-[10002] w-72 rounded-xl border border-border bg-card p-4 shadow-2xl",style:(()=>{if(!o)return{display:"none"};let e={position:"fixed",zIndex:10001};switch(u.placement){case"right":e.left=o.right+12,e.top=o.top+o.height/2,e.transform="translateY(-50%)";break;case"bottom":e.left=o.left+o.width/2,e.top=o.bottom+12,e.transform="translateX(-50%)";break;case"left":e.right=window.innerWidth-o.left+12,e.top=o.top+o.height/2,e.transform="translateY(-50%)";break;case"top":e.left=o.left+o.width/2,e.bottom=window.innerHeight-o.top+12,e.transform="translateX(-50%)"}return e})(),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:s(u.titleKey)}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground leading-relaxed",children:s(u.descKey)})]}),(0,t.jsx)("button",{onClick:m,className:"shrink-0 rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(eP.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex gap-1",children:to.map((e,r)=>(0,t.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${r===a?"bg-amber-400":r<a?"bg-amber-400/40":"bg-muted"}`},r))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(C.Button,{variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:m,children:s("tour.skip")}),(0,t.jsx)(C.Button,{className:"h-7 px-3 text-xs bg-amber-500/15 text-amber-300 ring-1 ring-amber-500/25 hover:bg-amber-500/25",onClick:x,children:s(a<to.length-1?"tour.next":"tour.done")})]})]})]})]})}):null}var tl=e.i(469051);let tc=(0,x.default)("sun-moon",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);var td=e.i(769757),tu=e.i(360325),tm=e.i(317056);let th=(0,X.create)(e=>({open:!1,setOpen:t=>e({open:t}),toggle:()=>e(e=>({open:!e.open}))})),tp=(0,X.create)(e=>({open:!1,setOpen:t=>e({open:t}),toggle:()=>e(e=>({open:!e.open}))}));function tx(){let{t:e,locale:r,setLocale:a}=(0,A.useI18n)(),n=(0,s.useRouter)(),{resolvedTheme:i,setTheme:l}=(0,Y.useTheme)(),c=th(e=>e.open),d=th(e=>e.setOpen),u=th(e=>e.toggle),m=J(e=>e.setCreateProjectOpen),h=J(e=>e.setImportProjectOpen),x=tp(e=>e.toggle);(0,q.useActionShortcut)("global.commandPalette",()=>u());let g=e=>{d(!1),e()};return(0,t.jsxs)(tm.CommandDialog,{open:c,onOpenChange:d,title:e("palette.title"),children:[(0,t.jsx)(tm.CommandInput,{placeholder:e("palette.placeholder")}),(0,t.jsxs)(tm.CommandList,{children:[(0,t.jsx)(tm.CommandEmpty,{children:e("palette.empty")}),(0,t.jsxs)(tm.CommandGroup,{heading:e("palette.group.navigation"),children:[(0,t.jsxs)(tm.CommandItem,{onSelect:()=>g(()=>n.push("/missions")),children:[(0,t.jsx)(tl.LayoutGrid,{}),e("palette.gotoMissions")]}),(0,t.jsxs)(tm.CommandItem,{onSelect:()=>g(()=>n.push("/settings")),children:[(0,t.jsx)(b.Settings,{}),e("palette.openSettings")]})]}),(0,t.jsxs)(tm.CommandGroup,{heading:e("palette.group.actions"),children:[(0,t.jsxs)(tm.CommandItem,{onSelect:()=>g(()=>m(!0)),children:[(0,t.jsx)(o.Plus,{}),e("palette.newProject")]}),(0,t.jsxs)(tm.CommandItem,{onSelect:()=>g(()=>h(!0)),children:[(0,t.jsx)(p.FolderOpen,{}),e("palette.importProject")]}),(0,t.jsxs)(tm.CommandItem,{onSelect:()=>g(()=>x()),children:[(0,t.jsx)(tu.Keyboard,{}),e("palette.openHelp")]})]}),(0,t.jsxs)(tm.CommandGroup,{heading:e("palette.group.preferences"),children:[(0,t.jsxs)(tm.CommandItem,{onSelect:()=>g(()=>l("dark"===i?"light":"dark")),children:[(0,t.jsx)(tc,{}),e("palette.toggleTheme")]}),(0,t.jsxs)(tm.CommandItem,{onSelect:()=>g(()=>a("zh"===r?"en":"zh")),children:[(0,t.jsx)(td.Languages,{}),e("palette.toggleLocale")]})]})]})]})}var tg=e.i(371385),tf=e.i(75566),tj=e.i(851289);let tb=["global","panels","missions"],tv=new Set(["missions.cycleBack"]);function tw(){let{t:e}=(0,A.useI18n)(),s=tp(e=>e.open),a=tp(e=>e.setOpen),n=tp(e=>e.toggle),o=(0,tf.useKeymapStore)(e=>e.overrides),[i,l]=(0,r.useState)("");(0,q.useActionShortcut)("global.help",()=>n());let c=i.trim().toLowerCase(),d=tb.map(t=>{let r=tg.SHORTCUT_ACTIONS.filter(e=>e.group===t&&!tv.has(e.id)).map(t=>({id:t.id,description:e(t.descriptionKey),keys:(0,tf.resolveKeysFrom)(o,t.id)})).filter(e=>!c||e.description.toLowerCase().includes(c));return{title:e(`shortcuts.group.${t}`),shortcuts:r}}).filter(e=>e.shortcuts.length>0);return(0,t.jsx)(y.Dialog,{open:s,onOpenChange:a,children:(0,t.jsxs)(y.DialogContent,{className:"sm:max-w-2xl",children:[(0,t.jsx)(y.DialogHeader,{children:(0,t.jsx)(y.DialogTitle,{children:e("shortcuts.help.title")})}),(0,t.jsx)(S.Input,{value:i,onChange:e=>l(e.target.value),placeholder:e("shortcuts.help.searchPlaceholder")}),(0,t.jsx)("div",{className:"max-h-[60vh] space-y-4 overflow-y-auto",children:d.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-semibold text-muted-foreground",children:e.title}),(0,t.jsx)("div",{className:"space-y-0.5",children:e.shortcuts.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-md px-2 py-1.5 text-sm",children:[(0,t.jsx)("span",{className:"truncate",children:e.description}),(0,t.jsx)("div",{className:"flex shrink-0 items-center",children:(0,t.jsx)(tj.KeyCombo,{keys:e.keys})})]},e.id))})]},e.title))})]})})}function tN({workspaces:e,isFirstRun:a,username:n,children:o,handleCreateProject:i}){let l=(0,s.usePathname)(),c=(0,s.useRouter)(),{isOpen:d,displayMode:u,closeAssistant:m}=(0,eA.useAssistant)();(0,q.useActionShortcut)("global.gotoWorkspace",t=>{let r=/^Digit([1-9])$/.exec(t.code);if(!r)return;let s=e[Number(r[1])-1];if(!s)return;let a=(0,R.getLastProjectId)(s.id);c.push(a?`/workspaces/${s.id}?projectId=${a}`:`/workspaces/${s.id}`)});let h=l.split("/workspaces/")[1]?.split("/")[0],p=h||e[0]?.id;(0,q.useActionShortcut)("panels.taskManager",()=>c.push("/missions")),(0,q.useActionShortcut)("panels.assets",()=>{p&&c.push(`/workspaces/${p}/assets`)}),(0,q.useActionShortcut)("panels.notes",()=>{p&&c.push(`/workspaces/${p}/notes`)}),(0,q.useActionShortcut)("panels.archive",()=>{p&&c.push(`/workspaces/${p}/archive`)}),(0,r.useEffect)(()=>{a&&!l.startsWith("/onboarding")&&c.replace("/onboarding")},[a,l,c]);let[x,g]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{a||l.startsWith("/onboarding")||(0,eI.getConfigValue)("onboarding.tourCompleted",!1).then(e=>{e?j(!0):g(!0)})},[a,l]);let[b,v]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(0,eI.getConfigValue)("notification.enabled",!0).then(v)},[]);let w=l.startsWith("/onboarding");if(!function(e){let t=(0,r.useRef)(e),{t:s}=(0,A.useI18n)(),a=(0,r.useRef)(s);t.current=e,a.current=s,(0,r.useEffect)(()=>{if(!e)return;let r=null,s=null,n=!1;function o(e,t){"Notification"in window&&"granted"===window.Notification.permission?new window.Notification(e,{body:t,icon:"/web-app-manifest-192x192.png"}):E.toast.success(e,{description:t})}async function i(){if(n)return;let e=await (0,ta.getActualWsPort)();n||((r=new WebSocket(`ws://localhost:${e}/terminal?taskId=__notifications__`)).onmessage=e=>{if(t.current)try{let t=JSON.parse(e.data),r=a.current;if("type"in t&&"stop"===t.type){if("u"<typeof document||"hidden"!==document.visibilityState)return;o(t.taskTitle,`${t.projectName}:${r("notification.taskReplied")}`)}else o(t.taskTitle,r("COMPLETED"===t.status?"notification.taskCompleted":"notification.taskFailed"))}catch{}},r.onclose=()=>{n||(s=setTimeout(i,5e3))},r.onerror=()=>{r?.close()})}return i(),()=>{n=!0,s&&clearTimeout(s),r?.close()}},[e])}(b&&!w),w)return(0,t.jsx)(t.Fragment,{children:o});let N=/\/workspaces\/[^/]+\/tasks\/[^/]+/.test(l),k=/\/workspaces\/[^/]+\/(notes|assets|archive|groups)/.test(l),C=d&&"sidebar"===u?(0,t.jsx)(tt,{mode:"sidebar"}):null,S="dialog"===u?(0,t.jsx)(y.Dialog,{open:d,onOpenChange:e=>{e||m()},children:(0,t.jsx)(y.DialogContent,{showCloseButton:!1,style:{width:"90vw",minWidth:"360px",maxWidth:"600px",height:"70vh",minHeight:"480px",maxHeight:"800px",padding:0},children:(0,t.jsx)(tt,{mode:"dialog"})})}):null,T=N||k;return(0,t.jsxs)(t.Fragment,{children:[f&&(0,t.jsx)(ts,{onDismiss:()=>j(!1)}),(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[(0,t.jsx)("div",{className:T?"hidden":"contents",children:(0,t.jsx)(_,{workspaces:e})}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(e4,{onCreateProject:i,username:n,workspaces:e,defaultWorkspaceId:h}),(0,t.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[C,(0,t.jsx)("main",{className:`flex-1 bg-background ${T?"overflow-hidden":"overflow-auto"}`,children:(0,t.jsx)(e8.ErrorBoundary,{children:o})})]})]})]}),S,x&&(0,t.jsx)(ti,{onComplete:()=>{g(!1),j(!0)}}),(0,t.jsx)(tx,{}),(0,t.jsx)(tw,{})]})}e.s(["LayoutClient",0,function({workspaces:e,isFirstRun:r,username:a,children:n}){let o=(0,s.useRouter)(),i=(0,s.usePathname)(),l=i.split("/workspaces/")[1]?.split("/")[0],c=async t=>{let r=t.workspaceId||l||(e.length>0?e[0].id:null);if(!r){let e=await P({name:"Default Workspace"}),r=await (0,e6.createProject)({...t,workspaceId:e.id});return o.refresh(),o.push(`/workspaces/${e.id}`),{id:r.id}}let s=await (0,e6.createProject)({...t,workspaceId:r});return o.refresh(),o.push(`/workspaces/${r}`),{id:s.id}};return(0,t.jsx)(eA.AssistantProvider,{children:(0,t.jsx)(e3.TerminalPortalProvider,{children:(0,t.jsx)(tN,{workspaces:e,isFirstRun:r,username:a,handleCreateProject:c,children:n})})})}],914935)},782406,e=>{"use strict";var t=e.i(289721),r=e.i(821957);e.s(["ThemeProvider",0,function({children:e,...s}){return(0,t.jsx)(r.ThemeProvider,{...s,children:e})}])},713354,e=>{"use strict";var t=e.i(289721),r=e.i(821957),s=e.i(360112),a=e.i(59737),a=a,n=e.i(756502),n=n,o=e.i(567098),o=o;let i=(0,e.i(572989).default)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var l=e.i(519587),l=l;e.s(["Toaster",0,({...e})=>{let{theme:c="system"}=(0,r.useTheme)();return(0,t.jsx)(s.Toaster,{theme:c,className:"toaster group",icons:{success:(0,t.jsx)(a.default,{className:"size-4"}),info:(0,t.jsx)(n.default,{className:"size-4"}),warning:(0,t.jsx)(o.default,{className:"size-4"}),error:(0,t.jsx)(i,{className:"size-4"}),loading:(0,t.jsx)(l.default,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})}],713354)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:a,description:r,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r}),i&&(0,t.jsx)("div",{className:"mt-2",children:i})]})}])},236967,e=>{"use strict";var t=e.i(289721),s=e.i(210702),a=e.i(538059),r=e.i(259846),i=e.i(645378),n=e.i(453889),l=e.i(487278),o=e.i(911219),d=e.i(533499);let c=[{key:"notes",icon:i.FileText},{key:"assets",icon:n.FolderOpen},{key:"archive",icon:l.Archive},{key:"groups",icon:o.Boxes}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:i}=(0,d.useI18n)(),n=(0,a.usePathname)(),l=c.find(e=>n.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(s.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),c.map(a=>{let r=a.icon,n=l===a.key;return(0,t.jsxs)(s.default,{href:`/workspaces/${e}/${a.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${n?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i(`sidebar.${a.key}`)})]},a.key)})]})}])},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)},980376,20836,e=>{"use strict";var t=e.i(289721),s=e.i(225061),a=e.i(975157),r=e.i(519455),i=e.i(670123);function n({...e}){return(0,t.jsx)(s.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function l({className:e,...r}){return(0,t.jsx)(s.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,a.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...r})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(s.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:o,side:d="right",showCloseButton:c=!0,...m}){return(0,t.jsxs)(n,{children:[(0,t.jsx)(l,{}),(0,t.jsxs)(s.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,a.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...m,children:[o,c&&(0,t.jsxs)(s.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(i.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...r}){return(0,t.jsx)(s.Dialog.Description,{"data-slot":"sheet-description",className:(0,a.cn)("text-sm text-muted-foreground",e),...r})},"SheetHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,a.cn)("flex flex-col gap-0.5 p-4",e),...s})},"SheetTitle",0,function({className:e,...r}){return(0,t.jsx)(s.Dialog.Title,{"data-slot":"sheet-title",className:(0,a.cn)("font-heading text-base font-medium text-foreground",e),...r})}],980376);var o=e.i(514798);let d=(0,o.createServerReference)("403a7d2c9bb7cb0a78ee046f71013ad11077222cc0",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,d],20836)},606393,e=>{"use strict";let t=(0,e.i(572989).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],606393)},605005,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(980376),r=e.i(759684),i=e.i(487486),n=e.i(519455),l=e.i(533499),o=e.i(28725),d=e.i(20836),c=e.i(242407),m=e.i(445522),x=e.i(554057),u=e.i(950481),h=e.i(938238),p=e.i(184331),f=e.i(744798),g=e.i(997025),j=e.i(235357),v=e.i(144640),b=e.i(937304),N=e.i(685149),y=e.i(606393),k=e.i(875840),w=e.i(245697),S=e.i(12659),C=e.i(736061),T=e.i(460707),I=e.i(567860),D=e.i(645378),P=e.i(867533),B=e.i(297338),F=e.i(453889);function $({added:e,removed:s}){let{t:a}=(0,l.useI18n)();return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,t.jsx)("span",{children:a("diff.filesChanged",{count:String(e+s)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),s>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",s]})]})}var A=e.i(35967),O=e.i(360112);let z=/\.(txt|md|json)$/i;function M({text:e}){let{t:a}=(0,l.useI18n)(),[r,i]=(0,s.useState)(!1),[n,o]=(0,s.useState)(!1),d=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=d.current;e&&o(e.scrollHeight>e.clientHeight+1)},[]),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{ref:d,className:`text-sm text-foreground whitespace-pre-wrap ${r?"":"line-clamp-5"}`,children:e}),n&&(0,t.jsx)("button",{type:"button",onClick:()=>i(e=>!e),className:"mt-1 text-xs font-medium text-sky-600 hover:underline dark:text-sky-400",children:a(r?"taskDrawer.collapseDescription":"taskDrawer.expandDescription")})]})}e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:R,taskId:U,hideEnvActions:L=!1}){let{t:E}=(0,l.useI18n)(),[H,V]=(0,s.useState)(null),[_,K]=(0,s.useTransition)(),[J,W]=(0,s.useState)(!1),[q,G]=(0,s.useState)([]),[X,Y]=(0,s.useState)([]),[Q,Z]=(0,s.useState)(null),[ee,et]=(0,s.useState)([]),[es,ea]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!U||!e){V(null),Y([]),et([]);return}(0,m.getTaskNotes)(U).then(e=>Y(e.map(e=>({id:e.id,title:e.title,content:e.content,category:e.category})))).catch(()=>Y([])),(0,x.getTaskAssets)(U).then(e=>et(e.map(e=>({id:e.id,filename:e.filename,path:e.path,mimeType:e.mimeType,size:e.size})))).catch(()=>et([])),K(async()=>{let e=await (0,d.getTaskOverview)(U);e&&(V(e),e.project?.workspaceId&&(0,c.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{G(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>G([])))})},[U,e]);let er=H?N.BOARD_COLUMNS.find(e=>e.id===H.status):null,ei=H?N.PRIORITY_CONFIG[H.priority]:null,en=H?.executions?.[0]??null,el=(()=>{if(en?.worktreePath)return en.worktreePath;let e=H?.project?.localPath;return e?H?.subPath?`${e}/${H.subPath}`:e:null})(),eo=(()=>{let e=en?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),ed=e=>(0,b.isImageAsset)(e.filename,e.mimeType)||z.test(e.filename),ec=e=>{ed(e)?ea(e):O.toast.info(E("assets.previewNotSupported"))},em=async 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(()=>({}));O.toast.error(e.error||E("git.openInFileManagerFailed"))}}catch{O.toast.error(E("git.openInFileManagerFailed"))}},ex=es?(0,b.isImageAsset)(es.filename,es.mimeType)?"image":z.test(es.filename)?"text":null:null,eu=ee.filter(e=>(0,b.isImageAsset)(e.filename,e.mimeType)).map(e=>({id:e.id,url:(0,b.localPathToApiUrl)(e.path),filename:e.filename})),eh=es?eu.findIndex(e=>e.id===es.id):-1,ep=async e=>{if(H?.project)try{let{autoStart:t,...s}=e;await (0,o.createTask)({...s,projectId:H.project.id}),O.toast.success(E("taskDrawer.duplicateSuccess")),W(!1),R(!1)}catch{O.toast.error(E("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(a.Sheet,{open:e,onOpenChange:R,children:[(0,t.jsxs)(a.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(a.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(a.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:H?.title??""}),(0,t.jsx)(a.SheetDescription,{className:"sr-only",children:E("taskDrawer.title")}),H&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[er&&(0,t.jsxs)(i.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${er.color}`}),er.label]}),ei&&(0,t.jsx)(i.Badge,{variant:"secondary",className:`text-xs ${ei.color}`,children:ei.label}),H.version&&(0,t.jsx)(A.TaskVersionTag,{number:H.version.number,name:H.version.name,showName:!0})]})]}),(0,t.jsx)(r.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:_&&!H?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:E("assets.loading")}):H?(0,t.jsxs)("div",{className:"p-4 pb-8 space-y-4",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:E("taskDrawer.description")}),H.description?(0,t.jsx)(M,{text:H.description},H.id):(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:E("taskDrawer.noDescription")})]}),H.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:E("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:H.labels.map(e=>(0,t.jsx)(i.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(y.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:E("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(H.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(w.Package,{className:"h-3.5 w-3.5"}),E("taskDrawer.resources"),(0,t.jsx)("span",{className:"text-foreground",children:H._count.assets})]}),ee.length>0?(0,t.jsx)("div",{className:"space-y-1.5",children:ee.map(e=>{var s;let a=ed(e);return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border px-2 py-1.5",children:[(0,t.jsx)(B.Paperclip,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("button",{type:"button",onClick:()=>ec(e),disabled:!a,className:`min-w-0 flex-1 truncate text-left text-sm ${a?"cursor-pointer hover:underline":"cursor-default"}`,title:a?E("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)(n.Button,{variant:"ghost",size:"icon-xs",onClick:()=>ec(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:E("assets.preview"),children:(0,t.jsx)(P.Eye,{className:"h-3 w-3"})}),(0,t.jsx)(n.Button,{variant:"ghost",size:"icon-xs",onClick:()=>em(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:E("assets.revealInFinder"),children:(0,t.jsx)(F.FolderOpen,{className:"h-3 w-3"})})]})]},e.id)})}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:E("taskDrawer.noResources")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(D.FileText,{className:"h-3.5 w-3.5"}),E("taskDrawer.notes")]}),X.length>0?(0,t.jsx)("div",{className:"space-y-1.5",children:X.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>Z(e),className:"group/note flex w-full items-start gap-2 rounded-md border border-border p-2 text-left transition-colors hover:bg-accent/40",title:E("taskDrawer.previewNote"),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium",children:e.title}),e.content&&(0,t.jsx)("p",{className:"mt-0.5 line-clamp-2 whitespace-pre-wrap text-xs text-muted-foreground",children:e.content})]}),(0,t.jsx)(P.Eye,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/note:opacity-100"})]},e.id))}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:E("taskDrawer.noNotes")})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:E("taskDrawer.fileChanges")}),eo?(0,t.jsx)($,{added:eo.added,removed:eo.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:E("taskDrawer.noFileChanges")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(S.PlayCircle,{className:"h-3.5 w-3.5"}),E("taskDrawer.lastExecution")]}),en?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(i.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:en.status}),en.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:en.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:E("taskDrawer.noExecution")})]}),el&&!L&&(0,t.jsxs)("section",{className:"flex flex-col",children:[(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,u.openInFileManager)(el)}catch(e){console.error("openInFileManager failed:",e),O.toast.error(E("git.openInFileManagerFailed"))}},children:[(0,t.jsx)(C.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),E("git.openInFileManager")]}),(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,h.openInEditor)(el)}catch(e){console.error("openInEditor failed:",e),O.toast.error(E("git.openInEditorFailed"))}},children:[(0,t.jsx)(T.Code,{className:"h-3.5 w-3.5 shrink-0"}),E("git.openInEditor")]}),(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,p.openInTerminal)(el)}catch(e){console.error("openInTerminal failed:",e),O.toast.error(E("git.openInTerminalFailed"))}},children:[(0,t.jsx)(I.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),E("git.openInTerminal")]})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(n.Button,{variant:"default",className:"w-full",onClick:()=>{H&&W(!0)},disabled:!H,children:[(0,t.jsx)(k.Copy,{className:"h-4 w-4"}),E("taskDrawer.duplicate")]})})]}):null})]}),H?.project&&(0,t.jsx)(f.CreateTaskDialog,{open:J,onOpenChange:W,onSubmit:ep,labels:q,projectType:H.project.type,projectLocalPath:H.project.localPath,prefillFromTask:{title:H.title,description:H.description,priority:H.priority,subPath:H.subPath,labelIds:H.labels.map(e=>e.label.id),baseBranch:H.baseBranch}}),(0,t.jsx)(g.NotePreviewDialog,{note:Q,open:null!==Q,onOpenChange:e=>{e||Z(null)}}),(0,t.jsx)(j.ImageLightbox,{imageUrl:"image"===ex&&eh>=0?eu[eh].url:null,filename:"image"===ex&&eh>=0?eu[eh].filename:"",open:"image"===ex,onOpenChange:e=>{e||ea(null)},assets:eu.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:eh>=0?eh:void 0,onIndexChange:e=>{let t=eu[e];if(!t)return;let s=ee.find(e=>e.id===t.id);s&&ea(s)}}),(0,t.jsx)(v.TextPreviewDialog,{url:"text"===ex&&es?(0,b.localPathToApiUrl)(es.path):null,filename:es?.filename??"",open:"text"===ex,onOpenChange:e=>{e||ea(null)}})]})}],605005)},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)},768096,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40423169aa2508c9cd2bada9f65d9397112c0ea175",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,s])},127395,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("404cb0cdb388fc63f10c22dc497e72b00bb5c78d42",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,s])},734525,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(400355),r=e.i(738690),i=e.i(236967),n=e.i(533499),l=e.i(768096),o=e.i(514798);let d=(0,o.createServerReference)("4099fb0ca8f0f4a630a0f2347cf1795d311f8aba51",o.callServer,void 0,o.findSourceMapURL,"getProjectAssets");var c=e.i(453889),m=e.i(912505),x=e.i(645378),u=e.i(867533),h=e.i(998626),p=e.i(519455),f=e.i(937304);function g({asset:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i}){var l;let{t:o}=(0,n.useI18n)(),d=(0,f.localPathToApiUrl)(e.path),m=(0,f.isImageAsset)(e.filename,e.mimeType);return(0,t.jsxs)("div",{className:"flex items-center gap-4 rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:bg-accent/20",children:[(0,t.jsx)(p.Button,{variant:"ghost",onClick:()=>s(e),className:"flex-shrink-0 cursor-pointer p-0 h-auto",children:m?(0,t.jsx)("img",{src:d,alt:e.filename,className:"h-12 w-12 rounded object-cover border border-border"}):(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded border border-border bg-muted",children:(0,t.jsx)(x.FileText,{className:"h-6 w-6 text-muted-foreground"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:e.filename}),e.taskTitle&&e.taskId&&(0,t.jsx)(p.Button,{variant:"ghost",onClick:t=>{t.stopPropagation(),i?.(e.taskId)},className:"flex-shrink-0 bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs px-1.5 py-0.5 rounded cursor-pointer hover:bg-blue-500/20 transition-colors h-auto",children:e.taskTitle.length>20?`[任务: ${e.taskTitle.slice(0,20)}...]`:`[任务: ${e.taskTitle}]`})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:null===(l=e.size)?"-":l<1024?`${l} B`:l<1048576?`${(l/1024).toFixed(1)} KB`:l<0x40000000?`${(l/1048576).toFixed(1)} MB`:`${(l/0x40000000).toFixed(1)} GB`}),(0,t.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,t.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>s(e),className:"text-muted-foreground","aria-label":o("assets.preview"),children:(0,t.jsx)(u.Eye,{className:"h-4 w-4"})}),(0,t.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>a(e),className:"text-muted-foreground","aria-label":o("assets.revealInFinder"),children:(0,t.jsx)(c.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>r(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":o("assets.delete"),children:(0,t.jsx)(h.Trash2,{className:"h-4 w-4"})})]})]})}function j({assets:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i}){let{t:l}=(0,n.useI18n)();return 0===e.length?(0,t.jsx)(m.EmptyState,{icon:c.FolderOpen,title:l("assets.empty"),description:l("assets.emptyHint")}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsx)(g,{asset:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i},e.id))})}var v=e.i(631675),b=e.i(657153),N=e.i(127395),y=e.i(624687),k=e.i(967489);function w({allWorkspaces:e,initialWsId:a,initialProjectId:r,onUploaded:i}){let{t:l}=(0,n.useI18n)(),o=(0,s.useRef)(null),[d,c]=(0,s.useState)(!1),[m,x]=(0,s.useState)(!1),[u,h]=(0,s.useState)(null),[f,g]=(0,s.useState)(a),[j,S]=(0,s.useState)(r),[C,T]=(0,s.useState)(""),I=e.find(e=>e.id===f),D=I?.projects??[],P=D.find(e=>e.id===j),B=P?P.alias?`${P.name} (${P.alias})`:P.name:j??"",F=()=>{c(!1),h(null),o.current&&(o.current.value="")},$=async()=>{if(u&&j){x(!0);try{let e=new FormData;e.append("file",u),e.append("projectId",j),e.append("description",C.trim()),await (0,N.uploadAsset)(e),i(j),F()}finally{x(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(p.Button,{onClick:()=>{g(a),S(r),h(null),T(""),c(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(v.Upload,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("assets.upload")})]}),d&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:F}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg",children:[(0,t.jsx)(p.Button,{variant:"ghost",size:"icon-xs",onClick:F,className:"absolute right-3 top-3 text-muted-foreground",children:(0,t.jsx)(b.X,{className:"h-4 w-4"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-4",children:l("assets.uploadTitle")}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:l("assets.workspace")}),(0,t.jsxs)(k.Select,{value:f,onValueChange:t=>{var s;let a;return g(s=t??""),a=e.find(e=>e.id===s),void S(a?.projects[0]?.id??null)},children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 min-w-0 text-xs",children:(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",title:I?.name??f,children:I?.name??f})}),(0,t.jsx)(k.SelectContent,{className:"max-w-[var(--anchor-width)]",children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,title:e.name,children:(0,t.jsx)("span",{className:"block truncate",children:e.name})},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:l("assets.project")}),D.length>0?(0,t.jsxs)(k.Select,{value:j??"",onValueChange:e=>S(e??""),children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 min-w-0 text-xs",children:(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",title:B,children:B})}),(0,t.jsx)(k.SelectContent,{className:"max-w-[var(--anchor-width)]",children:D.map(e=>{let s=e.alias?`${e.name} (${e.alias})`:e.name;return(0,t.jsx)(k.SelectItem,{value:e.id,title:s,children:(0,t.jsx)("span",{className:"block truncate",children:s})},e.id)})})]}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:l("assets.noProject")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:l("assets.file")}),(0,t.jsx)("input",{type:"file",ref:o,onChange:e=>{h(e.target.files?.[0]??null)},className:"hidden"}),(0,t.jsx)(p.Button,{variant:"outline",onClick:()=>{o.current?.click()},className:"flex-1 border-dashed bg-background px-3 py-2 text-xs text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors text-left justify-start",children:u?u.name:l("assets.selectFile")})]}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0 pt-1.5",children:l("assets.description")}),(0,t.jsx)(y.Textarea,{value:C,onChange:e=>T(e.target.value),placeholder:l("assets.descriptionPlaceholder"),className:"flex-1 rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none h-20"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end mt-6",children:[(0,t.jsx)(p.Button,{variant:"outline",onClick:F,children:l("notes.cancel")}),(0,t.jsx)(p.Button,{onClick:$,disabled:!u||!j||!C.trim()||m,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:l(m?"assets.uploading":"assets.upload")})]})]})]})]})}var S=e.i(235357),C=e.i(144640),T=e.i(605005),I=e.i(360112);e.s(["AssetsPageClient",0,function({allWorkspaces:e,initialWorkspaceId:o,initialProjectId:c,initialAssets:m}){let x,{t:u}=(0,n.useI18n)(),[h,p]=(0,s.useTransition)(),[g,v]=(0,s.useState)(o),[b,N]=(0,s.useState)(c),[y,D]=(0,s.useState)(m),[P,B]=(0,s.useState)(""),[F,$]=(0,s.useState)(null),A=e.find(e=>e.id===g),O=A?.projects??[],z=(0,s.useCallback)(e=>{e?p(async()=>{D(await d(e))}):D([])},[p]),[M,R]=(0,s.useState)(null),U=M?(0,f.isImageAsset)(M.filename,M.mimeType)?"image":/\.(txt|md|json)$/i.test(M.filename)?"text":null:null,L=P.trim().toLowerCase(),E=L?y.filter(e=>e.filename.toLowerCase().includes(L)):y,H=E.filter(e=>(0,f.isImageAsset)(e.filename,e.mimeType)).map(e=>({id:e.id,url:(0,f.localPathToApiUrl)(e.path),filename:e.filename})),V=M?H.findIndex(e=>e.id===M.id):-1,_=async 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(()=>({}));I.toast.error(e.error||"Failed to reveal file")}}catch{I.toast.error("Failed to reveal file")}},K=async e=>{let t=y.find(t=>t.id===e);confirm(u("assets.deleteConfirm",{filename:t?.filename??e}))&&(await (0,l.deleteAsset)(e),z(b))};return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(i.SubPageNav,{workspaceId:g}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(k.Select,{value:g,onValueChange:t=>t&&(t=>{if(t===g)return;v(t);let s=e.find(e=>e.id===t),a=s?.projects[0]??null;N(a?.id??null),z(a?.id??null)})(t),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===g)?.name??g})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]}),O.length>0&&(0,t.jsxs)(k.Select,{value:b??"",onValueChange:e=>e&&void(e!==b&&(N(e),z(e))),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(x=O.find(e=>e.id===b))?x.alias?`${x.name} (${x.alias})`:x.name:""})}),(0,t.jsx)(k.SelectContent,{children:O.map(e=>(0,t.jsxs)(k.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,t.jsxs)("div",{className:"relative ml-auto",children:[(0,t.jsx)(r.Search,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)("input",{type:"text",value:P,onChange:e=>B(e.target.value),placeholder:u("assets.searchPlaceholder"),className:"h-8 w-48 rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),(0,t.jsx)(w,{allWorkspaces:e,initialWsId:g,initialProjectId:b,onUploaded:e=>{e===b&&z(b)}})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,t.jsxs)("div",{className:`relative ${h?"opacity-40 pointer-events-none":""} transition-opacity`,children:[h&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(a.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===O.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:u("assets.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:u("assets.noProjectHint")})]}):(0,t.jsx)(j,{assets:E.map(e=>({...e,taskId:e.task?.id??null,taskTitle:e.task?.title??null})),onPreview:e=>{let t=(0,f.isImageAsset)(e.filename,e.mimeType),s=/\.(txt|md|json)$/i.test(e.filename);(t||s)&&R(e)},onReveal:_,onDelete:K,onTaskClick:$})]})}),(0,t.jsx)(S.ImageLightbox,{imageUrl:"image"===U&&V>=0?H[V].url:null,filename:"image"===U&&V>=0?H[V].filename:"",open:"image"===U,onOpenChange:e=>{e||R(null)},assets:H.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:V>=0?V:void 0,onIndexChange:e=>{let t=H[e];if(!t)return;let s=y.find(e=>e.id===t.id);s&&R({...s,taskId:s.task?.id??null,taskTitle:s.task?.title??null})}}),(0,t.jsx)(C.TextPreviewDialog,{url:"text"===U&&M?(0,f.localPathToApiUrl)(M.path):null,filename:M?.filename??"",open:"text"===U,onOpenChange:e=>{e||R(null)}}),(0,t.jsx)(T.TaskOverviewDrawer,{open:!!F,onOpenChange:e=>{e||$(null)},taskId:F})]})}],734525)},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)))}]);
|