remote-codex 0.11.0 → 0.11.2
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/apps/supervisor-api/dist/index.js +3056 -753
- package/apps/supervisor-web/dist/assets/core-DIQen2lE.js +12 -0
- package/apps/supervisor-web/dist/assets/{css-DPfMkruS.js → css-CLj8gQPS.js} +1 -1
- package/apps/supervisor-web/dist/assets/engine-javascript-DBd1bXLz.js +141 -0
- package/apps/supervisor-web/dist/assets/graph-vendor-C5ap-Sga.css +1 -0
- package/apps/supervisor-web/dist/assets/graph-vendor-CGzY-MFv.js +23 -0
- package/apps/supervisor-web/dist/assets/{html-GMplVEZG.js → html-pp8916En.js} +1 -1
- package/apps/supervisor-web/dist/assets/index-CbDzXN9T.css +1 -0
- package/apps/supervisor-web/dist/assets/index-DQpHiQXN.js +4 -0
- package/apps/supervisor-web/dist/assets/markdown-vendor-hBDTCSB-.js +291 -0
- package/apps/supervisor-web/dist/assets/react-vendor-o1Xrx7m4.js +60 -0
- package/apps/supervisor-web/dist/assets/{shellscript-Yzrsuije.js → shellscript-CEILq0vU.js} +1 -1
- package/apps/supervisor-web/dist/assets/{sql-BLtJtn59.js → sql-CRqJ_cUM.js} +1 -1
- package/apps/supervisor-web/dist/assets/terminal-vendor-Beg8tuEN.css +32 -0
- package/apps/supervisor-web/dist/assets/{xterm-D4sevve4.js → terminal-vendor-CLGgN91S.js} +17 -6
- package/apps/supervisor-web/dist/assets/thread-ui-BEieA99i.css +1 -0
- package/apps/supervisor-web/dist/assets/thread-ui-CDk3ExRH.js +3516 -0
- package/apps/supervisor-web/dist/assets/ui-vendor-CgOZX1B8.js +425 -0
- package/apps/supervisor-web/dist/index.html +11 -2
- package/apps/supervisor-web/dist/vendor/3Dmol-min.js +2 -0
- package/bin/remote-codex-plugin-mcp.mjs +140 -0
- package/package.json +6 -1
- package/packages/agent-runtime/src/model-pricing.ts +16 -3
- package/packages/agent-runtime/src/types.ts +1 -0
- package/packages/agent-runtime/src/unavailable-runtime.ts +5 -13
- package/packages/claude/src/historyItems.ts +41 -5
- package/packages/claude/src/runtimeAdapter.test.ts +22 -0
- package/packages/claude/src/runtimeAdapter.ts +7 -5
- package/packages/codex/src/appServerManager.ts +3 -3
- package/packages/codex/src/historyItems.test.ts +29 -4
- package/packages/codex/src/historyItems.ts +52 -20
- package/packages/codex/src/modelPricing.test.ts +51 -0
- package/packages/codex/src/runtime-errors.ts +0 -5
- package/packages/codex/src/runtimeAdapter.ts +3 -0
- package/packages/codex/src/types.ts +1 -0
- package/packages/db/migrations/0018_shell_session_label.sql +1 -0
- package/packages/db/src/repositories.ts +12 -0
- package/packages/db/src/schema.ts +1 -0
- package/packages/opencode/src/historyItems.ts +0 -17
- package/packages/opencode/src/runtimeAdapter.test.ts +89 -0
- package/packages/opencode/src/runtimeAdapter.ts +8 -4
- package/packages/plugin-terminal/package.json +17 -0
- package/packages/plugin-terminal/plugin.json +25 -0
- package/packages/plugin-terminal/src/index.ts +2 -0
- package/packages/plugin-terminal/src/manifest.ts +51 -0
- package/packages/shared/src/index.ts +129 -0
- package/apps/supervisor-web/dist/assets/abap-BdImnpbu.js +0 -1
- package/apps/supervisor-web/dist/assets/actionscript-3-CoDkCxhg.js +0 -1
- package/apps/supervisor-web/dist/assets/ada-bCR0ucgS.js +0 -1
- package/apps/supervisor-web/dist/assets/addon-fit-YJmn1quW.js +0 -12
- package/apps/supervisor-web/dist/assets/andromeeda-C4gqWexZ.js +0 -1
- package/apps/supervisor-web/dist/assets/angular-html-CU67Zn6k.js +0 -1
- package/apps/supervisor-web/dist/assets/angular-ts-BwZT4LLn.js +0 -1
- package/apps/supervisor-web/dist/assets/apache-Pmp26Uib.js +0 -1
- package/apps/supervisor-web/dist/assets/apex-D8_7TLub.js +0 -1
- package/apps/supervisor-web/dist/assets/apl-dKokRX4l.js +0 -1
- package/apps/supervisor-web/dist/assets/applescript-Co6uUVPk.js +0 -1
- package/apps/supervisor-web/dist/assets/ara-BRHolxvo.js +0 -1
- package/apps/supervisor-web/dist/assets/asciidoc-Ve4PFQV2.js +0 -1
- package/apps/supervisor-web/dist/assets/asm-D_Q5rh1f.js +0 -1
- package/apps/supervisor-web/dist/assets/astro-CbQHKStN.js +0 -1
- package/apps/supervisor-web/dist/assets/aurora-x-D-2ljcwZ.js +0 -1
- package/apps/supervisor-web/dist/assets/awk-DMzUqQB5.js +0 -1
- package/apps/supervisor-web/dist/assets/ayu-mirage-32ctXXKs.js +0 -1
- package/apps/supervisor-web/dist/assets/ballerina-BFfxhgS-.js +0 -1
- package/apps/supervisor-web/dist/assets/bat-BkioyH1T.js +0 -1
- package/apps/supervisor-web/dist/assets/beancount-k_qm7-4y.js +0 -1
- package/apps/supervisor-web/dist/assets/berry-uYugtg8r.js +0 -1
- package/apps/supervisor-web/dist/assets/bibtex-CHM0blh-.js +0 -1
- package/apps/supervisor-web/dist/assets/bicep-Bmn6On1c.js +0 -1
- package/apps/supervisor-web/dist/assets/bird2-DPOp833l.js +0 -1
- package/apps/supervisor-web/dist/assets/blade-D4QpJJKB.js +0 -1
- package/apps/supervisor-web/dist/assets/bsl-BO_Y6i37.js +0 -1
- package/apps/supervisor-web/dist/assets/c-BIGW1oBm.js +0 -1
- package/apps/supervisor-web/dist/assets/c3-eo99z4R2.js +0 -1
- package/apps/supervisor-web/dist/assets/cadence-Bv_4Rxtq.js +0 -1
- package/apps/supervisor-web/dist/assets/cairo-KRGpt6FW.js +0 -1
- package/apps/supervisor-web/dist/assets/catppuccin-frappe-DFWUc33u.js +0 -1
- package/apps/supervisor-web/dist/assets/catppuccin-latte-C9dUb6Cb.js +0 -1
- package/apps/supervisor-web/dist/assets/catppuccin-macchiato-DQyhUUbL.js +0 -1
- package/apps/supervisor-web/dist/assets/catppuccin-mocha-D87Tk5Gz.js +0 -1
- package/apps/supervisor-web/dist/assets/clarity-D53aC0YG.js +0 -1
- package/apps/supervisor-web/dist/assets/clojure-P80f7IUj.js +0 -1
- package/apps/supervisor-web/dist/assets/cmake-D1j8_8rp.js +0 -1
- package/apps/supervisor-web/dist/assets/cobol-nwyudZeR.js +0 -1
- package/apps/supervisor-web/dist/assets/codeowners-Bp6g37R7.js +0 -1
- package/apps/supervisor-web/dist/assets/codeql-DsOJ9woJ.js +0 -1
- package/apps/supervisor-web/dist/assets/coffee-Ch7k5sss.js +0 -1
- package/apps/supervisor-web/dist/assets/common-lisp-Cg-RD9OK.js +0 -1
- package/apps/supervisor-web/dist/assets/coq-DkFqJrB1.js +0 -1
- package/apps/supervisor-web/dist/assets/cpp-CofmeUqb.js +0 -1
- package/apps/supervisor-web/dist/assets/crystal-tKQVLTB8.js +0 -1
- package/apps/supervisor-web/dist/assets/csharp-COcwbKMJ.js +0 -1
- package/apps/supervisor-web/dist/assets/cue-D82EKSYY.js +0 -1
- package/apps/supervisor-web/dist/assets/cypher-COkxafJQ.js +0 -1
- package/apps/supervisor-web/dist/assets/d-85-TOEBH.js +0 -1
- package/apps/supervisor-web/dist/assets/dark-plus-C3mMm8J8.js +0 -1
- package/apps/supervisor-web/dist/assets/dart-CF10PKvl.js +0 -1
- package/apps/supervisor-web/dist/assets/dax-CEL-wOlO.js +0 -1
- package/apps/supervisor-web/dist/assets/desktop-BmXAJ9_W.js +0 -1
- package/apps/supervisor-web/dist/assets/diff-D97Zzqfu.js +0 -1
- package/apps/supervisor-web/dist/assets/docker-BcOcwvcX.js +0 -1
- package/apps/supervisor-web/dist/assets/dotenv-Da5cRb03.js +0 -1
- package/apps/supervisor-web/dist/assets/dracula-BzJJZx-M.js +0 -1
- package/apps/supervisor-web/dist/assets/dracula-soft-BXkSAIEj.js +0 -1
- package/apps/supervisor-web/dist/assets/dream-maker-BtqSS_iP.js +0 -1
- package/apps/supervisor-web/dist/assets/edge-BkV0erSs.js +0 -1
- package/apps/supervisor-web/dist/assets/elixir-CDX3lj18.js +0 -1
- package/apps/supervisor-web/dist/assets/elm-DbKCFpqz.js +0 -1
- package/apps/supervisor-web/dist/assets/emacs-lisp-C9XAeP06.js +0 -1
- package/apps/supervisor-web/dist/assets/erb-B12qg9BL.js +0 -1
- package/apps/supervisor-web/dist/assets/erlang-DsQrWhSR.js +0 -1
- package/apps/supervisor-web/dist/assets/everforest-dark-BgDCqdQA.js +0 -1
- package/apps/supervisor-web/dist/assets/everforest-light-C8M2exoo.js +0 -1
- package/apps/supervisor-web/dist/assets/fennel-BYunw83y.js +0 -1
- package/apps/supervisor-web/dist/assets/fish-BvzEVeQv.js +0 -1
- package/apps/supervisor-web/dist/assets/fluent-C4IJs8-o.js +0 -1
- package/apps/supervisor-web/dist/assets/fortran-fixed-form-CkoXwp7k.js +0 -1
- package/apps/supervisor-web/dist/assets/fortran-free-form-BxgE0vQu.js +0 -1
- package/apps/supervisor-web/dist/assets/fsharp-CXgrBDvD.js +0 -1
- package/apps/supervisor-web/dist/assets/gdresource-BOOCDP_w.js +0 -1
- package/apps/supervisor-web/dist/assets/gdscript-C5YyOfLZ.js +0 -1
- package/apps/supervisor-web/dist/assets/gdshader-DkwncUOv.js +0 -1
- package/apps/supervisor-web/dist/assets/genie-D0YGMca9.js +0 -1
- package/apps/supervisor-web/dist/assets/gherkin-DyxjwDmM.js +0 -1
- package/apps/supervisor-web/dist/assets/git-commit-F4YmCXRG.js +0 -1
- package/apps/supervisor-web/dist/assets/git-rebase-r7XF79zn.js +0 -1
- package/apps/supervisor-web/dist/assets/github-dark-DHJKELXO.js +0 -1
- package/apps/supervisor-web/dist/assets/github-dark-default-Cuk6v7N8.js +0 -1
- package/apps/supervisor-web/dist/assets/github-dark-dimmed-DH5Ifo-i.js +0 -1
- package/apps/supervisor-web/dist/assets/github-dark-high-contrast-E3gJ1_iC.js +0 -1
- package/apps/supervisor-web/dist/assets/github-light-DAi9KRSo.js +0 -1
- package/apps/supervisor-web/dist/assets/github-light-default-D7oLnXFd.js +0 -1
- package/apps/supervisor-web/dist/assets/github-light-high-contrast-BfjtVDDH.js +0 -1
- package/apps/supervisor-web/dist/assets/gleam-BspZqrRM.js +0 -1
- package/apps/supervisor-web/dist/assets/glimmer-js-Rg0-pVw9.js +0 -1
- package/apps/supervisor-web/dist/assets/glimmer-ts-U6CK756n.js +0 -1
- package/apps/supervisor-web/dist/assets/glsl-DplSGwfg.js +0 -1
- package/apps/supervisor-web/dist/assets/gn-n2N0HUVH.js +0 -1
- package/apps/supervisor-web/dist/assets/gnuplot-DdkO51Og.js +0 -1
- package/apps/supervisor-web/dist/assets/go-CxLEBnE3.js +0 -1
- package/apps/supervisor-web/dist/assets/graphql-ChdNCCLP.js +0 -1
- package/apps/supervisor-web/dist/assets/groovy-gcz8RCvz.js +0 -1
- package/apps/supervisor-web/dist/assets/gruvbox-dark-hard-CFHQjOhq.js +0 -1
- package/apps/supervisor-web/dist/assets/gruvbox-dark-medium-GsRaNv29.js +0 -1
- package/apps/supervisor-web/dist/assets/gruvbox-dark-soft-CVdnzihN.js +0 -1
- package/apps/supervisor-web/dist/assets/gruvbox-light-hard-CH1njM8p.js +0 -1
- package/apps/supervisor-web/dist/assets/gruvbox-light-medium-DRw_LuNl.js +0 -1
- package/apps/supervisor-web/dist/assets/gruvbox-light-soft-hJgmCMqR.js +0 -1
- package/apps/supervisor-web/dist/assets/hack-CaT9iCJl.js +0 -1
- package/apps/supervisor-web/dist/assets/haml-B8DHNrY2.js +0 -1
- package/apps/supervisor-web/dist/assets/handlebars-BL8al0AC.js +0 -1
- package/apps/supervisor-web/dist/assets/haskell-Df6bDoY_.js +0 -1
- package/apps/supervisor-web/dist/assets/haxe-CzTSHFRz.js +0 -1
- package/apps/supervisor-web/dist/assets/hcl-BWvSN4gD.js +0 -1
- package/apps/supervisor-web/dist/assets/highlighted-body-OFNGDK62-ChrwAL9u.js +0 -1
- package/apps/supervisor-web/dist/assets/hjson-D5-asLiD.js +0 -1
- package/apps/supervisor-web/dist/assets/hlsl-D3lLCCz7.js +0 -1
- package/apps/supervisor-web/dist/assets/horizon-BUw7H-hv.js +0 -1
- package/apps/supervisor-web/dist/assets/horizon-bright-Cn-bp-IR.js +0 -1
- package/apps/supervisor-web/dist/assets/houston-DnULxvSX.js +0 -1
- package/apps/supervisor-web/dist/assets/html-derivative-BFtXZ54Q.js +0 -1
- package/apps/supervisor-web/dist/assets/http-jrhK8wxY.js +0 -1
- package/apps/supervisor-web/dist/assets/hurl-irOxFIW8.js +0 -1
- package/apps/supervisor-web/dist/assets/hxml-Bvhsp5Yf.js +0 -1
- package/apps/supervisor-web/dist/assets/hy-DFXneXwc.js +0 -1
- package/apps/supervisor-web/dist/assets/imba-DGztddWO.js +0 -1
- package/apps/supervisor-web/dist/assets/index-DHf2HOXx.js +0 -381
- package/apps/supervisor-web/dist/assets/index-DpWxXCgt.css +0 -32
- package/apps/supervisor-web/dist/assets/ini-BEwlwnbL.js +0 -1
- package/apps/supervisor-web/dist/assets/java-CylS5w8V.js +0 -1
- package/apps/supervisor-web/dist/assets/jinja-4LBKfQ-Z.js +0 -1
- package/apps/supervisor-web/dist/assets/jison-wvAkD_A8.js +0 -1
- package/apps/supervisor-web/dist/assets/json5-C9tS-k6U.js +0 -1
- package/apps/supervisor-web/dist/assets/jsonc-Des-eS-w.js +0 -1
- package/apps/supervisor-web/dist/assets/jsonl-DcaNXYhu.js +0 -1
- package/apps/supervisor-web/dist/assets/jsonnet-DFQXde-d.js +0 -1
- package/apps/supervisor-web/dist/assets/jssm-C2t-YnRu.js +0 -1
- package/apps/supervisor-web/dist/assets/julia-CxzCAyBv.js +0 -1
- package/apps/supervisor-web/dist/assets/just-Cw27pwNe.js +0 -1
- package/apps/supervisor-web/dist/assets/kanagawa-dragon-CkXjmgJE.js +0 -1
- package/apps/supervisor-web/dist/assets/kanagawa-lotus-CfQXZHmo.js +0 -1
- package/apps/supervisor-web/dist/assets/kanagawa-wave-DWedfzmr.js +0 -1
- package/apps/supervisor-web/dist/assets/kdl-DV7GczEv.js +0 -1
- package/apps/supervisor-web/dist/assets/kotlin-BdnUsdx6.js +0 -1
- package/apps/supervisor-web/dist/assets/kusto-DZf3V79B.js +0 -1
- package/apps/supervisor-web/dist/assets/laserwave-DUszq2jm.js +0 -1
- package/apps/supervisor-web/dist/assets/latex-CWtU0Tv5.js +0 -1
- package/apps/supervisor-web/dist/assets/lean-BZvkOJ9d.js +0 -1
- package/apps/supervisor-web/dist/assets/less-B1dDrJ26.js +0 -1
- package/apps/supervisor-web/dist/assets/light-plus-B7mTdjB0.js +0 -1
- package/apps/supervisor-web/dist/assets/liquid-DYVedYrR.js +0 -1
- package/apps/supervisor-web/dist/assets/llvm-DjAJT7YJ.js +0 -1
- package/apps/supervisor-web/dist/assets/log-2UxHyX5q.js +0 -1
- package/apps/supervisor-web/dist/assets/logo-BtOb2qkB.js +0 -1
- package/apps/supervisor-web/dist/assets/lua-BaeVxFsk.js +0 -1
- package/apps/supervisor-web/dist/assets/luau-C-HG3fhB.js +0 -1
- package/apps/supervisor-web/dist/assets/make-CHLpvVh8.js +0 -1
- package/apps/supervisor-web/dist/assets/marko-CnJfTvn9.js +0 -1
- package/apps/supervisor-web/dist/assets/material-theme-D5KoaKCx.js +0 -1
- package/apps/supervisor-web/dist/assets/material-theme-darker-BfHTSMKl.js +0 -1
- package/apps/supervisor-web/dist/assets/material-theme-lighter-B0m2ddpp.js +0 -1
- package/apps/supervisor-web/dist/assets/material-theme-ocean-CyktbL80.js +0 -1
- package/apps/supervisor-web/dist/assets/material-theme-palenight-Csfq5Kiy.js +0 -1
- package/apps/supervisor-web/dist/assets/matlab-D7o27uSR.js +0 -1
- package/apps/supervisor-web/dist/assets/mdc-BMNejdWA.js +0 -1
- package/apps/supervisor-web/dist/assets/mdx-Cmh6b_Ma.js +0 -1
- package/apps/supervisor-web/dist/assets/mermaid-mWjccvbQ.js +0 -1
- package/apps/supervisor-web/dist/assets/min-dark-CafNBF8u.js +0 -1
- package/apps/supervisor-web/dist/assets/min-light-CTRr51gU.js +0 -1
- package/apps/supervisor-web/dist/assets/mipsasm-CKIfxQSi.js +0 -1
- package/apps/supervisor-web/dist/assets/mojo-rZm6bMo-.js +0 -1
- package/apps/supervisor-web/dist/assets/monokai-D4h5O-jR.js +0 -1
- package/apps/supervisor-web/dist/assets/moonbit-_H4v1dQx.js +0 -1
- package/apps/supervisor-web/dist/assets/move-IF9eRakj.js +0 -1
- package/apps/supervisor-web/dist/assets/narrat-DRg8JJMk.js +0 -1
- package/apps/supervisor-web/dist/assets/nextflow-Zz6hmt5N.js +0 -1
- package/apps/supervisor-web/dist/assets/nextflow-groovy-BeH2EWoN.js +0 -1
- package/apps/supervisor-web/dist/assets/nginx-BpAMiNFr.js +0 -1
- package/apps/supervisor-web/dist/assets/night-owl-C39BiMTA.js +0 -1
- package/apps/supervisor-web/dist/assets/night-owl-light-CMTm3GFP.js +0 -1
- package/apps/supervisor-web/dist/assets/nim-CVrawwO9.js +0 -1
- package/apps/supervisor-web/dist/assets/nix-CwoSXNpI.js +0 -1
- package/apps/supervisor-web/dist/assets/nord-Ddv68eIx.js +0 -1
- package/apps/supervisor-web/dist/assets/nushell-Cz2AlsmD.js +0 -1
- package/apps/supervisor-web/dist/assets/objective-c-DXmwc3jG.js +0 -1
- package/apps/supervisor-web/dist/assets/objective-cpp-CLxacb5B.js +0 -1
- package/apps/supervisor-web/dist/assets/ocaml-C0hk2d4L.js +0 -1
- package/apps/supervisor-web/dist/assets/odin-BBf5iR-q.js +0 -1
- package/apps/supervisor-web/dist/assets/one-dark-pro-DVMEJ2y_.js +0 -1
- package/apps/supervisor-web/dist/assets/one-light-C3Wv6jpd.js +0 -1
- package/apps/supervisor-web/dist/assets/openscad-C4EeE6gA.js +0 -1
- package/apps/supervisor-web/dist/assets/pascal-D93ZcfNL.js +0 -1
- package/apps/supervisor-web/dist/assets/perl-C0TMdlhV.js +0 -1
- package/apps/supervisor-web/dist/assets/php-Dhbhpdrm.js +0 -1
- package/apps/supervisor-web/dist/assets/pkl-u5AG7uiY.js +0 -1
- package/apps/supervisor-web/dist/assets/plastic-3e1v2bzS.js +0 -1
- package/apps/supervisor-web/dist/assets/plsql-ChMvpjG-.js +0 -1
- package/apps/supervisor-web/dist/assets/po-BTJTHyun.js +0 -1
- package/apps/supervisor-web/dist/assets/poimandres-CS3Unz2-.js +0 -1
- package/apps/supervisor-web/dist/assets/polar-C0HS_06l.js +0 -1
- package/apps/supervisor-web/dist/assets/postcss-CXtECtnM.js +0 -1
- package/apps/supervisor-web/dist/assets/powerquery-CEu0bR-o.js +0 -1
- package/apps/supervisor-web/dist/assets/powershell-Dpen1YoG.js +0 -1
- package/apps/supervisor-web/dist/assets/prisma-Dd19v3D-.js +0 -1
- package/apps/supervisor-web/dist/assets/prolog-CbFg5uaA.js +0 -1
- package/apps/supervisor-web/dist/assets/proto-C7zT0LnQ.js +0 -1
- package/apps/supervisor-web/dist/assets/pug-CGlum2m_.js +0 -1
- package/apps/supervisor-web/dist/assets/puppet-BMWR74SV.js +0 -1
- package/apps/supervisor-web/dist/assets/purescript-CklMAg4u.js +0 -1
- package/apps/supervisor-web/dist/assets/qml-3beO22l8.js +0 -1
- package/apps/supervisor-web/dist/assets/qmldir-C8lEn-DE.js +0 -1
- package/apps/supervisor-web/dist/assets/qss-IeuSbFQv.js +0 -1
- package/apps/supervisor-web/dist/assets/r-Dspwwk_N.js +0 -1
- package/apps/supervisor-web/dist/assets/racket-BqYA7rlc.js +0 -1
- package/apps/supervisor-web/dist/assets/raku-DXvB9xmW.js +0 -1
- package/apps/supervisor-web/dist/assets/razor-Uh8Bk_45.js +0 -1
- package/apps/supervisor-web/dist/assets/red-bN70gL4F.js +0 -1
- package/apps/supervisor-web/dist/assets/reg-C-SQnVFl.js +0 -1
- package/apps/supervisor-web/dist/assets/regexp-CDVJQ6XC.js +0 -1
- package/apps/supervisor-web/dist/assets/rel-C3B-1QV4.js +0 -1
- package/apps/supervisor-web/dist/assets/riscv-BM1_JUlF.js +0 -1
- package/apps/supervisor-web/dist/assets/ron-D8l8udqQ.js +0 -1
- package/apps/supervisor-web/dist/assets/rose-pine-dawn-DHQR4-dF.js +0 -1
- package/apps/supervisor-web/dist/assets/rose-pine-moon-D4_iv3hh.js +0 -1
- package/apps/supervisor-web/dist/assets/rose-pine-qdsjHGoJ.js +0 -1
- package/apps/supervisor-web/dist/assets/rosmsg-BJDFO7_C.js +0 -1
- package/apps/supervisor-web/dist/assets/rst-BrH8l1NY.js +0 -1
- package/apps/supervisor-web/dist/assets/ruby-Dw2BHqvy.js +0 -1
- package/apps/supervisor-web/dist/assets/rust-B1yitclQ.js +0 -1
- package/apps/supervisor-web/dist/assets/sas-cz2c8ADy.js +0 -1
- package/apps/supervisor-web/dist/assets/sass-Cj5Yp3dK.js +0 -1
- package/apps/supervisor-web/dist/assets/scala-C151Ov-r.js +0 -1
- package/apps/supervisor-web/dist/assets/scheme-C98Dy4si.js +0 -1
- package/apps/supervisor-web/dist/assets/scss-OYdSNvt2.js +0 -1
- package/apps/supervisor-web/dist/assets/sdbl-DVxCFoDh.js +0 -1
- package/apps/supervisor-web/dist/assets/shaderlab-Dg9Lc6iA.js +0 -1
- package/apps/supervisor-web/dist/assets/shellsession-BADoaaVG.js +0 -1
- package/apps/supervisor-web/dist/assets/slack-dark-BthQWCQV.js +0 -1
- package/apps/supervisor-web/dist/assets/slack-ochin-DqwNpetd.js +0 -1
- package/apps/supervisor-web/dist/assets/smalltalk-BERRCDM3.js +0 -1
- package/apps/supervisor-web/dist/assets/snazzy-light-Bw305WKR.js +0 -1
- package/apps/supervisor-web/dist/assets/solarized-dark-DXbdFlpD.js +0 -1
- package/apps/supervisor-web/dist/assets/solarized-light-L9t79GZl.js +0 -1
- package/apps/supervisor-web/dist/assets/solidity-rGO070M0.js +0 -1
- package/apps/supervisor-web/dist/assets/soy-Brmx7dQM.js +0 -1
- package/apps/supervisor-web/dist/assets/sparql-rVzFXLq3.js +0 -1
- package/apps/supervisor-web/dist/assets/splunk-BtCnVYZw.js +0 -1
- package/apps/supervisor-web/dist/assets/ssh-config-_ykCGR6B.js +0 -1
- package/apps/supervisor-web/dist/assets/stata-BH5u7GGu.js +0 -1
- package/apps/supervisor-web/dist/assets/stylus-BEDo0Tqx.js +0 -1
- package/apps/supervisor-web/dist/assets/surrealql-Bq5Q-fJD.js +0 -1
- package/apps/supervisor-web/dist/assets/svelte-C_ipcX3V.js +0 -1
- package/apps/supervisor-web/dist/assets/swift-D82vCrfD.js +0 -1
- package/apps/supervisor-web/dist/assets/synthwave-84-CbfX1IO0.js +0 -1
- package/apps/supervisor-web/dist/assets/system-verilog-CnnmHF94.js +0 -1
- package/apps/supervisor-web/dist/assets/systemd-4A_iFExJ.js +0 -1
- package/apps/supervisor-web/dist/assets/talonscript-CkByrt1z.js +0 -1
- package/apps/supervisor-web/dist/assets/tasl-QIJgUcNo.js +0 -1
- package/apps/supervisor-web/dist/assets/tcl-dwOrl1Do.js +0 -1
- package/apps/supervisor-web/dist/assets/templ-P3uqSqPl.js +0 -1
- package/apps/supervisor-web/dist/assets/terraform-BETggiCN.js +0 -1
- package/apps/supervisor-web/dist/assets/tex-idrVyKtj.js +0 -1
- package/apps/supervisor-web/dist/assets/tokyo-night-hegEt444.js +0 -1
- package/apps/supervisor-web/dist/assets/ts-tags-zn1MmPIZ.js +0 -1
- package/apps/supervisor-web/dist/assets/tsv-B_m7g4N7.js +0 -1
- package/apps/supervisor-web/dist/assets/turtle-BsS91CYL.js +0 -1
- package/apps/supervisor-web/dist/assets/twig-DNn4PbVi.js +0 -1
- package/apps/supervisor-web/dist/assets/typespec-BGHnOYBU.js +0 -1
- package/apps/supervisor-web/dist/assets/typst-DHCkPAjA.js +0 -1
- package/apps/supervisor-web/dist/assets/v-BcVCzyr7.js +0 -1
- package/apps/supervisor-web/dist/assets/vala-CsfeWuGM.js +0 -1
- package/apps/supervisor-web/dist/assets/vb-D17OF-Vu.js +0 -1
- package/apps/supervisor-web/dist/assets/verilog-BQ8w6xss.js +0 -1
- package/apps/supervisor-web/dist/assets/vesper-DU1UobuO.js +0 -1
- package/apps/supervisor-web/dist/assets/vhdl-CeAyd5Ju.js +0 -1
- package/apps/supervisor-web/dist/assets/viml-CJc9bBzg.js +0 -1
- package/apps/supervisor-web/dist/assets/vitesse-black-Bkuqu6BP.js +0 -1
- package/apps/supervisor-web/dist/assets/vitesse-dark-D0r3Knsf.js +0 -1
- package/apps/supervisor-web/dist/assets/vitesse-light-CVO1_9PV.js +0 -1
- package/apps/supervisor-web/dist/assets/vue-DN_0RTcg.js +0 -1
- package/apps/supervisor-web/dist/assets/vue-html-AaS7Mt5G.js +0 -1
- package/apps/supervisor-web/dist/assets/vue-vine-CQOfvN7w.js +0 -1
- package/apps/supervisor-web/dist/assets/vyper-CDx5xZoG.js +0 -1
- package/apps/supervisor-web/dist/assets/wasm-CG6Dc4jp.js +0 -1
- package/apps/supervisor-web/dist/assets/wasm-MzD3tlZU.js +0 -1
- package/apps/supervisor-web/dist/assets/wenyan-BV7otONQ.js +0 -1
- package/apps/supervisor-web/dist/assets/wgsl-Dx-B1_4e.js +0 -1
- package/apps/supervisor-web/dist/assets/wikitext-BhOHFoWU.js +0 -1
- package/apps/supervisor-web/dist/assets/wit-5i3qLPDT.js +0 -1
- package/apps/supervisor-web/dist/assets/wolfram-lXgVvXCa.js +0 -1
- package/apps/supervisor-web/dist/assets/xml-sdJ4AIDG.js +0 -1
- package/apps/supervisor-web/dist/assets/xsl-CtQFsRM5.js +0 -1
- package/apps/supervisor-web/dist/assets/zenscript-DVFEvuxE.js +0 -1
- package/apps/supervisor-web/dist/assets/zig-VOosw3JB.js +0 -1
|
@@ -0,0 +1,3516 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-DIQen2lE.js","assets/markdown-vendor-hBDTCSB-.js","assets/react-vendor-o1Xrx7m4.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/terminal-vendor-CLGgN91S.js","assets/terminal-vendor-Beg8tuEN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as i,R as bd,j as e,a as bn}from"./react-vendor-o1Xrx7m4.js";import{C as Dr,D as ln,B as $a,a as sl,Z as ol,b as ll,R as il,c as dl,T as wr,P as cl,d as hl,e as vd,A as kd,I as wd,f as ul,W as _a,g as yd,S as jd,h as Nd,F as Cd,i as Sd,j as Td,k as Hs,l as Ed,m as zd,E as Ld,n as Rd,o as Id,H as Pd,p as Md,q as ml,r as $d,s as ba,t as _d,G as Ad,u as Dd,L as Aa,v as vn,w as Da,x as pl,y as dn,z as Ba,J as cn,K as Bd,U as fl,M as va,N as Fd,O as gl,Q as xl,V as bl,X as Gd,Y as Od,_ as Hd,$ as vl,a0 as Vd,a1 as Ud,a2 as Wd,a3 as qd,a4 as Kd,a5 as Xd,a6 as Zd,a7 as Yd,a8 as Jd,a9 as Qd,aa as ec,ab as tc,ac as rc,ad as nc,ae as ac,af as sc,ag as oc,ah as lc,ai as ic,aj as dc,ak as cc,al as hc,am as uc,an as mc,ao as pc,ap as fc,aq as gc,ar as kl,as as xc,at as bc,au as vc,av as kc,aw as wc,ax as yc,ay as jc,az as Nc,aA as Cc,aB as Sc,aC as Tc,aD as Ec,aE as zc,aF as Lc,aG as Rc}from"./ui-vendor-CgOZX1B8.js";import"./terminal-vendor-CLGgN91S.js";import{u as Ic,a as Pc,H as Vs,P as sr,b as Mc,M as wl,R as $c,i as _c,C as Ac,B as Dc,c as Us,g as yl}from"./graph-vendor-CGzY-MFv.js";import{M as Bc,r as Fc,a as Gc,b as Oc}from"./markdown-vendor-hBDTCSB-.js";const Hc="modulepreload",Vc=function(t){return"/"+t},Ws={},st=function(r,n,a){let o=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),c=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=l(n.map(h=>{if(h=Vc(h),h in Ws)return;Ws[h]=!0;const p=h.endsWith(".css"),f=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${f}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":Hc,p||(m.as="script"),m.crossOrigin="",m.href=h,c&&m.setAttribute("nonce",c),document.head.appendChild(m),p)return new Promise((x,v)=>{m.addEventListener("load",x),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return o.then(l=>{for(const d of l||[])d.status==="rejected"&&s(d.reason);return r().catch(s)})};function jl(t){var r,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(r=0;r<o;r++)t[r]&&(n=jl(t[r]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function Nl(){for(var t,r,n=0,a="",o=arguments.length;n<o;n++)(t=arguments[n])&&(r=jl(t))&&(a&&(a+=" "),a+=r);return a}const qs=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Ks=Nl,Br=(t,r)=>n=>{var a;if((r==null?void 0:r.variants)==null)return Ks(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=r,l=Object.keys(o).map(h=>{const p=n==null?void 0:n[h],f=s==null?void 0:s[h];if(p===null)return null;const m=qs(p)||qs(f);return o[h][m]}),d=n&&Object.entries(n).reduce((h,p)=>{let[f,m]=p;return m===void 0||(h[f]=m),h},{}),c=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((h,p)=>{let{class:f,className:m,...x}=p;return Object.entries(x).every(v=>{let[b,k]=v;return Array.isArray(k)?k.includes({...s,...d}[b]):{...s,...d}[b]===k})?[...h,f,m]:h},[]);return Ks(t,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},Uc=(t,r)=>{const n=new Array(t.length+r.length);for(let a=0;a<t.length;a++)n[a]=t[a];for(let a=0;a<r.length;a++)n[t.length+a]=r[a];return n},Wc=(t,r)=>({classGroupId:t,validator:r}),Cl=(t=new Map,r=null,n)=>({nextPart:t,validators:r,classGroupId:n}),hn="-",Xs=[],qc="arbitrary..",Kc=t=>{const r=Zc(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Xc(l);const d=l.split(hn),c=d[0]===""&&d.length>1?1:0;return Sl(d,c,r)},getConflictingClassGroupIds:(l,d)=>{if(d){const c=a[l],h=n[l];return c?h?Uc(h,c):c:h||Xs}return n[l]||Xs}}},Sl=(t,r,n)=>{if(t.length-r===0)return n.classGroupId;const o=t[r],s=n.nextPart.get(o);if(s){const h=Sl(t,r+1,s);if(h)return h}const l=n.validators;if(l===null)return;const d=r===0?t.join(hn):t.slice(r).join(hn),c=l.length;for(let h=0;h<c;h++){const p=l[h];if(p.validator(d))return p.classGroupId}},Xc=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=t.slice(1,-1),n=r.indexOf(":"),a=r.slice(0,n);return a?qc+a:void 0})(),Zc=t=>{const{theme:r,classGroups:n}=t;return Yc(n,r)},Yc=(t,r)=>{const n=Cl();for(const a in t){const o=t[a];Fa(o,n,a,r)}return n},Fa=(t,r,n,a)=>{const o=t.length;for(let s=0;s<o;s++){const l=t[s];Jc(l,r,n,a)}},Jc=(t,r,n,a)=>{if(typeof t=="string"){Qc(t,r,n);return}if(typeof t=="function"){eh(t,r,n,a);return}th(t,r,n,a)},Qc=(t,r,n)=>{const a=t===""?r:Tl(r,t);a.classGroupId=n},eh=(t,r,n,a)=>{if(rh(t)){Fa(t(a),r,n,a);return}r.validators===null&&(r.validators=[]),r.validators.push(Wc(n,t))},th=(t,r,n,a)=>{const o=Object.entries(t),s=o.length;for(let l=0;l<s;l++){const[d,c]=o[l];Fa(c,Tl(r,d),n,a)}},Tl=(t,r)=>{let n=t;const a=r.split(hn),o=a.length;for(let s=0;s<o;s++){const l=a[s];let d=n.nextPart.get(l);d||(d=Cl(),n.nextPart.set(l,d)),n=d}return n},rh=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,nh=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,n=Object.create(null),a=Object.create(null);const o=(s,l)=>{n[s]=l,r++,r>t&&(r=0,a=n,n=Object.create(null))};return{get(s){let l=n[s];if(l!==void 0)return l;if((l=a[s])!==void 0)return o(s,l),l},set(s,l){s in n?n[s]=l:o(s,l)}}},ka="!",Zs=":",ah=[],Ys=(t,r,n,a,o)=>({modifiers:t,hasImportantModifier:r,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),sh=t=>{const{prefix:r,experimentalParseClassName:n}=t;let a=o=>{const s=[];let l=0,d=0,c=0,h;const p=o.length;for(let b=0;b<p;b++){const k=o[b];if(l===0&&d===0){if(k===Zs){s.push(o.slice(c,b)),c=b+1;continue}if(k==="/"){h=b;continue}}k==="["?l++:k==="]"?l--:k==="("?d++:k===")"&&d--}const f=s.length===0?o:o.slice(c);let m=f,x=!1;f.endsWith(ka)?(m=f.slice(0,-1),x=!0):f.startsWith(ka)&&(m=f.slice(1),x=!0);const v=h&&h>c?h-c:void 0;return Ys(s,x,m,v)};if(r){const o=r+Zs,s=a;a=l=>l.startsWith(o)?s(l.slice(o.length)):Ys(ah,!1,l,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},oh=t=>{const r=new Map;return t.orderSensitiveModifiers.forEach((n,a)=>{r.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let s=0;s<n.length;s++){const l=n[s],d=l[0]==="[",c=r.has(l);d||c?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(l)):o.push(l)}return o.length>0&&(o.sort(),a.push(...o)),a}},lh=t=>({cache:nh(t.cacheSize),parseClassName:sh(t),sortModifiers:oh(t),postfixLookupClassGroupIds:ih(t),...Kc(t)}),ih=t=>{const r=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let a=0;a<n.length;a++)r[n[a]]=!0;return r},dh=/\s+/,ch=(t,r)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:l}=r,d=[],c=t.trim().split(dh);let h="";for(let p=c.length-1;p>=0;p-=1){const f=c[p],{isExternal:m,modifiers:x,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:k}=n(f);if(m){h=f+(h.length>0?" "+h:h);continue}let g=!!k,w;if(g){const M=b.substring(0,k);w=a(M);const I=w&&l[w]?a(b):void 0;I&&I!==w&&(w=I,g=!1)}else w=a(b);if(!w){if(!g){h=f+(h.length>0?" "+h:h);continue}if(w=a(b),!w){h=f+(h.length>0?" "+h:h);continue}g=!1}const T=x.length===0?"":x.length===1?x[0]:s(x).join(":"),y=v?T+ka:T,C=y+w;if(d.indexOf(C)>-1)continue;d.push(C);const z=o(w,g);for(let M=0;M<z.length;++M){const I=z[M];d.push(y+I)}h=f+(h.length>0?" "+h:h)}return h},hh=(...t)=>{let r=0,n,a,o="";for(;r<t.length;)(n=t[r++])&&(a=El(n))&&(o&&(o+=" "),o+=a);return o},El=t=>{if(typeof t=="string")return t;let r,n="";for(let a=0;a<t.length;a++)t[a]&&(r=El(t[a]))&&(n&&(n+=" "),n+=r);return n},uh=(t,...r)=>{let n,a,o,s;const l=c=>{const h=r.reduce((p,f)=>f(p),t());return n=lh(h),a=n.cache.get,o=n.cache.set,s=d,d(c)},d=c=>{const h=a(c);if(h)return h;const p=ch(c,n);return o(c,p),p};return s=l,(...c)=>s(hh(...c))},mh=[],ut=t=>{const r=n=>n[t]||mh;return r.isThemeGetter=!0,r},zl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ll=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ph=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vt=t=>ph.test(t),De=t=>!!t&&!Number.isNaN(Number(t)),_t=t=>!!t&&Number.isInteger(Number(t)),qn=t=>t.endsWith("%")&&De(t.slice(0,-1)),Bt=t=>fh.test(t),Rl=()=>!0,kh=t=>gh.test(t)&&!xh.test(t),Ga=()=>!1,wh=t=>bh.test(t),yh=t=>vh.test(t),jh=t=>!le(t)&&!de(t),Nh=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),Ch=t=>Kt(t,Ml,Ga),le=t=>zl.test(t),er=t=>Kt(t,$l,kh),Js=t=>Kt(t,Ph,De),Sh=t=>Kt(t,Al,Rl),Th=t=>Kt(t,_l,Ga),Qs=t=>Kt(t,Il,Ga),Eh=t=>Kt(t,Pl,yh),Zr=t=>Kt(t,Dl,wh),de=t=>Ll.test(t),Tr=t=>ir(t,$l),zh=t=>ir(t,_l),eo=t=>ir(t,Il),Lh=t=>ir(t,Ml),Rh=t=>ir(t,Pl),Yr=t=>ir(t,Dl,!0),Ih=t=>ir(t,Al,!0),Kt=(t,r,n)=>{const a=zl.exec(t);return a?a[1]?r(a[1]):n(a[2]):!1},ir=(t,r,n=!1)=>{const a=Ll.exec(t);return a?a[1]?r(a[1]):n:!1},Il=t=>t==="position"||t==="percentage",Pl=t=>t==="image"||t==="url",Ml=t=>t==="length"||t==="size"||t==="bg-size",$l=t=>t==="length",Ph=t=>t==="number",_l=t=>t==="family-name",Al=t=>t==="number"||t==="weight",Dl=t=>t==="shadow",Mh=()=>{const t=ut("color"),r=ut("font"),n=ut("text"),a=ut("font-weight"),o=ut("tracking"),s=ut("leading"),l=ut("breakpoint"),d=ut("container"),c=ut("spacing"),h=ut("radius"),p=ut("shadow"),f=ut("inset-shadow"),m=ut("text-shadow"),x=ut("drop-shadow"),v=ut("blur"),b=ut("perspective"),k=ut("aspect"),g=ut("ease"),w=ut("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...y(),de,le],z=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],I=()=>[de,le,c],R=()=>[Vt,"full","auto",...I()],K=()=>[_t,"none","subgrid",de,le],Z=()=>["auto",{span:["full",_t,de,le]},_t,de,le],D=()=>[_t,"auto",de,le],ce=()=>["auto","min","max","fr",de,le],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...I()],we=()=>[Vt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],me=()=>[Vt,"screen","full","dvw","lvw","svw","min","max","fit",...I()],Re=()=>[Vt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],X=()=>[t,de,le],$=()=>[...y(),eo,Qs,{position:[de,le]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",Lh,Ch,{size:[de,le]}],O=()=>[qn,Tr,er],B=()=>["","none","full",h,de,le],N=()=>["",De,Tr,er],E=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>[De,qn,eo,Qs],ne=()=>["","none",v,de,le],te=()=>["none",De,de,le],je=()=>["none",De,de,le],ee=()=>[De,de,le],pe=()=>[Vt,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bt],breakpoint:[Bt],color:[Rl],container:[Bt],"drop-shadow":[Bt],ease:["in","out","in-out"],font:[jh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bt],shadow:[Bt],spacing:["px",De],text:[Bt],"text-shadow":[Bt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vt,le,de,k]}],container:["container"],"container-type":[{"@container":["","normal","size",de,le]}],"container-named":[Nh],columns:[{columns:[De,le,de,d]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[_t,"auto",de,le]}],basis:[{basis:[Vt,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Vt,"auto","initial","none",le]}],grow:[{grow:["",De,de,le]}],shrink:[{shrink:["",De,de,le]}],order:[{order:[_t,"first","last","none",de,le]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:we()}],"inline-size":[{inline:["auto",...me()]}],"min-inline-size":[{"min-inline":["auto",...me()]}],"max-inline-size":[{"max-inline":["none",...me()]}],"block-size":[{block:["auto",...Re()]}],"min-block-size":[{"min-block":["auto",...Re()]}],"max-block-size":[{"max-block":["none",...Re()]}],w:[{w:[d,"screen",...we()]}],"min-w":[{"min-w":[d,"screen","none",...we()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[l]},...we()]}],h:[{h:["screen","lh",...we()]}],"min-h":[{"min-h":["screen","lh","none",...we()]}],"max-h":[{"max-h":["screen","lh",...we()]}],"font-size":[{text:["base",n,Tr,er]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ih,Sh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qn,le]}],"font-family":[{font:[zh,Th,r]}],"font-features":[{"font-features":[le]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,de,le]}],"line-clamp":[{"line-clamp":[De,"none",de,Js]}],leading:[{leading:[s,...I()]}],"list-image":[{"list-image":["none",de,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...E(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",de,er]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[De,"auto",de,le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[_t,de,le]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",de,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},_t,de,le],radial:["",de,le],conic:[_t,de,le]},Rh,Eh]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":N()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...E(),"hidden","none"]}],"divide-style":[{divide:[...E(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...E(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,de,le]}],"outline-w":[{outline:["",De,Tr,er]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",p,Yr,Zr]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",f,Yr,Zr]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[De,er]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",m,Yr,Zr]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[De,de,le]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":_()}],"mask-image-linear-to-pos":[{"mask-linear-to":_()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":_()}],"mask-image-t-to-pos":[{"mask-t-to":_()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":_()}],"mask-image-r-to-pos":[{"mask-r-to":_()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":_()}],"mask-image-b-to-pos":[{"mask-b-to":_()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":_()}],"mask-image-l-to-pos":[{"mask-l-to":_()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":_()}],"mask-image-x-to-pos":[{"mask-x-to":_()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":_()}],"mask-image-y-to-pos":[{"mask-y-to":_()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[de,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":_()}],"mask-image-radial-to-pos":[{"mask-radial-to":_()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":_()}],"mask-image-conic-to-pos":[{"mask-conic-to":_()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,le]}],filter:[{filter:["","none",de,le]}],blur:[{blur:ne()}],brightness:[{brightness:[De,de,le]}],contrast:[{contrast:[De,de,le]}],"drop-shadow":[{"drop-shadow":["","none",x,Yr,Zr]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",De,de,le]}],"hue-rotate":[{"hue-rotate":[De,de,le]}],invert:[{invert:["",De,de,le]}],saturate:[{saturate:[De,de,le]}],sepia:[{sepia:["",De,de,le]}],"backdrop-filter":[{"backdrop-filter":["","none",de,le]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[De,de,le]}],"backdrop-contrast":[{"backdrop-contrast":[De,de,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,de,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,de,le]}],"backdrop-invert":[{"backdrop-invert":["",De,de,le]}],"backdrop-opacity":[{"backdrop-opacity":[De,de,le]}],"backdrop-saturate":[{"backdrop-saturate":[De,de,le]}],"backdrop-sepia":[{"backdrop-sepia":["",De,de,le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",de,le]}],ease:[{ease:["linear","initial",g,de,le]}],delay:[{delay:[De,de,le]}],animate:[{animate:["none",w,de,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,de,le]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:je()}],"scale-x":[{"scale-x":je()}],"scale-y":[{"scale-y":je()}],"scale-z":[{"scale-z":je()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[de,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":["translate-none"],zoom:[{zoom:[_t,de,le]}],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",de,le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":X()}],"scrollbar-track-color":[{"scrollbar-track":X()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",de,le]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[De,Tr,er,Js]}],stroke:[{stroke:["none",...X()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},$h=uh(Mh),kn=i.createContext(null);kn.displayName="PanelGroupContext";const at={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Oa=10,or=i.useLayoutEffect,to=bd.useId,_h=typeof to=="function"?to:()=>null;let Ah=0;function Ha(t=null){const r=_h(),n=i.useRef(t||r||null);return n.current===null&&(n.current=""+Ah++),t??n.current}function Bl({children:t,className:r="",collapsedSize:n,collapsible:a,defaultSize:o,forwardedRef:s,id:l,maxSize:d,minSize:c,onCollapse:h,onExpand:p,onResize:f,order:m,style:x,tagName:v="div",...b}){const k=i.useContext(kn);if(k===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:w,getPanelSize:T,getPanelStyle:y,groupId:C,isPanelCollapsed:z,reevaluatePanelConstraints:M,registerPanel:I,resizePanel:R,unregisterPanel:K}=k,Z=Ha(l),D=i.useRef({callbacks:{onCollapse:h,onExpand:p,onResize:f},constraints:{collapsedSize:n,collapsible:a,defaultSize:o,maxSize:d,minSize:c},id:Z,idIsFromProps:l!==void 0,order:m});i.useRef({didLogMissingDefaultSizeWarning:!1}),or(()=>{const{callbacks:W,constraints:G}=D.current,Y={...G};D.current.id=Z,D.current.idIsFromProps=l!==void 0,D.current.order=m,W.onCollapse=h,W.onExpand=p,W.onResize=f,G.collapsedSize=n,G.collapsible=a,G.defaultSize=o,G.maxSize=d,G.minSize=c,(Y.collapsedSize!==G.collapsedSize||Y.collapsible!==G.collapsible||Y.maxSize!==G.maxSize||Y.minSize!==G.minSize)&&M(D.current,Y)}),or(()=>{const W=D.current;return I(W),()=>{K(W)}},[m,Z,I,K]),i.useImperativeHandle(s,()=>({collapse:()=>{g(D.current)},expand:W=>{w(D.current,W)},getId(){return Z},getSize(){return T(D.current)},isCollapsed(){return z(D.current)},isExpanded(){return!z(D.current)},resize:W=>{R(D.current,W)}}),[g,w,T,z,Z,R]);const ce=y(D.current,o);return i.createElement(v,{...b,children:t,className:r,id:Z,style:{...ce,...x},[at.groupId]:C,[at.panel]:"",[at.panelCollapsible]:a||void 0,[at.panelId]:Z,[at.panelSize]:parseFloat(""+ce.flexGrow).toFixed(1)})}const Fl=i.forwardRef((t,r)=>i.createElement(Bl,{...t,forwardedRef:r}));Bl.displayName="Panel";Fl.displayName="forwardRef(Panel)";let wa=null,sn=-1,Wt=null;function Dh(t,r,n){const a=(r&Ul)!==0,o=(r&Wl)!==0,s=(r&ql)!==0,l=(r&Kl)!==0;if(r){if(a)return s?"se-resize":l?"ne-resize":"e-resize";if(o)return s?"sw-resize":l?"nw-resize":"w-resize";if(s)return"s-resize";if(l)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Bh(){Wt!==null&&(document.head.removeChild(Wt),wa=null,Wt=null,sn=-1)}function Kn(t,r,n){var a,o;const s=Dh(t,r);if(wa!==s){if(wa=s,Wt===null&&(Wt=document.createElement("style"),document.head.appendChild(Wt)),sn>=0){var l;(l=Wt.sheet)===null||l===void 0||l.removeRule(sn)}sn=(a=(o=Wt.sheet)===null||o===void 0?void 0:o.insertRule(`*{cursor: ${s} !important;}`))!==null&&a!==void 0?a:-1}}function Gl(t){return t.type==="keydown"}function Ol(t){return t.type.startsWith("pointer")}function Hl(t){return t.type.startsWith("mouse")}function wn(t){if(Ol(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(Hl(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Fh(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Gh(t,r,n){return t.x<r.x+r.width&&t.x+t.width>r.x&&t.y<r.y+r.height&&t.y+t.height>r.y}function Oh(t,r){if(t===r)throw new Error("Cannot compare node with itself");const n={a:ao(t),b:ao(r)};let a;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),r=n.b.pop(),a=t;$e(a,"Stacking order can only be calculated for elements with a common ancestor");const o={a:no(ro(n.a)),b:no(ro(n.b))};if(o.a===o.b){const s=a.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let d=s.length;for(;d--;){const c=s[d];if(c===l.a)return 1;if(c===l.b)return-1}}return Math.sign(o.a-o.b)}const Hh=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Vh(t){var r;const n=getComputedStyle((r=Vl(t))!==null&&r!==void 0?r:t).display;return n==="flex"||n==="inline-flex"}function Uh(t){const r=getComputedStyle(t);return!!(r.position==="fixed"||r.zIndex!=="auto"&&(r.position!=="static"||Vh(t))||+r.opacity<1||"transform"in r&&r.transform!=="none"||"webkitTransform"in r&&r.webkitTransform!=="none"||"mixBlendMode"in r&&r.mixBlendMode!=="normal"||"filter"in r&&r.filter!=="none"||"webkitFilter"in r&&r.webkitFilter!=="none"||"isolation"in r&&r.isolation==="isolate"||Hh.test(r.willChange)||r.webkitOverflowScrolling==="touch")}function ro(t){let r=t.length;for(;r--;){const n=t[r];if($e(n,"Missing node"),Uh(n))return n}return null}function no(t){return t&&Number(getComputedStyle(t).zIndex)||0}function ao(t){const r=[];for(;t;)r.push(t),t=Vl(t);return r}function Vl(t){const{parentNode:r}=t;return r&&r instanceof ShadowRoot?r.host:r}const Ul=1,Wl=2,ql=4,Kl=8,Wh=Fh()==="coarse";let Rt=[],vr=!1,qt=new Map,yn=new Map;const $r=new Set;function qh(t,r,n,a,o){var s;const{ownerDocument:l}=r,d={direction:n,element:r,hitAreaMargins:a,setResizeHandlerState:o},c=(s=qt.get(l))!==null&&s!==void 0?s:0;return qt.set(l,c+1),$r.add(d),un(),function(){var p;yn.delete(t),$r.delete(d);const f=(p=qt.get(l))!==null&&p!==void 0?p:1;if(qt.set(l,f-1),un(),f===1&&qt.delete(l),Rt.includes(d)){const m=Rt.indexOf(d);m>=0&&Rt.splice(m,1),jn(),o("up",!0,null)}}}function Kh(t){const{target:r}=t,{x:n,y:a}=wn(t);vr=!0,Va({target:r,x:n,y:a}),un(),Rt.length>0&&(mn("down",t),jn(),t.preventDefault(),Xl(r)||t.stopImmediatePropagation())}function Xn(t){const{x:r,y:n}=wn(t);if(vr&&t.type!=="pointerleave"&&t.buttons===0&&(vr=!1,mn("up",t)),!vr){const{target:a}=t;Va({target:a,x:r,y:n})}mn("move",t),jn(),Rt.length>0&&t.preventDefault()}function Zn(t){const{target:r}=t,{x:n,y:a}=wn(t);yn.clear(),vr=!1,Rt.length>0&&(t.preventDefault(),Xl(r)||t.stopImmediatePropagation()),mn("up",t),Va({target:r,x:n,y:a}),jn(),un()}function Xl(t){let r=t;for(;r;){if(r.hasAttribute(at.resizeHandle))return!0;r=r.parentElement}return!1}function Va({target:t,x:r,y:n}){Rt.splice(0);let a=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(a=t),$r.forEach(o=>{const{element:s,hitAreaMargins:l}=o,d=s.getBoundingClientRect(),{bottom:c,left:h,right:p,top:f}=d,m=Wh?l.coarse:l.fine;if(r>=h-m&&r<=p+m&&n>=f-m&&n<=c+m){if(a!==null&&document.contains(a)&&s!==a&&!s.contains(a)&&!a.contains(s)&&Oh(a,s)>0){let v=a,b=!1;for(;v&&!v.contains(s);){if(Gh(v.getBoundingClientRect(),d)){b=!0;break}v=v.parentElement}if(b)return}Rt.push(o)}})}function Yn(t,r){yn.set(t,r)}function jn(){let t=!1,r=!1;Rt.forEach(a=>{const{direction:o}=a;o==="horizontal"?t=!0:r=!0});let n=0;yn.forEach(a=>{n|=a}),t&&r?Kn("intersection",n):t?Kn("horizontal",n):r?Kn("vertical",n):Bh()}let Jn;function un(){var t;(t=Jn)===null||t===void 0||t.abort(),Jn=new AbortController;const r={capture:!0,signal:Jn.signal};$r.size&&(vr?(Rt.length>0&&qt.forEach((n,a)=>{const{body:o}=a;n>0&&(o.addEventListener("contextmenu",Zn,r),o.addEventListener("pointerleave",Xn,r),o.addEventListener("pointermove",Xn,r))}),qt.forEach((n,a)=>{const{body:o}=a;o.addEventListener("pointerup",Zn,r),o.addEventListener("pointercancel",Zn,r)})):qt.forEach((n,a)=>{const{body:o}=a;n>0&&(o.addEventListener("pointerdown",Kh,r),o.addEventListener("pointermove",Xn,r))}))}function mn(t,r){$r.forEach(n=>{const{setResizeHandlerState:a}=n,o=Rt.includes(n);a(t,o,r)})}function Xh(){const[t,r]=i.useState(0);return i.useCallback(()=>r(n=>n+1),[])}function $e(t,r){if(!t)throw console.error(r),Error(r)}function lr(t,r,n=Oa){return t.toFixed(n)===r.toFixed(n)?0:t>r?1:-1}function Ft(t,r,n=Oa){return lr(t,r,n)===0}function Ct(t,r,n){return lr(t,r,n)===0}function Zh(t,r,n){if(t.length!==r.length)return!1;for(let a=0;a<t.length;a++){const o=t[a],s=r[a];if(!Ct(o,s,n))return!1}return!0}function br({panelConstraints:t,panelIndex:r,size:n}){const a=t[r];$e(a!=null,`Panel constraints not found for index ${r}`);let{collapsedSize:o=0,collapsible:s,maxSize:l=100,minSize:d=0}=a;if(lr(n,d)<0)if(s){const c=(o+d)/2;lr(n,c)<0?n=o:n=d}else n=d;return n=Math.min(l,n),n=parseFloat(n.toFixed(Oa)),n}function Lr({delta:t,initialLayout:r,panelConstraints:n,pivotIndices:a,prevLayout:o,trigger:s}){if(Ct(t,0))return r;const l=[...r],[d,c]=a;$e(d!=null,"Invalid first pivot index"),$e(c!=null,"Invalid second pivot index");let h=0;if(s==="keyboard"){{const f=t<0?c:d,m=n[f];$e(m,`Panel constraints not found for index ${f}`);const{collapsedSize:x=0,collapsible:v,minSize:b=0}=m;if(v){const k=r[f];if($e(k!=null,`Previous layout not found for panel index ${f}`),Ct(k,x)){const g=b-k;lr(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}{const f=t<0?d:c,m=n[f];$e(m,`No panel constraints found for index ${f}`);const{collapsedSize:x=0,collapsible:v,minSize:b=0}=m;if(v){const k=r[f];if($e(k!=null,`Previous layout not found for panel index ${f}`),Ct(k,b)){const g=k-x;lr(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const f=t<0?1:-1;let m=t<0?c:d,x=0;for(;;){const b=r[m];$e(b!=null,`Previous layout not found for panel index ${m}`);const g=br({panelConstraints:n,panelIndex:m,size:100})-b;if(x+=g,m+=f,m<0||m>=n.length)break}const v=Math.min(Math.abs(t),Math.abs(x));t=t<0?0-v:v}{let m=t<0?d:c;for(;m>=0&&m<n.length;){const x=Math.abs(t)-Math.abs(h),v=r[m];$e(v!=null,`Previous layout not found for panel index ${m}`);const b=v-x,k=br({panelConstraints:n,panelIndex:m,size:b});if(!Ct(v,k)&&(h+=v-k,l[m]=k,h.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?m--:m++}}if(Zh(o,l))return o;{const f=t<0?c:d,m=r[f];$e(m!=null,`Previous layout not found for panel index ${f}`);const x=m+h,v=br({panelConstraints:n,panelIndex:f,size:x});if(l[f]=v,!Ct(v,x)){let b=x-v,g=t<0?c:d;for(;g>=0&&g<n.length;){const w=l[g];$e(w!=null,`Previous layout not found for panel index ${g}`);const T=w+b,y=br({panelConstraints:n,panelIndex:g,size:T});if(Ct(w,y)||(b-=y-w,l[g]=y),Ct(b,0))break;t>0?g--:g++}}}const p=l.reduce((f,m)=>m+f,0);return Ct(p,100)?l:o}function Yh({layout:t,panelsArray:r,pivotIndices:n}){let a=0,o=100,s=0,l=0;const d=n[0];$e(d!=null,"No pivot index found"),r.forEach((f,m)=>{const{constraints:x}=f,{maxSize:v=100,minSize:b=0}=x;m===d?(a=b,o=v):(s+=b,l+=v)});const c=Math.min(o,100-s),h=Math.max(a,100-l),p=t[d];return{valueMax:c,valueMin:h,valueNow:p}}function _r(t,r=document){return Array.from(r.querySelectorAll(`[${at.resizeHandleId}][data-panel-group-id="${t}"]`))}function Zl(t,r,n=document){const o=_r(t,n).findIndex(s=>s.getAttribute(at.resizeHandleId)===r);return o??null}function Yl(t,r,n){const a=Zl(t,r,n);return a!=null?[a,a+1]:[-1,-1]}function Jh(t){return t instanceof HTMLElement?!0:typeof t=="object"&&t!==null&&"tagName"in t&&"getAttribute"in t}function Jl(t,r=document){if(Jh(r)&&r.dataset.panelGroupId==t)return r;const n=r.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return n||null}function Nn(t,r=document){const n=r.querySelector(`[${at.resizeHandleId}="${t}"]`);return n||null}function Qh(t,r,n,a=document){var o,s,l,d;const c=Nn(r,a),h=_r(t,a),p=c?h.indexOf(c):-1,f=(o=(s=n[p])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null,m=(l=(d=n[p+1])===null||d===void 0?void 0:d.id)!==null&&l!==void 0?l:null;return[f,m]}function eu({committedValuesRef:t,eagerValuesRef:r,groupId:n,layout:a,panelDataArray:o,panelGroupElement:s,setLayout:l}){i.useRef({didWarnAboutMissingResizeHandle:!1}),or(()=>{if(!s)return;const d=_r(n,s);for(let c=0;c<o.length-1;c++){const{valueMax:h,valueMin:p,valueNow:f}=Yh({layout:a,panelsArray:o,pivotIndices:[c,c+1]}),m=d[c];if(m!=null){const x=o[c];$e(x,`No panel data found for index "${c}"`),m.setAttribute("aria-controls",x.id),m.setAttribute("aria-valuemax",""+Math.round(h)),m.setAttribute("aria-valuemin",""+Math.round(p)),m.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{d.forEach((c,h)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,a,o,s]),i.useEffect(()=>{if(!s)return;const d=r.current;$e(d,"Eager values not found");const{panelDataArray:c}=d,h=Jl(n,s);$e(h!=null,`No group found for id "${n}"`);const p=_r(n,s);$e(p,`No resize handles found for group id "${n}"`);const f=p.map(m=>{const x=m.getAttribute(at.resizeHandleId);$e(x,"Resize handle element has no handle id attribute");const[v,b]=Qh(n,x,c,s);if(v==null||b==null)return()=>{};const k=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const w=c.findIndex(T=>T.id===v);if(w>=0){const T=c[w];$e(T,`No panel data found for index ${w}`);const y=a[w],{collapsedSize:C=0,collapsible:z,minSize:M=0}=T.constraints;if(y!=null&&z){const I=Lr({delta:Ct(y,C)?M-C:C-y,initialLayout:a,panelConstraints:c.map(R=>R.constraints),pivotIndices:Yl(n,x,s),prevLayout:a,trigger:"keyboard"});a!==I&&l(I)}}break}}};return m.addEventListener("keydown",k),()=>{m.removeEventListener("keydown",k)}});return()=>{f.forEach(m=>m())}},[s,t,r,n,a,o,l])}function so(t,r){if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==r[n])return!1;return!0}function Ql(t,r){const n=t==="horizontal",{x:a,y:o}=wn(r);return n?a:o}function tu(t,r,n,a,o){const s=n==="horizontal",l=Nn(r,o);$e(l,`No resize handle element found for id "${r}"`);const d=l.getAttribute(at.groupId);$e(d,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=a;const h=Ql(n,t),p=Jl(d,o);$e(p,`No group element found for id "${d}"`);const f=p.getBoundingClientRect(),m=s?f.width:f.height;return(h-c)/m*100}function ru(t,r,n,a,o,s){if(Gl(t)){const l=n==="horizontal";let d=0;t.shiftKey?d=100:o!=null?d=o:d=10;let c=0;switch(t.key){case"ArrowDown":c=l?0:d;break;case"ArrowLeft":c=l?-d:0;break;case"ArrowRight":c=l?d:0;break;case"ArrowUp":c=l?0:-d;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return a==null?0:tu(t,r,n,a,s)}function nu({panelDataArray:t}){const r=Array(t.length),n=t.map(s=>s.constraints);let a=0,o=100;for(let s=0;s<t.length;s++){const l=n[s];$e(l,`Panel constraints not found for index ${s}`);const{defaultSize:d}=l;d!=null&&(a++,r[s]=d,o-=d)}for(let s=0;s<t.length;s++){const l=n[s];$e(l,`Panel constraints not found for index ${s}`);const{defaultSize:d}=l;if(d!=null)continue;const c=t.length-a,h=o/c;a++,r[s]=h,o-=h}return r}function mr(t,r,n){r.forEach((a,o)=>{const s=t[o];$e(s,`Panel data not found for index ${o}`);const{callbacks:l,constraints:d,id:c}=s,{collapsedSize:h=0,collapsible:p}=d,f=n[c];if(f==null||a!==f){n[c]=a;const{onCollapse:m,onExpand:x,onResize:v}=l;v&&v(a,f),p&&(m||x)&&(x&&(f==null||Ft(f,h))&&!Ft(a,h)&&x(),m&&(f==null||!Ft(f,h))&&Ft(a,h)&&m())}})}function Jr(t,r){if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=r[n])return!1;return!0}function au({defaultSize:t,dragState:r,layout:n,panelData:a,panelIndex:o,precision:s=3}){const l=n[o];let d;return l==null?d=t!=null?t.toFixed(s):"1":a.length===1?d="1":d=l.toFixed(s),{flexBasis:0,flexGrow:d,flexShrink:1,overflow:"hidden",pointerEvents:r!==null?"none":void 0}}function su(t,r=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...o)},r)}}function oo(t){try{if(typeof localStorage<"u")t.getItem=r=>localStorage.getItem(r),t.setItem=(r,n)=>{localStorage.setItem(r,n)};else throw new Error("localStorage not supported in this environment")}catch(r){console.error(r),t.getItem=()=>null,t.setItem=()=>{}}}function ei(t){return`react-resizable-panels:${t}`}function ti(t){return t.map(r=>{const{constraints:n,id:a,idIsFromProps:o,order:s}=r;return o?a:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((r,n)=>r.localeCompare(n)).join(",")}function ri(t,r){try{const n=ei(t),a=r.getItem(n);if(a){const o=JSON.parse(a);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function ou(t,r,n){var a,o;const s=(a=ri(t,n))!==null&&a!==void 0?a:{},l=ti(r);return(o=s[l])!==null&&o!==void 0?o:null}function lu(t,r,n,a,o){var s;const l=ei(t),d=ti(r),c=(s=ri(t,o))!==null&&s!==void 0?s:{};c[d]={expandToSizes:Object.fromEntries(n.entries()),layout:a};try{o.setItem(l,JSON.stringify(c))}catch(h){console.error(h)}}function lo({layout:t,panelConstraints:r}){const n=[...t],a=n.reduce((s,l)=>s+l,0);if(n.length!==r.length)throw Error(`Invalid ${r.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!Ct(a,100)&&n.length>0)for(let s=0;s<r.length;s++){const l=n[s];$e(l!=null,`No layout data found for index ${s}`);const d=100/a*l;n[s]=d}let o=0;for(let s=0;s<r.length;s++){const l=n[s];$e(l!=null,`No layout data found for index ${s}`);const d=br({panelConstraints:r,panelIndex:s,size:l});l!=d&&(o+=l-d,n[s]=d)}if(!Ct(o,0))for(let s=0;s<r.length;s++){const l=n[s];$e(l!=null,`No layout data found for index ${s}`);const d=l+o,c=br({panelConstraints:r,panelIndex:s,size:d});if(l!==c&&(o-=c-l,n[s]=c,Ct(o,0)))break}return n}const iu=100,Rr={getItem:t=>(oo(Rr),Rr.getItem(t)),setItem:(t,r)=>{oo(Rr),Rr.setItem(t,r)}},io={};function ni({autoSaveId:t=null,children:r,className:n="",direction:a,forwardedRef:o,id:s=null,onLayout:l=null,keyboardResizeBy:d=null,storage:c=Rr,style:h,tagName:p="div",...f}){const m=Ha(s),x=i.useRef(null),[v,b]=i.useState(null),[k,g]=i.useState([]),w=Xh(),T=i.useRef({}),y=i.useRef(new Map),C=i.useRef(0),z=i.useRef({autoSaveId:t,direction:a,dragState:v,id:m,keyboardResizeBy:d,onLayout:l,storage:c}),M=i.useRef({layout:k,panelDataArray:[],panelDataArrayChanged:!1});i.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),i.useImperativeHandle(o,()=>({getId:()=>z.current.id,getLayout:()=>{const{layout:P}=M.current;return P},setLayout:P=>{const{onLayout:O}=z.current,{layout:B,panelDataArray:N}=M.current,E=lo({layout:P,panelConstraints:N.map(V=>V.constraints)});so(B,E)||(g(E),M.current.layout=E,O&&O(E),mr(N,E,T.current))}}),[]),or(()=>{z.current.autoSaveId=t,z.current.direction=a,z.current.dragState=v,z.current.id=m,z.current.onLayout=l,z.current.storage=c}),eu({committedValuesRef:z,eagerValuesRef:M,groupId:m,layout:k,panelDataArray:M.current.panelDataArray,setLayout:g,panelGroupElement:x.current}),i.useEffect(()=>{const{panelDataArray:P}=M.current;if(t){if(k.length===0||k.length!==P.length)return;let O=io[t];O==null&&(O=su(lu,iu),io[t]=O);const B=[...P],N=new Map(y.current);O(t,B,N,k,c)}},[t,k,c]),i.useEffect(()=>{});const I=i.useCallback(P=>{const{onLayout:O}=z.current,{layout:B,panelDataArray:N}=M.current;if(P.constraints.collapsible){const E=N.map(te=>te.constraints),{collapsedSize:V=0,panelSize:_,pivotIndices:ne}=tr(N,P,B);if($e(_!=null,`Panel size not found for panel "${P.id}"`),!Ft(_,V)){y.current.set(P.id,_);const je=gr(N,P)===N.length-1?_-V:V-_,ee=Lr({delta:je,initialLayout:B,panelConstraints:E,pivotIndices:ne,prevLayout:B,trigger:"imperative-api"});Jr(B,ee)||(g(ee),M.current.layout=ee,O&&O(ee),mr(N,ee,T.current))}}},[]),R=i.useCallback((P,O)=>{const{onLayout:B}=z.current,{layout:N,panelDataArray:E}=M.current;if(P.constraints.collapsible){const V=E.map(pe=>pe.constraints),{collapsedSize:_=0,panelSize:ne=0,minSize:te=0,pivotIndices:je}=tr(E,P,N),ee=O??te;if(Ft(ne,_)){const pe=y.current.get(P.id),he=pe!=null&&pe>=ee?pe:ee,Fe=gr(E,P)===E.length-1?ne-he:he-ne,J=Lr({delta:Fe,initialLayout:N,panelConstraints:V,pivotIndices:je,prevLayout:N,trigger:"imperative-api"});Jr(N,J)||(g(J),M.current.layout=J,B&&B(J),mr(E,J,T.current))}}},[]),K=i.useCallback(P=>{const{layout:O,panelDataArray:B}=M.current,{panelSize:N}=tr(B,P,O);return $e(N!=null,`Panel size not found for panel "${P.id}"`),N},[]),Z=i.useCallback((P,O)=>{const{panelDataArray:B}=M.current,N=gr(B,P);return au({defaultSize:O,dragState:v,layout:k,panelData:B,panelIndex:N})},[v,k]),D=i.useCallback(P=>{const{layout:O,panelDataArray:B}=M.current,{collapsedSize:N=0,collapsible:E,panelSize:V}=tr(B,P,O);return $e(V!=null,`Panel size not found for panel "${P.id}"`),E===!0&&Ft(V,N)},[]),ce=i.useCallback(P=>{const{layout:O,panelDataArray:B}=M.current,{collapsedSize:N=0,collapsible:E,panelSize:V}=tr(B,P,O);return $e(V!=null,`Panel size not found for panel "${P.id}"`),!E||lr(V,N)>0},[]),W=i.useCallback(P=>{const{panelDataArray:O}=M.current;O.push(P),O.sort((B,N)=>{const E=B.order,V=N.order;return E==null&&V==null?0:E==null?-1:V==null?1:E-V}),M.current.panelDataArrayChanged=!0,w()},[w]);or(()=>{if(M.current.panelDataArrayChanged){M.current.panelDataArrayChanged=!1;const{autoSaveId:P,onLayout:O,storage:B}=z.current,{layout:N,panelDataArray:E}=M.current;let V=null;if(P){const ne=ou(P,E,B);ne&&(y.current=new Map(Object.entries(ne.expandToSizes)),V=ne.layout)}V==null&&(V=nu({panelDataArray:E}));const _=lo({layout:V,panelConstraints:E.map(ne=>ne.constraints)});so(N,_)||(g(_),M.current.layout=_,O&&O(_),mr(E,_,T.current))}}),or(()=>{const P=M.current;return()=>{P.layout=[]}},[]);const G=i.useCallback(P=>{let O=!1;const B=x.current;return B&&window.getComputedStyle(B,null).getPropertyValue("direction")==="rtl"&&(O=!0),function(E){E.preventDefault();const V=x.current;if(!V)return()=>null;const{direction:_,dragState:ne,id:te,keyboardResizeBy:je,onLayout:ee}=z.current,{layout:pe,panelDataArray:he}=M.current,{initialLayout:Ce}=ne??{},Fe=Yl(te,P,V);let J=ru(E,P,_,ne,je,V);const U=_==="horizontal";U&&O&&(J=-J);const re=he.map(xe=>xe.constraints),ae=Lr({delta:J,initialLayout:Ce??pe,panelConstraints:re,pivotIndices:Fe,prevLayout:pe,trigger:Gl(E)?"keyboard":"mouse-or-touch"}),Q=!Jr(pe,ae);(Ol(E)||Hl(E))&&C.current!=J&&(C.current=J,!Q&&J!==0?U?Yn(P,J<0?Ul:Wl):Yn(P,J<0?ql:Kl):Yn(P,0)),Q&&(g(ae),M.current.layout=ae,ee&&ee(ae),mr(he,ae,T.current))}},[]),Y=i.useCallback((P,O)=>{const{onLayout:B}=z.current,{layout:N,panelDataArray:E}=M.current,V=E.map(pe=>pe.constraints),{panelSize:_,pivotIndices:ne}=tr(E,P,N);$e(_!=null,`Panel size not found for panel "${P.id}"`);const je=gr(E,P)===E.length-1?_-O:O-_,ee=Lr({delta:je,initialLayout:N,panelConstraints:V,pivotIndices:ne,prevLayout:N,trigger:"imperative-api"});Jr(N,ee)||(g(ee),M.current.layout=ee,B&&B(ee),mr(E,ee,T.current))},[]),we=i.useCallback((P,O)=>{const{layout:B,panelDataArray:N}=M.current,{collapsedSize:E=0,collapsible:V}=O,{collapsedSize:_=0,collapsible:ne,maxSize:te=100,minSize:je=0}=P.constraints,{panelSize:ee}=tr(N,P,B);ee!=null&&(V&&ne&&Ft(ee,E)?Ft(E,_)||Y(P,_):ee<je?Y(P,je):ee>te&&Y(P,te))},[Y]),me=i.useCallback((P,O)=>{const{direction:B}=z.current,{layout:N}=M.current;if(!x.current)return;const E=Nn(P,x.current);$e(E,`Drag handle element not found for id "${P}"`);const V=Ql(B,O);b({dragHandleId:P,dragHandleRect:E.getBoundingClientRect(),initialCursorPosition:V,initialLayout:N})},[]),Re=i.useCallback(()=>{b(null)},[]),X=i.useCallback(P=>{const{panelDataArray:O}=M.current,B=gr(O,P);B>=0&&(O.splice(B,1),delete T.current[P.id],M.current.panelDataArrayChanged=!0,w())},[w]),$=i.useMemo(()=>({collapsePanel:I,direction:a,dragState:v,expandPanel:R,getPanelSize:K,getPanelStyle:Z,groupId:m,isPanelCollapsed:D,isPanelExpanded:ce,reevaluatePanelConstraints:we,registerPanel:W,registerResizeHandle:G,resizePanel:Y,startDragging:me,stopDragging:Re,unregisterPanel:X,panelGroupElement:x.current}),[I,v,a,R,K,Z,m,D,ce,we,W,G,Y,me,Re,X]),F={display:"flex",flexDirection:a==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return i.createElement(kn.Provider,{value:$},i.createElement(p,{...f,children:r,className:n,id:s,ref:x,style:{...F,...h},[at.group]:"",[at.groupDirection]:a,[at.groupId]:m}))}const ai=i.forwardRef((t,r)=>i.createElement(ni,{...t,forwardedRef:r}));ni.displayName="PanelGroup";ai.displayName="forwardRef(PanelGroup)";function gr(t,r){return t.findIndex(n=>n===r||n.id===r.id)}function tr(t,r,n){const a=gr(t,r),s=a===t.length-1?[a-1,a]:[a,a+1],l=n[a];return{...r.constraints,panelSize:l,pivotIndices:s}}function du({disabled:t,handleId:r,resizeHandler:n,panelGroupElement:a}){i.useEffect(()=>{if(t||n==null||a==null)return;const o=Nn(r,a);if(o==null)return;const s=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),n(l);break}case"F6":{l.preventDefault();const d=o.getAttribute(at.groupId);$e(d,`No group element found for id "${d}"`);const c=_r(d,a),h=Zl(d,r,a);$e(h!==null,`No resize element found for id "${r}"`);const p=l.shiftKey?h>0?h-1:c.length-1:h+1<c.length?h+1:0;c[p].focus();break}}};return o.addEventListener("keydown",s),()=>{o.removeEventListener("keydown",s)}},[a,t,r,n])}function si({children:t=null,className:r="",disabled:n=!1,hitAreaMargins:a,id:o,onBlur:s,onClick:l,onDragging:d,onFocus:c,onPointerDown:h,onPointerUp:p,style:f={},tabIndex:m=0,tagName:x="div",...v}){var b,k;const g=i.useRef(null),w=i.useRef({onClick:l,onDragging:d,onPointerDown:h,onPointerUp:p});i.useEffect(()=>{w.current.onClick=l,w.current.onDragging=d,w.current.onPointerDown=h,w.current.onPointerUp=p});const T=i.useContext(kn);if(T===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:C,registerResizeHandle:z,startDragging:M,stopDragging:I,panelGroupElement:R}=T,K=Ha(o),[Z,D]=i.useState("inactive"),[ce,W]=i.useState(!1),[G,Y]=i.useState(null),we=i.useRef({state:Z});or(()=>{we.current.state=Z}),i.useEffect(()=>{if(n)Y(null);else{const $=z(K);Y(()=>$)}},[n,K,z]);const me=(b=a==null?void 0:a.coarse)!==null&&b!==void 0?b:15,Re=(k=a==null?void 0:a.fine)!==null&&k!==void 0?k:5;i.useEffect(()=>{if(n||G==null)return;const $=g.current;$e($,"Element ref not attached");let F=!1;return qh(K,$,y,{coarse:me,fine:Re},(O,B,N)=>{if(!B){D("inactive");return}switch(O){case"down":{D("drag"),F=!1,$e(N,'Expected event to be defined for "down" action'),M(K,N);const{onDragging:E,onPointerDown:V}=w.current;E==null||E(!0),V==null||V();break}case"move":{const{state:E}=we.current;F=!0,E!=="drag"&&D("hover"),$e(N,'Expected event to be defined for "move" action'),G(N);break}case"up":{D("hover"),I();const{onClick:E,onDragging:V,onPointerUp:_}=w.current;V==null||V(!1),_==null||_(),F||E==null||E();break}}})},[me,y,n,Re,z,K,G,M,I]),du({disabled:n,handleId:K,resizeHandler:G,panelGroupElement:R});const X={touchAction:"none",userSelect:"none"};return i.createElement(x,{...v,children:t,className:r,id:o,onBlur:()=>{W(!1),s==null||s()},onFocus:()=>{W(!0),c==null||c()},ref:g,role:"separator",style:{...X,...f},tabIndex:m,[at.groupDirection]:y,[at.groupId]:C,[at.resizeHandle]:"",[at.resizeHandleActive]:Z==="drag"?"pointer":ce?"keyboard":void 0,[at.resizeHandleEnabled]:!n,[at.resizeHandleId]:K,[at.resizeHandleState]:Z})}si.displayName="PanelResizeHandle";var Qn="chemistry.molecule3d",cu={id:"remote-codex.xyz-viewer",name:"XYZ Molecule Viewer",version:"0.1.0",description:"A draft built-in plugin for previewing xyz, extxyz, cif, and pdb molecular structures with 3Dmol.js.",remoteCodex:"^0.11.0",capabilities:{artifactTypes:[{type:Qn,title:"3D Molecule",fileExtensions:["xyz","extxyz","cif","pdb"]}],timelineRenderers:[Qn],threadPanels:[{id:"xyz-viewer",label:"Molecules",artifactTypes:[Qn]}],modelHints:[{id:"render-molecule",text:"XYZ Molecule Viewer is enabled. When outputting a molecular structure, you must call remote_codex_render_molecule; do not output plain xyz, pdb, cif, or extxyz text. Do not invent coordinates unless asked for an example."}],mcpServers:[{id:"remote-codex-plugin-mcp",name:"remote_codex_plugins",command:"node",args:["bin/remote-codex-plugin-mcp.mjs"]}],frontend:{entry:"./dist/index.js",style:"./src/styles.css"}}},hu=["xyz","extxyz","cif","pdb"];new Set(hu);var uu="remote-codex.terminal",mu={id:uu,name:"Terminal",version:"0.1.0",description:"Built-in durable terminal panel backed by the supervisor PTY host.",remoteCodex:"^0.11.0",capabilities:{artifactTypes:[],timelineRenderers:[],threadPanels:[{id:"terminal",label:"Terminal",kind:"terminal",artifactTypes:[]}],frontend:{entry:"./dist/index.js"},backend:{entry:"./dist/backend.js"}}};const pu=["xyz","extxyz","cif","pdb"];new Set(pu);function fu(t){const r=t==null?void 0:t.trim().toLowerCase();return!r||r==="extxyz"?"xyz":r}function gu(t){var o,s;const r=t.replace(/\r\n/g,`
|
|
3
|
+
`).replace(/\r/g,`
|
|
4
|
+
`).split(`
|
|
5
|
+
`),n=[];let a=0;for(;a<r.length;){for(;a<r.length&&((o=r[a])==null?void 0:o.trim())==="";)a+=1;if(a>=r.length)break;const l=Number.parseInt(((s=r[a])==null?void 0:s.trim())??"",10);if(!Number.isFinite(l)||l<0)return[t];const d=l+2;if(a+d>r.length)return[t];n.push(`${r.slice(a,a+d).join(`
|
|
6
|
+
`)}
|
|
7
|
+
`),a+=d}return n.length>0?n:[t]}function co(t,r){return r!=="xyz"?t:t.flatMap(n=>gu(n))}function ho(t){return t.map(r=>`${r.replace(/\s+$/g,"")}
|
|
8
|
+
`).join("")}function xu(t){if(!t)return{format:"xyz",frames:[],exportContent:""};if(typeof t=="string"){const a=co([t],"xyz");return{frames:a,format:"xyz",exportContent:ho(a)}}const r=fu(t.format),n=t.content.filter(a=>a.trim().length>0);return{frames:co(n,r),format:r,exportContent:ho(n)}}let ea=null;async function bu(){if(typeof window>"u")throw new Error("3Dmol is only available in a browser environment.");return window["3Dmol"]?window["3Dmol"]:(ea||(ea=new Promise((t,r)=>{const n=document.querySelector('script[data-remote-codex-3dmol="true"]'),a=()=>{if(window["3Dmol"]){t(window["3Dmol"]);return}r(new Error("3Dmol loaded without exposing the expected global."))};if(n){n.addEventListener("load",a,{once:!0}),n.addEventListener("error",()=>r(new Error("Unable to load 3Dmol viewer runtime.")),{once:!0});return}const o=document.createElement("script");o.src="/vendor/3Dmol-min.js",o.async=!0,o.dataset.remoteCodex3dmol="true",o.addEventListener("load",a,{once:!0}),o.addEventListener("error",()=>r(new Error("Unable to load 3Dmol viewer runtime.")),{once:!0}),document.head.appendChild(o)})),ea)}function vu(){try{const t=document.createElement("canvas");return!!(t.getContext("webgl2")||t.getContext("webgl")||t.getContext("experimental-webgl"))}catch{return!1}}function uo(t,r){const n=new Blob([t],{type:"text/plain"}),a=URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.download=r,o.click(),URL.revokeObjectURL(a)}function ku(t){return(t==null?void 0:t.trim().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""))||"molecule"}function oi({source:t,moleculeId:r=null,title:n="Molecule Viewer",className:a="",onScreenshot:o,onSelectionChange:s}){const l=i.useRef(null),d=i.useRef(null),c=i.useRef(null),h=i.useRef(!1),p=i.useRef(!0),[f,m]=i.useState(null),[x,v]=i.useState(0),[b,k]=i.useState(!1),[g,w]=i.useState([]),[T,y]=i.useState([]),[C,z]=i.useState(null),[M,I]=i.useState(null),[R,K]=i.useState(!1),[Z,D]=i.useState(!1),ce=i.useMemo(()=>xu(t),[t]),W=ce.frames,G=W[x]??"",Y=ku(r),we=W.length>0&&x===W.length-1;i.useEffect(()=>{if(W.length===0){v(0);return}v(W.length-1)},[W.length]),i.useEffect(()=>{if(!b||W.length<=1)return;const $=window.setInterval(()=>{v(F=>F>=W.length-1?(window.clearInterval($),k(!1),F):F+1)},200);return()=>window.clearInterval($)},[W.length,b]),i.useEffect(()=>{const $=l.current;if(!$||d.current)return;let F=!1;if(!vu()){m("WebGL is unavailable in this browser environment. Unable to render the 3D viewer.");return}const P=()=>{var O,B;(O=d.current)==null||O.resize(),(B=d.current)==null||B.render()};return bu().then(O=>{if(!(F||d.current))try{const B=O.createViewer($,{});d.current=B,B.setBackgroundColor("#fbfbfb",1),window.addEventListener("resize",P),window.setTimeout(P,100)}catch(B){console.error("Failed to initialize 3Dmol viewer:",B),m("Failed to initialize the 3D molecule viewer.")}}).catch(O=>{console.error("Failed to load 3Dmol viewer runtime:",O),m("Failed to load the 3D molecule viewer runtime.")}),()=>{F=!0,window.removeEventListener("resize",P),d.current=null,c.current=null}},[]),i.useEffect(()=>{const $=d.current;if(!(!$||!G))try{$.removeAllModels(),$.removeAllShapes(),$.removeAllLabels();const F=$.addModel(G,ce.format);c.current=F,F.setStyle({},{stick:{radius:.2},sphere:{scale:.3}});const P=F.getCrystData(),O=!!(P&&typeof P=="object"&&Object.keys(P).length>0);D(O),K(O?p.current:!1);const B=G.split(`
|
|
9
|
+
`).slice(2).map(N=>N.trim()).filter(Boolean).map(N=>N.split(/\s+/)[0]??"Atom");y(B),w([]),h.current||($.zoomTo(),h.current=!0),F.setClickable({},!0,(N,E,V)=>{const _=N.serial??N.index;_!==void 0&&w(ne=>!(V!=null&&V.shiftKey||V!=null&&V.metaKey||V!=null&&V.ctrlKey)?ne.length===1&&ne[0]===_?[]:[_]:ne.includes(_)?ne.filter(je=>je!==_):[...ne,_])}),F.setHoverable({},!0,(N,E,V)=>{V&&z({x:V.clientX,y:V.clientY,label:`${N.atom||N.elem||"Atom"} (${N.serial??N.index??"?"})`,coords:{x:N.x.toFixed(2),y:N.y.toFixed(2),z:N.z.toFixed(2)}})},()=>z(null)),$.render()}catch(F){console.error("Failed to render molecule:",F),m("Unable to render this molecular structure.")}},[G,ce.format]),i.useEffect(()=>{const $=d.current,F=c.current;if(!(!$||!F)){try{$.removeUnitCell(F)}catch{}if(R&&Z)try{$.addUnitCell(F,{box:{color:"black",opacity:1,linewidth:5},astyle:{radius:.12,mid:.85,color:"red",opacity:.6},bstyle:{radius:.12,mid:.85,color:"green",opacity:.6},cstyle:{radius:.12,mid:.85,color:"blue",opacity:.6},alabel:"a",blabel:"b",clabel:"c"})}catch{D(!1),K(!1)}$.render()}},[Z,R,G]),i.useEffect(()=>{const $=d.current,F=c.current;!$||!F||!G||(F.setStyle({},{stick:{radius:.2},sphere:{scale:.3}}),g.length>0&&F.setStyle({serial:g},{stick:{radius:.3,color:"yellow"},sphere:{scale:.4,color:"yellow"}}),$.render(),s==null||s({moleculeId:r,atoms:g}))},[G,r,s,g]),i.useEffect(()=>{if(!G)return;let $=0;const F=()=>{var O,B;const P=(B=(O=d.current)==null?void 0:O.getView)==null?void 0:B.call(O);if(Array.isArray(P)&&P.length>=8){const[N,E,V,_,ne,te,je,ee]=P;typeof N=="number"&&typeof E=="number"&&typeof V=="number"&&typeof _=="number"&&typeof ne=="number"&&typeof te=="number"&&typeof je=="number"&&typeof ee=="number"&&I({x:N,y:E,z:V,zoom:_,qx:ne,qy:te,qz:je,qw:ee})}$=window.requestAnimationFrame(F)};return $=window.requestAnimationFrame(F),()=>window.cancelAnimationFrame($)},[G]);const me=i.useCallback(async()=>{G&&await navigator.clipboard.writeText(G)},[G]),Re=i.useCallback(async()=>{const $=d.current;if(!($!=null&&$.pngURI))return;$.render();const F=$.pngURI();if(F){try{const O=await(await fetch(F)).blob(),B={[O.type||"image/png"]:O},N=new ClipboardItem(B);await navigator.clipboard.write([N])}catch{}o==null||o({moleculeId:r,image:F})}},[r,o]),X=i.useCallback(()=>{const $=d.current;$&&($.zoomTo(),$.setCameraParameters({}),$.render())},[]);return e.jsxs("div",{className:`xyz-viewer-plugin ${a}`,children:[e.jsxs("header",{className:"xyz-viewer-plugin__header",children:[e.jsxs("div",{children:[e.jsx("h2",{children:n}),e.jsxs("p",{children:[ce.format.toUpperCase()," structure preview"]})]}),e.jsx("span",{children:W.length>1?`${W.length} frames`:"single frame"})]}),e.jsxs("div",{className:"xyz-viewer-plugin__toolbar","aria-label":"Molecule controls",children:[e.jsx("button",{type:"button",onClick:me,disabled:!G,title:"Copy current frame",children:e.jsx(Dr,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>uo(G,`${Y}_frame_${x+1}.${ce.format}`),disabled:!G,title:"Download current frame",children:e.jsx(ln,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>uo(ce.exportContent,`${Y}_trajectory.${ce.format}`),disabled:!ce.exportContent,title:"Download all frames",children:e.jsx($a,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:Re,disabled:!G,title:"Capture screenshot",children:e.jsx(sl,{"aria-hidden":"true"})}),e.jsx("span",{className:"xyz-viewer-plugin__toolbar-divider","aria-hidden":"true"}),e.jsx("button",{type:"button",onClick:()=>{var $;return($=d.current)==null?void 0:$.zoom(1.2)},disabled:!G,title:"Zoom in",children:e.jsx(ol,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>{var $;return($=d.current)==null?void 0:$.zoom(.8)},disabled:!G,title:"Zoom out",children:e.jsx(ll,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:X,disabled:!G,title:"Reset camera",children:e.jsx(il,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>K($=>{const F=!$;return p.current=F,F}),disabled:!Z,title:R?"Hide unit cell":"Show unit cell",children:e.jsx(dl,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>w([]),disabled:g.length===0,title:"Clear selection",children:e.jsx(wr,{"aria-hidden":"true"})})]}),e.jsxs("div",{className:"xyz-viewer-plugin__stage",children:[e.jsx("div",{ref:l,className:"xyz-viewer-plugin__canvas"}),f&&e.jsx("div",{className:"xyz-viewer-plugin__error",children:f}),!f&&!G&&e.jsx("div",{className:"xyz-viewer-plugin__empty",children:"No molecule data available."}),C&&e.jsxs("div",{className:"xyz-viewer-plugin__tooltip",style:{left:C.x-20,top:C.y-50},children:[e.jsx("strong",{children:C.label}),e.jsxs("span",{children:["x: ",C.coords.x," y: ",C.coords.y," z:"," ",C.coords.z]})]})]}),W.length>1&&e.jsxs("div",{className:"xyz-viewer-plugin__timeline",children:[e.jsx("button",{type:"button",onClick:()=>{k($=>{const F=!$;return F&&x===W.length-1&&v(0),F})},title:b?"Pause trajectory":"Play trajectory",children:b&&x!==W.length-1?e.jsx(cl,{"aria-hidden":"true"}):e.jsx(hl,{"aria-hidden":"true"})}),e.jsx("input",{type:"range",min:0,max:W.length-1,step:1,value:x,onChange:$=>v(Number($.currentTarget.value)),"aria-label":"Trajectory frame"}),e.jsx("button",{type:"button",className:we?"is-live":"",onClick:()=>v(W.length-1),children:"Live"}),e.jsxs("span",{children:[x+1," / ",W.length]})]}),e.jsxs("footer",{className:"xyz-viewer-plugin__status",children:[e.jsxs("span",{children:["Selected atoms:"," ",g.length>0?g.map($=>`${T[$]??"Atom"}(${$})`).join(", "):"None"]}),M&&e.jsxs("span",{children:["Camera x=",M.x.toFixed(1)," y=",M.y.toFixed(1)," z=",M.z.toFixed(1)]})]})]})}function ta(t){return typeof t=="string"&&t.trim()!==""&&Number.isFinite(Number(t))}function wu(t){const r=t.split(/\r?\n/).map(o=>o.trim()).filter(Boolean),n=Number(r[0]);if(!Number.isInteger(n)||n<=0||n>1e5)return!1;const a=r.slice(2);return a.length<n?!1:a.slice(0,n).every(o=>{const s=o.split(/\s+/);return s.length>=4&&/^([A-Za-z][A-Za-z]?|\d+)$/.test(s[0]??"")&&ta(s[1])&&ta(s[2])&&ta(s[3])})}function yu(t){return t.split(/\r?\n/).some(r=>/^(ATOM|HETATM)\s+/i.test(r))}function ju(t){return/\bdata_[^\s]*/i.test(t)&&/_atom_site\./i.test(t)}function Nu(t,r){switch(r){case"xyz":case"extxyz":return wu(t);case"pdb":return yu(t);case"cif":return ju(t);default:return!1}}function Cu(t,{insertAt:r}={}){if(typeof document>"u")return;const n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",r==="top"&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}Cu(`.thread-ui-shell,
|
|
10
|
+
.thread-graph-dialog {
|
|
11
|
+
color-scheme: light;
|
|
12
|
+
--radius: 0.625rem;
|
|
13
|
+
--background: oklch(1 0 0);
|
|
14
|
+
--foreground: oklch(0.145 0 0);
|
|
15
|
+
--card: oklch(1 0 0);
|
|
16
|
+
--card-foreground: oklch(0.145 0 0);
|
|
17
|
+
--popover: oklch(1 0 0);
|
|
18
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
19
|
+
--primary: oklch(0.205 0 0);
|
|
20
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
21
|
+
--secondary: oklch(0.97 0 0);
|
|
22
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
23
|
+
--muted: oklch(0.97 0 0);
|
|
24
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
25
|
+
--accent: oklch(0.97 0 0);
|
|
26
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
27
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
28
|
+
--border: oklch(0.922 0 0);
|
|
29
|
+
--input: oklch(0.922 0 0);
|
|
30
|
+
--ring: oklch(0.708 0 0);
|
|
31
|
+
--sidebar: oklch(0.985 0 0);
|
|
32
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
33
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
34
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
35
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
36
|
+
--thread-gc-bg: #eef2f7;
|
|
37
|
+
--thread-gc-panel: #f8fafc;
|
|
38
|
+
--thread-gc-workspace: #f3f6fb;
|
|
39
|
+
--thread-gc-surface: #edf2f7;
|
|
40
|
+
--thread-gc-muted: #e6edf5;
|
|
41
|
+
--thread-gc-hover: #e8eef6;
|
|
42
|
+
--thread-gc-border: rgb(203 213 225 / 0.82);
|
|
43
|
+
--thread-gc-border-strong: rgb(174 187 204);
|
|
44
|
+
--thread-gc-border-contrast: rgb(123 139 161);
|
|
45
|
+
--thread-gc-fg: rgb(15 23 42);
|
|
46
|
+
--thread-gc-fg-soft: rgb(51 65 85);
|
|
47
|
+
--thread-gc-fg-muted: rgb(148 163 184);
|
|
48
|
+
--thread-gc-primary: rgb(2 6 23);
|
|
49
|
+
--thread-gc-primary-hover: rgb(30 41 59);
|
|
50
|
+
--thread-gc-primary-fg: #f8fafc;
|
|
51
|
+
--thread-gc-accent-soft: rgb(241 245 249);
|
|
52
|
+
--thread-gc-accent-strong: rgb(15 23 42);
|
|
53
|
+
--thread-gc-accent-border: rgb(203 213 225);
|
|
54
|
+
--thread-gc-shadow: 0 10px 30px rgb(15 23 42 / 0.04);
|
|
55
|
+
--theme-bg: var(--thread-gc-bg);
|
|
56
|
+
--theme-panel: var(--thread-gc-panel);
|
|
57
|
+
--theme-surface: var(--thread-gc-workspace);
|
|
58
|
+
--theme-surface-strong: var(--thread-gc-surface);
|
|
59
|
+
--theme-muted: var(--thread-gc-muted);
|
|
60
|
+
--theme-hover: var(--thread-gc-hover);
|
|
61
|
+
--theme-border: var(--thread-gc-border);
|
|
62
|
+
--theme-border-strong: var(--thread-gc-border-strong);
|
|
63
|
+
--theme-border-contrast: var(--thread-gc-border-contrast);
|
|
64
|
+
--theme-fg: var(--thread-gc-fg);
|
|
65
|
+
--theme-fg-soft: var(--thread-gc-fg-soft);
|
|
66
|
+
--theme-fg-muted: var(--thread-gc-fg-muted);
|
|
67
|
+
--theme-accent-solid: var(--thread-gc-primary);
|
|
68
|
+
--theme-accent-solid-hover: var(--thread-gc-primary-hover);
|
|
69
|
+
--theme-accent-solid-fg: var(--thread-gc-primary-fg);
|
|
70
|
+
--theme-accent-soft: var(--thread-gc-accent-soft);
|
|
71
|
+
--theme-accent-strong: var(--thread-gc-accent-strong);
|
|
72
|
+
--theme-accent-border: var(--thread-gc-accent-border);
|
|
73
|
+
--theme-shadow: var(--thread-gc-shadow);
|
|
74
|
+
background: var(--theme-bg);
|
|
75
|
+
color: var(--theme-fg);
|
|
76
|
+
isolation: isolate;
|
|
77
|
+
font-family:
|
|
78
|
+
Inter,
|
|
79
|
+
ui-sans-serif,
|
|
80
|
+
system-ui,
|
|
81
|
+
-apple-system,
|
|
82
|
+
BlinkMacSystemFont,
|
|
83
|
+
"Segoe UI",
|
|
84
|
+
"Noto Sans CJK SC",
|
|
85
|
+
"Noto Sans SC",
|
|
86
|
+
"Microsoft YaHei",
|
|
87
|
+
"PingFang SC",
|
|
88
|
+
"Hiragino Sans GB",
|
|
89
|
+
sans-serif;
|
|
90
|
+
}
|
|
91
|
+
.thread-graph-dialog {
|
|
92
|
+
background: var(--theme-panel);
|
|
93
|
+
color: var(--theme-fg);
|
|
94
|
+
}
|
|
95
|
+
.thread-ui-shell.thread-ui-viewport-constrained {
|
|
96
|
+
height: 100svh;
|
|
97
|
+
max-height: 100svh;
|
|
98
|
+
min-height: 0;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
overscroll-behavior: none;
|
|
101
|
+
}
|
|
102
|
+
.thread-ui-shell.thread-ui-theme-dark,
|
|
103
|
+
.thread-ui-shell[data-theme-effective=dark],
|
|
104
|
+
:root[data-theme-effective=dark] .thread-ui-shell,
|
|
105
|
+
.thread-ui-shell.dark,
|
|
106
|
+
.thread-ui-shell[data-theme=dark],
|
|
107
|
+
.thread-ui-shell[data-theme-mode=dark],
|
|
108
|
+
.thread-ui-shell[data-theme-mode=system][data-system-theme=dark],
|
|
109
|
+
.thread-graph-dialog[data-theme-effective=dark],
|
|
110
|
+
.thread-graph-dialog[data-theme-mode=dark],
|
|
111
|
+
.thread-graph-dialog[data-theme-mode=system][data-system-theme=dark] {
|
|
112
|
+
color-scheme: dark;
|
|
113
|
+
--background: oklch(0.145 0 0);
|
|
114
|
+
--foreground: oklch(0.985 0 0);
|
|
115
|
+
--card: oklch(0.205 0 0);
|
|
116
|
+
--card-foreground: oklch(0.985 0 0);
|
|
117
|
+
--popover: oklch(0.205 0 0);
|
|
118
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
119
|
+
--primary: oklch(0.922 0 0);
|
|
120
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
121
|
+
--secondary: oklch(0.269 0 0);
|
|
122
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
123
|
+
--muted: oklch(0.269 0 0);
|
|
124
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
125
|
+
--accent: oklch(0.269 0 0);
|
|
126
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
127
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
128
|
+
--border: oklch(1 0 0 / 10%);
|
|
129
|
+
--input: oklch(1 0 0 / 15%);
|
|
130
|
+
--ring: oklch(0.556 0 0);
|
|
131
|
+
--sidebar: oklch(0.205 0 0);
|
|
132
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
133
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
134
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
135
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
136
|
+
--thread-gc-bg: #101217;
|
|
137
|
+
--thread-gc-panel: #171a22;
|
|
138
|
+
--thread-gc-workspace: #151820;
|
|
139
|
+
--thread-gc-surface: #1d222c;
|
|
140
|
+
--thread-gc-muted: #222733;
|
|
141
|
+
--thread-gc-hover: #222733;
|
|
142
|
+
--thread-gc-border: #2a2f3a;
|
|
143
|
+
--thread-gc-border-strong: #303642;
|
|
144
|
+
--thread-gc-border-contrast: #475063;
|
|
145
|
+
--thread-gc-fg: rgb(241 245 249);
|
|
146
|
+
--thread-gc-fg-soft: rgb(203 213 225);
|
|
147
|
+
--thread-gc-fg-muted: rgb(148 163 184);
|
|
148
|
+
--thread-gc-primary: rgb(241 245 249);
|
|
149
|
+
--thread-gc-primary-hover: rgb(203 213 225);
|
|
150
|
+
--thread-gc-primary-fg: #11141a;
|
|
151
|
+
--thread-gc-accent-soft: #222733;
|
|
152
|
+
--thread-gc-accent-strong: rgb(241 245 249);
|
|
153
|
+
--thread-gc-accent-border: #303642;
|
|
154
|
+
--thread-gc-shadow: 0 18px 40px rgb(0 0 0 / 0.28);
|
|
155
|
+
}
|
|
156
|
+
.thread-ui-shell *,
|
|
157
|
+
.thread-ui-shell *::before,
|
|
158
|
+
.thread-ui-shell *::after {
|
|
159
|
+
box-sizing: border-box;
|
|
160
|
+
}
|
|
161
|
+
.thread-ui-shell .thread-main-panel,
|
|
162
|
+
.thread-ui-shell .thread-detail-surface,
|
|
163
|
+
.thread-ui-shell .thread-sidebar-surface,
|
|
164
|
+
.thread-ui-shell .thread-workspace-panel,
|
|
165
|
+
.thread-ui-shell .thread-workspace-card {
|
|
166
|
+
border-color: var(--theme-border);
|
|
167
|
+
background: var(--theme-panel);
|
|
168
|
+
color: var(--theme-fg);
|
|
169
|
+
}
|
|
170
|
+
.thread-ui-shell .thread-sidebar-surface {
|
|
171
|
+
background: color-mix(in oklch, var(--theme-panel) 92%, var(--theme-surface));
|
|
172
|
+
color: var(--theme-fg);
|
|
173
|
+
}
|
|
174
|
+
.thread-ui-shell .thread-graph-rooms-surface,
|
|
175
|
+
.thread-ui-shell .thread-topbar-surface {
|
|
176
|
+
border-color: var(--theme-border);
|
|
177
|
+
background: var(--theme-panel);
|
|
178
|
+
color: var(--theme-fg);
|
|
179
|
+
}
|
|
180
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-rooms-surface,
|
|
181
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-rooms-surface,
|
|
182
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-graph-rooms-surface,
|
|
183
|
+
.thread-ui-shell.dark .thread-graph-rooms-surface,
|
|
184
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-topbar-surface,
|
|
185
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-topbar-surface,
|
|
186
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-topbar-surface,
|
|
187
|
+
.thread-ui-shell.dark .thread-topbar-surface {
|
|
188
|
+
border-color: #2a2f3a;
|
|
189
|
+
background: #171a22;
|
|
190
|
+
color: rgb(241 245 249);
|
|
191
|
+
box-shadow: 0 18px 40px rgb(0 0 0 / 0.28);
|
|
192
|
+
}
|
|
193
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-rooms-surface,
|
|
194
|
+
:root[data-theme-effective=light] .thread-ui-shell .thread-graph-rooms-surface,
|
|
195
|
+
.thread-ui-shell[data-theme-effective=light] .thread-topbar-surface,
|
|
196
|
+
:root[data-theme-effective=light] .thread-ui-shell .thread-topbar-surface {
|
|
197
|
+
border-color: rgb(226 232 240 / 0.8);
|
|
198
|
+
background: rgb(255 255 255);
|
|
199
|
+
color: rgb(15 23 42);
|
|
200
|
+
box-shadow: 0 10px 30px rgb(15 23 42 / 0.04);
|
|
201
|
+
}
|
|
202
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-mobile-scrim,
|
|
203
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-mobile-scrim,
|
|
204
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-mobile-scrim,
|
|
205
|
+
.thread-ui-shell.dark .thread-mobile-scrim {
|
|
206
|
+
background: rgb(0 0 0 / 0.55);
|
|
207
|
+
}
|
|
208
|
+
.thread-ui-shell .thread-shell-frame {
|
|
209
|
+
display: block;
|
|
210
|
+
height: 100%;
|
|
211
|
+
min-height: 0;
|
|
212
|
+
width: 100%;
|
|
213
|
+
}
|
|
214
|
+
.thread-ui-shell .thread-rooms-rail {
|
|
215
|
+
transform: none;
|
|
216
|
+
translate: -100% 0;
|
|
217
|
+
overflow-x: hidden;
|
|
218
|
+
}
|
|
219
|
+
.thread-ui-shell .thread-rooms-rail.translate-x-0 {
|
|
220
|
+
transform: none;
|
|
221
|
+
translate: 0 0;
|
|
222
|
+
}
|
|
223
|
+
.thread-ui-shell .thread-shell-main {
|
|
224
|
+
height: 100%;
|
|
225
|
+
width: 100%;
|
|
226
|
+
min-width: 0;
|
|
227
|
+
min-height: 0;
|
|
228
|
+
overflow: hidden;
|
|
229
|
+
}
|
|
230
|
+
.thread-ui-shell .thread-shell-card {
|
|
231
|
+
border-color: transparent;
|
|
232
|
+
}
|
|
233
|
+
.thread-ui-shell .thread-desktop-only-flex,
|
|
234
|
+
.thread-ui-shell .thread-desktop-only-inline-flex,
|
|
235
|
+
.thread-ui-shell .thread-mobile-chat-hidden,
|
|
236
|
+
.thread-ui-shell .thread-mobile-workspace-hidden {
|
|
237
|
+
display: none;
|
|
238
|
+
}
|
|
239
|
+
.thread-ui-shell .thread-mobile-only-block {
|
|
240
|
+
display: block;
|
|
241
|
+
}
|
|
242
|
+
.thread-ui-shell .thread-mobile-only-grid {
|
|
243
|
+
display: grid;
|
|
244
|
+
}
|
|
245
|
+
.thread-ui-shell .thread-mobile-only-inline-flex {
|
|
246
|
+
display: inline-flex;
|
|
247
|
+
}
|
|
248
|
+
.thread-ui-shell .thread-main-panel,
|
|
249
|
+
.thread-ui-shell .thread-shell-card {
|
|
250
|
+
height: 100%;
|
|
251
|
+
min-height: 0;
|
|
252
|
+
}
|
|
253
|
+
.thread-ui-shell .thread-topbar-surface {
|
|
254
|
+
min-height: 3.5rem;
|
|
255
|
+
}
|
|
256
|
+
.thread-ui-shell .thread-icon-button,
|
|
257
|
+
.thread-ui-shell .thread-secondary-action {
|
|
258
|
+
border-color: var(--theme-border);
|
|
259
|
+
background: transparent;
|
|
260
|
+
color: var(--theme-fg-soft);
|
|
261
|
+
}
|
|
262
|
+
.thread-ui-shell .thread-icon-button:hover,
|
|
263
|
+
.thread-ui-shell .thread-secondary-action:hover {
|
|
264
|
+
background: var(--theme-hover);
|
|
265
|
+
color: var(--theme-fg);
|
|
266
|
+
}
|
|
267
|
+
.thread-ui-shell .thread-topbar-meta-row {
|
|
268
|
+
color: var(--theme-fg-muted);
|
|
269
|
+
}
|
|
270
|
+
.thread-ui-shell button.thread-topbar-meta-row:hover {
|
|
271
|
+
color: var(--theme-fg);
|
|
272
|
+
}
|
|
273
|
+
.thread-ui-shell .thread-topbar-details-trigger {
|
|
274
|
+
border-color: var(--theme-border);
|
|
275
|
+
background: var(--theme-surface);
|
|
276
|
+
color: var(--theme-fg-soft);
|
|
277
|
+
}
|
|
278
|
+
.thread-ui-shell .thread-topbar-details-trigger:hover,
|
|
279
|
+
.thread-ui-shell .thread-topbar-details-trigger[aria-expanded=true] {
|
|
280
|
+
border-color: var(--theme-border-strong);
|
|
281
|
+
background: var(--theme-hover);
|
|
282
|
+
color: var(--theme-fg);
|
|
283
|
+
}
|
|
284
|
+
.thread-ui-shell .thread-topbar-details-popover {
|
|
285
|
+
border-color: var(--theme-border);
|
|
286
|
+
background: var(--theme-panel);
|
|
287
|
+
color: var(--theme-fg);
|
|
288
|
+
box-shadow: var(--theme-shadow);
|
|
289
|
+
}
|
|
290
|
+
.thread-ui-shell .thread-topbar-meta-row .font-mono {
|
|
291
|
+
color: var(--theme-fg-soft);
|
|
292
|
+
}
|
|
293
|
+
.thread-ui-shell button.thread-topbar-meta-row:hover .font-mono {
|
|
294
|
+
color: var(--theme-fg);
|
|
295
|
+
}
|
|
296
|
+
.thread-ui-shell .thread-graph-topbar-actions {
|
|
297
|
+
border-color: var(--theme-border);
|
|
298
|
+
background: var(--theme-surface);
|
|
299
|
+
}
|
|
300
|
+
.thread-ui-shell .thread-graph-topbar-actions > * {
|
|
301
|
+
display: inline-flex;
|
|
302
|
+
align-items: center;
|
|
303
|
+
gap: 0.25rem;
|
|
304
|
+
}
|
|
305
|
+
.thread-ui-shell .thread-graph-topbar-actions button,
|
|
306
|
+
.thread-ui-shell .thread-graph-topbar-actions a {
|
|
307
|
+
min-width: 2rem;
|
|
308
|
+
height: 2rem;
|
|
309
|
+
border-radius: 0.375rem;
|
|
310
|
+
border-color: transparent;
|
|
311
|
+
background: transparent;
|
|
312
|
+
color: var(--theme-fg-soft);
|
|
313
|
+
box-shadow: none;
|
|
314
|
+
}
|
|
315
|
+
.thread-ui-shell .thread-graph-topbar-actions button:hover,
|
|
316
|
+
.thread-ui-shell .thread-graph-topbar-actions a:hover {
|
|
317
|
+
background: var(--theme-hover);
|
|
318
|
+
color: var(--theme-fg);
|
|
319
|
+
}
|
|
320
|
+
.thread-ui-shell .thread-graph-topbar-actions button:disabled,
|
|
321
|
+
.thread-ui-shell .thread-graph-topbar-actions a[aria-disabled=true] {
|
|
322
|
+
cursor: not-allowed;
|
|
323
|
+
opacity: 0.5;
|
|
324
|
+
}
|
|
325
|
+
.thread-ui-shell .thread-graph-dialog,
|
|
326
|
+
.thread-graph-dialog {
|
|
327
|
+
border-color: var(--theme-border);
|
|
328
|
+
color: var(--theme-fg);
|
|
329
|
+
}
|
|
330
|
+
.thread-ui-shell .thread-graph-settings-dialog,
|
|
331
|
+
.thread-graph-settings-dialog,
|
|
332
|
+
.thread-graph-create-thread-dialog {
|
|
333
|
+
border-color: var(--theme-border);
|
|
334
|
+
background: var(--theme-panel);
|
|
335
|
+
color: var(--theme-fg);
|
|
336
|
+
}
|
|
337
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-description],
|
|
338
|
+
.thread-graph-settings-dialog [data-slot=dialog-description],
|
|
339
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-description] {
|
|
340
|
+
color: var(--theme-fg-muted);
|
|
341
|
+
}
|
|
342
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-close],
|
|
343
|
+
.thread-graph-settings-dialog [data-slot=dialog-close],
|
|
344
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-close] {
|
|
345
|
+
color: var(--theme-fg-muted);
|
|
346
|
+
}
|
|
347
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-close]:hover,
|
|
348
|
+
.thread-graph-settings-dialog [data-slot=dialog-close]:hover,
|
|
349
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-close]:hover {
|
|
350
|
+
color: var(--theme-fg);
|
|
351
|
+
}
|
|
352
|
+
.thread-ui-shell .thread-graph-settings-card,
|
|
353
|
+
.thread-ui-shell .thread-graph-theme-mode-group,
|
|
354
|
+
.thread-ui-shell .thread-graph-settings-tabs,
|
|
355
|
+
.thread-graph-settings-dialog .thread-graph-settings-card,
|
|
356
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-group,
|
|
357
|
+
.thread-graph-settings-dialog .thread-graph-settings-tabs {
|
|
358
|
+
border-color: var(--theme-border);
|
|
359
|
+
background: var(--theme-surface);
|
|
360
|
+
}
|
|
361
|
+
.thread-ui-shell .thread-graph-theme-mode-button,
|
|
362
|
+
.thread-ui-shell .thread-graph-settings-tab-button,
|
|
363
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button,
|
|
364
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button {
|
|
365
|
+
color: var(--theme-fg-muted);
|
|
366
|
+
}
|
|
367
|
+
.thread-ui-shell .thread-graph-theme-mode-button:hover:not(:disabled),
|
|
368
|
+
.thread-ui-shell .thread-graph-settings-tab-button:hover:not(:disabled),
|
|
369
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button:hover:not(:disabled),
|
|
370
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button:hover:not(:disabled) {
|
|
371
|
+
background: var(--theme-hover);
|
|
372
|
+
color: var(--theme-fg);
|
|
373
|
+
}
|
|
374
|
+
.thread-ui-shell .thread-graph-theme-mode-button.is-selected,
|
|
375
|
+
.thread-ui-shell .thread-graph-settings-tab-button.is-active,
|
|
376
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button.is-selected,
|
|
377
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button.is-active {
|
|
378
|
+
background: var(--theme-accent-solid);
|
|
379
|
+
color: var(--theme-accent-solid-fg);
|
|
380
|
+
box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
|
|
381
|
+
}
|
|
382
|
+
.thread-ui-shell .thread-graph-theme-mode-button:disabled,
|
|
383
|
+
.thread-ui-shell .thread-graph-settings-tab-button:disabled,
|
|
384
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button:disabled,
|
|
385
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button:disabled {
|
|
386
|
+
cursor: not-allowed;
|
|
387
|
+
opacity: 0.55;
|
|
388
|
+
}
|
|
389
|
+
.thread-graph-settings-dialog .thread-graph-settings-body {
|
|
390
|
+
max-height: min(62vh, 42rem);
|
|
391
|
+
color: var(--theme-fg);
|
|
392
|
+
}
|
|
393
|
+
.thread-graph-settings-dialog .thread-graph-settings-global-content {
|
|
394
|
+
color: var(--theme-fg);
|
|
395
|
+
}
|
|
396
|
+
.thread-graph-settings-dialog .thread-graph-settings-body dt,
|
|
397
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-500,
|
|
398
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-500,
|
|
399
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-400,
|
|
400
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-400 {
|
|
401
|
+
color: var(--theme-fg-muted) !important;
|
|
402
|
+
}
|
|
403
|
+
.thread-graph-settings-dialog .thread-graph-settings-body dd,
|
|
404
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-100,
|
|
405
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-200,
|
|
406
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-300,
|
|
407
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-100,
|
|
408
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-200,
|
|
409
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-300 {
|
|
410
|
+
color: var(--theme-fg) !important;
|
|
411
|
+
}
|
|
412
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-stone-950,
|
|
413
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-stone-900,
|
|
414
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-slate-950,
|
|
415
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-slate-900 {
|
|
416
|
+
background: var(--theme-surface-strong) !important;
|
|
417
|
+
}
|
|
418
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-stone-800,
|
|
419
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-stone-700,
|
|
420
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-slate-800,
|
|
421
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-slate-700 {
|
|
422
|
+
border-color: var(--theme-border) !important;
|
|
423
|
+
}
|
|
424
|
+
.thread-graph-create-thread-input {
|
|
425
|
+
border-color: var(--theme-border);
|
|
426
|
+
background: var(--theme-surface);
|
|
427
|
+
color: var(--theme-fg);
|
|
428
|
+
}
|
|
429
|
+
.thread-graph-create-thread-input::placeholder {
|
|
430
|
+
color: var(--theme-fg-muted);
|
|
431
|
+
}
|
|
432
|
+
.thread-graph-create-thread-input:focus {
|
|
433
|
+
border-color: var(--theme-border-contrast);
|
|
434
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-border-contrast) 18%, transparent);
|
|
435
|
+
}
|
|
436
|
+
.thread-graph-create-thread-submit {
|
|
437
|
+
background: var(--theme-accent-solid);
|
|
438
|
+
color: var(--theme-accent-solid-fg);
|
|
439
|
+
}
|
|
440
|
+
.thread-graph-create-thread-submit:hover:not(:disabled) {
|
|
441
|
+
background: var(--theme-accent-solid-hover);
|
|
442
|
+
}
|
|
443
|
+
.thread-ui-shell .ui-action-danger {
|
|
444
|
+
border: 1px solid color-mix(in oklch, rgb(244 63 94) 48%, var(--theme-border));
|
|
445
|
+
background: color-mix(in oklch, rgb(244 63 94) 18%, var(--theme-panel));
|
|
446
|
+
color: color-mix(in oklch, rgb(254 226 226) 86%, var(--theme-fg));
|
|
447
|
+
}
|
|
448
|
+
.thread-ui-shell .ui-action-danger:hover {
|
|
449
|
+
background: color-mix(in oklch, rgb(244 63 94) 26%, var(--theme-panel));
|
|
450
|
+
color: rgb(254 226 226);
|
|
451
|
+
}
|
|
452
|
+
.thread-ui-shell .thread-mobile-segment {
|
|
453
|
+
background: var(--theme-surface-strong);
|
|
454
|
+
color: var(--theme-fg-soft);
|
|
455
|
+
}
|
|
456
|
+
.thread-ui-shell .thread-mobile-segment:hover {
|
|
457
|
+
background: var(--theme-hover);
|
|
458
|
+
color: var(--theme-fg);
|
|
459
|
+
}
|
|
460
|
+
.thread-ui-shell .thread-mobile-segment.is-active {
|
|
461
|
+
background: var(--theme-accent-solid);
|
|
462
|
+
color: var(--theme-accent-solid-fg);
|
|
463
|
+
}
|
|
464
|
+
.thread-ui-shell .thread-sidebar-card {
|
|
465
|
+
border-color: transparent;
|
|
466
|
+
background: var(--theme-surface-strong);
|
|
467
|
+
color: var(--theme-fg-soft);
|
|
468
|
+
}
|
|
469
|
+
.thread-ui-shell .thread-graph-room-card {
|
|
470
|
+
border-color: rgb(226 232 240 / 0.9);
|
|
471
|
+
background: rgb(248 250 252);
|
|
472
|
+
color: rgb(51 65 85);
|
|
473
|
+
}
|
|
474
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card {
|
|
475
|
+
border-color: rgb(226 232 240 / 0.9);
|
|
476
|
+
background: rgb(248 250 252);
|
|
477
|
+
color: rgb(51 65 85);
|
|
478
|
+
}
|
|
479
|
+
.thread-ui-shell .thread-sidebar-card:hover {
|
|
480
|
+
border-color: var(--theme-border);
|
|
481
|
+
background: var(--theme-panel);
|
|
482
|
+
color: var(--theme-fg);
|
|
483
|
+
}
|
|
484
|
+
.thread-ui-shell .thread-graph-room-card:hover {
|
|
485
|
+
border-color: rgb(203 213 225);
|
|
486
|
+
background: rgb(255 255 255);
|
|
487
|
+
color: rgb(15 23 42);
|
|
488
|
+
}
|
|
489
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card:hover {
|
|
490
|
+
border-color: rgb(203 213 225);
|
|
491
|
+
background: rgb(255 255 255);
|
|
492
|
+
color: rgb(15 23 42);
|
|
493
|
+
}
|
|
494
|
+
.thread-ui-shell .thread-sidebar-card-active {
|
|
495
|
+
border-color: var(--theme-accent-solid);
|
|
496
|
+
background: var(--theme-accent-solid);
|
|
497
|
+
color: var(--theme-accent-solid-fg);
|
|
498
|
+
box-shadow: 0 12px 30px oklch(0.22 0.024 255 / 0.18);
|
|
499
|
+
}
|
|
500
|
+
.thread-ui-shell .thread-graph-room-card.is-active {
|
|
501
|
+
border-color: rgb(203 213 225);
|
|
502
|
+
background: rgb(241 245 249);
|
|
503
|
+
color: rgb(15 23 42);
|
|
504
|
+
box-shadow: 0 8px 22px rgb(15 23 42 / 0.06);
|
|
505
|
+
}
|
|
506
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card.is-active {
|
|
507
|
+
border-color: rgb(203 213 225);
|
|
508
|
+
background: rgb(241 245 249);
|
|
509
|
+
color: rgb(15 23 42);
|
|
510
|
+
box-shadow: 0 8px 22px rgb(15 23 42 / 0.06);
|
|
511
|
+
}
|
|
512
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card.is-active,
|
|
513
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card.is-active,
|
|
514
|
+
.thread-ui-shell.dark .thread-graph-room-card.is-active {
|
|
515
|
+
border-color: #3c4556;
|
|
516
|
+
background: #262c38;
|
|
517
|
+
color: rgb(241 245 249);
|
|
518
|
+
box-shadow: 0 10px 24px rgb(0 0 0 / 0.18);
|
|
519
|
+
}
|
|
520
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card,
|
|
521
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card,
|
|
522
|
+
.thread-ui-shell.dark .thread-graph-room-card {
|
|
523
|
+
border-color: transparent;
|
|
524
|
+
background: #1d222c;
|
|
525
|
+
color: rgb(203 213 225);
|
|
526
|
+
}
|
|
527
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card:hover,
|
|
528
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card:hover,
|
|
529
|
+
.thread-ui-shell.dark .thread-graph-room-card:hover {
|
|
530
|
+
border-color: #343b48;
|
|
531
|
+
background: #222733;
|
|
532
|
+
color: rgb(241 245 249);
|
|
533
|
+
}
|
|
534
|
+
.thread-ui-shell .thread-sidebar-card-icon {
|
|
535
|
+
background: var(--theme-panel);
|
|
536
|
+
color: var(--theme-fg-muted);
|
|
537
|
+
}
|
|
538
|
+
.thread-ui-shell .thread-graph-room-card-icon {
|
|
539
|
+
background: rgb(255 255 255);
|
|
540
|
+
color: rgb(100 116 139);
|
|
541
|
+
}
|
|
542
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card-icon {
|
|
543
|
+
background: rgb(255 255 255);
|
|
544
|
+
color: rgb(100 116 139);
|
|
545
|
+
}
|
|
546
|
+
.thread-ui-shell .thread-sidebar-card-icon.is-active {
|
|
547
|
+
background: color-mix(in oklch, var(--theme-accent-solid-fg) 16%, transparent);
|
|
548
|
+
color: var(--theme-accent-solid-fg);
|
|
549
|
+
}
|
|
550
|
+
.thread-ui-shell .thread-graph-room-card-icon.is-active {
|
|
551
|
+
background: rgb(226 232 240);
|
|
552
|
+
color: rgb(15 23 42);
|
|
553
|
+
}
|
|
554
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card-icon.is-active {
|
|
555
|
+
background: rgb(226 232 240);
|
|
556
|
+
color: rgb(15 23 42);
|
|
557
|
+
}
|
|
558
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card-icon.is-active,
|
|
559
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card-icon.is-active,
|
|
560
|
+
.thread-ui-shell.dark .thread-graph-room-card-icon.is-active {
|
|
561
|
+
background: #12151c;
|
|
562
|
+
color: rgb(226 232 240);
|
|
563
|
+
}
|
|
564
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card-icon,
|
|
565
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card-icon,
|
|
566
|
+
.thread-ui-shell.dark .thread-graph-room-card-icon {
|
|
567
|
+
background: #12151c;
|
|
568
|
+
color: rgb(148 163 184);
|
|
569
|
+
}
|
|
570
|
+
.thread-ui-shell .thread-sidebar-card-active .thread-sidebar-card-title,
|
|
571
|
+
.thread-ui-shell .thread-sidebar-card-active p,
|
|
572
|
+
.thread-ui-shell .thread-sidebar-card-active span,
|
|
573
|
+
.thread-ui-shell .thread-sidebar-card-active button,
|
|
574
|
+
.thread-ui-shell .thread-graph-room-card.is-active .thread-graph-room-card-title,
|
|
575
|
+
.thread-ui-shell .thread-graph-room-card.is-active p,
|
|
576
|
+
.thread-ui-shell .thread-graph-room-card.is-active button {
|
|
577
|
+
color: inherit;
|
|
578
|
+
}
|
|
579
|
+
.thread-ui-shell .thread-card-quiet-button {
|
|
580
|
+
color: var(--theme-fg-muted);
|
|
581
|
+
}
|
|
582
|
+
.thread-ui-shell .thread-card-quiet-button:hover {
|
|
583
|
+
background: color-mix(in oklch, var(--theme-hover) 80%, transparent);
|
|
584
|
+
color: var(--theme-fg);
|
|
585
|
+
}
|
|
586
|
+
.thread-ui-shell .thread-card-session-copy-button {
|
|
587
|
+
opacity: 0;
|
|
588
|
+
}
|
|
589
|
+
.thread-ui-shell .thread-graph-room-card:hover .thread-card-session-copy-button,
|
|
590
|
+
.thread-ui-shell .thread-card-session-copy-button:focus-visible,
|
|
591
|
+
.thread-ui-shell .thread-card-session-copy-button:active {
|
|
592
|
+
opacity: 1;
|
|
593
|
+
}
|
|
594
|
+
.thread-ui-shell .thread-card-danger-button {
|
|
595
|
+
color: oklch(0.62 0.16 25);
|
|
596
|
+
}
|
|
597
|
+
.thread-ui-shell .thread-card-danger-button:hover {
|
|
598
|
+
background: rgb(254 226 226);
|
|
599
|
+
}
|
|
600
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-card-danger-button:hover,
|
|
601
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-card-danger-button:hover,
|
|
602
|
+
.thread-ui-shell.dark .thread-card-danger-button:hover {
|
|
603
|
+
background: rgb(127 29 29 / 0.32);
|
|
604
|
+
}
|
|
605
|
+
.thread-ui-shell .thread-new-thread-button,
|
|
606
|
+
.thread-ui-shell .thread-graph-new-room-button {
|
|
607
|
+
min-width: 0;
|
|
608
|
+
}
|
|
609
|
+
.thread-ui-shell .thread-graph-new-room-strip {
|
|
610
|
+
border-color: var(--theme-border);
|
|
611
|
+
}
|
|
612
|
+
.thread-ui-shell .thread-graph-new-room-button {
|
|
613
|
+
background: var(--theme-accent-solid);
|
|
614
|
+
color: var(--theme-accent-solid-fg);
|
|
615
|
+
transition: background-color 160ms ease, transform 160ms ease;
|
|
616
|
+
}
|
|
617
|
+
.thread-ui-shell .thread-graph-new-room-button:hover {
|
|
618
|
+
background: var(--theme-accent-solid-hover);
|
|
619
|
+
transform: translateY(-1px);
|
|
620
|
+
}
|
|
621
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-new-room-button,
|
|
622
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-new-room-button,
|
|
623
|
+
.thread-ui-shell.dark .thread-graph-new-room-button {
|
|
624
|
+
border: 1px solid #343b48;
|
|
625
|
+
background: #222733;
|
|
626
|
+
color: rgb(241 245 249);
|
|
627
|
+
}
|
|
628
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-new-room-button:hover,
|
|
629
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-new-room-button:hover,
|
|
630
|
+
.thread-ui-shell.dark .thread-graph-new-room-button:hover {
|
|
631
|
+
border-color: #465164;
|
|
632
|
+
background: #2b313d;
|
|
633
|
+
}
|
|
634
|
+
.thread-ui-shell .thread-detail-surface {
|
|
635
|
+
border-color: transparent;
|
|
636
|
+
background: var(--theme-surface);
|
|
637
|
+
box-shadow: none;
|
|
638
|
+
}
|
|
639
|
+
.thread-ui-shell .thread-graph-chat-panel {
|
|
640
|
+
background: var(--theme-surface);
|
|
641
|
+
color: var(--theme-fg);
|
|
642
|
+
}
|
|
643
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-chat-panel,
|
|
644
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-chat-panel,
|
|
645
|
+
.thread-ui-shell.dark .thread-graph-chat-panel {
|
|
646
|
+
background: var(--theme-surface);
|
|
647
|
+
color: var(--theme-fg);
|
|
648
|
+
}
|
|
649
|
+
.thread-ui-shell .thread-graph-scroll-container {
|
|
650
|
+
background: var(--theme-surface);
|
|
651
|
+
color: var(--theme-fg);
|
|
652
|
+
scrollbar-color: rgb(203 213 225) transparent;
|
|
653
|
+
}
|
|
654
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-scroll-container,
|
|
655
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-scroll-container,
|
|
656
|
+
.thread-ui-shell.dark .thread-graph-scroll-container {
|
|
657
|
+
background: var(--theme-surface);
|
|
658
|
+
color: var(--theme-fg);
|
|
659
|
+
scrollbar-color: #374151 transparent;
|
|
660
|
+
}
|
|
661
|
+
.thread-ui-shell .thread-graph-scroll-content {
|
|
662
|
+
min-height: 100%;
|
|
663
|
+
padding: 0.75rem 0 max(0rem, var(--thread-graph-chat-scroll-bottom-spacer, 0px));
|
|
664
|
+
}
|
|
665
|
+
.thread-ui-shell .thread-graph-message-list {
|
|
666
|
+
display: flex;
|
|
667
|
+
flex-direction: column;
|
|
668
|
+
gap: 1rem;
|
|
669
|
+
}
|
|
670
|
+
.thread-ui-shell .thread-graph-message-section {
|
|
671
|
+
border-top: 1px solid var(--theme-border);
|
|
672
|
+
}
|
|
673
|
+
.thread-ui-shell .thread-graph-history-control,
|
|
674
|
+
.thread-ui-shell .thread-graph-empty-state {
|
|
675
|
+
color: var(--theme-fg-muted);
|
|
676
|
+
}
|
|
677
|
+
.thread-ui-shell .thread-graph-history-button,
|
|
678
|
+
.thread-ui-shell .thread-graph-turn-index,
|
|
679
|
+
.thread-ui-shell .thread-graph-turn-collapse {
|
|
680
|
+
border-color: var(--theme-border);
|
|
681
|
+
background: var(--theme-panel);
|
|
682
|
+
color: var(--theme-fg-muted);
|
|
683
|
+
}
|
|
684
|
+
.thread-ui-shell .thread-graph-history-button:hover,
|
|
685
|
+
.thread-ui-shell .thread-graph-turn-collapse:hover {
|
|
686
|
+
background: var(--theme-hover);
|
|
687
|
+
color: var(--theme-fg);
|
|
688
|
+
}
|
|
689
|
+
.thread-ui-shell .thread-graph-turn {
|
|
690
|
+
border-radius: 0;
|
|
691
|
+
}
|
|
692
|
+
.thread-ui-shell .thread-graph-turn-header {
|
|
693
|
+
color: var(--theme-fg-muted);
|
|
694
|
+
}
|
|
695
|
+
.thread-ui-shell .thread-graph-turn-time {
|
|
696
|
+
color: var(--theme-fg-muted);
|
|
697
|
+
}
|
|
698
|
+
.thread-ui-shell :where(.text-stone-100, .text-stone-200, .text-stone-300) {
|
|
699
|
+
color: var(--theme-fg) !important;
|
|
700
|
+
}
|
|
701
|
+
.thread-ui-shell :where(.text-stone-400, .text-stone-500, .text-stone-600) {
|
|
702
|
+
color: var(--theme-fg-muted) !important;
|
|
703
|
+
}
|
|
704
|
+
.thread-ui-shell :where(.border-stone-600, .border-stone-700, .border-stone-700\\/90, .border-stone-800, .border-stone-800\\/80) {
|
|
705
|
+
border-color: var(--theme-border) !important;
|
|
706
|
+
}
|
|
707
|
+
.thread-ui-shell :where(.bg-stone-800, .bg-stone-800\\/60, .bg-stone-800\\/80, .bg-stone-900, .bg-stone-900\\/60, .bg-stone-900\\/70, .bg-stone-900\\/72, .bg-stone-900\\/80, .bg-stone-950, .bg-stone-950\\/70, .bg-stone-950\\/90) {
|
|
708
|
+
background: var(--theme-surface-strong) !important;
|
|
709
|
+
}
|
|
710
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-sky-100, .text-sky-50),
|
|
711
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-sky-100, .text-sky-50) {
|
|
712
|
+
color: rgb(3 105 161);
|
|
713
|
+
}
|
|
714
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-emerald-100, .text-emerald-50),
|
|
715
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-emerald-100, .text-emerald-50) {
|
|
716
|
+
color: rgb(21 128 61);
|
|
717
|
+
}
|
|
718
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-rose-100, .text-rose-50),
|
|
719
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-rose-100, .text-rose-50) {
|
|
720
|
+
color: rgb(190 24 93);
|
|
721
|
+
}
|
|
722
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-amber-100, .text-amber-50, .text-amber-200),
|
|
723
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-amber-100, .text-amber-50, .text-amber-200) {
|
|
724
|
+
color: rgb(120 53 15);
|
|
725
|
+
}
|
|
726
|
+
.thread-ui-shell[data-theme-effective=light] .text-fuchsia-100,
|
|
727
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-fuchsia-100 {
|
|
728
|
+
color: rgb(162 28 175);
|
|
729
|
+
}
|
|
730
|
+
.thread-ui-shell[data-theme-effective=light] .text-violet-100,
|
|
731
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-violet-100 {
|
|
732
|
+
color: rgb(109 40 217);
|
|
733
|
+
}
|
|
734
|
+
.thread-ui-shell[data-theme-effective=light] .text-lime-100,
|
|
735
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-lime-100 {
|
|
736
|
+
color: rgb(77 124 15);
|
|
737
|
+
}
|
|
738
|
+
.thread-ui-shell[data-theme-effective=light] :where(.bg-sky-300\\/10, .bg-sky-300\\/15, .bg-emerald-300\\/10, .bg-emerald-300\\/15, .bg-amber-300\\/10, .bg-amber-300\\/15, .bg-rose-300\\/10, .bg-rose-300\\/15, .bg-fuchsia-300\\/10, .bg-fuchsia-300\\/15, .bg-violet-300\\/10, .bg-violet-300\\/15, .bg-lime-300\\/10, .bg-lime-300\\/15),
|
|
739
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.bg-sky-300\\/10, .bg-sky-300\\/15, .bg-emerald-300\\/10, .bg-emerald-300\\/15, .bg-amber-300\\/10, .bg-amber-300\\/15, .bg-rose-300\\/10, .bg-rose-300\\/15, .bg-fuchsia-300\\/10, .bg-fuchsia-300\\/15, .bg-violet-300\\/10, .bg-violet-300\\/15, .bg-lime-300\\/10, .bg-lime-300\\/15) {
|
|
740
|
+
filter: saturate(0.72) brightness(0.97);
|
|
741
|
+
}
|
|
742
|
+
.thread-ui-shell .thread-token-popover {
|
|
743
|
+
border-color: var(--theme-border);
|
|
744
|
+
background: var(--theme-panel);
|
|
745
|
+
color: var(--theme-fg);
|
|
746
|
+
}
|
|
747
|
+
.thread-ui-shell .thread-token-popover-row {
|
|
748
|
+
border-color: var(--theme-border);
|
|
749
|
+
background: var(--theme-surface);
|
|
750
|
+
}
|
|
751
|
+
.thread-ui-shell .thread-token-popover-text {
|
|
752
|
+
color: var(--theme-fg-soft);
|
|
753
|
+
}
|
|
754
|
+
.thread-ui-shell .thread-token-popover-strong {
|
|
755
|
+
color: var(--theme-fg);
|
|
756
|
+
}
|
|
757
|
+
.thread-ui-shell .token-badge-in {
|
|
758
|
+
border-color: rgb(22 101 52 / 0.32);
|
|
759
|
+
background: rgb(220 252 231 / 0.72);
|
|
760
|
+
color: rgb(20 83 45);
|
|
761
|
+
}
|
|
762
|
+
.thread-ui-shell .token-badge-cache {
|
|
763
|
+
border-color: rgb(3 105 161 / 0.32);
|
|
764
|
+
background: rgb(224 242 254 / 0.76);
|
|
765
|
+
color: rgb(7 89 133);
|
|
766
|
+
}
|
|
767
|
+
.thread-ui-shell .token-badge-out {
|
|
768
|
+
border-color: rgb(109 40 217 / 0.28);
|
|
769
|
+
background: rgb(237 233 254 / 0.76);
|
|
770
|
+
color: rgb(91 33 182);
|
|
771
|
+
}
|
|
772
|
+
.thread-ui-shell .token-badge-reason {
|
|
773
|
+
border-color: rgb(146 64 14 / 0.28);
|
|
774
|
+
background: rgb(254 243 199 / 0.72);
|
|
775
|
+
color: rgb(120 53 15);
|
|
776
|
+
}
|
|
777
|
+
.thread-ui-shell .token-badge-total {
|
|
778
|
+
border-color: rgb(77 124 15 / 0.3);
|
|
779
|
+
background: rgb(236 252 203 / 0.72);
|
|
780
|
+
color: rgb(63 98 18);
|
|
781
|
+
}
|
|
782
|
+
.thread-ui-shell .token-badge-empty {
|
|
783
|
+
border-color: var(--theme-border-strong);
|
|
784
|
+
background: var(--theme-surface);
|
|
785
|
+
color: var(--theme-fg-soft);
|
|
786
|
+
}
|
|
787
|
+
.thread-ui-shell .thread-token-badge-value {
|
|
788
|
+
color: currentColor;
|
|
789
|
+
}
|
|
790
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-token-popover,
|
|
791
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-token-popover,
|
|
792
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-token-popover,
|
|
793
|
+
.thread-ui-shell.dark .thread-token-popover {
|
|
794
|
+
border-color: #303642;
|
|
795
|
+
background: #171a22;
|
|
796
|
+
}
|
|
797
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-token-popover-row,
|
|
798
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-token-popover-row,
|
|
799
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-token-popover-row,
|
|
800
|
+
.thread-ui-shell.dark .thread-token-popover-row {
|
|
801
|
+
border-color: #303642;
|
|
802
|
+
background: #1d222c;
|
|
803
|
+
}
|
|
804
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-in,
|
|
805
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-cache,
|
|
806
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-out,
|
|
807
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-reason,
|
|
808
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-total,
|
|
809
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-in,
|
|
810
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-cache,
|
|
811
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-out,
|
|
812
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-reason,
|
|
813
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-total,
|
|
814
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-in,
|
|
815
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-cache,
|
|
816
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-out,
|
|
817
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-reason,
|
|
818
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-total,
|
|
819
|
+
.thread-ui-shell.dark .token-badge-in,
|
|
820
|
+
.thread-ui-shell.dark .token-badge-cache,
|
|
821
|
+
.thread-ui-shell.dark .token-badge-out,
|
|
822
|
+
.thread-ui-shell.dark .token-badge-reason,
|
|
823
|
+
.thread-ui-shell.dark .token-badge-total {
|
|
824
|
+
background-color: color-mix(in oklch, currentColor 12%, transparent);
|
|
825
|
+
}
|
|
826
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-in,
|
|
827
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-in,
|
|
828
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-in,
|
|
829
|
+
.thread-ui-shell.dark .token-badge-in {
|
|
830
|
+
color: rgb(134 239 172);
|
|
831
|
+
}
|
|
832
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-cache,
|
|
833
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-cache,
|
|
834
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-cache,
|
|
835
|
+
.thread-ui-shell.dark .token-badge-cache {
|
|
836
|
+
color: rgb(125 211 252);
|
|
837
|
+
}
|
|
838
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-out,
|
|
839
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-out,
|
|
840
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-out,
|
|
841
|
+
.thread-ui-shell.dark .token-badge-out {
|
|
842
|
+
color: rgb(196 181 253);
|
|
843
|
+
}
|
|
844
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-reason,
|
|
845
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-reason,
|
|
846
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-reason,
|
|
847
|
+
.thread-ui-shell.dark .token-badge-reason {
|
|
848
|
+
color: rgb(252 211 77);
|
|
849
|
+
}
|
|
850
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-total,
|
|
851
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-total,
|
|
852
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-total,
|
|
853
|
+
.thread-ui-shell.dark .token-badge-total {
|
|
854
|
+
color: rgb(190 242 100);
|
|
855
|
+
}
|
|
856
|
+
.thread-ui-shell .thread-graph-event,
|
|
857
|
+
.thread-ui-shell .thread-graph-event-card,
|
|
858
|
+
.thread-ui-shell .thread-graph-history-group,
|
|
859
|
+
.thread-ui-shell .thread-graph-history-group-card {
|
|
860
|
+
border-color: var(--theme-border);
|
|
861
|
+
background: var(--theme-panel);
|
|
862
|
+
color: var(--theme-fg);
|
|
863
|
+
}
|
|
864
|
+
.thread-ui-shell .thread-graph-event-card,
|
|
865
|
+
.thread-ui-shell .thread-graph-history-group-card {
|
|
866
|
+
background: var(--theme-surface);
|
|
867
|
+
}
|
|
868
|
+
.thread-ui-shell .thread-graph-event-line,
|
|
869
|
+
.thread-ui-shell .thread-graph-history-group-toggle {
|
|
870
|
+
color: var(--theme-fg);
|
|
871
|
+
}
|
|
872
|
+
.thread-ui-shell .thread-graph-history-group-list {
|
|
873
|
+
border-color: var(--theme-border);
|
|
874
|
+
}
|
|
875
|
+
.thread-ui-shell .thread-workspace-panel {
|
|
876
|
+
background: var(--theme-panel);
|
|
877
|
+
}
|
|
878
|
+
.thread-ui-shell .thread-workspace-card {
|
|
879
|
+
background: var(--theme-surface);
|
|
880
|
+
}
|
|
881
|
+
.thread-ui-shell .thread-workspace-collapse-tab,
|
|
882
|
+
.thread-ui-shell .thread-workspace-small-toggle,
|
|
883
|
+
.thread-ui-shell .thread-workspace-expand-fab,
|
|
884
|
+
.thread-ui-shell .thread-graph-panel-expand-fab {
|
|
885
|
+
align-items: center;
|
|
886
|
+
justify-content: center;
|
|
887
|
+
width: 2rem;
|
|
888
|
+
height: 2rem;
|
|
889
|
+
border: 1px solid var(--theme-border);
|
|
890
|
+
border-radius: 999px;
|
|
891
|
+
background: color-mix(in oklch, var(--theme-panel) 92%, transparent);
|
|
892
|
+
color: var(--theme-fg-soft);
|
|
893
|
+
box-shadow: 0 10px 26px color-mix(in oklch, var(--theme-bg) 62%, transparent);
|
|
894
|
+
transition:
|
|
895
|
+
background-color 160ms ease,
|
|
896
|
+
border-color 160ms ease,
|
|
897
|
+
color 160ms ease,
|
|
898
|
+
transform 160ms ease,
|
|
899
|
+
box-shadow 160ms ease;
|
|
900
|
+
}
|
|
901
|
+
.thread-ui-shell .thread-workspace-collapse-tab:hover,
|
|
902
|
+
.thread-ui-shell .thread-workspace-small-toggle:hover,
|
|
903
|
+
.thread-ui-shell .thread-workspace-expand-fab:hover,
|
|
904
|
+
.thread-ui-shell .thread-graph-panel-expand-fab:hover {
|
|
905
|
+
border-color: var(--theme-border-strong);
|
|
906
|
+
background: var(--theme-hover);
|
|
907
|
+
color: var(--theme-fg);
|
|
908
|
+
box-shadow: 0 14px 30px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
909
|
+
}
|
|
910
|
+
.thread-ui-shell .thread-workspace-collapse-tab {
|
|
911
|
+
position: absolute;
|
|
912
|
+
left: -1rem;
|
|
913
|
+
top: 50%;
|
|
914
|
+
z-index: 30;
|
|
915
|
+
transform: translateY(-50%);
|
|
916
|
+
}
|
|
917
|
+
.thread-ui-shell .thread-workspace-collapse-tab:hover {
|
|
918
|
+
transform: translateY(-50%) translateX(-1px);
|
|
919
|
+
}
|
|
920
|
+
.thread-ui-shell .thread-workspace-expand-fab {
|
|
921
|
+
position: absolute;
|
|
922
|
+
right: 0.75rem;
|
|
923
|
+
top: 50%;
|
|
924
|
+
z-index: 30;
|
|
925
|
+
transform: translateY(-50%);
|
|
926
|
+
}
|
|
927
|
+
.thread-ui-shell .thread-workspace-expand-fab:hover {
|
|
928
|
+
transform: translateY(-50%) translateX(-1px);
|
|
929
|
+
}
|
|
930
|
+
.thread-ui-shell .thread-chat-usage-footer {
|
|
931
|
+
background: var(--theme-surface);
|
|
932
|
+
color: rgb(148 163 184);
|
|
933
|
+
}
|
|
934
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-chat-usage-footer,
|
|
935
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-chat-usage-footer,
|
|
936
|
+
.thread-ui-shell.dark .thread-chat-usage-footer {
|
|
937
|
+
background: var(--theme-surface);
|
|
938
|
+
color: rgb(100 116 139);
|
|
939
|
+
}
|
|
940
|
+
.thread-ui-shell .thread-graph-composer-host {
|
|
941
|
+
border-top: 1px solid rgb(226 232 240);
|
|
942
|
+
background: var(--theme-surface);
|
|
943
|
+
padding: 0.5rem 0.75rem calc(env(safe-area-inset-bottom) + 0.5rem);
|
|
944
|
+
}
|
|
945
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-host,
|
|
946
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-host,
|
|
947
|
+
.thread-ui-shell.dark .thread-graph-composer-host {
|
|
948
|
+
border-top-color: #2a2f3a;
|
|
949
|
+
background: var(--theme-surface);
|
|
950
|
+
}
|
|
951
|
+
.thread-ui-shell .thread-graph-composer-host > .thread-composer-layer,
|
|
952
|
+
.thread-ui-shell .thread-graph-composer-host > .thread-graph-composer-layer {
|
|
953
|
+
width: 100%;
|
|
954
|
+
}
|
|
955
|
+
.thread-ui-shell .thread-split-chat-pane,
|
|
956
|
+
.thread-ui-shell .thread-split-workspace-pane {
|
|
957
|
+
width: 100%;
|
|
958
|
+
min-height: 0;
|
|
959
|
+
}
|
|
960
|
+
.thread-ui-shell .thread-split-chat-pane {
|
|
961
|
+
min-width: 0;
|
|
962
|
+
}
|
|
963
|
+
.thread-ui-shell .thread-split-region,
|
|
964
|
+
.thread-ui-shell .thread-split-container {
|
|
965
|
+
height: 100%;
|
|
966
|
+
min-height: 0;
|
|
967
|
+
overflow: hidden;
|
|
968
|
+
}
|
|
969
|
+
.thread-ui-shell .thread-graph-shell-desktop-split {
|
|
970
|
+
display: none !important;
|
|
971
|
+
}
|
|
972
|
+
.thread-ui-shell .thread-graph-shell-mobile-split {
|
|
973
|
+
display: block !important;
|
|
974
|
+
}
|
|
975
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split {
|
|
976
|
+
display: flex !important;
|
|
977
|
+
}
|
|
978
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-mobile-split {
|
|
979
|
+
display: none !important;
|
|
980
|
+
}
|
|
981
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
982
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-workspace-pane,
|
|
983
|
+
.thread-ui-shell .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
984
|
+
.thread-ui-shell .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
985
|
+
min-width: 0;
|
|
986
|
+
height: 100%;
|
|
987
|
+
}
|
|
988
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
989
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
990
|
+
flex: 1 1 0;
|
|
991
|
+
min-width: 0;
|
|
992
|
+
width: auto;
|
|
993
|
+
}
|
|
994
|
+
.thread-ui-shell[data-thread-layout=desktop] {
|
|
995
|
+
padding: 0.5rem;
|
|
996
|
+
}
|
|
997
|
+
.thread-ui-shell[data-thread-layout=desktop].thread-ui-viewport-constrained {
|
|
998
|
+
height: 100svh;
|
|
999
|
+
max-height: 100svh;
|
|
1000
|
+
}
|
|
1001
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-frame {
|
|
1002
|
+
display: grid;
|
|
1003
|
+
grid-template-columns: 264px minmax(0, 1fr);
|
|
1004
|
+
gap: 0.5rem;
|
|
1005
|
+
height: 100%;
|
|
1006
|
+
min-height: 0;
|
|
1007
|
+
}
|
|
1008
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-only-flex {
|
|
1009
|
+
display: flex !important;
|
|
1010
|
+
}
|
|
1011
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-only-inline-flex {
|
|
1012
|
+
display: inline-flex !important;
|
|
1013
|
+
}
|
|
1014
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-block,
|
|
1015
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-grid,
|
|
1016
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-inline-flex {
|
|
1017
|
+
display: none !important;
|
|
1018
|
+
}
|
|
1019
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-chat-hidden,
|
|
1020
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-workspace-hidden {
|
|
1021
|
+
display: block !important;
|
|
1022
|
+
}
|
|
1023
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-collapsed-hidden {
|
|
1024
|
+
display: none;
|
|
1025
|
+
}
|
|
1026
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-frame.is-rail-collapsed {
|
|
1027
|
+
grid-template-columns: 56px minmax(0, 1fr);
|
|
1028
|
+
}
|
|
1029
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-rooms-rail {
|
|
1030
|
+
position: static;
|
|
1031
|
+
z-index: auto;
|
|
1032
|
+
width: auto;
|
|
1033
|
+
min-width: 0;
|
|
1034
|
+
height: 100%;
|
|
1035
|
+
transform: none;
|
|
1036
|
+
translate: 0 0;
|
|
1037
|
+
pointer-events: auto;
|
|
1038
|
+
border: 1px solid var(--theme-border);
|
|
1039
|
+
border-radius: 12px;
|
|
1040
|
+
box-shadow: var(--theme-shadow);
|
|
1041
|
+
}
|
|
1042
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-rooms-rail-header {
|
|
1043
|
+
height: 4rem;
|
|
1044
|
+
align-items: center;
|
|
1045
|
+
padding-bottom: 0;
|
|
1046
|
+
}
|
|
1047
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-card {
|
|
1048
|
+
border: 1px solid var(--theme-border);
|
|
1049
|
+
border-radius: 12px;
|
|
1050
|
+
}
|
|
1051
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-topbar-row {
|
|
1052
|
+
min-height: 4rem;
|
|
1053
|
+
padding-left: 1.25rem;
|
|
1054
|
+
padding-right: 1.25rem;
|
|
1055
|
+
}
|
|
1056
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-view-switch {
|
|
1057
|
+
display: none !important;
|
|
1058
|
+
}
|
|
1059
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-region {
|
|
1060
|
+
padding: 0.5rem;
|
|
1061
|
+
}
|
|
1062
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-container.has-workspace {
|
|
1063
|
+
display: flex;
|
|
1064
|
+
align-items: stretch;
|
|
1065
|
+
min-width: 0;
|
|
1066
|
+
min-height: 0;
|
|
1067
|
+
}
|
|
1068
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-chat-pane {
|
|
1069
|
+
flex: 0 0 var(--thread-chat-percent, 54%);
|
|
1070
|
+
min-width: min(31rem, 100%);
|
|
1071
|
+
width: auto;
|
|
1072
|
+
height: 100%;
|
|
1073
|
+
display: block;
|
|
1074
|
+
}
|
|
1075
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-workspace-pane {
|
|
1076
|
+
flex: 0 0 var(--thread-workspace-percent, 46%);
|
|
1077
|
+
min-width: 19rem;
|
|
1078
|
+
width: auto;
|
|
1079
|
+
height: 100%;
|
|
1080
|
+
display: block;
|
|
1081
|
+
}
|
|
1082
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-resize-handle {
|
|
1083
|
+
display: flex !important;
|
|
1084
|
+
}
|
|
1085
|
+
@media (min-width: 640px) {
|
|
1086
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) {
|
|
1087
|
+
padding: 0.5rem;
|
|
1088
|
+
}
|
|
1089
|
+
.thread-ui-shell:not([data-thread-layout=mobile]).thread-ui-viewport-constrained {
|
|
1090
|
+
height: 100svh;
|
|
1091
|
+
max-height: 100svh;
|
|
1092
|
+
}
|
|
1093
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-frame {
|
|
1094
|
+
display: grid;
|
|
1095
|
+
grid-template-columns: 264px minmax(0, 1fr);
|
|
1096
|
+
gap: 0.5rem;
|
|
1097
|
+
height: 100%;
|
|
1098
|
+
min-height: 0;
|
|
1099
|
+
}
|
|
1100
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-only-flex {
|
|
1101
|
+
display: flex !important;
|
|
1102
|
+
}
|
|
1103
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-only-inline-flex {
|
|
1104
|
+
display: inline-flex !important;
|
|
1105
|
+
}
|
|
1106
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-block,
|
|
1107
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-grid,
|
|
1108
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-inline-flex {
|
|
1109
|
+
display: none !important;
|
|
1110
|
+
}
|
|
1111
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-chat-hidden,
|
|
1112
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-workspace-hidden {
|
|
1113
|
+
display: block !important;
|
|
1114
|
+
}
|
|
1115
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-collapsed-hidden {
|
|
1116
|
+
display: none;
|
|
1117
|
+
}
|
|
1118
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-frame.is-rail-collapsed {
|
|
1119
|
+
grid-template-columns: 56px minmax(0, 1fr);
|
|
1120
|
+
}
|
|
1121
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-rooms-rail {
|
|
1122
|
+
position: static;
|
|
1123
|
+
z-index: auto;
|
|
1124
|
+
width: auto;
|
|
1125
|
+
min-width: 0;
|
|
1126
|
+
height: 100%;
|
|
1127
|
+
transform: none;
|
|
1128
|
+
translate: 0 0;
|
|
1129
|
+
pointer-events: auto;
|
|
1130
|
+
border: 1px solid var(--theme-border);
|
|
1131
|
+
border-radius: 12px;
|
|
1132
|
+
box-shadow: var(--theme-shadow);
|
|
1133
|
+
}
|
|
1134
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-rooms-rail-header {
|
|
1135
|
+
height: 4rem;
|
|
1136
|
+
align-items: center;
|
|
1137
|
+
padding-bottom: 0;
|
|
1138
|
+
}
|
|
1139
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-card {
|
|
1140
|
+
border: 1px solid var(--theme-border);
|
|
1141
|
+
border-radius: 12px;
|
|
1142
|
+
}
|
|
1143
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-topbar-row {
|
|
1144
|
+
min-height: 4rem;
|
|
1145
|
+
padding-left: 1.25rem;
|
|
1146
|
+
padding-right: 1.25rem;
|
|
1147
|
+
}
|
|
1148
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-view-switch {
|
|
1149
|
+
display: none !important;
|
|
1150
|
+
}
|
|
1151
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-region {
|
|
1152
|
+
padding: 0.5rem;
|
|
1153
|
+
}
|
|
1154
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-container.has-workspace {
|
|
1155
|
+
display: flex;
|
|
1156
|
+
align-items: stretch;
|
|
1157
|
+
min-width: 0;
|
|
1158
|
+
min-height: 0;
|
|
1159
|
+
}
|
|
1160
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-chat-pane {
|
|
1161
|
+
flex: 0 0 var(--thread-chat-percent, 54%);
|
|
1162
|
+
min-width: min(31rem, 100%);
|
|
1163
|
+
width: auto;
|
|
1164
|
+
height: 100%;
|
|
1165
|
+
display: block;
|
|
1166
|
+
}
|
|
1167
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-workspace-pane {
|
|
1168
|
+
flex: 0 0 var(--thread-workspace-percent, 46%);
|
|
1169
|
+
min-width: 19rem;
|
|
1170
|
+
width: auto;
|
|
1171
|
+
height: 100%;
|
|
1172
|
+
display: block;
|
|
1173
|
+
}
|
|
1174
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-resize-handle {
|
|
1175
|
+
display: flex !important;
|
|
1176
|
+
}
|
|
1177
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split {
|
|
1178
|
+
display: flex !important;
|
|
1179
|
+
}
|
|
1180
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-mobile-split {
|
|
1181
|
+
display: none !important;
|
|
1182
|
+
}
|
|
1183
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
1184
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
1185
|
+
flex: 1 1 0;
|
|
1186
|
+
min-width: 0;
|
|
1187
|
+
width: auto;
|
|
1188
|
+
}
|
|
1189
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-chat-pane {
|
|
1190
|
+
min-width: 0;
|
|
1191
|
+
}
|
|
1192
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
1193
|
+
min-width: 0;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
.thread-ui-shell .thread-resize-handle span {
|
|
1197
|
+
background: var(--theme-border);
|
|
1198
|
+
}
|
|
1199
|
+
.thread-ui-shell .thread-resize-handle:hover span,
|
|
1200
|
+
.thread-ui-shell .thread-resize-handle:focus-visible span {
|
|
1201
|
+
background: var(--theme-border-strong);
|
|
1202
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--theme-accent-border) 24%, transparent);
|
|
1203
|
+
}
|
|
1204
|
+
.thread-ui-shell .thread-graph-right-tabs {
|
|
1205
|
+
border-color: var(--theme-border);
|
|
1206
|
+
background: var(--theme-surface);
|
|
1207
|
+
}
|
|
1208
|
+
.thread-ui-shell .thread-graph-right-tab-secondary {
|
|
1209
|
+
border-color: var(--theme-border);
|
|
1210
|
+
}
|
|
1211
|
+
.thread-ui-shell .thread-workspace-tab,
|
|
1212
|
+
.thread-ui-shell .thread-graph-right-tab {
|
|
1213
|
+
color: var(--theme-fg-muted);
|
|
1214
|
+
}
|
|
1215
|
+
.thread-ui-shell .thread-workspace-tab:hover,
|
|
1216
|
+
.thread-ui-shell .thread-graph-right-tab:hover {
|
|
1217
|
+
background: var(--theme-hover);
|
|
1218
|
+
color: var(--theme-fg);
|
|
1219
|
+
}
|
|
1220
|
+
.thread-ui-shell .thread-workspace-tab.is-active,
|
|
1221
|
+
.thread-ui-shell .thread-graph-right-tab.is-active {
|
|
1222
|
+
background: var(--theme-surface-strong);
|
|
1223
|
+
color: var(--theme-fg);
|
|
1224
|
+
}
|
|
1225
|
+
.thread-ui-shell .thread-graph-visualization-panel {
|
|
1226
|
+
background: var(--theme-surface);
|
|
1227
|
+
color: var(--theme-fg);
|
|
1228
|
+
}
|
|
1229
|
+
.thread-ui-shell .thread-graph-flow {
|
|
1230
|
+
overflow: hidden;
|
|
1231
|
+
border: 1px solid var(--theme-border);
|
|
1232
|
+
border-radius: 12px;
|
|
1233
|
+
background: var(--theme-surface);
|
|
1234
|
+
}
|
|
1235
|
+
.thread-ui-shell .thread-graph-flow-node {
|
|
1236
|
+
position: relative;
|
|
1237
|
+
min-width: 8rem;
|
|
1238
|
+
max-width: 12rem;
|
|
1239
|
+
border: 1px solid var(--theme-border-strong);
|
|
1240
|
+
border-radius: 8px;
|
|
1241
|
+
background: var(--theme-panel);
|
|
1242
|
+
padding: 0.85rem 1rem;
|
|
1243
|
+
color: var(--theme-fg);
|
|
1244
|
+
text-align: center;
|
|
1245
|
+
box-shadow: var(--theme-shadow);
|
|
1246
|
+
}
|
|
1247
|
+
.thread-ui-shell .thread-graph-flow .react-flow {
|
|
1248
|
+
background: var(--theme-surface);
|
|
1249
|
+
color: var(--theme-fg);
|
|
1250
|
+
}
|
|
1251
|
+
.thread-ui-shell .thread-graph-flow .react-flow__edge-path {
|
|
1252
|
+
stroke: var(--theme-border-contrast);
|
|
1253
|
+
}
|
|
1254
|
+
.thread-ui-shell .thread-graph-flow .react-flow__background {
|
|
1255
|
+
background: var(--theme-surface);
|
|
1256
|
+
}
|
|
1257
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls {
|
|
1258
|
+
overflow: hidden;
|
|
1259
|
+
border: 1px solid var(--theme-border);
|
|
1260
|
+
border-radius: 8px;
|
|
1261
|
+
box-shadow: var(--theme-shadow);
|
|
1262
|
+
}
|
|
1263
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button {
|
|
1264
|
+
border-bottom-color: var(--theme-border);
|
|
1265
|
+
background: var(--theme-panel);
|
|
1266
|
+
color: var(--theme-fg-soft);
|
|
1267
|
+
}
|
|
1268
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button:hover {
|
|
1269
|
+
background: var(--theme-hover);
|
|
1270
|
+
color: var(--theme-fg);
|
|
1271
|
+
}
|
|
1272
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button svg {
|
|
1273
|
+
fill: currentColor;
|
|
1274
|
+
}
|
|
1275
|
+
.thread-ui-shell .thread-guide-section {
|
|
1276
|
+
color: var(--theme-fg);
|
|
1277
|
+
}
|
|
1278
|
+
.thread-ui-shell .thread-guide-icon,
|
|
1279
|
+
.thread-ui-shell .thread-guide-tag {
|
|
1280
|
+
background: var(--theme-surface-strong);
|
|
1281
|
+
color: var(--theme-fg-muted);
|
|
1282
|
+
}
|
|
1283
|
+
.thread-ui-shell .thread-graph-workspace-mobile-tabs,
|
|
1284
|
+
.thread-ui-shell .thread-graph-workspace-mobile-explorer {
|
|
1285
|
+
border-color: var(--theme-border);
|
|
1286
|
+
background: var(--theme-surface);
|
|
1287
|
+
}
|
|
1288
|
+
.thread-ui-shell .thread-graph-workspace-mobile-stack,
|
|
1289
|
+
.thread-ui-shell .thread-graph-workspace-mobile-viewer {
|
|
1290
|
+
background: var(--theme-surface);
|
|
1291
|
+
color: var(--theme-fg);
|
|
1292
|
+
}
|
|
1293
|
+
.thread-ui-shell .thread-graph-workspace-resizable {
|
|
1294
|
+
height: 100%;
|
|
1295
|
+
min-width: 0;
|
|
1296
|
+
}
|
|
1297
|
+
.thread-ui-shell .thread-graph-workspace-explorer-pane {
|
|
1298
|
+
min-width: 0;
|
|
1299
|
+
}
|
|
1300
|
+
.thread-ui-shell .thread-graph-workspace-viewer-pane {
|
|
1301
|
+
min-width: 0;
|
|
1302
|
+
}
|
|
1303
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle::after {
|
|
1304
|
+
background: var(--theme-border);
|
|
1305
|
+
}
|
|
1306
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle:hover::after,
|
|
1307
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle:focus-visible::after {
|
|
1308
|
+
background: var(--theme-border-contrast);
|
|
1309
|
+
}
|
|
1310
|
+
.thread-ui-shell .thread-graph-explorer,
|
|
1311
|
+
.thread-ui-shell .thread-graph-viewer {
|
|
1312
|
+
border-color: var(--theme-border);
|
|
1313
|
+
background: var(--theme-surface);
|
|
1314
|
+
color: var(--theme-fg);
|
|
1315
|
+
}
|
|
1316
|
+
.thread-ui-shell .thread-graph-explorer-header,
|
|
1317
|
+
.thread-ui-shell .thread-graph-viewer-header {
|
|
1318
|
+
border-color: var(--theme-border);
|
|
1319
|
+
background: var(--theme-surface);
|
|
1320
|
+
color: var(--theme-fg);
|
|
1321
|
+
}
|
|
1322
|
+
.thread-ui-shell .thread-graph-explorer h2,
|
|
1323
|
+
.thread-ui-shell .thread-graph-viewer h2 {
|
|
1324
|
+
color: var(--theme-fg);
|
|
1325
|
+
}
|
|
1326
|
+
.thread-ui-shell .thread-graph-explorer-icon-button,
|
|
1327
|
+
.thread-ui-shell .thread-graph-explorer-collapse-button,
|
|
1328
|
+
.thread-ui-shell .thread-graph-viewer-header button {
|
|
1329
|
+
border-color: var(--theme-border);
|
|
1330
|
+
background: var(--theme-surface-strong);
|
|
1331
|
+
color: var(--theme-fg-soft);
|
|
1332
|
+
}
|
|
1333
|
+
.thread-ui-shell .thread-graph-explorer-icon-button:hover,
|
|
1334
|
+
.thread-ui-shell .thread-graph-explorer-collapse-button:hover,
|
|
1335
|
+
.thread-ui-shell .thread-graph-viewer-header button:hover {
|
|
1336
|
+
border-color: var(--theme-border-strong);
|
|
1337
|
+
background: var(--theme-hover);
|
|
1338
|
+
color: var(--theme-fg);
|
|
1339
|
+
}
|
|
1340
|
+
.thread-ui-shell .thread-graph-panel-expand-fab {
|
|
1341
|
+
position: absolute;
|
|
1342
|
+
top: 50%;
|
|
1343
|
+
z-index: 30;
|
|
1344
|
+
display: inline-flex;
|
|
1345
|
+
transform: translateY(-50%);
|
|
1346
|
+
}
|
|
1347
|
+
.thread-ui-shell .thread-graph-panel-expand-fab.left-3 {
|
|
1348
|
+
left: 0.75rem;
|
|
1349
|
+
}
|
|
1350
|
+
.thread-ui-shell .thread-graph-panel-expand-fab.right-3 {
|
|
1351
|
+
right: 0.75rem;
|
|
1352
|
+
}
|
|
1353
|
+
.thread-ui-shell .thread-graph-panel-expand-fab:hover {
|
|
1354
|
+
transform: translateY(-50%) scale(1.04);
|
|
1355
|
+
}
|
|
1356
|
+
.thread-ui-shell .thread-graph-workspace-label,
|
|
1357
|
+
.thread-ui-shell .thread-graph-workspace-loading,
|
|
1358
|
+
.thread-ui-shell .thread-graph-workspace-empty,
|
|
1359
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1360
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1361
|
+
color: var(--theme-fg-muted);
|
|
1362
|
+
}
|
|
1363
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1364
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1365
|
+
border-color: var(--theme-border);
|
|
1366
|
+
}
|
|
1367
|
+
.thread-ui-shell .thread-graph-file-preview-footer,
|
|
1368
|
+
.thread-ui-shell .thread-graph-file-preview-frame {
|
|
1369
|
+
background: var(--theme-bg);
|
|
1370
|
+
}
|
|
1371
|
+
.thread-ui-shell .thread-graph-workspace-empty {
|
|
1372
|
+
border-color: var(--theme-border);
|
|
1373
|
+
background: var(--theme-surface-strong);
|
|
1374
|
+
}
|
|
1375
|
+
.thread-ui-shell .thread-graph-explorer button,
|
|
1376
|
+
.thread-ui-shell .thread-graph-viewer button {
|
|
1377
|
+
color: inherit;
|
|
1378
|
+
}
|
|
1379
|
+
.thread-ui-shell .thread-graph-tree-row {
|
|
1380
|
+
color: var(--theme-fg-soft);
|
|
1381
|
+
}
|
|
1382
|
+
.thread-ui-shell .thread-graph-tree-row:hover {
|
|
1383
|
+
background: var(--theme-hover);
|
|
1384
|
+
color: var(--theme-fg);
|
|
1385
|
+
}
|
|
1386
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected {
|
|
1387
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 13%, var(--theme-panel));
|
|
1388
|
+
color: var(--theme-fg);
|
|
1389
|
+
box-shadow: inset 3px 0 0 color-mix(in oklch, var(--theme-accent-solid) 72%, transparent);
|
|
1390
|
+
}
|
|
1391
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tree-row.is-selected,
|
|
1392
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tree-row.is-selected,
|
|
1393
|
+
.thread-ui-shell.dark .thread-graph-tree-row.is-selected {
|
|
1394
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 18%, var(--theme-panel));
|
|
1395
|
+
color: var(--theme-fg);
|
|
1396
|
+
box-shadow: inset 3px 0 0 color-mix(in oklch, var(--theme-accent-solid) 72%, transparent);
|
|
1397
|
+
}
|
|
1398
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected svg {
|
|
1399
|
+
color: currentColor;
|
|
1400
|
+
}
|
|
1401
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected .thread-graph-tree-action,
|
|
1402
|
+
.thread-ui-shell .thread-graph-tree-action.is-selected {
|
|
1403
|
+
color: var(--theme-fg-muted);
|
|
1404
|
+
}
|
|
1405
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected .thread-graph-tree-action:hover,
|
|
1406
|
+
.thread-ui-shell .thread-graph-tree-action.is-selected:hover {
|
|
1407
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 12%, transparent);
|
|
1408
|
+
color: var(--theme-fg);
|
|
1409
|
+
}
|
|
1410
|
+
.thread-ui-shell .thread-graph-tree-action {
|
|
1411
|
+
color: var(--theme-fg-muted);
|
|
1412
|
+
}
|
|
1413
|
+
.thread-ui-shell .thread-graph-tree-action:hover {
|
|
1414
|
+
background: var(--theme-surface-strong);
|
|
1415
|
+
color: var(--theme-fg);
|
|
1416
|
+
}
|
|
1417
|
+
.thread-ui-shell .thread-graph-molecule-preview {
|
|
1418
|
+
background: var(--theme-surface);
|
|
1419
|
+
}
|
|
1420
|
+
.thread-ui-shell .thread-graph-molecule-viewer {
|
|
1421
|
+
background: var(--theme-surface);
|
|
1422
|
+
color: var(--theme-fg);
|
|
1423
|
+
}
|
|
1424
|
+
.thread-ui-shell .thread-graph-molecule-header,
|
|
1425
|
+
.thread-ui-shell .thread-graph-molecule-controls {
|
|
1426
|
+
border-color: var(--theme-border);
|
|
1427
|
+
background: var(--theme-surface);
|
|
1428
|
+
color: var(--theme-fg);
|
|
1429
|
+
}
|
|
1430
|
+
.thread-ui-shell .thread-graph-molecule-body {
|
|
1431
|
+
display: flex;
|
|
1432
|
+
min-height: 0;
|
|
1433
|
+
flex: 1;
|
|
1434
|
+
flex-direction: column;
|
|
1435
|
+
overflow: hidden;
|
|
1436
|
+
}
|
|
1437
|
+
.thread-ui-shell .thread-graph-molecule-header h2 {
|
|
1438
|
+
color: var(--theme-fg);
|
|
1439
|
+
}
|
|
1440
|
+
.thread-ui-shell .thread-graph-molecule-header p,
|
|
1441
|
+
.thread-ui-shell .thread-graph-molecule-header span,
|
|
1442
|
+
.thread-ui-shell .thread-graph-molecule-trajectory {
|
|
1443
|
+
color: var(--theme-fg-muted);
|
|
1444
|
+
}
|
|
1445
|
+
.thread-ui-shell .thread-graph-molecule-controls {
|
|
1446
|
+
border-top: 1px solid var(--theme-border);
|
|
1447
|
+
display: flex;
|
|
1448
|
+
flex-direction: column;
|
|
1449
|
+
gap: 0.75rem;
|
|
1450
|
+
max-height: min(42%, 18rem);
|
|
1451
|
+
overflow: auto;
|
|
1452
|
+
padding: 0.75rem;
|
|
1453
|
+
}
|
|
1454
|
+
.thread-ui-shell .thread-graph-molecule-control-row {
|
|
1455
|
+
display: flex;
|
|
1456
|
+
align-items: flex-start;
|
|
1457
|
+
justify-content: space-between;
|
|
1458
|
+
gap: 0.75rem;
|
|
1459
|
+
}
|
|
1460
|
+
.thread-ui-shell .thread-graph-molecule-control-title {
|
|
1461
|
+
color: var(--theme-fg);
|
|
1462
|
+
font-size: 0.875rem;
|
|
1463
|
+
font-weight: 600;
|
|
1464
|
+
line-height: 1.25rem;
|
|
1465
|
+
}
|
|
1466
|
+
.thread-ui-shell .thread-graph-molecule-control-subtitle {
|
|
1467
|
+
margin-top: 0.125rem;
|
|
1468
|
+
color: var(--theme-fg-muted);
|
|
1469
|
+
font-size: 0.6875rem;
|
|
1470
|
+
line-height: 1rem;
|
|
1471
|
+
}
|
|
1472
|
+
.thread-ui-shell .thread-graph-molecule-button-group {
|
|
1473
|
+
display: inline-flex;
|
|
1474
|
+
align-items: center;
|
|
1475
|
+
gap: 0.125rem;
|
|
1476
|
+
border: 1px solid var(--theme-border);
|
|
1477
|
+
border-radius: 0.5rem;
|
|
1478
|
+
background: var(--theme-surface);
|
|
1479
|
+
padding: 0.125rem;
|
|
1480
|
+
}
|
|
1481
|
+
.thread-ui-shell .thread-graph-molecule-button {
|
|
1482
|
+
display: inline-flex;
|
|
1483
|
+
min-width: 1.75rem;
|
|
1484
|
+
height: 1.75rem;
|
|
1485
|
+
align-items: center;
|
|
1486
|
+
justify-content: center;
|
|
1487
|
+
border: 1px solid transparent;
|
|
1488
|
+
border-radius: 0.375rem;
|
|
1489
|
+
background: transparent;
|
|
1490
|
+
color: var(--theme-fg-soft);
|
|
1491
|
+
transition:
|
|
1492
|
+
background-color 140ms ease,
|
|
1493
|
+
border-color 140ms ease,
|
|
1494
|
+
color 140ms ease,
|
|
1495
|
+
opacity 140ms ease;
|
|
1496
|
+
}
|
|
1497
|
+
.thread-ui-shell .thread-graph-molecule-button:hover:not(:disabled) {
|
|
1498
|
+
border-color: var(--theme-border);
|
|
1499
|
+
background: var(--theme-hover);
|
|
1500
|
+
color: var(--theme-fg);
|
|
1501
|
+
}
|
|
1502
|
+
.thread-ui-shell .thread-graph-molecule-button:disabled {
|
|
1503
|
+
cursor: not-allowed;
|
|
1504
|
+
color: var(--theme-fg-subtle);
|
|
1505
|
+
opacity: 0.45;
|
|
1506
|
+
}
|
|
1507
|
+
.thread-ui-shell .thread-graph-molecule-button-divider {
|
|
1508
|
+
width: 1px;
|
|
1509
|
+
align-self: stretch;
|
|
1510
|
+
margin-inline: 0.25rem;
|
|
1511
|
+
background: var(--theme-border);
|
|
1512
|
+
}
|
|
1513
|
+
.thread-ui-shell .thread-graph-molecule-stage {
|
|
1514
|
+
background: var(--theme-bg);
|
|
1515
|
+
}
|
|
1516
|
+
.thread-ui-shell .thread-graph-molecule-error {
|
|
1517
|
+
background: color-mix(in oklch, #ef4444 12%, var(--theme-surface));
|
|
1518
|
+
color: var(--theme-danger);
|
|
1519
|
+
}
|
|
1520
|
+
.thread-ui-shell .thread-graph-molecule-empty {
|
|
1521
|
+
color: var(--theme-fg-muted);
|
|
1522
|
+
}
|
|
1523
|
+
.thread-ui-shell .thread-graph-molecule-tooltip {
|
|
1524
|
+
border-color: var(--theme-border);
|
|
1525
|
+
background: color-mix(in oklch, var(--theme-surface) 96%, transparent);
|
|
1526
|
+
color: var(--theme-fg);
|
|
1527
|
+
box-shadow: 0 10px 28px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
1528
|
+
}
|
|
1529
|
+
.thread-ui-shell .thread-graph-molecule-tooltip div,
|
|
1530
|
+
.thread-ui-shell .thread-graph-molecule-tooltip span {
|
|
1531
|
+
color: inherit;
|
|
1532
|
+
}
|
|
1533
|
+
.thread-ui-shell .thread-graph-molecule-trajectory input {
|
|
1534
|
+
accent-color: var(--theme-accent-solid);
|
|
1535
|
+
}
|
|
1536
|
+
.thread-ui-shell .thread-graph-molecule-live-button {
|
|
1537
|
+
display: inline-flex;
|
|
1538
|
+
align-items: center;
|
|
1539
|
+
gap: 0.25rem;
|
|
1540
|
+
border: 1px solid var(--theme-border);
|
|
1541
|
+
border-radius: 0.375rem;
|
|
1542
|
+
background: var(--theme-surface);
|
|
1543
|
+
padding: 0.125rem 0.5rem;
|
|
1544
|
+
color: var(--theme-fg-muted);
|
|
1545
|
+
transition: background-color 140ms ease, color 140ms ease;
|
|
1546
|
+
}
|
|
1547
|
+
.thread-ui-shell .thread-graph-molecule-live-button:hover {
|
|
1548
|
+
background: var(--theme-hover);
|
|
1549
|
+
color: var(--theme-fg);
|
|
1550
|
+
}
|
|
1551
|
+
.thread-ui-shell .thread-graph-molecule-camera {
|
|
1552
|
+
margin-top: 0.75rem;
|
|
1553
|
+
border: 1px solid var(--theme-border);
|
|
1554
|
+
border-radius: 0.5rem;
|
|
1555
|
+
padding: 0.5rem;
|
|
1556
|
+
color: var(--theme-fg-muted);
|
|
1557
|
+
font-size: 0.625rem;
|
|
1558
|
+
}
|
|
1559
|
+
.thread-ui-shell .thread-graph-molecule-camera-divider {
|
|
1560
|
+
width: 100%;
|
|
1561
|
+
height: 1px;
|
|
1562
|
+
margin-block: 0.5rem;
|
|
1563
|
+
background: var(--theme-border);
|
|
1564
|
+
}
|
|
1565
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin {
|
|
1566
|
+
height: 100%;
|
|
1567
|
+
min-height: 0;
|
|
1568
|
+
border: 0;
|
|
1569
|
+
border-radius: 0;
|
|
1570
|
+
background: var(--theme-surface);
|
|
1571
|
+
color: var(--theme-fg);
|
|
1572
|
+
}
|
|
1573
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header {
|
|
1574
|
+
min-height: 60px;
|
|
1575
|
+
border-color: var(--theme-border);
|
|
1576
|
+
background: var(--theme-surface);
|
|
1577
|
+
padding: 0.75rem 1.25rem;
|
|
1578
|
+
}
|
|
1579
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header h2 {
|
|
1580
|
+
color: var(--theme-fg);
|
|
1581
|
+
font-size: 0.875rem;
|
|
1582
|
+
font-weight: 650;
|
|
1583
|
+
}
|
|
1584
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header p,
|
|
1585
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header span {
|
|
1586
|
+
color: var(--theme-fg-muted);
|
|
1587
|
+
}
|
|
1588
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar {
|
|
1589
|
+
border-color: var(--theme-border);
|
|
1590
|
+
background: var(--theme-surface);
|
|
1591
|
+
padding: 0.5rem 0.625rem;
|
|
1592
|
+
}
|
|
1593
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button,
|
|
1594
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button {
|
|
1595
|
+
border-color: var(--theme-border);
|
|
1596
|
+
background: var(--theme-surface-strong);
|
|
1597
|
+
color: var(--theme-fg-soft);
|
|
1598
|
+
}
|
|
1599
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button:hover,
|
|
1600
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button:hover {
|
|
1601
|
+
border-color: var(--theme-border-strong);
|
|
1602
|
+
background: var(--theme-hover);
|
|
1603
|
+
color: var(--theme-fg);
|
|
1604
|
+
}
|
|
1605
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button:disabled,
|
|
1606
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button:disabled {
|
|
1607
|
+
color: var(--theme-fg-subtle);
|
|
1608
|
+
}
|
|
1609
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar-divider {
|
|
1610
|
+
background: var(--theme-border);
|
|
1611
|
+
}
|
|
1612
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__stage {
|
|
1613
|
+
min-height: 0;
|
|
1614
|
+
background: var(--theme-bg);
|
|
1615
|
+
}
|
|
1616
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__error {
|
|
1617
|
+
background: color-mix(in oklch, #ef4444 12%, var(--theme-surface));
|
|
1618
|
+
color: var(--theme-danger);
|
|
1619
|
+
}
|
|
1620
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__empty {
|
|
1621
|
+
color: var(--theme-fg-muted);
|
|
1622
|
+
}
|
|
1623
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__tooltip {
|
|
1624
|
+
border-color: var(--theme-border);
|
|
1625
|
+
background: color-mix(in oklch, var(--theme-surface) 96%, transparent);
|
|
1626
|
+
color: var(--theme-fg);
|
|
1627
|
+
box-shadow: 0 10px 28px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
1628
|
+
}
|
|
1629
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__tooltip span {
|
|
1630
|
+
color: var(--theme-fg-soft);
|
|
1631
|
+
}
|
|
1632
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline,
|
|
1633
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__status {
|
|
1634
|
+
border-color: var(--theme-border);
|
|
1635
|
+
background: var(--theme-surface);
|
|
1636
|
+
color: var(--theme-fg-muted);
|
|
1637
|
+
}
|
|
1638
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline input {
|
|
1639
|
+
accent-color: var(--theme-accent-solid);
|
|
1640
|
+
}
|
|
1641
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button.is-live {
|
|
1642
|
+
color: var(--theme-danger);
|
|
1643
|
+
}
|
|
1644
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1645
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1646
|
+
border-color: var(--theme-border);
|
|
1647
|
+
background: var(--theme-surface);
|
|
1648
|
+
color: var(--theme-fg-muted);
|
|
1649
|
+
}
|
|
1650
|
+
.thread-ui-shell .thread-graph-load-more-button {
|
|
1651
|
+
border: 1px solid var(--theme-border);
|
|
1652
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 8%, var(--theme-panel));
|
|
1653
|
+
color: var(--theme-fg-soft);
|
|
1654
|
+
transition:
|
|
1655
|
+
background-color 140ms ease,
|
|
1656
|
+
border-color 140ms ease,
|
|
1657
|
+
color 140ms ease;
|
|
1658
|
+
}
|
|
1659
|
+
.thread-ui-shell .thread-graph-load-more-button:hover:not(:disabled) {
|
|
1660
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 28%, var(--theme-border));
|
|
1661
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 14%, var(--theme-panel));
|
|
1662
|
+
color: var(--theme-fg);
|
|
1663
|
+
}
|
|
1664
|
+
.thread-ui-shell .thread-graph-code-preview {
|
|
1665
|
+
background: var(--theme-bg);
|
|
1666
|
+
color: var(--theme-fg);
|
|
1667
|
+
}
|
|
1668
|
+
.thread-ui-shell .thread-graph-code-preview pre,
|
|
1669
|
+
.thread-ui-shell .thread-graph-code-preview code {
|
|
1670
|
+
font-family:
|
|
1671
|
+
ui-monospace,
|
|
1672
|
+
SFMono-Regular,
|
|
1673
|
+
Menlo,
|
|
1674
|
+
Monaco,
|
|
1675
|
+
Consolas,
|
|
1676
|
+
"Liberation Mono",
|
|
1677
|
+
monospace !important;
|
|
1678
|
+
font-size: 0.78rem;
|
|
1679
|
+
line-height: 1.55;
|
|
1680
|
+
}
|
|
1681
|
+
.thread-ui-shell .thread-graph-plain-code-preview {
|
|
1682
|
+
min-height: 100%;
|
|
1683
|
+
margin: 0;
|
|
1684
|
+
padding: 1rem;
|
|
1685
|
+
background: transparent;
|
|
1686
|
+
color: var(--theme-fg);
|
|
1687
|
+
white-space: pre;
|
|
1688
|
+
}
|
|
1689
|
+
.thread-ui-shell .thread-tool-call {
|
|
1690
|
+
background: var(--theme-panel);
|
|
1691
|
+
color: var(--theme-fg);
|
|
1692
|
+
overflow: hidden;
|
|
1693
|
+
}
|
|
1694
|
+
.thread-ui-shell .thread-tool-call:hover {
|
|
1695
|
+
border-color: var(--theme-border-strong);
|
|
1696
|
+
}
|
|
1697
|
+
.thread-ui-shell .thread-graph-tool-call {
|
|
1698
|
+
font-family:
|
|
1699
|
+
Inter,
|
|
1700
|
+
ui-sans-serif,
|
|
1701
|
+
system-ui,
|
|
1702
|
+
-apple-system,
|
|
1703
|
+
BlinkMacSystemFont,
|
|
1704
|
+
"Segoe UI",
|
|
1705
|
+
sans-serif;
|
|
1706
|
+
}
|
|
1707
|
+
.thread-ui-shell .thread-graph-tool-call,
|
|
1708
|
+
.thread-ui-shell .thread-graph-tool-accordion,
|
|
1709
|
+
.thread-ui-shell .thread-graph-tool-trigger,
|
|
1710
|
+
.thread-ui-shell .thread-graph-tool-content,
|
|
1711
|
+
.thread-ui-shell .thread-graph-tool-json,
|
|
1712
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1713
|
+
color: var(--theme-fg);
|
|
1714
|
+
}
|
|
1715
|
+
.thread-ui-shell .thread-graph-tool-accordion {
|
|
1716
|
+
overflow: hidden;
|
|
1717
|
+
border: 1px solid var(--theme-border);
|
|
1718
|
+
border-radius: 0.5rem;
|
|
1719
|
+
background: var(--theme-panel);
|
|
1720
|
+
box-shadow: 0 1px 2px color-mix(in oklch, var(--theme-bg) 65%, transparent);
|
|
1721
|
+
}
|
|
1722
|
+
.thread-ui-shell .thread-graph-tool-trigger {
|
|
1723
|
+
display: flex;
|
|
1724
|
+
width: 100%;
|
|
1725
|
+
min-width: 0;
|
|
1726
|
+
align-items: center;
|
|
1727
|
+
justify-content: space-between;
|
|
1728
|
+
gap: 0.75rem;
|
|
1729
|
+
border: 0;
|
|
1730
|
+
background: var(--theme-panel);
|
|
1731
|
+
text-align: left;
|
|
1732
|
+
transition: background 160ms ease, color 160ms ease;
|
|
1733
|
+
}
|
|
1734
|
+
.thread-ui-shell .thread-graph-tool-trigger:hover {
|
|
1735
|
+
background: var(--theme-hover);
|
|
1736
|
+
}
|
|
1737
|
+
.thread-ui-shell .thread-graph-tool-trigger svg {
|
|
1738
|
+
color: var(--theme-fg-muted);
|
|
1739
|
+
}
|
|
1740
|
+
.thread-ui-shell .thread-graph-tool-trigger > svg {
|
|
1741
|
+
margin-left: auto;
|
|
1742
|
+
}
|
|
1743
|
+
.thread-ui-shell .thread-graph-tool-badge {
|
|
1744
|
+
display: inline-flex;
|
|
1745
|
+
min-height: 1.35rem;
|
|
1746
|
+
shrink: 0;
|
|
1747
|
+
align-items: center;
|
|
1748
|
+
gap: 0.25rem;
|
|
1749
|
+
border: 1px solid transparent;
|
|
1750
|
+
border-radius: 999px;
|
|
1751
|
+
padding: 0.1rem 0.5rem;
|
|
1752
|
+
font-size: 0.75rem;
|
|
1753
|
+
font-weight: 400;
|
|
1754
|
+
line-height: 1rem;
|
|
1755
|
+
}
|
|
1756
|
+
.thread-ui-shell .thread-graph-tool-badge.is-completed {
|
|
1757
|
+
background: oklch(0.94 0.052 155);
|
|
1758
|
+
color: oklch(0.43 0.095 155);
|
|
1759
|
+
}
|
|
1760
|
+
.thread-ui-shell .thread-graph-tool-badge.is-failed {
|
|
1761
|
+
background: oklch(0.94 0.04 25);
|
|
1762
|
+
color: oklch(0.48 0.125 24);
|
|
1763
|
+
}
|
|
1764
|
+
.thread-ui-shell .thread-graph-tool-badge.is-pending {
|
|
1765
|
+
background: oklch(0.94 0.03 235);
|
|
1766
|
+
color: oklch(0.43 0.09 242);
|
|
1767
|
+
}
|
|
1768
|
+
.thread-ui-shell .thread-graph-tool-badge.is-neutral {
|
|
1769
|
+
background: var(--theme-muted);
|
|
1770
|
+
color: var(--theme-fg-muted);
|
|
1771
|
+
}
|
|
1772
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-completed,
|
|
1773
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-completed,
|
|
1774
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-completed {
|
|
1775
|
+
background: oklch(0.31 0.05 155);
|
|
1776
|
+
color: oklch(0.8 0.115 155);
|
|
1777
|
+
}
|
|
1778
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-failed,
|
|
1779
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-failed,
|
|
1780
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-failed {
|
|
1781
|
+
background: oklch(0.31 0.052 25);
|
|
1782
|
+
color: oklch(0.78 0.12 25);
|
|
1783
|
+
}
|
|
1784
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-pending,
|
|
1785
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-pending,
|
|
1786
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-pending {
|
|
1787
|
+
background: oklch(0.3 0.042 235);
|
|
1788
|
+
color: oklch(0.77 0.1 235);
|
|
1789
|
+
}
|
|
1790
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-neutral,
|
|
1791
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-neutral,
|
|
1792
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-neutral {
|
|
1793
|
+
background: #222733;
|
|
1794
|
+
color: rgb(148 163 184);
|
|
1795
|
+
}
|
|
1796
|
+
.thread-ui-shell .thread-graph-tool-content {
|
|
1797
|
+
display: grid;
|
|
1798
|
+
gap: 0.75rem;
|
|
1799
|
+
border-top: 0;
|
|
1800
|
+
background: var(--theme-panel);
|
|
1801
|
+
}
|
|
1802
|
+
.thread-ui-shell .thread-graph-tool-content h4 {
|
|
1803
|
+
margin: 0.25rem 0 0.5rem;
|
|
1804
|
+
color: var(--theme-fg-muted);
|
|
1805
|
+
font-size: 0.625rem;
|
|
1806
|
+
font-weight: 700;
|
|
1807
|
+
letter-spacing: 0.08em;
|
|
1808
|
+
line-height: 1rem;
|
|
1809
|
+
text-transform: uppercase;
|
|
1810
|
+
}
|
|
1811
|
+
.thread-ui-shell .thread-graph-tool-json,
|
|
1812
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1813
|
+
overflow-x: auto;
|
|
1814
|
+
border: 1px solid var(--theme-border);
|
|
1815
|
+
border-radius: 0.375rem;
|
|
1816
|
+
background: var(--theme-surface-strong);
|
|
1817
|
+
padding: 0.75rem;
|
|
1818
|
+
font-family:
|
|
1819
|
+
ui-monospace,
|
|
1820
|
+
SFMono-Regular,
|
|
1821
|
+
Menlo,
|
|
1822
|
+
Monaco,
|
|
1823
|
+
Consolas,
|
|
1824
|
+
"Liberation Mono",
|
|
1825
|
+
monospace;
|
|
1826
|
+
font-size: 0.78rem;
|
|
1827
|
+
line-height: 1.55;
|
|
1828
|
+
white-space: pre-wrap;
|
|
1829
|
+
}
|
|
1830
|
+
.thread-ui-shell .thread-graph-tool-json > div {
|
|
1831
|
+
padding-left: 1rem;
|
|
1832
|
+
}
|
|
1833
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1834
|
+
margin-top: 0.5rem;
|
|
1835
|
+
}
|
|
1836
|
+
.thread-ui-shell .thread-graph-tool-key {
|
|
1837
|
+
color: oklch(0.58 0.18 18);
|
|
1838
|
+
}
|
|
1839
|
+
.thread-ui-shell .thread-graph-tool-string {
|
|
1840
|
+
color: oklch(0.52 0.12 155);
|
|
1841
|
+
}
|
|
1842
|
+
.thread-ui-shell .thread-graph-tool-number {
|
|
1843
|
+
color: oklch(0.55 0.13 235);
|
|
1844
|
+
}
|
|
1845
|
+
.thread-ui-shell .thread-graph-tool-boolean {
|
|
1846
|
+
color: oklch(0.56 0.13 302);
|
|
1847
|
+
}
|
|
1848
|
+
.thread-ui-shell .thread-graph-tool-null,
|
|
1849
|
+
.thread-ui-shell .thread-graph-tool-punctuation,
|
|
1850
|
+
.thread-ui-shell .thread-graph-tool-object {
|
|
1851
|
+
color: var(--theme-fg-muted);
|
|
1852
|
+
}
|
|
1853
|
+
.thread-ui-shell .thread-graph-history-tool {
|
|
1854
|
+
width: 100%;
|
|
1855
|
+
min-width: 0;
|
|
1856
|
+
border: 0;
|
|
1857
|
+
background: transparent !important;
|
|
1858
|
+
color: var(--theme-fg);
|
|
1859
|
+
}
|
|
1860
|
+
.thread-ui-shell .thread-graph-history-tool-accordion {
|
|
1861
|
+
background: var(--theme-panel);
|
|
1862
|
+
}
|
|
1863
|
+
.thread-ui-shell .thread-graph-history-tool-trigger {
|
|
1864
|
+
min-height: 2.75rem;
|
|
1865
|
+
}
|
|
1866
|
+
.thread-ui-shell .thread-graph-history-tool-trigger > div:first-child {
|
|
1867
|
+
min-width: 0;
|
|
1868
|
+
}
|
|
1869
|
+
.thread-ui-shell .thread-graph-history-tool-icon {
|
|
1870
|
+
display: inline-flex;
|
|
1871
|
+
align-items: center;
|
|
1872
|
+
justify-content: center;
|
|
1873
|
+
color: var(--theme-fg-muted);
|
|
1874
|
+
}
|
|
1875
|
+
.thread-ui-shell .thread-graph-history-tool.is-command .thread-graph-history-tool-icon {
|
|
1876
|
+
color: oklch(0.63 0.12 75);
|
|
1877
|
+
}
|
|
1878
|
+
.thread-ui-shell .thread-graph-history-tool.is-tool .thread-graph-history-tool-icon {
|
|
1879
|
+
color: oklch(0.61 0.12 315);
|
|
1880
|
+
}
|
|
1881
|
+
.thread-ui-shell .thread-graph-history-tool.is-agent .thread-graph-history-tool-icon {
|
|
1882
|
+
color: oklch(0.58 0.11 170);
|
|
1883
|
+
}
|
|
1884
|
+
.thread-ui-shell .thread-graph-history-tool.is-skill .thread-graph-history-tool-icon {
|
|
1885
|
+
color: oklch(0.58 0.12 285);
|
|
1886
|
+
}
|
|
1887
|
+
.thread-ui-shell .thread-graph-history-tool.is-search .thread-graph-history-tool-icon {
|
|
1888
|
+
color: oklch(0.58 0.12 235);
|
|
1889
|
+
}
|
|
1890
|
+
.thread-ui-shell .thread-graph-history-tool.is-file-read .thread-graph-history-tool-icon {
|
|
1891
|
+
color: oklch(0.58 0.1 205);
|
|
1892
|
+
}
|
|
1893
|
+
.thread-ui-shell .thread-graph-history-tool-summary {
|
|
1894
|
+
display: flex;
|
|
1895
|
+
min-width: 0;
|
|
1896
|
+
align-items: center;
|
|
1897
|
+
gap: 0.5rem;
|
|
1898
|
+
overflow: hidden;
|
|
1899
|
+
border: 1px solid var(--theme-border);
|
|
1900
|
+
border-radius: 0.375rem;
|
|
1901
|
+
background: var(--theme-surface-strong);
|
|
1902
|
+
padding: 0.65rem 0.75rem;
|
|
1903
|
+
color: var(--theme-fg-soft);
|
|
1904
|
+
font-size: 0.875rem;
|
|
1905
|
+
line-height: 1.5;
|
|
1906
|
+
}
|
|
1907
|
+
.thread-ui-shell .thread-graph-history-tool-summary > span:first-child {
|
|
1908
|
+
min-width: 0;
|
|
1909
|
+
overflow: hidden;
|
|
1910
|
+
text-overflow: ellipsis;
|
|
1911
|
+
white-space: nowrap;
|
|
1912
|
+
}
|
|
1913
|
+
.thread-ui-shell .thread-graph-history-tool-ellipsis {
|
|
1914
|
+
flex: 0 0 auto;
|
|
1915
|
+
color: var(--theme-fg-muted);
|
|
1916
|
+
font-size: 0.75rem;
|
|
1917
|
+
letter-spacing: 0.16em;
|
|
1918
|
+
}
|
|
1919
|
+
.thread-ui-shell .thread-graph-history-tool-open {
|
|
1920
|
+
border-color: var(--theme-border);
|
|
1921
|
+
background: var(--theme-surface);
|
|
1922
|
+
color: var(--theme-fg-soft);
|
|
1923
|
+
}
|
|
1924
|
+
.thread-ui-shell .thread-graph-history-tool-open:hover {
|
|
1925
|
+
background: var(--theme-hover);
|
|
1926
|
+
color: var(--theme-fg);
|
|
1927
|
+
}
|
|
1928
|
+
.thread-ui-shell .thread-graph-history-event {
|
|
1929
|
+
display: flex;
|
|
1930
|
+
min-width: 0;
|
|
1931
|
+
width: 100%;
|
|
1932
|
+
align-items: flex-start;
|
|
1933
|
+
gap: 0.625rem;
|
|
1934
|
+
border: 0;
|
|
1935
|
+
background: transparent !important;
|
|
1936
|
+
color: var(--theme-fg);
|
|
1937
|
+
}
|
|
1938
|
+
.thread-ui-shell .thread-graph-history-event-icon {
|
|
1939
|
+
display: inline-flex;
|
|
1940
|
+
height: 1.75rem;
|
|
1941
|
+
width: 1.75rem;
|
|
1942
|
+
flex: 0 0 auto;
|
|
1943
|
+
align-items: center;
|
|
1944
|
+
justify-content: center;
|
|
1945
|
+
border: 1px solid var(--theme-border);
|
|
1946
|
+
border-radius: 999px;
|
|
1947
|
+
background: var(--theme-panel);
|
|
1948
|
+
color: var(--theme-fg-muted);
|
|
1949
|
+
}
|
|
1950
|
+
.thread-ui-shell .thread-graph-history-event-card {
|
|
1951
|
+
min-width: 0;
|
|
1952
|
+
flex: 1 1 auto;
|
|
1953
|
+
overflow: hidden;
|
|
1954
|
+
border: 1px solid var(--theme-border);
|
|
1955
|
+
border-radius: 0.5rem;
|
|
1956
|
+
background: var(--theme-panel);
|
|
1957
|
+
color: var(--theme-fg);
|
|
1958
|
+
box-shadow: 0 1px 2px color-mix(in oklch, var(--theme-bg) 65%, transparent);
|
|
1959
|
+
}
|
|
1960
|
+
.thread-ui-shell .thread-graph-history-event-header {
|
|
1961
|
+
display: flex;
|
|
1962
|
+
min-width: 0;
|
|
1963
|
+
align-items: center;
|
|
1964
|
+
justify-content: space-between;
|
|
1965
|
+
gap: 0.75rem;
|
|
1966
|
+
padding: 0.75rem 1rem;
|
|
1967
|
+
}
|
|
1968
|
+
.thread-ui-shell .thread-graph-history-event-heading {
|
|
1969
|
+
flex: 1 1 auto;
|
|
1970
|
+
min-width: 0;
|
|
1971
|
+
}
|
|
1972
|
+
.thread-ui-shell .thread-graph-history-event-title {
|
|
1973
|
+
flex: 0 0 auto;
|
|
1974
|
+
max-width: min(14rem, 36%);
|
|
1975
|
+
}
|
|
1976
|
+
.thread-ui-shell .thread-graph-history-event-actions {
|
|
1977
|
+
display: inline-flex;
|
|
1978
|
+
flex: 0 0 auto;
|
|
1979
|
+
align-items: center;
|
|
1980
|
+
gap: 0.5rem;
|
|
1981
|
+
}
|
|
1982
|
+
.thread-ui-shell .thread-graph-history-event-body {
|
|
1983
|
+
display: grid;
|
|
1984
|
+
gap: 0.625rem;
|
|
1985
|
+
border-top: 1px solid var(--theme-border);
|
|
1986
|
+
padding: 0.75rem 1rem 1rem;
|
|
1987
|
+
color: var(--theme-fg-soft);
|
|
1988
|
+
}
|
|
1989
|
+
.thread-ui-shell .thread-graph-history-event-line {
|
|
1990
|
+
display: flex;
|
|
1991
|
+
min-width: 0;
|
|
1992
|
+
align-items: center;
|
|
1993
|
+
gap: 0.5rem;
|
|
1994
|
+
color: var(--theme-fg);
|
|
1995
|
+
}
|
|
1996
|
+
.thread-ui-shell .thread-graph-history-event-primary {
|
|
1997
|
+
min-width: 0;
|
|
1998
|
+
color: var(--theme-fg);
|
|
1999
|
+
font-size: 0.875rem;
|
|
2000
|
+
font-weight: 500;
|
|
2001
|
+
line-height: 1.5;
|
|
2002
|
+
}
|
|
2003
|
+
.thread-ui-shell .thread-graph-history-event-secondary {
|
|
2004
|
+
min-width: 0;
|
|
2005
|
+
color: var(--theme-fg-muted);
|
|
2006
|
+
font-size: 0.75rem;
|
|
2007
|
+
line-height: 1.35;
|
|
2008
|
+
}
|
|
2009
|
+
.thread-ui-shell .thread-graph-history-event-summary {
|
|
2010
|
+
display: block;
|
|
2011
|
+
width: 100%;
|
|
2012
|
+
min-width: 0;
|
|
2013
|
+
overflow: hidden;
|
|
2014
|
+
border: 1px solid var(--theme-border);
|
|
2015
|
+
border-radius: 0.375rem;
|
|
2016
|
+
background: var(--theme-surface-strong);
|
|
2017
|
+
padding: 0.65rem 0.75rem;
|
|
2018
|
+
color: var(--theme-fg-soft);
|
|
2019
|
+
font-size: 0.875rem;
|
|
2020
|
+
line-height: 1.5;
|
|
2021
|
+
text-align: left;
|
|
2022
|
+
}
|
|
2023
|
+
.thread-ui-shell .thread-graph-history-event-summary.is-clickable {
|
|
2024
|
+
transition: background 160ms ease, color 160ms ease;
|
|
2025
|
+
}
|
|
2026
|
+
.thread-ui-shell .thread-graph-history-event-summary.is-clickable:hover {
|
|
2027
|
+
background: var(--theme-hover);
|
|
2028
|
+
color: var(--theme-fg);
|
|
2029
|
+
}
|
|
2030
|
+
.thread-ui-shell .thread-graph-history-event-prose {
|
|
2031
|
+
color: var(--theme-fg-soft);
|
|
2032
|
+
}
|
|
2033
|
+
.thread-ui-shell .thread-graph-history-event-pre {
|
|
2034
|
+
overflow-x: auto;
|
|
2035
|
+
border: 1px solid var(--theme-border);
|
|
2036
|
+
border-radius: 0.375rem;
|
|
2037
|
+
background: var(--theme-surface-strong);
|
|
2038
|
+
padding: 0.75rem;
|
|
2039
|
+
color: var(--theme-fg-soft);
|
|
2040
|
+
font-size: 0.8125rem;
|
|
2041
|
+
line-height: 1.55;
|
|
2042
|
+
white-space: pre-wrap;
|
|
2043
|
+
}
|
|
2044
|
+
.thread-ui-shell .thread-graph-history-event-action,
|
|
2045
|
+
.thread-ui-shell .thread-graph-history-event-pill {
|
|
2046
|
+
display: inline-flex;
|
|
2047
|
+
align-items: center;
|
|
2048
|
+
gap: 0.375rem;
|
|
2049
|
+
border: 1px solid var(--theme-border);
|
|
2050
|
+
border-radius: 999px;
|
|
2051
|
+
background: var(--theme-surface);
|
|
2052
|
+
padding: 0.25rem 0.55rem;
|
|
2053
|
+
color: var(--theme-fg-muted);
|
|
2054
|
+
font-size: 0.6875rem;
|
|
2055
|
+
font-weight: 500;
|
|
2056
|
+
line-height: 1rem;
|
|
2057
|
+
transition: background 160ms ease, color 160ms ease;
|
|
2058
|
+
}
|
|
2059
|
+
.thread-ui-shell .thread-graph-history-event-action:hover {
|
|
2060
|
+
background: var(--theme-hover);
|
|
2061
|
+
color: var(--theme-fg);
|
|
2062
|
+
}
|
|
2063
|
+
.thread-ui-shell .thread-graph-history-event-path {
|
|
2064
|
+
display: block;
|
|
2065
|
+
max-width: 100%;
|
|
2066
|
+
overflow: hidden;
|
|
2067
|
+
text-overflow: ellipsis;
|
|
2068
|
+
white-space: nowrap;
|
|
2069
|
+
color: var(--theme-fg-muted);
|
|
2070
|
+
font-size: 0.75rem;
|
|
2071
|
+
line-height: 1.4;
|
|
2072
|
+
text-align: left;
|
|
2073
|
+
}
|
|
2074
|
+
.thread-ui-shell .thread-graph-history-event-path:hover {
|
|
2075
|
+
color: var(--theme-fg);
|
|
2076
|
+
}
|
|
2077
|
+
.thread-ui-shell .thread-graph-history-event-image {
|
|
2078
|
+
max-height: 24rem;
|
|
2079
|
+
width: 100%;
|
|
2080
|
+
object-fit: contain;
|
|
2081
|
+
border: 1px solid var(--theme-border);
|
|
2082
|
+
border-radius: 0.5rem;
|
|
2083
|
+
background: var(--theme-surface-strong);
|
|
2084
|
+
}
|
|
2085
|
+
.thread-ui-shell .thread-graph-history-event.is-plan .thread-graph-history-event-icon {
|
|
2086
|
+
color: oklch(0.58 0.12 235);
|
|
2087
|
+
}
|
|
2088
|
+
.thread-ui-shell .thread-graph-history-event.is-context .thread-graph-history-event-icon {
|
|
2089
|
+
color: oklch(0.58 0.11 170);
|
|
2090
|
+
}
|
|
2091
|
+
.thread-ui-shell .thread-graph-history-event.is-image .thread-graph-history-event-icon,
|
|
2092
|
+
.thread-ui-shell .thread-graph-history-event.is-artifact .thread-graph-history-event-icon {
|
|
2093
|
+
color: oklch(0.58 0.12 285);
|
|
2094
|
+
}
|
|
2095
|
+
.thread-ui-shell .thread-graph-history-event.is-file-change .thread-graph-history-event-icon {
|
|
2096
|
+
color: oklch(0.62 0.12 145);
|
|
2097
|
+
}
|
|
2098
|
+
.thread-ui-shell .thread-graph-history-event.is-hook .thread-graph-history-event-icon {
|
|
2099
|
+
color: oklch(0.61 0.12 315);
|
|
2100
|
+
}
|
|
2101
|
+
@media (max-width: 639px) {
|
|
2102
|
+
.thread-ui-shell .thread-graph-history-event {
|
|
2103
|
+
gap: 0.5rem;
|
|
2104
|
+
}
|
|
2105
|
+
.thread-ui-shell .thread-graph-history-event-icon {
|
|
2106
|
+
height: 1.5rem;
|
|
2107
|
+
width: 1.5rem;
|
|
2108
|
+
}
|
|
2109
|
+
.thread-ui-shell .thread-graph-history-event-header,
|
|
2110
|
+
.thread-ui-shell .thread-graph-history-event-body {
|
|
2111
|
+
padding-left: 0.75rem;
|
|
2112
|
+
padding-right: 0.75rem;
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
.thread-ui-shell .thread-graph-history-detail-row {
|
|
2116
|
+
border-color: var(--theme-border);
|
|
2117
|
+
background: var(--theme-surface);
|
|
2118
|
+
color: var(--theme-fg);
|
|
2119
|
+
}
|
|
2120
|
+
.thread-ui-shell .thread-graph-history-detail-row:hover {
|
|
2121
|
+
background: var(--theme-hover);
|
|
2122
|
+
color: var(--theme-fg);
|
|
2123
|
+
}
|
|
2124
|
+
.thread-ui-shell .thread-graph-history-detail-text {
|
|
2125
|
+
color: var(--theme-fg);
|
|
2126
|
+
}
|
|
2127
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-card {
|
|
2128
|
+
border-radius: 0.4375rem;
|
|
2129
|
+
}
|
|
2130
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-header {
|
|
2131
|
+
min-height: 2.75rem;
|
|
2132
|
+
padding-block: 0.5rem;
|
|
2133
|
+
}
|
|
2134
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-heading {
|
|
2135
|
+
flex: 1 1 auto;
|
|
2136
|
+
min-width: 0;
|
|
2137
|
+
gap: 0.375rem;
|
|
2138
|
+
}
|
|
2139
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-title {
|
|
2140
|
+
max-width: none;
|
|
2141
|
+
font-size: 0.8125rem;
|
|
2142
|
+
}
|
|
2143
|
+
.thread-ui-shell .thread-graph-file-change-inline,
|
|
2144
|
+
.thread-ui-shell .thread-graph-file-change-inline-button {
|
|
2145
|
+
min-width: 0;
|
|
2146
|
+
}
|
|
2147
|
+
.thread-ui-shell .thread-graph-file-change-inline {
|
|
2148
|
+
max-width: 100%;
|
|
2149
|
+
gap: 0.375rem;
|
|
2150
|
+
}
|
|
2151
|
+
.thread-ui-shell .thread-graph-file-change-inline-button {
|
|
2152
|
+
display: block;
|
|
2153
|
+
flex: 1 1 auto;
|
|
2154
|
+
color: inherit;
|
|
2155
|
+
}
|
|
2156
|
+
.thread-ui-shell .thread-graph-file-change-inline-button:hover .thread-graph-history-detail-text {
|
|
2157
|
+
color: var(--theme-fg);
|
|
2158
|
+
text-decoration: underline;
|
|
2159
|
+
text-decoration-thickness: 1px;
|
|
2160
|
+
text-underline-offset: 2px;
|
|
2161
|
+
}
|
|
2162
|
+
.thread-ui-shell .thread-graph-history-detail-meta {
|
|
2163
|
+
color: var(--theme-fg-muted);
|
|
2164
|
+
}
|
|
2165
|
+
.thread-ui-shell .thread-graph-history-delta-badge {
|
|
2166
|
+
display: inline-flex;
|
|
2167
|
+
align-items: center;
|
|
2168
|
+
justify-content: center;
|
|
2169
|
+
border: 1px solid transparent;
|
|
2170
|
+
border-radius: 999px;
|
|
2171
|
+
padding: 0.125rem 0.375rem;
|
|
2172
|
+
font-size: 0.6875rem;
|
|
2173
|
+
font-weight: 500;
|
|
2174
|
+
line-height: 1rem;
|
|
2175
|
+
}
|
|
2176
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-add {
|
|
2177
|
+
border-color: rgb(52 211 153 / 0.28);
|
|
2178
|
+
background: rgb(52 211 153 / 0.1);
|
|
2179
|
+
color: rgb(167 243 208);
|
|
2180
|
+
}
|
|
2181
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-remove {
|
|
2182
|
+
border-color: rgb(251 113 133 / 0.3);
|
|
2183
|
+
background: rgb(251 113 133 / 0.1);
|
|
2184
|
+
color: rgb(254 205 211);
|
|
2185
|
+
}
|
|
2186
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-neutral {
|
|
2187
|
+
border-color: var(--theme-border);
|
|
2188
|
+
background: var(--theme-muted);
|
|
2189
|
+
color: var(--theme-fg-soft);
|
|
2190
|
+
}
|
|
2191
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-history-delta-badge.is-add {
|
|
2192
|
+
border-color: rgb(16 185 129 / 0.25);
|
|
2193
|
+
background: rgb(16 185 129 / 0.1);
|
|
2194
|
+
color: rgb(4 120 87);
|
|
2195
|
+
}
|
|
2196
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-history-delta-badge.is-remove {
|
|
2197
|
+
border-color: rgb(244 63 94 / 0.25);
|
|
2198
|
+
background: rgb(244 63 94 / 0.1);
|
|
2199
|
+
color: rgb(190 18 60);
|
|
2200
|
+
}
|
|
2201
|
+
@media (max-width: 639px) {
|
|
2202
|
+
.thread-ui-shell .thread-graph-history-tool-trigger {
|
|
2203
|
+
padding-left: 0.75rem;
|
|
2204
|
+
padding-right: 0.75rem;
|
|
2205
|
+
}
|
|
2206
|
+
.thread-ui-shell .thread-graph-history-tool-trigger .thread-graph-tool-badge {
|
|
2207
|
+
max-width: 7.5rem;
|
|
2208
|
+
}
|
|
2209
|
+
.thread-ui-shell .thread-graph-history-tool-content {
|
|
2210
|
+
padding-left: 0.75rem;
|
|
2211
|
+
padding-right: 0.75rem;
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
.thread-ui-shell .xyz-viewer-plugin {
|
|
2215
|
+
border-color: var(--theme-border);
|
|
2216
|
+
border-radius: 0;
|
|
2217
|
+
background: var(--theme-surface);
|
|
2218
|
+
color: var(--theme-fg);
|
|
2219
|
+
}
|
|
2220
|
+
.thread-ui-shell .xyz-viewer-plugin__header,
|
|
2221
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar,
|
|
2222
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline,
|
|
2223
|
+
.thread-ui-shell .xyz-viewer-plugin__status {
|
|
2224
|
+
border-color: var(--theme-border);
|
|
2225
|
+
background: var(--theme-surface);
|
|
2226
|
+
color: var(--theme-fg-muted);
|
|
2227
|
+
}
|
|
2228
|
+
.thread-ui-shell .xyz-viewer-plugin__header h2 {
|
|
2229
|
+
color: var(--theme-fg);
|
|
2230
|
+
}
|
|
2231
|
+
.thread-ui-shell .xyz-viewer-plugin__header p,
|
|
2232
|
+
.thread-ui-shell .xyz-viewer-plugin__header span,
|
|
2233
|
+
.thread-ui-shell .xyz-viewer-plugin__tooltip span {
|
|
2234
|
+
color: var(--theme-fg-muted);
|
|
2235
|
+
}
|
|
2236
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar button,
|
|
2237
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline button {
|
|
2238
|
+
border-color: var(--theme-border);
|
|
2239
|
+
background: var(--theme-surface-strong);
|
|
2240
|
+
color: var(--theme-fg-soft);
|
|
2241
|
+
}
|
|
2242
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar button:hover,
|
|
2243
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline button:hover {
|
|
2244
|
+
background: var(--theme-hover);
|
|
2245
|
+
color: var(--theme-fg);
|
|
2246
|
+
}
|
|
2247
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar-divider {
|
|
2248
|
+
background: var(--theme-border);
|
|
2249
|
+
}
|
|
2250
|
+
.thread-ui-shell .xyz-viewer-plugin__stage {
|
|
2251
|
+
background: var(--theme-bg);
|
|
2252
|
+
}
|
|
2253
|
+
.thread-ui-shell .xyz-viewer-plugin__tooltip {
|
|
2254
|
+
border-color: var(--theme-border);
|
|
2255
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent);
|
|
2256
|
+
box-shadow: var(--theme-shadow);
|
|
2257
|
+
color: var(--theme-fg);
|
|
2258
|
+
}
|
|
2259
|
+
.thread-ui-shell .xyz-viewer-plugin__empty {
|
|
2260
|
+
color: var(--theme-fg-muted);
|
|
2261
|
+
}
|
|
2262
|
+
.thread-ui-shell .xyz-viewer-plugin__error {
|
|
2263
|
+
background: color-mix(in oklch, oklch(0.62 0.16 25) 14%, var(--theme-panel));
|
|
2264
|
+
color: oklch(0.78 0.12 25);
|
|
2265
|
+
}
|
|
2266
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-key,
|
|
2267
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-key,
|
|
2268
|
+
.thread-ui-shell.dark .thread-graph-tool-key {
|
|
2269
|
+
color: oklch(0.78 0.12 18);
|
|
2270
|
+
}
|
|
2271
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-string,
|
|
2272
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-string,
|
|
2273
|
+
.thread-ui-shell.dark .thread-graph-tool-string {
|
|
2274
|
+
color: oklch(0.79 0.11 155);
|
|
2275
|
+
}
|
|
2276
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-number,
|
|
2277
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-number,
|
|
2278
|
+
.thread-ui-shell.dark .thread-graph-tool-number {
|
|
2279
|
+
color: oklch(0.77 0.1 235);
|
|
2280
|
+
}
|
|
2281
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-boolean,
|
|
2282
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-boolean,
|
|
2283
|
+
.thread-ui-shell.dark .thread-graph-tool-boolean {
|
|
2284
|
+
color: oklch(0.79 0.1 302);
|
|
2285
|
+
}
|
|
2286
|
+
.thread-ui-shell .thread-timeline-surface,
|
|
2287
|
+
.thread-ui-shell .thread-scroll-container {
|
|
2288
|
+
background: var(--theme-surface);
|
|
2289
|
+
color: var(--theme-fg);
|
|
2290
|
+
scrollbar-color: var(--theme-border-strong) transparent;
|
|
2291
|
+
}
|
|
2292
|
+
.thread-ui-shell .thread-scroll-container > div > .divide-y {
|
|
2293
|
+
border-color: var(--theme-border);
|
|
2294
|
+
}
|
|
2295
|
+
.thread-ui-shell .timeline-item-frame {
|
|
2296
|
+
border-color: var(--theme-border);
|
|
2297
|
+
background: var(--theme-panel);
|
|
2298
|
+
color: var(--theme-fg);
|
|
2299
|
+
box-shadow: none;
|
|
2300
|
+
}
|
|
2301
|
+
.thread-ui-shell .timeline-agent {
|
|
2302
|
+
border-color: transparent;
|
|
2303
|
+
background: transparent;
|
|
2304
|
+
box-shadow: none;
|
|
2305
|
+
}
|
|
2306
|
+
.thread-ui-shell .timeline-user {
|
|
2307
|
+
border-color: transparent;
|
|
2308
|
+
background: oklch(0.94 0.025 214);
|
|
2309
|
+
color: oklch(0.24 0.027 255);
|
|
2310
|
+
}
|
|
2311
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user,
|
|
2312
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user,
|
|
2313
|
+
.thread-ui-shell.dark .timeline-user {
|
|
2314
|
+
background: oklch(0.29 0.034 224);
|
|
2315
|
+
color: var(--theme-fg);
|
|
2316
|
+
}
|
|
2317
|
+
.thread-ui-shell .timeline-command,
|
|
2318
|
+
.thread-ui-shell .timeline-agent-tool,
|
|
2319
|
+
.thread-ui-shell .timeline-skill-tool,
|
|
2320
|
+
.thread-ui-shell .timeline-action,
|
|
2321
|
+
.thread-ui-shell .timeline-file-change,
|
|
2322
|
+
.thread-ui-shell .timeline-file-read,
|
|
2323
|
+
.thread-ui-shell .timeline-search,
|
|
2324
|
+
.thread-ui-shell .timeline-plan,
|
|
2325
|
+
.thread-ui-shell .timeline-reasoning,
|
|
2326
|
+
.thread-ui-shell .timeline-other,
|
|
2327
|
+
.thread-ui-shell .timeline-special-warning,
|
|
2328
|
+
.thread-ui-shell .timeline-special-info,
|
|
2329
|
+
.thread-ui-shell .timeline-special-file-read,
|
|
2330
|
+
.thread-ui-shell .timeline-special-success,
|
|
2331
|
+
.thread-ui-shell .timeline-mobile-dense-event,
|
|
2332
|
+
.thread-ui-shell .timeline-batch-inner,
|
|
2333
|
+
.thread-ui-shell .timeline-item-inner {
|
|
2334
|
+
border-color: var(--theme-border);
|
|
2335
|
+
background: var(--theme-panel);
|
|
2336
|
+
color: var(--theme-fg);
|
|
2337
|
+
}
|
|
2338
|
+
.thread-ui-shell .timeline-special-warning,
|
|
2339
|
+
.thread-ui-shell .timeline-special-info,
|
|
2340
|
+
.thread-ui-shell .timeline-special-file-read,
|
|
2341
|
+
.thread-ui-shell .timeline-special-success {
|
|
2342
|
+
box-shadow: none;
|
|
2343
|
+
}
|
|
2344
|
+
.thread-ui-shell .timeline-mobile-dense-command,
|
|
2345
|
+
.thread-ui-shell .timeline-mobile-dense-search,
|
|
2346
|
+
.thread-ui-shell .timeline-mobile-dense-file-read,
|
|
2347
|
+
.thread-ui-shell .timeline-mobile-dense-file {
|
|
2348
|
+
background: var(--theme-panel);
|
|
2349
|
+
}
|
|
2350
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.border-stone-700, .border-stone-700\\/90, .border-stone-800, .border-stone-800\\/80) {
|
|
2351
|
+
border-color: var(--theme-border) !important;
|
|
2352
|
+
}
|
|
2353
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.bg-stone-800, .bg-stone-900, .bg-stone-900\\/60, .bg-stone-900\\/72, .bg-stone-900\\/80, .bg-stone-950, .bg-stone-950\\/35, .bg-stone-950\\/40, .bg-stone-950\\/60, .bg-stone-950\\/70, .bg-stone-950\\/90, .bg-stone-950\\/96) {
|
|
2354
|
+
background: var(--theme-surface-strong) !important;
|
|
2355
|
+
}
|
|
2356
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-stone-100, .text-stone-200, .text-stone-300, .text-sky-50, .text-sky-100, .text-emerald-50, .text-emerald-100, .text-amber-100) {
|
|
2357
|
+
color: var(--theme-fg) !important;
|
|
2358
|
+
}
|
|
2359
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-stone-400, .text-stone-500) {
|
|
2360
|
+
color: var(--theme-fg-muted) !important;
|
|
2361
|
+
}
|
|
2362
|
+
.thread-ui-shell .timeline-kind-agent,
|
|
2363
|
+
.thread-ui-shell .timeline-kind-user,
|
|
2364
|
+
.thread-ui-shell .timeline-kind-command,
|
|
2365
|
+
.thread-ui-shell .timeline-kind-search,
|
|
2366
|
+
.thread-ui-shell .timeline-kind-file-read,
|
|
2367
|
+
.thread-ui-shell .timeline-kind-reasoning,
|
|
2368
|
+
.thread-ui-shell .timeline-kind-agent-tool,
|
|
2369
|
+
.thread-ui-shell .timeline-kind-skill-tool,
|
|
2370
|
+
.thread-ui-shell .timeline-kind-action,
|
|
2371
|
+
.thread-ui-shell .timeline-kind-plan,
|
|
2372
|
+
.thread-ui-shell .timeline-kind-file {
|
|
2373
|
+
border-left-width: 1px;
|
|
2374
|
+
}
|
|
2375
|
+
.thread-ui-shell .timeline-primary-text,
|
|
2376
|
+
.thread-ui-shell .timeline-message-content,
|
|
2377
|
+
.thread-ui-shell .timeline-mobile-bubble-content,
|
|
2378
|
+
.thread-ui-shell .thread-message-prose,
|
|
2379
|
+
.thread-ui-shell .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2380
|
+
color: var(--theme-fg);
|
|
2381
|
+
}
|
|
2382
|
+
.thread-ui-shell .timeline-user .thread-message-prose,
|
|
2383
|
+
.thread-ui-shell .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2384
|
+
color: oklch(0.24 0.027 255);
|
|
2385
|
+
}
|
|
2386
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user .thread-message-prose,
|
|
2387
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user .thread-message-prose,
|
|
2388
|
+
.thread-ui-shell.dark .timeline-user .thread-message-prose,
|
|
2389
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2390
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2391
|
+
.thread-ui-shell.dark .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2392
|
+
color: var(--theme-fg);
|
|
2393
|
+
}
|
|
2394
|
+
.thread-ui-shell .timeline-agent .thread-message-prose,
|
|
2395
|
+
.thread-ui-shell .timeline-agent .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2396
|
+
color: var(--theme-fg);
|
|
2397
|
+
}
|
|
2398
|
+
.thread-ui-shell .thread-graph-message {
|
|
2399
|
+
width: 100%;
|
|
2400
|
+
min-width: 0;
|
|
2401
|
+
}
|
|
2402
|
+
.thread-ui-shell .thread-graph-message-bubble {
|
|
2403
|
+
color: var(--theme-fg);
|
|
2404
|
+
}
|
|
2405
|
+
.thread-ui-shell .thread-graph-message-bubble.is-user {
|
|
2406
|
+
width: 100%;
|
|
2407
|
+
max-width: 100%;
|
|
2408
|
+
border-radius: 0.75rem;
|
|
2409
|
+
background: #eef5f9;
|
|
2410
|
+
padding: 0.5rem 0.75rem;
|
|
2411
|
+
color: rgb(15 23 42);
|
|
2412
|
+
}
|
|
2413
|
+
.thread-ui-shell .thread-graph-message-bubble.is-assistant {
|
|
2414
|
+
width: 100%;
|
|
2415
|
+
border: 0;
|
|
2416
|
+
background: transparent;
|
|
2417
|
+
padding: 0;
|
|
2418
|
+
box-shadow: none;
|
|
2419
|
+
}
|
|
2420
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-bubble.is-user,
|
|
2421
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-bubble.is-user,
|
|
2422
|
+
.thread-ui-shell.dark .thread-graph-message-bubble.is-user {
|
|
2423
|
+
background: #212b35;
|
|
2424
|
+
color: rgb(241 245 249);
|
|
2425
|
+
}
|
|
2426
|
+
.thread-ui-shell .thread-graph-message-content.is-user,
|
|
2427
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-message-prose,
|
|
2428
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2429
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2430
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2431
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2432
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2433
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code) {
|
|
2434
|
+
color: rgb(51 65 85);
|
|
2435
|
+
}
|
|
2436
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user,
|
|
2437
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user,
|
|
2438
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user,
|
|
2439
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-message-prose,
|
|
2440
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-message-prose,
|
|
2441
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-message-prose,
|
|
2442
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2443
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2444
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2445
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2446
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2447
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2448
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2449
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2450
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2451
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2452
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2453
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2454
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2455
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2456
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2457
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code),
|
|
2458
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code),
|
|
2459
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code) {
|
|
2460
|
+
color: rgb(226 232 240);
|
|
2461
|
+
}
|
|
2462
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant,
|
|
2463
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-message-prose,
|
|
2464
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-markdown,
|
|
2465
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-plain-text,
|
|
2466
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2467
|
+
color: var(--theme-fg);
|
|
2468
|
+
}
|
|
2469
|
+
.thread-ui-shell .thread-graph-message-prose,
|
|
2470
|
+
.thread-ui-shell .thread-graph-markdown,
|
|
2471
|
+
.thread-ui-shell .thread-graph-plain-text {
|
|
2472
|
+
color: inherit;
|
|
2473
|
+
}
|
|
2474
|
+
.thread-ui-shell .thread-graph-markdown {
|
|
2475
|
+
max-width: none;
|
|
2476
|
+
font-size: 0.875rem;
|
|
2477
|
+
line-height: 1.7;
|
|
2478
|
+
}
|
|
2479
|
+
.thread-ui-shell .thread-graph-message-markdown {
|
|
2480
|
+
color: inherit;
|
|
2481
|
+
word-break: break-word;
|
|
2482
|
+
}
|
|
2483
|
+
.thread-ui-shell .thread-graph-show-more {
|
|
2484
|
+
min-height: 1.25rem;
|
|
2485
|
+
border-color: var(--theme-border);
|
|
2486
|
+
background: color-mix(in oklch, var(--theme-panel) 72%, transparent);
|
|
2487
|
+
color: var(--theme-fg-muted);
|
|
2488
|
+
}
|
|
2489
|
+
.thread-ui-shell .thread-graph-show-more:hover,
|
|
2490
|
+
.thread-ui-shell .thread-graph-show-more:focus-visible {
|
|
2491
|
+
background: var(--theme-hover);
|
|
2492
|
+
color: var(--theme-fg);
|
|
2493
|
+
}
|
|
2494
|
+
.thread-ui-shell .thread-graph-markdown :where(p, ul, ol, pre, blockquote, table, hr) {
|
|
2495
|
+
margin-bottom: 0.75rem;
|
|
2496
|
+
}
|
|
2497
|
+
.thread-ui-shell .thread-graph-markdown :where(p:last-child, ul:last-child, ol:last-child, pre:last-child, blockquote:last-child, table:last-child, hr:last-child) {
|
|
2498
|
+
margin-bottom: 0;
|
|
2499
|
+
}
|
|
2500
|
+
.thread-ui-shell .thread-graph-markdown :where(a) {
|
|
2501
|
+
color: rgb(3 105 161);
|
|
2502
|
+
text-decoration: underline;
|
|
2503
|
+
text-underline-offset: 2px;
|
|
2504
|
+
}
|
|
2505
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-markdown :where(a),
|
|
2506
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-markdown :where(a),
|
|
2507
|
+
.thread-ui-shell.dark .thread-graph-markdown :where(a) {
|
|
2508
|
+
color: rgb(125 211 252);
|
|
2509
|
+
}
|
|
2510
|
+
.thread-ui-shell .thread-graph-markdown :where(blockquote) {
|
|
2511
|
+
border-left: 3px solid var(--theme-border-strong);
|
|
2512
|
+
padding-left: 0.85rem;
|
|
2513
|
+
color: var(--theme-fg-soft);
|
|
2514
|
+
}
|
|
2515
|
+
.thread-ui-shell .thread-graph-markdown :where(ul, ol) {
|
|
2516
|
+
padding-left: 1.25rem;
|
|
2517
|
+
}
|
|
2518
|
+
.thread-ui-shell .thread-graph-markdown :where(li) {
|
|
2519
|
+
margin-top: 0.25rem;
|
|
2520
|
+
}
|
|
2521
|
+
.thread-ui-shell .thread-graph-markdown :where(table) {
|
|
2522
|
+
display: block;
|
|
2523
|
+
width: 100%;
|
|
2524
|
+
overflow-x: auto;
|
|
2525
|
+
border-collapse: collapse;
|
|
2526
|
+
}
|
|
2527
|
+
.thread-ui-shell .thread-graph-markdown :where(th, td) {
|
|
2528
|
+
border: 1px solid var(--theme-border);
|
|
2529
|
+
padding: 0.4rem 0.55rem;
|
|
2530
|
+
text-align: left;
|
|
2531
|
+
}
|
|
2532
|
+
.thread-ui-shell .thread-graph-markdown :where(th) {
|
|
2533
|
+
background: var(--theme-surface-strong);
|
|
2534
|
+
color: var(--theme-fg);
|
|
2535
|
+
}
|
|
2536
|
+
.thread-ui-shell .thread-graph-code-block {
|
|
2537
|
+
border-color: rgb(226 232 240);
|
|
2538
|
+
background: rgb(248 250 252);
|
|
2539
|
+
color: rgb(31 41 55);
|
|
2540
|
+
}
|
|
2541
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-block,
|
|
2542
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-block,
|
|
2543
|
+
.thread-ui-shell.dark .thread-graph-code-block {
|
|
2544
|
+
border-color: #303642;
|
|
2545
|
+
background: #11141a;
|
|
2546
|
+
color: rgb(241 245 249);
|
|
2547
|
+
}
|
|
2548
|
+
.thread-ui-shell .thread-graph-code-block pre,
|
|
2549
|
+
.thread-ui-shell .thread-graph-code-block code {
|
|
2550
|
+
margin: 0;
|
|
2551
|
+
background: transparent;
|
|
2552
|
+
color: inherit;
|
|
2553
|
+
}
|
|
2554
|
+
.thread-ui-shell .thread-graph-code-copy {
|
|
2555
|
+
background: rgb(255 255 255 / 0.72);
|
|
2556
|
+
color: rgb(51 65 85);
|
|
2557
|
+
box-shadow: 0 4px 12px rgb(15 23 42 / 0.08);
|
|
2558
|
+
}
|
|
2559
|
+
.thread-ui-shell .thread-graph-code-copy:hover {
|
|
2560
|
+
background: rgb(255 255 255);
|
|
2561
|
+
color: rgb(15 23 42);
|
|
2562
|
+
}
|
|
2563
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-copy,
|
|
2564
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-copy,
|
|
2565
|
+
.thread-ui-shell.dark .thread-graph-code-copy {
|
|
2566
|
+
background: rgb(34 39 51 / 0.82);
|
|
2567
|
+
color: rgb(226 232 240);
|
|
2568
|
+
}
|
|
2569
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-copy:hover,
|
|
2570
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-copy:hover,
|
|
2571
|
+
.thread-ui-shell.dark .thread-graph-code-copy:hover {
|
|
2572
|
+
background: #2b313d;
|
|
2573
|
+
color: rgb(248 250 252);
|
|
2574
|
+
}
|
|
2575
|
+
.thread-ui-shell .thread-graph-inline-code {
|
|
2576
|
+
background: rgb(241 245 249);
|
|
2577
|
+
color: rgb(31 41 55);
|
|
2578
|
+
}
|
|
2579
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-inline-code,
|
|
2580
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-inline-code,
|
|
2581
|
+
.thread-ui-shell.dark .thread-graph-inline-code {
|
|
2582
|
+
background: #222733;
|
|
2583
|
+
color: rgb(241 245 249);
|
|
2584
|
+
}
|
|
2585
|
+
.thread-ui-shell .thread-graph-message-sender {
|
|
2586
|
+
background: oklch(0.96 0.025 155);
|
|
2587
|
+
color: oklch(0.42 0.11 155);
|
|
2588
|
+
}
|
|
2589
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-sender,
|
|
2590
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-sender,
|
|
2591
|
+
.thread-ui-shell.dark .thread-graph-message-sender {
|
|
2592
|
+
background: rgb(52 211 153 / 0.1);
|
|
2593
|
+
color: rgb(110 231 183);
|
|
2594
|
+
}
|
|
2595
|
+
.thread-ui-shell .thread-graph-message-copy {
|
|
2596
|
+
border-color: var(--theme-border);
|
|
2597
|
+
background: var(--theme-panel);
|
|
2598
|
+
color: var(--theme-fg-muted);
|
|
2599
|
+
}
|
|
2600
|
+
.thread-ui-shell .thread-graph-message-copy:hover {
|
|
2601
|
+
background: var(--theme-hover);
|
|
2602
|
+
color: var(--theme-fg);
|
|
2603
|
+
}
|
|
2604
|
+
.thread-ui-shell .thread-graph-message-header-actions {
|
|
2605
|
+
color: var(--theme-fg-muted);
|
|
2606
|
+
}
|
|
2607
|
+
.thread-ui-shell .thread-graph-message-time {
|
|
2608
|
+
color: var(--theme-fg-muted);
|
|
2609
|
+
white-space: nowrap;
|
|
2610
|
+
}
|
|
2611
|
+
.thread-ui-shell .thread-graph-message-status {
|
|
2612
|
+
box-shadow: none;
|
|
2613
|
+
}
|
|
2614
|
+
@media (min-width: 640px) {
|
|
2615
|
+
.thread-ui-shell .thread-graph-message-bubble.is-user {
|
|
2616
|
+
padding: 0.375rem 1rem;
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
.thread-ui-shell .timeline-soft-text,
|
|
2620
|
+
.thread-ui-shell .thread-message-prose :where(blockquote) {
|
|
2621
|
+
color: var(--theme-fg-soft);
|
|
2622
|
+
}
|
|
2623
|
+
.thread-ui-shell .timeline-meta-text,
|
|
2624
|
+
.thread-ui-shell .thread-message-prose :where(figcaption) {
|
|
2625
|
+
color: var(--theme-fg-muted);
|
|
2626
|
+
}
|
|
2627
|
+
.thread-ui-shell .timeline-overlay-badge,
|
|
2628
|
+
.thread-ui-shell .ui-status-neutral,
|
|
2629
|
+
.thread-ui-shell .ui-status-info,
|
|
2630
|
+
.thread-ui-shell .ui-status-warning,
|
|
2631
|
+
.thread-ui-shell .ui-status-success,
|
|
2632
|
+
.thread-ui-shell .ui-status-danger {
|
|
2633
|
+
border-color: transparent;
|
|
2634
|
+
box-shadow: none;
|
|
2635
|
+
}
|
|
2636
|
+
.thread-ui-shell .timeline-command-status-complete,
|
|
2637
|
+
.thread-ui-shell .timeline-command-status-pending,
|
|
2638
|
+
.thread-ui-shell .timeline-delta-badge,
|
|
2639
|
+
.thread-ui-shell .timeline-live-plan-step {
|
|
2640
|
+
border-color: var(--theme-border);
|
|
2641
|
+
background: var(--theme-muted);
|
|
2642
|
+
color: var(--theme-fg-soft);
|
|
2643
|
+
}
|
|
2644
|
+
.thread-ui-shell .ui-status-neutral {
|
|
2645
|
+
background: var(--theme-muted);
|
|
2646
|
+
color: var(--theme-fg-soft);
|
|
2647
|
+
}
|
|
2648
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-neutral,
|
|
2649
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-neutral,
|
|
2650
|
+
.thread-ui-shell.dark .ui-status-neutral {
|
|
2651
|
+
border-color: #303642;
|
|
2652
|
+
background: #151923;
|
|
2653
|
+
color: rgb(203 213 225);
|
|
2654
|
+
}
|
|
2655
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card.is-active .ui-status-neutral,
|
|
2656
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card.is-active .ui-status-neutral,
|
|
2657
|
+
.thread-ui-shell.dark .thread-graph-room-card.is-active .ui-status-neutral {
|
|
2658
|
+
border-color: #424b5e;
|
|
2659
|
+
background: #1a1f2a;
|
|
2660
|
+
color: rgb(203 213 225);
|
|
2661
|
+
}
|
|
2662
|
+
.thread-ui-shell .ui-status-info {
|
|
2663
|
+
background: oklch(0.94 0.03 235);
|
|
2664
|
+
color: oklch(0.43 0.09 242);
|
|
2665
|
+
}
|
|
2666
|
+
.thread-ui-shell .ui-status-warning {
|
|
2667
|
+
background: oklch(0.94 0.048 84);
|
|
2668
|
+
color: oklch(0.46 0.08 75);
|
|
2669
|
+
}
|
|
2670
|
+
.thread-ui-shell .ui-status-success {
|
|
2671
|
+
background: oklch(0.94 0.052 155);
|
|
2672
|
+
color: oklch(0.43 0.095 155);
|
|
2673
|
+
}
|
|
2674
|
+
.thread-ui-shell .ui-status-danger {
|
|
2675
|
+
background: oklch(0.94 0.04 25);
|
|
2676
|
+
color: oklch(0.48 0.125 24);
|
|
2677
|
+
}
|
|
2678
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-info,
|
|
2679
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-info,
|
|
2680
|
+
.thread-ui-shell.dark .ui-status-info {
|
|
2681
|
+
background: oklch(0.3 0.042 235);
|
|
2682
|
+
color: oklch(0.77 0.1 235);
|
|
2683
|
+
}
|
|
2684
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-warning,
|
|
2685
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-warning,
|
|
2686
|
+
.thread-ui-shell.dark .ui-status-warning {
|
|
2687
|
+
background: oklch(0.31 0.045 75);
|
|
2688
|
+
color: oklch(0.83 0.11 80);
|
|
2689
|
+
}
|
|
2690
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-success,
|
|
2691
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-success,
|
|
2692
|
+
.thread-ui-shell.dark .ui-status-success {
|
|
2693
|
+
background: oklch(0.31 0.05 155);
|
|
2694
|
+
color: oklch(0.8 0.115 155);
|
|
2695
|
+
}
|
|
2696
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-danger,
|
|
2697
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-danger,
|
|
2698
|
+
.thread-ui-shell.dark .ui-status-danger {
|
|
2699
|
+
background: oklch(0.31 0.052 25);
|
|
2700
|
+
color: oklch(0.78 0.12 25);
|
|
2701
|
+
}
|
|
2702
|
+
.thread-ui-shell .thread-message-icon-user,
|
|
2703
|
+
.thread-ui-shell .thread-message-icon-agent {
|
|
2704
|
+
border-color: transparent;
|
|
2705
|
+
background: var(--theme-muted);
|
|
2706
|
+
color: var(--theme-fg-muted);
|
|
2707
|
+
}
|
|
2708
|
+
.thread-ui-shell .thread-graph-thinking-trigger {
|
|
2709
|
+
display: inline-flex;
|
|
2710
|
+
align-items: center;
|
|
2711
|
+
color: rgb(148 163 184);
|
|
2712
|
+
}
|
|
2713
|
+
.thread-ui-shell .thread-graph-thinking-trigger:hover,
|
|
2714
|
+
.thread-ui-shell .thread-graph-thinking-trigger[data-state=open] {
|
|
2715
|
+
color: rgb(125 211 252);
|
|
2716
|
+
}
|
|
2717
|
+
.thread-ui-shell .thread-graph-thinking-label {
|
|
2718
|
+
min-width: 0;
|
|
2719
|
+
}
|
|
2720
|
+
.thread-ui-shell .thread-graph-thinking-body {
|
|
2721
|
+
border-color: rgb(42 47 58);
|
|
2722
|
+
background: #1b1f29;
|
|
2723
|
+
color: rgb(203 213 225);
|
|
2724
|
+
}
|
|
2725
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger {
|
|
2726
|
+
color: rgb(100 116 139);
|
|
2727
|
+
}
|
|
2728
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger:hover,
|
|
2729
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger[data-state=open] {
|
|
2730
|
+
color: rgb(3 105 161);
|
|
2731
|
+
}
|
|
2732
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-body {
|
|
2733
|
+
border-color: rgb(226 232 240);
|
|
2734
|
+
background: rgb(248 250 252);
|
|
2735
|
+
color: rgb(51 65 85);
|
|
2736
|
+
}
|
|
2737
|
+
.thread-ui-shell .timeline-corner-copy-visual {
|
|
2738
|
+
border-color: var(--theme-border);
|
|
2739
|
+
background: color-mix(in oklch, var(--theme-panel) 88%, transparent);
|
|
2740
|
+
color: var(--theme-fg-muted);
|
|
2741
|
+
}
|
|
2742
|
+
.thread-ui-shell .thread-composer-form {
|
|
2743
|
+
border-color: var(--theme-border);
|
|
2744
|
+
background: var(--theme-surface);
|
|
2745
|
+
}
|
|
2746
|
+
.thread-ui-shell .thread-composer-toolbar,
|
|
2747
|
+
.thread-ui-shell .thread-composer-input,
|
|
2748
|
+
.thread-ui-shell .thread-composer-menu {
|
|
2749
|
+
border-color: var(--theme-border);
|
|
2750
|
+
background: var(--theme-panel);
|
|
2751
|
+
color: var(--theme-fg);
|
|
2752
|
+
}
|
|
2753
|
+
.thread-ui-shell .thread-composer-toolbar {
|
|
2754
|
+
border-radius: 0;
|
|
2755
|
+
border: 0;
|
|
2756
|
+
background: transparent;
|
|
2757
|
+
box-shadow: none;
|
|
2758
|
+
order: 2;
|
|
2759
|
+
min-height: 2.75rem;
|
|
2760
|
+
padding: 0.25rem 0.75rem 0.65rem;
|
|
2761
|
+
flex-wrap: wrap;
|
|
2762
|
+
align-items: center;
|
|
2763
|
+
}
|
|
2764
|
+
.thread-ui-shell .thread-composer-prompt-region {
|
|
2765
|
+
order: 1;
|
|
2766
|
+
}
|
|
2767
|
+
.thread-ui-shell .thread-composer-input {
|
|
2768
|
+
position: relative;
|
|
2769
|
+
min-height: 5.25rem !important;
|
|
2770
|
+
max-height: 12rem !important;
|
|
2771
|
+
border: 0;
|
|
2772
|
+
border-radius: 0;
|
|
2773
|
+
background: transparent !important;
|
|
2774
|
+
box-shadow: none;
|
|
2775
|
+
overflow: visible;
|
|
2776
|
+
padding-top: 0.7rem;
|
|
2777
|
+
padding-bottom: 0.45rem;
|
|
2778
|
+
}
|
|
2779
|
+
.thread-ui-shell .thread-composer-input:focus-within {
|
|
2780
|
+
border-color: transparent;
|
|
2781
|
+
box-shadow: none;
|
|
2782
|
+
}
|
|
2783
|
+
.thread-ui-shell .thread-composer-input [contenteditable],
|
|
2784
|
+
.thread-ui-shell .thread-composer-input textarea {
|
|
2785
|
+
display: block;
|
|
2786
|
+
width: 100%;
|
|
2787
|
+
min-width: 0;
|
|
2788
|
+
background: transparent !important;
|
|
2789
|
+
color: var(--theme-fg);
|
|
2790
|
+
font-size: 1rem;
|
|
2791
|
+
line-height: 1.55;
|
|
2792
|
+
}
|
|
2793
|
+
.thread-ui-shell .thread-composer-input [contenteditable] {
|
|
2794
|
+
min-height: 4.15rem !important;
|
|
2795
|
+
max-height: 9.5rem !important;
|
|
2796
|
+
overflow-y: auto;
|
|
2797
|
+
}
|
|
2798
|
+
.thread-ui-shell .thread-composer-input textarea {
|
|
2799
|
+
min-height: 4.15rem !important;
|
|
2800
|
+
max-height: 9.5rem !important;
|
|
2801
|
+
overflow-y: auto;
|
|
2802
|
+
resize: none;
|
|
2803
|
+
}
|
|
2804
|
+
.thread-ui-shell .thread-composer-shell {
|
|
2805
|
+
border: 1px solid var(--theme-border);
|
|
2806
|
+
background: #fbfcfd;
|
|
2807
|
+
box-shadow: 0 4px 18px oklch(0.22 0.024 255 / 0.04);
|
|
2808
|
+
}
|
|
2809
|
+
.thread-ui-shell .thread-composer-send-button {
|
|
2810
|
+
flex: 0 0 auto;
|
|
2811
|
+
}
|
|
2812
|
+
.thread-ui-shell .thread-goal-compose-card {
|
|
2813
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 18%, var(--theme-border));
|
|
2814
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 7%, var(--theme-panel));
|
|
2815
|
+
color: var(--theme-fg-soft);
|
|
2816
|
+
box-shadow: 0 8px 18px rgb(15 23 42 / 0.05);
|
|
2817
|
+
}
|
|
2818
|
+
.thread-ui-shell .thread-goal-compose-label {
|
|
2819
|
+
color: color-mix(in oklch, var(--theme-accent-solid) 68%, var(--theme-fg));
|
|
2820
|
+
}
|
|
2821
|
+
.thread-ui-shell .thread-goal-compose-field {
|
|
2822
|
+
color: var(--theme-fg-soft);
|
|
2823
|
+
}
|
|
2824
|
+
.thread-ui-shell .thread-goal-compose-input {
|
|
2825
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 20%, var(--theme-border));
|
|
2826
|
+
background: var(--theme-panel);
|
|
2827
|
+
color: var(--theme-fg);
|
|
2828
|
+
}
|
|
2829
|
+
.thread-ui-shell .thread-goal-compose-input::placeholder {
|
|
2830
|
+
color: var(--theme-fg-muted);
|
|
2831
|
+
}
|
|
2832
|
+
.thread-ui-shell .thread-goal-compose-input:focus {
|
|
2833
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 48%, var(--theme-border));
|
|
2834
|
+
}
|
|
2835
|
+
.thread-ui-shell .thread-goal-compose-cancel {
|
|
2836
|
+
border-color: var(--theme-border);
|
|
2837
|
+
background: var(--theme-surface-strong);
|
|
2838
|
+
color: var(--theme-fg-soft);
|
|
2839
|
+
}
|
|
2840
|
+
.thread-ui-shell .thread-goal-compose-cancel:hover {
|
|
2841
|
+
background: var(--theme-hover);
|
|
2842
|
+
color: var(--theme-fg);
|
|
2843
|
+
}
|
|
2844
|
+
.thread-ui-shell .thread-goal-compose-error {
|
|
2845
|
+
color: rgb(190 18 60);
|
|
2846
|
+
}
|
|
2847
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-card,
|
|
2848
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-card,
|
|
2849
|
+
.thread-ui-shell.dark .thread-goal-compose-card {
|
|
2850
|
+
border-color: rgb(125 211 252 / 0.25);
|
|
2851
|
+
background: rgb(125 211 252 / 0.07);
|
|
2852
|
+
color: rgb(226 232 240);
|
|
2853
|
+
box-shadow: 0 8px 18px rgb(0 0 0 / 0.18);
|
|
2854
|
+
}
|
|
2855
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-label,
|
|
2856
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-label,
|
|
2857
|
+
.thread-ui-shell.dark .thread-goal-compose-label {
|
|
2858
|
+
color: rgb(224 242 254 / 0.9);
|
|
2859
|
+
}
|
|
2860
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-field,
|
|
2861
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-field,
|
|
2862
|
+
.thread-ui-shell.dark .thread-goal-compose-field {
|
|
2863
|
+
color: rgb(203 213 225);
|
|
2864
|
+
}
|
|
2865
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-input,
|
|
2866
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-input,
|
|
2867
|
+
.thread-ui-shell.dark .thread-goal-compose-input {
|
|
2868
|
+
border-color: rgb(125 211 252 / 0.25);
|
|
2869
|
+
background: rgb(2 6 23 / 0.46);
|
|
2870
|
+
color: rgb(241 245 249);
|
|
2871
|
+
}
|
|
2872
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-cancel,
|
|
2873
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-cancel,
|
|
2874
|
+
.thread-ui-shell.dark .thread-goal-compose-cancel {
|
|
2875
|
+
border-color: #343b48;
|
|
2876
|
+
background: #1d222c;
|
|
2877
|
+
color: rgb(203 213 225);
|
|
2878
|
+
}
|
|
2879
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-cancel:hover,
|
|
2880
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-cancel:hover,
|
|
2881
|
+
.thread-ui-shell.dark .thread-goal-compose-cancel:hover {
|
|
2882
|
+
background: #222733;
|
|
2883
|
+
color: rgb(241 245 249);
|
|
2884
|
+
}
|
|
2885
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-error,
|
|
2886
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-error,
|
|
2887
|
+
.thread-ui-shell.dark .thread-goal-compose-error {
|
|
2888
|
+
color: rgb(254 205 211);
|
|
2889
|
+
}
|
|
2890
|
+
@media (min-width: 640px) {
|
|
2891
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-shell {
|
|
2892
|
+
border-radius: 16px;
|
|
2893
|
+
}
|
|
2894
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input {
|
|
2895
|
+
min-height: 5.75rem !important;
|
|
2896
|
+
max-height: 12.5rem !important;
|
|
2897
|
+
padding-top: 0.9rem;
|
|
2898
|
+
}
|
|
2899
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input [contenteditable],
|
|
2900
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input textarea {
|
|
2901
|
+
min-height: 4.5rem !important;
|
|
2902
|
+
max-height: 10rem !important;
|
|
2903
|
+
font-size: 0.875rem;
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-form {
|
|
2907
|
+
padding: 0.5rem 1rem 0.75rem;
|
|
2908
|
+
}
|
|
2909
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-shell,
|
|
2910
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-shell,
|
|
2911
|
+
.thread-ui-shell.dark .thread-composer-shell {
|
|
2912
|
+
border-color: #303642;
|
|
2913
|
+
background: #181b23;
|
|
2914
|
+
box-shadow: 0 8px 24px oklch(0 0 0 / 0.22);
|
|
2915
|
+
}
|
|
2916
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-toolbar,
|
|
2917
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-toolbar,
|
|
2918
|
+
.thread-ui-shell.dark .thread-composer-toolbar,
|
|
2919
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input,
|
|
2920
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input,
|
|
2921
|
+
.thread-ui-shell.dark .thread-composer-input {
|
|
2922
|
+
border-color: #303642 !important;
|
|
2923
|
+
background: transparent !important;
|
|
2924
|
+
color: rgb(241 245 249) !important;
|
|
2925
|
+
box-shadow: none !important;
|
|
2926
|
+
}
|
|
2927
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input [contenteditable],
|
|
2928
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input [contenteditable],
|
|
2929
|
+
.thread-ui-shell.dark .thread-composer-input [contenteditable],
|
|
2930
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input textarea,
|
|
2931
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input textarea,
|
|
2932
|
+
.thread-ui-shell.dark .thread-composer-input textarea {
|
|
2933
|
+
background: transparent !important;
|
|
2934
|
+
color: rgb(241 245 249) !important;
|
|
2935
|
+
}
|
|
2936
|
+
.thread-ui-shell .thread-graph-composer-form {
|
|
2937
|
+
border-color: var(--theme-border);
|
|
2938
|
+
background: var(--theme-surface);
|
|
2939
|
+
}
|
|
2940
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-form,
|
|
2941
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-form,
|
|
2942
|
+
.thread-ui-shell.dark .thread-graph-composer-form {
|
|
2943
|
+
border-color: var(--theme-border);
|
|
2944
|
+
background: var(--theme-surface);
|
|
2945
|
+
}
|
|
2946
|
+
.thread-ui-shell .thread-graph-composer-shell {
|
|
2947
|
+
border: 1px solid var(--theme-border);
|
|
2948
|
+
background: var(--theme-panel);
|
|
2949
|
+
box-shadow: 0 4px 18px oklch(0.22 0.024 255 / 0.04);
|
|
2950
|
+
overflow: visible !important;
|
|
2951
|
+
}
|
|
2952
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-shell,
|
|
2953
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-shell,
|
|
2954
|
+
.thread-ui-shell.dark .thread-graph-composer-shell {
|
|
2955
|
+
border-color: var(--theme-border-strong);
|
|
2956
|
+
background: var(--theme-panel);
|
|
2957
|
+
box-shadow: 0 8px 24px oklch(0 0 0 / 0.22);
|
|
2958
|
+
}
|
|
2959
|
+
.thread-ui-shell .thread-graph-composer-input-group {
|
|
2960
|
+
order: 1;
|
|
2961
|
+
display: flex;
|
|
2962
|
+
flex-direction: column;
|
|
2963
|
+
align-items: stretch;
|
|
2964
|
+
height: auto;
|
|
2965
|
+
min-height: 0;
|
|
2966
|
+
color: rgb(30 41 59);
|
|
2967
|
+
overflow: visible !important;
|
|
2968
|
+
}
|
|
2969
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input-group,
|
|
2970
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input-group,
|
|
2971
|
+
.thread-ui-shell.dark .thread-graph-composer-input-group {
|
|
2972
|
+
color: rgb(241 245 249);
|
|
2973
|
+
}
|
|
2974
|
+
.thread-ui-shell .thread-graph-composer-prompt-region {
|
|
2975
|
+
order: 1;
|
|
2976
|
+
}
|
|
2977
|
+
.thread-ui-shell .thread-graph-composer-input {
|
|
2978
|
+
position: relative;
|
|
2979
|
+
border: 0;
|
|
2980
|
+
background: transparent;
|
|
2981
|
+
color: rgb(30 41 59);
|
|
2982
|
+
box-shadow: none;
|
|
2983
|
+
overflow-y: auto;
|
|
2984
|
+
}
|
|
2985
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input,
|
|
2986
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input,
|
|
2987
|
+
.thread-ui-shell.dark .thread-graph-composer-input {
|
|
2988
|
+
color: rgb(241 245 249);
|
|
2989
|
+
}
|
|
2990
|
+
.thread-ui-shell .thread-graph-composer-input [contenteditable] {
|
|
2991
|
+
display: block;
|
|
2992
|
+
width: 100%;
|
|
2993
|
+
min-width: 0;
|
|
2994
|
+
overflow-y: auto;
|
|
2995
|
+
background: transparent;
|
|
2996
|
+
color: inherit;
|
|
2997
|
+
}
|
|
2998
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-chip,
|
|
2999
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-chip {
|
|
3000
|
+
box-sizing: border-box;
|
|
3001
|
+
flex: 0 0 auto;
|
|
3002
|
+
width: max-content !important;
|
|
3003
|
+
max-width: min(100%, 7.25rem) !important;
|
|
3004
|
+
vertical-align: middle;
|
|
3005
|
+
}
|
|
3006
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-chip-photo,
|
|
3007
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-chip-photo {
|
|
3008
|
+
display: inline-flex !important;
|
|
3009
|
+
flex-direction: column;
|
|
3010
|
+
align-items: flex-start;
|
|
3011
|
+
gap: 0.25rem;
|
|
3012
|
+
padding: 0.35rem !important;
|
|
3013
|
+
}
|
|
3014
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-thumb,
|
|
3015
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-thumb {
|
|
3016
|
+
display: block;
|
|
3017
|
+
width: 5.75rem !important;
|
|
3018
|
+
height: 3.75rem !important;
|
|
3019
|
+
max-width: 100%;
|
|
3020
|
+
border-radius: 0.6rem !important;
|
|
3021
|
+
object-fit: cover;
|
|
3022
|
+
}
|
|
3023
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3024
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-caption {
|
|
3025
|
+
display: block !important;
|
|
3026
|
+
width: 100%;
|
|
3027
|
+
max-width: 5.75rem !important;
|
|
3028
|
+
margin-left: 0 !important;
|
|
3029
|
+
overflow: hidden;
|
|
3030
|
+
color: rgb(3 105 161);
|
|
3031
|
+
text-overflow: ellipsis;
|
|
3032
|
+
white-space: nowrap;
|
|
3033
|
+
}
|
|
3034
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3035
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3036
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3037
|
+
.thread-ui-shell.dark .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3038
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input .thread-composer-attachment-caption,
|
|
3039
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input .thread-composer-attachment-caption,
|
|
3040
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-composer-input .thread-composer-attachment-caption,
|
|
3041
|
+
.thread-ui-shell.dark .thread-composer-input .thread-composer-attachment-caption {
|
|
3042
|
+
color: rgb(125 211 252);
|
|
3043
|
+
}
|
|
3044
|
+
.thread-ui-shell .thread-graph-composer-toolbar {
|
|
3045
|
+
order: 2;
|
|
3046
|
+
width: 100%;
|
|
3047
|
+
min-height: 2.75rem;
|
|
3048
|
+
flex-wrap: wrap;
|
|
3049
|
+
justify-content: flex-start;
|
|
3050
|
+
gap: 0.5rem;
|
|
3051
|
+
border: 0;
|
|
3052
|
+
background: transparent;
|
|
3053
|
+
padding: 0 0.5rem 0.5rem;
|
|
3054
|
+
color: rgb(100 116 139);
|
|
3055
|
+
box-shadow: none;
|
|
3056
|
+
overflow: visible !important;
|
|
3057
|
+
}
|
|
3058
|
+
@media (min-width: 640px) {
|
|
3059
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-composer-toolbar {
|
|
3060
|
+
flex-wrap: nowrap;
|
|
3061
|
+
padding: 0 0.75rem 0.75rem;
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-toolbar,
|
|
3065
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-toolbar,
|
|
3066
|
+
.thread-ui-shell.dark .thread-graph-composer-toolbar {
|
|
3067
|
+
color: rgb(148 163 184);
|
|
3068
|
+
}
|
|
3069
|
+
.thread-ui-shell .thread-graph-composer-send-button {
|
|
3070
|
+
flex: 0 0 auto;
|
|
3071
|
+
}
|
|
3072
|
+
.thread-ui-shell .thread-composer-icon-button,
|
|
3073
|
+
.thread-ui-shell .thread-composer-inline-toggle,
|
|
3074
|
+
.thread-ui-shell .thread-composer-chip-button,
|
|
3075
|
+
.thread-ui-shell .thread-composer-menu-item,
|
|
3076
|
+
.thread-ui-shell .thread-composer-panel-button,
|
|
3077
|
+
.thread-ui-shell .thread-graph-composer-icon-button,
|
|
3078
|
+
.thread-ui-shell .thread-graph-composer-inline-toggle,
|
|
3079
|
+
.thread-ui-shell .thread-graph-composer-chip-button,
|
|
3080
|
+
.thread-ui-shell .thread-graph-composer-menu-item,
|
|
3081
|
+
.thread-ui-shell .thread-graph-composer-panel-button {
|
|
3082
|
+
border-color: var(--theme-border) !important;
|
|
3083
|
+
background: transparent !important;
|
|
3084
|
+
color: var(--theme-fg-soft) !important;
|
|
3085
|
+
}
|
|
3086
|
+
.thread-ui-shell .thread-composer-icon-button:hover,
|
|
3087
|
+
.thread-ui-shell .thread-composer-inline-toggle:hover,
|
|
3088
|
+
.thread-ui-shell .thread-composer-chip-button:hover,
|
|
3089
|
+
.thread-ui-shell .thread-composer-menu-item:hover,
|
|
3090
|
+
.thread-ui-shell .thread-composer-panel-button:hover,
|
|
3091
|
+
.thread-ui-shell .thread-graph-composer-icon-button:hover,
|
|
3092
|
+
.thread-ui-shell .thread-graph-composer-inline-toggle:hover,
|
|
3093
|
+
.thread-ui-shell .thread-graph-composer-chip-button:hover,
|
|
3094
|
+
.thread-ui-shell .thread-graph-composer-menu-item:hover,
|
|
3095
|
+
.thread-ui-shell .thread-graph-composer-panel-button:hover {
|
|
3096
|
+
background: var(--theme-hover) !important;
|
|
3097
|
+
color: var(--theme-fg) !important;
|
|
3098
|
+
}
|
|
3099
|
+
.thread-ui-shell .thread-composer-icon-button,
|
|
3100
|
+
.thread-ui-shell .thread-graph-composer-icon-button {
|
|
3101
|
+
background: var(--theme-muted) !important;
|
|
3102
|
+
}
|
|
3103
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-icon-button,
|
|
3104
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-icon-button,
|
|
3105
|
+
.thread-ui-shell.dark .thread-composer-icon-button,
|
|
3106
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-icon-button,
|
|
3107
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-icon-button,
|
|
3108
|
+
.thread-ui-shell.dark .thread-graph-composer-icon-button {
|
|
3109
|
+
border-color: #303642 !important;
|
|
3110
|
+
background: #222733 !important;
|
|
3111
|
+
color: rgb(203 213 225) !important;
|
|
3112
|
+
}
|
|
3113
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-icon-button:hover,
|
|
3114
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-icon-button:hover,
|
|
3115
|
+
.thread-ui-shell.dark .thread-composer-icon-button:hover,
|
|
3116
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-icon-button:hover,
|
|
3117
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-icon-button:hover,
|
|
3118
|
+
.thread-ui-shell.dark .thread-graph-composer-icon-button:hover {
|
|
3119
|
+
background: #2b313d !important;
|
|
3120
|
+
color: rgb(241 245 249) !important;
|
|
3121
|
+
}
|
|
3122
|
+
.thread-ui-shell .thread-composer-menu,
|
|
3123
|
+
.thread-ui-shell .thread-graph-composer-menu {
|
|
3124
|
+
border-radius: 12px;
|
|
3125
|
+
border-color: var(--theme-border) !important;
|
|
3126
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent) !important;
|
|
3127
|
+
color: var(--theme-fg) !important;
|
|
3128
|
+
box-shadow: 0 16px 38px oklch(0.22 0.024 255 / 0.16);
|
|
3129
|
+
z-index: 80;
|
|
3130
|
+
}
|
|
3131
|
+
.thread-ui-shell [data-composer-menu-surface=true] {
|
|
3132
|
+
border-color: var(--theme-border) !important;
|
|
3133
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent) !important;
|
|
3134
|
+
color: var(--theme-fg) !important;
|
|
3135
|
+
box-shadow: 0 16px 38px oklch(0.22 0.024 255 / 0.16) !important;
|
|
3136
|
+
}
|
|
3137
|
+
.thread-ui-shell .thread-graph-composer-menu {
|
|
3138
|
+
max-height: min(27rem, calc(100svh - 8rem));
|
|
3139
|
+
overflow: auto !important;
|
|
3140
|
+
}
|
|
3141
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select) {
|
|
3142
|
+
border-color: var(--theme-border) !important;
|
|
3143
|
+
background: var(--theme-panel) !important;
|
|
3144
|
+
color: var(--theme-fg) !important;
|
|
3145
|
+
}
|
|
3146
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea)::placeholder {
|
|
3147
|
+
color: var(--theme-fg-muted) !important;
|
|
3148
|
+
}
|
|
3149
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select):focus {
|
|
3150
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 38%, var(--theme-border)) !important;
|
|
3151
|
+
}
|
|
3152
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.border-sky-300\\/35, .border-emerald-400\\/45) {
|
|
3153
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 24%, var(--theme-border)) !important;
|
|
3154
|
+
}
|
|
3155
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.bg-sky-300\\/10, .bg-sky-300\\/12, .bg-emerald-400\\/12) {
|
|
3156
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 8%, var(--theme-panel)) !important;
|
|
3157
|
+
}
|
|
3158
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200) {
|
|
3159
|
+
color: rgb(190 18 60) !important;
|
|
3160
|
+
}
|
|
3161
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60) {
|
|
3162
|
+
color: rgb(146 64 14) !important;
|
|
3163
|
+
}
|
|
3164
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-menu,
|
|
3165
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-menu,
|
|
3166
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-composer-menu,
|
|
3167
|
+
.thread-ui-shell.dark .thread-composer-menu,
|
|
3168
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-menu,
|
|
3169
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-menu,
|
|
3170
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-graph-composer-menu,
|
|
3171
|
+
.thread-ui-shell.dark .thread-graph-composer-menu,
|
|
3172
|
+
.thread-ui-shell.thread-ui-theme-dark [data-composer-menu-surface=true],
|
|
3173
|
+
.thread-ui-shell[data-theme-effective=dark] [data-composer-menu-surface=true],
|
|
3174
|
+
:root[data-theme-effective=dark] .thread-ui-shell [data-composer-menu-surface=true],
|
|
3175
|
+
.thread-ui-shell.dark [data-composer-menu-surface=true] {
|
|
3176
|
+
border-color: #303642 !important;
|
|
3177
|
+
background: rgb(23 26 34 / 0.96) !important;
|
|
3178
|
+
color: rgb(241 245 249) !important;
|
|
3179
|
+
box-shadow: 0 18px 48px rgb(0 0 0 / 0.28) !important;
|
|
3180
|
+
}
|
|
3181
|
+
.thread-ui-shell.thread-ui-theme-dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select),
|
|
3182
|
+
.thread-ui-shell[data-theme-effective=dark] :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select),
|
|
3183
|
+
:root[data-theme-effective=dark] .thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select),
|
|
3184
|
+
.thread-ui-shell.dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select) {
|
|
3185
|
+
border-color: #303642 !important;
|
|
3186
|
+
background: #11141a !important;
|
|
3187
|
+
color: rgb(241 245 249) !important;
|
|
3188
|
+
}
|
|
3189
|
+
.thread-ui-shell.thread-ui-theme-dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200),
|
|
3190
|
+
.thread-ui-shell[data-theme-effective=dark] :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200),
|
|
3191
|
+
:root[data-theme-effective=dark] .thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200),
|
|
3192
|
+
.thread-ui-shell.dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200) {
|
|
3193
|
+
color: rgb(254 205 211) !important;
|
|
3194
|
+
}
|
|
3195
|
+
.thread-ui-shell.thread-ui-theme-dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60),
|
|
3196
|
+
.thread-ui-shell[data-theme-effective=dark] :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60),
|
|
3197
|
+
:root[data-theme-effective=dark] .thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60),
|
|
3198
|
+
.thread-ui-shell.dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-amber-100\\/85, .text-amber-100\\/60) {
|
|
3199
|
+
color: rgb(253 230 138) !important;
|
|
3200
|
+
}
|
|
3201
|
+
.thread-ui-shell .thread-composer-plan-toggle-active,
|
|
3202
|
+
.thread-ui-shell .thread-graph-composer-plan-toggle-active {
|
|
3203
|
+
background: var(--theme-accent-soft);
|
|
3204
|
+
color: var(--theme-accent-strong);
|
|
3205
|
+
}
|
|
3206
|
+
.thread-ui-shell .thread-jump-latest-badge {
|
|
3207
|
+
border-color: var(--theme-border);
|
|
3208
|
+
background: var(--theme-panel);
|
|
3209
|
+
color: var(--theme-fg-muted);
|
|
3210
|
+
}
|
|
3211
|
+
.thread-ui-shell .ui-action-primary {
|
|
3212
|
+
background: var(--theme-accent-solid);
|
|
3213
|
+
color: var(--theme-accent-solid-fg);
|
|
3214
|
+
}
|
|
3215
|
+
.thread-ui-shell .ui-action-primary:hover {
|
|
3216
|
+
background: var(--theme-accent-solid-hover);
|
|
3217
|
+
}
|
|
3218
|
+
.thread-ui-shell .ui-action-info {
|
|
3219
|
+
background: oklch(0.46 0.1 235);
|
|
3220
|
+
color: oklch(0.98 0.005 235);
|
|
3221
|
+
}
|
|
3222
|
+
.thread-ui-shell .ui-action-danger {
|
|
3223
|
+
background: oklch(0.56 0.16 25);
|
|
3224
|
+
color: oklch(0.98 0.005 25);
|
|
3225
|
+
}
|
|
3226
|
+
.thread-ui-shell .thread-composer-send-button.ui-action-danger,
|
|
3227
|
+
.thread-ui-shell .thread-graph-composer-send-button.ui-action-danger {
|
|
3228
|
+
border: 1px solid var(--theme-border) !important;
|
|
3229
|
+
background: var(--theme-muted) !important;
|
|
3230
|
+
color: var(--theme-fg-soft) !important;
|
|
3231
|
+
}
|
|
3232
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-send-button.ui-action-danger,
|
|
3233
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-send-button.ui-action-danger,
|
|
3234
|
+
.thread-ui-shell.dark .thread-composer-send-button.ui-action-danger,
|
|
3235
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-send-button.ui-action-danger,
|
|
3236
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-send-button.ui-action-danger,
|
|
3237
|
+
.thread-ui-shell.dark .thread-graph-composer-send-button.ui-action-danger {
|
|
3238
|
+
border-color: #303642 !important;
|
|
3239
|
+
background: #222733 !important;
|
|
3240
|
+
color: rgb(241 245 249) !important;
|
|
3241
|
+
}
|
|
3242
|
+
.thread-ui-shell .thread-composer-send-button.ui-action-danger:hover,
|
|
3243
|
+
.thread-ui-shell .thread-graph-composer-send-button.ui-action-danger:hover {
|
|
3244
|
+
background: var(--theme-hover) !important;
|
|
3245
|
+
color: var(--theme-fg) !important;
|
|
3246
|
+
}
|
|
3247
|
+
.thread-ui-shell .thread-empty-surface,
|
|
3248
|
+
.thread-ui-shell .timeline-pending-card,
|
|
3249
|
+
.thread-ui-shell .timeline-note-card,
|
|
3250
|
+
.thread-ui-shell .timeline-activity-card,
|
|
3251
|
+
.thread-ui-shell .timeline-live-plan-card,
|
|
3252
|
+
.thread-ui-shell .timeline-question-section,
|
|
3253
|
+
.thread-ui-shell .timeline-live-plan-step,
|
|
3254
|
+
.thread-ui-shell .timeline-detail-row {
|
|
3255
|
+
border-color: var(--theme-border);
|
|
3256
|
+
background: var(--theme-panel);
|
|
3257
|
+
color: var(--theme-fg);
|
|
3258
|
+
}
|
|
3259
|
+
.thread-ui-shell .prose,
|
|
3260
|
+
.thread-ui-shell .prose :where(p, li, strong, code, pre, blockquote) {
|
|
3261
|
+
color: inherit;
|
|
3262
|
+
}
|
|
3263
|
+
.thread-ui-shell .prose img {
|
|
3264
|
+
max-width: min(28rem, 100%);
|
|
3265
|
+
height: auto;
|
|
3266
|
+
border-radius: 10px;
|
|
3267
|
+
border: 1px solid var(--theme-border);
|
|
3268
|
+
box-shadow: 0 12px 35px oklch(0.22 0.024 255 / 0.14);
|
|
3269
|
+
margin-top: 0.75rem;
|
|
3270
|
+
margin-bottom: 0.75rem;
|
|
3271
|
+
}
|
|
3272
|
+
.thread-ui-shell .thread-graph-plan-card {
|
|
3273
|
+
border-color: rgb(42 47 58);
|
|
3274
|
+
background: #1b1f29;
|
|
3275
|
+
color: rgb(241 245 249);
|
|
3276
|
+
box-shadow: none;
|
|
3277
|
+
}
|
|
3278
|
+
.thread-ui-shell .thread-graph-plan-step {
|
|
3279
|
+
border-color: rgb(48 54 66);
|
|
3280
|
+
background: #181b23;
|
|
3281
|
+
color: rgb(241 245 249);
|
|
3282
|
+
}
|
|
3283
|
+
.thread-ui-shell .thread-graph-plan-explanation {
|
|
3284
|
+
color: rgb(148 163 184);
|
|
3285
|
+
}
|
|
3286
|
+
.thread-ui-shell .thread-graph-plan-badge {
|
|
3287
|
+
border-color: transparent;
|
|
3288
|
+
background: rgb(56 189 248 / 0.12);
|
|
3289
|
+
color: rgb(186 230 253);
|
|
3290
|
+
box-shadow: none;
|
|
3291
|
+
text-transform: uppercase;
|
|
3292
|
+
letter-spacing: 0.16em;
|
|
3293
|
+
}
|
|
3294
|
+
.thread-ui-shell .thread-graph-plan-status {
|
|
3295
|
+
height: 1.75rem;
|
|
3296
|
+
min-width: 1.75rem;
|
|
3297
|
+
padding: 0;
|
|
3298
|
+
border-color: transparent;
|
|
3299
|
+
box-shadow: none;
|
|
3300
|
+
}
|
|
3301
|
+
.thread-ui-shell .thread-graph-plan-status.is-completed {
|
|
3302
|
+
background: rgb(52 211 153 / 0.14);
|
|
3303
|
+
color: rgb(167 243 208);
|
|
3304
|
+
}
|
|
3305
|
+
.thread-ui-shell .thread-graph-plan-status.is-running {
|
|
3306
|
+
background: rgb(56 189 248 / 0.14);
|
|
3307
|
+
color: rgb(186 230 253);
|
|
3308
|
+
}
|
|
3309
|
+
.thread-ui-shell .thread-graph-plan-status.is-pending,
|
|
3310
|
+
.thread-ui-shell .thread-graph-plan-status.is-unknown {
|
|
3311
|
+
background: #2b313d;
|
|
3312
|
+
color: rgb(203 213 225);
|
|
3313
|
+
}
|
|
3314
|
+
.thread-ui-shell .thread-graph-plan-status.is-failed {
|
|
3315
|
+
background: rgb(251 113 133 / 0.14);
|
|
3316
|
+
color: rgb(254 205 211);
|
|
3317
|
+
}
|
|
3318
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-card {
|
|
3319
|
+
border-color: rgb(226 232 240);
|
|
3320
|
+
background: rgb(248 250 252);
|
|
3321
|
+
color: rgb(15 23 42);
|
|
3322
|
+
}
|
|
3323
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step {
|
|
3324
|
+
border-color: rgb(226 232 240);
|
|
3325
|
+
background: rgb(255 255 255);
|
|
3326
|
+
color: rgb(15 23 42);
|
|
3327
|
+
}
|
|
3328
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-explanation {
|
|
3329
|
+
color: rgb(100 116 139);
|
|
3330
|
+
}
|
|
3331
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-badge {
|
|
3332
|
+
background: rgb(14 165 233 / 0.1);
|
|
3333
|
+
color: rgb(3 105 161);
|
|
3334
|
+
}
|
|
3335
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-completed {
|
|
3336
|
+
background: rgb(16 185 129 / 0.12);
|
|
3337
|
+
color: rgb(4 120 87);
|
|
3338
|
+
}
|
|
3339
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-running {
|
|
3340
|
+
background: rgb(14 165 233 / 0.12);
|
|
3341
|
+
color: rgb(3 105 161);
|
|
3342
|
+
}
|
|
3343
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-pending,
|
|
3344
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-unknown {
|
|
3345
|
+
background: rgb(226 232 240);
|
|
3346
|
+
color: rgb(71 85 105);
|
|
3347
|
+
}
|
|
3348
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-failed {
|
|
3349
|
+
background: rgb(244 63 94 / 0.12);
|
|
3350
|
+
color: rgb(190 18 60);
|
|
3351
|
+
}
|
|
3352
|
+
.thread-ui-shell .thread-graph-event {
|
|
3353
|
+
background: transparent !important;
|
|
3354
|
+
color: var(--theme-fg) !important;
|
|
3355
|
+
}
|
|
3356
|
+
.thread-ui-shell .thread-graph-event-card {
|
|
3357
|
+
background: var(--theme-surface) !important;
|
|
3358
|
+
color: var(--theme-fg) !important;
|
|
3359
|
+
}
|
|
3360
|
+
.thread-ui-shell .thread-graph-plan-card,
|
|
3361
|
+
.thread-ui-shell .thread-graph-plan-step,
|
|
3362
|
+
.thread-ui-shell .thread-graph-plan-step-text {
|
|
3363
|
+
color: rgb(241 245 249) !important;
|
|
3364
|
+
}
|
|
3365
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-card,
|
|
3366
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step,
|
|
3367
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step-text {
|
|
3368
|
+
color: rgb(15 23 42) !important;
|
|
3369
|
+
}
|
|
3370
|
+
.thread-export-dialog-root {
|
|
3371
|
+
--export-bg: rgb(248 250 252);
|
|
3372
|
+
--export-panel: rgb(255 255 255);
|
|
3373
|
+
--export-surface: rgb(241 245 249);
|
|
3374
|
+
--export-surface-strong: rgb(226 232 240);
|
|
3375
|
+
--export-border: rgb(203 213 225);
|
|
3376
|
+
--export-fg: rgb(15 23 42);
|
|
3377
|
+
--export-fg-soft: rgb(51 65 85);
|
|
3378
|
+
--export-fg-muted: rgb(100 116 139);
|
|
3379
|
+
--export-accent: rgb(217 119 6);
|
|
3380
|
+
--export-accent-bg: rgb(254 243 199);
|
|
3381
|
+
--export-accent-border: rgb(251 191 36);
|
|
3382
|
+
--export-shadow: rgb(15 23 42 / 0.16);
|
|
3383
|
+
color: var(--export-fg);
|
|
3384
|
+
}
|
|
3385
|
+
.thread-export-dialog-root.thread-ui-theme-dark,
|
|
3386
|
+
.thread-export-dialog-root[data-theme-effective=dark] {
|
|
3387
|
+
--export-bg: #12151c;
|
|
3388
|
+
--export-panel: #181d25;
|
|
3389
|
+
--export-surface: #1d222c;
|
|
3390
|
+
--export-surface-strong: #262c38;
|
|
3391
|
+
--export-border: #343b48;
|
|
3392
|
+
--export-fg: rgb(241 245 249);
|
|
3393
|
+
--export-fg-soft: rgb(203 213 225);
|
|
3394
|
+
--export-fg-muted: rgb(148 163 184);
|
|
3395
|
+
--export-accent: rgb(245 158 11);
|
|
3396
|
+
--export-accent-bg: rgb(245 158 11 / 0.16);
|
|
3397
|
+
--export-accent-border: rgb(245 158 11 / 0.34);
|
|
3398
|
+
--export-shadow: rgb(0 0 0 / 0.36);
|
|
3399
|
+
}
|
|
3400
|
+
.thread-export-dialog-backdrop {
|
|
3401
|
+
background: color-mix(in oklch, var(--export-bg) 68%, transparent);
|
|
3402
|
+
}
|
|
3403
|
+
.thread-export-dialog-root.thread-ui-theme-dark .thread-export-dialog-backdrop,
|
|
3404
|
+
.thread-export-dialog-root[data-theme-effective=dark] .thread-export-dialog-backdrop {
|
|
3405
|
+
background: rgb(2 6 23 / 0.74);
|
|
3406
|
+
}
|
|
3407
|
+
.thread-export-dialog-panel {
|
|
3408
|
+
border-color: var(--export-border);
|
|
3409
|
+
background: var(--export-panel);
|
|
3410
|
+
box-shadow: 0 26px 80px var(--export-shadow);
|
|
3411
|
+
}
|
|
3412
|
+
.thread-export-dialog-header,
|
|
3413
|
+
.thread-export-dialog-footer,
|
|
3414
|
+
.thread-export-dialog-box-header {
|
|
3415
|
+
border-color: var(--export-border);
|
|
3416
|
+
}
|
|
3417
|
+
.thread-export-dialog-title,
|
|
3418
|
+
.thread-export-dialog-strong,
|
|
3419
|
+
.thread-export-dialog-body-text {
|
|
3420
|
+
color: var(--export-fg);
|
|
3421
|
+
}
|
|
3422
|
+
.thread-export-dialog-subtitle,
|
|
3423
|
+
.thread-export-dialog-status-pill {
|
|
3424
|
+
color: var(--export-fg-muted);
|
|
3425
|
+
}
|
|
3426
|
+
.thread-export-dialog-icon-button,
|
|
3427
|
+
.thread-export-dialog-secondary-button,
|
|
3428
|
+
.thread-export-dialog-segment,
|
|
3429
|
+
.thread-export-dialog-box,
|
|
3430
|
+
.thread-export-dialog-status-pill {
|
|
3431
|
+
border-color: var(--export-border);
|
|
3432
|
+
background: var(--export-surface);
|
|
3433
|
+
}
|
|
3434
|
+
.thread-export-dialog-segment,
|
|
3435
|
+
.thread-export-dialog-box {
|
|
3436
|
+
background: color-mix(in oklch, var(--export-surface) 72%, var(--export-panel));
|
|
3437
|
+
}
|
|
3438
|
+
.thread-export-dialog-icon-button,
|
|
3439
|
+
.thread-export-dialog-secondary-button {
|
|
3440
|
+
color: var(--export-fg-soft);
|
|
3441
|
+
}
|
|
3442
|
+
.thread-export-dialog-icon-button:hover:not(:disabled),
|
|
3443
|
+
.thread-export-dialog-secondary-button:hover:not(:disabled),
|
|
3444
|
+
.thread-export-dialog-turn-row:hover {
|
|
3445
|
+
background: var(--export-surface-strong);
|
|
3446
|
+
color: var(--export-fg);
|
|
3447
|
+
}
|
|
3448
|
+
.thread-export-dialog-muted-action {
|
|
3449
|
+
color: var(--export-fg-muted);
|
|
3450
|
+
}
|
|
3451
|
+
.thread-export-dialog-muted-action:hover {
|
|
3452
|
+
color: var(--export-fg);
|
|
3453
|
+
}
|
|
3454
|
+
.thread-export-dialog-root .ui-status-warning {
|
|
3455
|
+
border: 1px solid var(--export-accent-border);
|
|
3456
|
+
background: var(--export-accent-bg);
|
|
3457
|
+
color: color-mix(in oklch, var(--export-accent) 72%, var(--export-fg));
|
|
3458
|
+
}
|
|
3459
|
+
.thread-export-dialog-checkbox {
|
|
3460
|
+
accent-color: var(--export-accent);
|
|
3461
|
+
}
|
|
3462
|
+
.thread-export-dialog-turn-row {
|
|
3463
|
+
color: var(--export-fg-soft);
|
|
3464
|
+
}
|
|
3465
|
+
`);function vt(...t){return $h(Nl(t))}var Su=Br("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Ar({asChild:t=!1,className:r,size:n,variant:a,...o}){const s=t?pl:"button";return e.jsx(s,{"data-slot":"button",className:vt(Su({variant:a,size:n,className:r})),...o})}function Tu({className:t,...r}){return e.jsx("div",{"data-slot":"input-group",role:"group",className:vt("group/input-group relative flex w-full min-w-0 items-center rounded-md border shadow-xs outline-none transition-[color,box-shadow]","h-9 has-[>textarea]:h-auto","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col",t),...r})}var Eu=Br("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*=size-])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem]","block-start":"order-first w-full justify-start px-3 pt-3","block-end":"order-last w-full justify-start px-3 pb-3"}},defaultVariants:{align:"inline-start"}});function zu({className:t,align:r="inline-start",...n}){return e.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":r,className:vt(Eu({align:r}),t),onClick:a=>{var s;if(a.target.closest("button"))return;const o=(s=a.currentTarget.parentElement)==null?void 0:s.querySelector('[data-slot="input-group-control"] [contenteditable="true"], [data-slot="input-group-control"] textarea, [data-slot="input-group-control"] input, [data-slot="input-group-control"]');o==null||o.focus()},...n})}var Lu=Br("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*=size-])]:size-3.5",sm:"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function rr({className:t,type:r="button",variant:n="ghost",size:a="xs",...o}){return e.jsx(Ar,{type:r,"data-size":a,variant:n,className:vt(Lu({size:a}),t),...o})}function Ru({className:t,...r}){return e.jsx("span",{className:vt("flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4",t),...r})}var Iu=180,on=[{value:"preToolUse",label:"PreToolUse",matcherHint:"Bash"},{value:"permissionRequest",label:"PermissionRequest",matcherHint:"Bash"},{value:"postToolUse",label:"PostToolUse",matcherHint:"Bash"},{value:"sessionStart",label:"SessionStart",matcherHint:"startup|resume"},{value:"userPromptSubmit",label:"UserPromptSubmit",matcherHint:""},{value:"stop",label:"Stop",matcherHint:""},{value:"preCompact",label:"PreCompact",matcherHint:""},{value:"postCompact",label:"PostCompact",matcherHint:""}],ra=`node -e "process.stdin.resume(); process.stdin.on('end', () => console.error('hook ran'))"`;function mo(t){return t.replace(/\u00a0/g," ")}function Pu(t){if(!t)return"";const r=document.createElement("div");return r.innerHTML=t,r.textContent??""}function Mu(t){return!!t.querySelector("[style], font")}function $u(t,r){if(!t)return[];const n=[],a=[...r].sort((l,d)=>d.placeholder.length-l.placeholder.length);let o=0,s=0;for(;o<t.length;){const l=a.find(h=>t.startsWith(h.placeholder,o));if(l){n.push({type:"attachment",key:`${l.clientId}-${o}`,attachment:l}),o+=l.placeholder.length;continue}let d=t.length;for(const h of a){const p=t.indexOf(h.placeholder,o);p!==-1&&p<d&&(d=p)}const c=t.slice(o,d);c&&(n.push({type:"text",key:`text-${s}`,text:c}),s+=1),o=d}return n}function Qr(t){return`${t.prompt}${t.attachments.map(r=>`${r.clientId}${r.kind}${r.placeholder}${r.originalName}`).join("")}`}function po(t){if(!t)return"Auto";switch(t){case"xhigh":return"xhigh";default:return t}}function _u(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"m4 5 2 2-2 2"}),e.jsx("path",{d:"M7.75 9.5h4.25"})]})}function Au(){return e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",children:e.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5"})})}function Du(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.75 2.5 5.25 13.5"}),e.jsx("path",{d:"M4.25 5.25h2.25"}),e.jsx("path",{d:"M9.5 10.75h2.25"})]})}function Bu(t){switch(t){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function Fu(t){switch(t){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function Gu(t){var r;return((r=on.find(n=>n.value===t))==null?void 0:r.label)??t}function Ou(t){var r;switch(t){case"cloudRequirements":return"Cloud";case"legacyManagedConfigFile":case"legacyManagedConfigMdm":return"Managed";case"sessionFlags":return"Session";default:return((r=t[0])==null?void 0:r.toUpperCase())+t.slice(1)}}function Hu(t){switch(t){case"managed":return"Managed";case"modified":return"Modified";case"trusted":return"Trusted";case"untrusted":return"Review"}}function Vu(t){switch(t){case"preToolUse":return"PreToolUse";case"permissionRequest":return"PermissionRequest";case"postToolUse":return"PostToolUse";case"preCompact":return"PreCompact";case"postCompact":return"PostCompact";case"sessionStart":return"SessionStart";case"userPromptSubmit":return"UserPromptSubmit";case"stop":return"Stop"}}function Uu(t){return t.source==="user"?"global":t.source==="project"?"project":null}function fo(t){const r=Uu(t);return!r||t.handlerType!=="command"||!t.command||t.isManaged?null:{scope:r,eventName:t.eventName,matcher:t.matcher,command:t.command,timeoutSec:t.timeoutSec,statusMessage:t.statusMessage}}function Wu(t){switch(t){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return t}}function qu(t){const r=t.trim();if(!r)return null;const n=Number(r);return!Number.isFinite(n)||n<=0?Number.NaN:Math.round(n*1e3)}function Ku(t){if(!t)return"";const r=t/1e3;return Number.isInteger(r)?String(r):String(Number(r.toFixed(1)))}function ya(t){return t.replace(/\r\n/g,`
|
|
3466
|
+
`)}function Xu(t){const r=t.trim();return/^[A-Za-z0-9_-]+$/.test(r)?r:null}function Zu(t){const n=ya(t).split(`
|
|
3467
|
+
`).map(o=>o.trim()).filter(Boolean).find(o=>/^\[mcp_servers\.[^\]]+\]$/.test(o));if(!n)return null;const a=n.match(/^\[mcp_servers\.([A-Za-z0-9_-]+)\]$/);return(a==null?void 0:a[1])??null}function Yu(t,r){return`[mcp_servers.${t}]
|
|
3468
|
+
url = ${JSON.stringify(r.trim())}
|
|
3469
|
+
`}function go(t,r,n){var f,m;const a=ya(t),o=`${ya(n).trim()}
|
|
3470
|
+
`,s=a.split(`
|
|
3471
|
+
`),l=`[mcp_servers.${r}]`,d=`[mcp_servers.${r}.`;let c=-1,h=s.length;for(let x=0;x<s.length;x+=1)if((((f=s[x])==null?void 0:f.trim())??"")===l){c=x;break}if(c>=0){for(let b=c+1;b<s.length;b+=1){const k=((m=s[b])==null?void 0:m.trim())??"";if(k.startsWith("[")&&!(k===l||k.startsWith(d))){h=b;break}}const x=s.slice(0,c).join(`
|
|
3472
|
+
`).trimEnd(),v=s.slice(h).join(`
|
|
3473
|
+
`).trim();return[x,o.trimEnd(),v].filter(Boolean).join(`
|
|
3474
|
+
|
|
3475
|
+
`).replace(/\n{3,}/g,`
|
|
3476
|
+
|
|
3477
|
+
`).concat(`
|
|
3478
|
+
`)}const p=a.trimEnd();return p?`${p}
|
|
3479
|
+
|
|
3480
|
+
${o}`:o}function li(t){return typeof t!="number"||Number.isNaN(t)?0:Math.max(0,Math.min(100,Math.round(t)))}function na(t){const r=t/1e3;return Number.isInteger(r)?`${r}k`:`${Number(r.toFixed(1))}k`}function Ju(t,r){if(!t)return"Select model";if((r==null?void 0:r.availability)!=="available"||typeof r.tokensInContextWindow!="number"||typeof r.modelContextWindow!="number")return`${t} · context unavailable`;const n=Math.max(r.tokensInContextWindow,0),a=Math.max(r.modelContextWindow,0),o=Math.max(a-n,0);return[t,`${na(n)} used / ${na(a)}`,`${na(o)} left`,`${li(r.remainingPercent)}% context left`].join(" · ")}function Qu({contextUsage:t}){const r=(t==null?void 0:t.availability)??"unavailable",n=li(t==null?void 0:t.remainingPercent);if(r!=="available")return null;const a=n<=20?"rgba(251,113,133,0.90)":n<=40?"rgba(252,211,77,0.85)":"rgba(125,211,252,0.80)";return e.jsx("span",{"aria-hidden":"true",className:"thread-context-progress-track pointer-events-none mt-0.5 block",children:e.jsx("span",{className:"thread-context-progress-fill block",style:{width:`${n}%`,backgroundColor:a}})})}function xo(t,r){const n=t.name.trim();if(n)return n;const a=r==="photo"?t.type.includes("png")?".png":t.type.includes("heic")?".heic":t.type.includes("heif")?".heif":t.type.includes("webp")?".webp":".jpg":"";return`${r==="photo"?"photo":"file"}-${Date.now()}${a}`}function bo(t){return t.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function aa(t){return t.type.startsWith("image/")?"photo":"file"}function ja(t,r){const n=[];if(t)for(const a of Array.from(t)){if(a.kind!=="file")continue;const o=a.getAsFile();o&&n.push(o)}return n.length>0?n:r?Array.from(r):[]}function vo(t,r){return ja(t,r).length>0}function nr(t){return t instanceof HTMLElement&&t.dataset.segmentType==="attachment"&&t.dataset.placeholder?t.dataset.placeholder:t.textContent??""}function em(t){const r=t.replace(/[\\/]+$/,"").trim();return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function ko(t){const r=t.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return r!=null&&r[1]?r[1]:em(t.originalName)}function tm(){return e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M3 4.5A1.75 1.75 0 0 1 4.75 2.75h6.5A1.75 1.75 0 0 1 13 4.5v4A1.75 1.75 0 0 1 11.25 10.25H8l-2.75 2v-2H4.75A1.75 1.75 0 0 1 3 8.5v-4Z"})})}function rm(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-3.5 w-3.5 fill-current",children:[e.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),e.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),e.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function sa(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M5.5 3.25h5"}),e.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function ar({label:t,tone:r="stone"}){const n=r==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-50":r==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-50":"border-stone-700/90 bg-stone-900/80 text-stone-100";return e.jsx("span",{className:`inline-flex min-w-[3rem] items-center justify-center rounded-full border px-2 py-1.5 text-[10px] font-medium tracking-[0.12em] ${n}`,children:t})}function Na({activeView:t,edgeToEdgeMobile:r=!1,busy:n=!1,settingsBusy:a=!1,compactBusy:o=!1,error:s,model:l=null,reasoningEffort:d=null,fastMode:c=!1,collaborationMode:h="default",modelOptions:p=[],contextUsage:f=null,capabilities:m=null,toolboxItems:x=null,hookCommandTemplates:v=null,mcpConfigFormat:b="none",followTail:k=!1,threadConnected:g=!0,shellAvailable:w=!0,disabled:T=!1,disabledPlaceholder:y,shellControlState:C=null,draftPrompt:z,draftAttachments:M,skillsState:I={status:"idle",data:null,error:null},mcpState:R={status:"idle",data:null,error:null},hooksState:K={status:"idle",data:null,error:null},goalState:Z={status:"idle",data:null,error:null},forkTurnOptionsState:D={status:"idle",data:null,error:null},onDraftChange:ce,onSubmit:W,onInterrupt:G,onCompact:Y,onOpenSkills:we,onOpenMcp:me,onOpenHooks:Re,onCreateHook:X,onUpdateHook:$,onTrustHook:F,onUntrustHook:P,onOpenGoal:O,onUpdateGoal:B,onOpenForkTurns:N,onForkLatest:E,onForkTurn:V,onReadProviderConfig:_,onWriteProviderConfig:ne,onToggleFollow:te,onUpdateSettings:je,onToggleView:ee,onShellCopy:pe,onShellControl:he,canInterrupt:Ce=!1}){var zs,Ls,Rs,Is,Ps,Ms,$s,_s,As,Ds,Bs,Fs,Gs;const[Fe,J]=i.useState({prompt:"",attachments:[]}),[U,re]=i.useState(()=>({prompt:z??"",attachments:M??[]})),[ae,Q]=i.useState(null),[xe,Ie]=i.useState("root"),[We,Ge]=i.useState("list"),[Ve,Qe]=i.useState("list"),[q,oe]=i.useState("project"),ve=i.useMemo(()=>({fast:(m==null?void 0:m.controls.performanceMode)??!1,compact:(m==null?void 0:m.turns.compact)??!1,goal:(m==null?void 0:m.controls.goals)??!1,fork:(m==null?void 0:m.branching.fork)??!1,skills:(m==null?void 0:m.management.skills)??!1,mcp:(m==null?void 0:m.management.mcpStatus)??!1,hooks:(m==null?void 0:m.management.hooks)??!1,hostConfigFiles:(m==null?void 0:m.management.hostConfigFiles)??!1,mcpConfigEditing:b==="codex-toml"&&!!(m!=null&&m.management.hostConfigFiles)&&!!_&&!!ne,hookTrust:(m==null?void 0:m.management.hookTrust)??!1,planMode:(m==null?void 0:m.controls.planMode)??!1}),[m,b,_,ne]),fe=i.useMemo(()=>(x??[]).filter(u=>{switch(u.action){case"fast":return ve.fast;case"compact":return ve.compact;case"goal":return ve.goal;case"fork":return ve.fork;case"skills":return ve.skills;case"mcp":return ve.mcp;case"hooks":return ve.hooks;default:return!1}}),[ve,x]),ue=i.useMemo(()=>{const u=new Map;for(const S of v??[])u.set(S.eventName,S.command);return u},[v]),ze=i.useMemo(()=>u=>ue.get(u)??ue.get("preToolUse")??ra,[ue]),_e=i.useMemo(()=>new Set([ra,...ue.values()]),[ue]),[Le,ct]=i.useState("preToolUse"),[ot,qe]=i.useState("Bash"),[ht,xt]=i.useState(ra),[St,kt]=i.useState("30"),[pt,mt]=i.useState("Running hook"),[yt,wt]=i.useState(null),[L,A]=i.useState(!1),[ie,be]=i.useState(null),[et,lt]=i.useState(null),[jt,it]=i.useState(""),[nt,It]=i.useState(""),[Nt,ye]=i.useState(""),[Oe,ft]=i.useState(null),[Ke,rt]=i.useState(!1),[Gt,bt]=i.useState(null),[jr,Tt]=i.useState(null),[Xt,j]=i.useState(null),[se,Pe]=i.useState(!1),[Ae,Ee]=i.useState(!1),[Ze,Ye]=i.useState(""),[Ne,Xe]=i.useState(!1),[Ot,Pt]=i.useState(null),[Mt,Ln]=i.useState(null),Ri=i.useRef(null),Ht=i.useRef(null),Za=i.useRef(null),Ya=i.useRef(null),cr=i.useRef(null),Ur=i.useRef([]),Et=i.useRef(null),Nr=i.useRef(new Map),Ja=i.useRef(""),Qa=i.useRef(0),$t=i.useRef(null),hr=i.useRef(U),Rn=i.useRef(Qr(U)),In=i.useRef(Rn.current),Me=t==="shell",Ii=w||Me,es=!!(Me&&(C!=null&&C.isMobileShell)),Pn=(C==null?void 0:C.promptLabel)??null,[Wr,ts]=i.useState({}),[rs,Cr]=i.useState(!1),[Mn,Pi]=i.useState(0),Lt=!Me&&z!==void 0&&M!==void 0&&typeof ce=="function",Mi=Lt?Qr({prompt:z??"",attachments:M??[]}):"",$n=i.useRef(Mi),tt=Lt?U.prompt:Fe.prompt,Zt=Lt?U.attachments:Fe.attachments,_n=Mt??h;i.useEffect(()=>()=>{An(hr.current),$t.current!==null&&window.clearTimeout($t.current)},[Lt,ce]),i.useEffect(()=>{if(!Lt){$n.current="";return}const u={prompt:z??"",attachments:M??[]},S=Qr(u);S!==$n.current&&($n.current=S,Rn.current=S,In.current=S,hr.current=u,$t.current!==null&&(window.clearTimeout($t.current),$t.current=null),re(u))},[M,z,Lt]),i.useEffect(()=>{Ln(null)},[h]),i.useEffect(()=>{ae!=="slash"&&(Ie("root"),Ge("list"),bt(null),Tt(null),Qe("list"),be(null),lt(null))},[ae]),i.useEffect(()=>{xe!=="mcp"&&(Ge("list"),bt(null),Tt(null))},[xe]),i.useEffect(()=>{xe!=="forkTurns"&&Pe(!1)},[xe]),i.useEffect(()=>{xe!=="hooks"&&(Qe("list"),be(null),lt(null))},[xe]),i.useEffect(()=>{const u=on.find(S=>S.value===Le);qe(S=>{const H=S.trim(),ge=new Set(on.map(ke=>ke.matcherHint).filter(Boolean));return H&&!ge.has(H)?S:(u==null?void 0:u.matcherHint)??""}),xt(S=>_e.has(S.trim())?ze(Le):S)},[ze,_e,Le,ue]),i.useEffect(()=>{if(!Xt)return;const u=window.setTimeout(()=>{j(S=>S===Xt?null:S)},1400);return()=>{window.clearTimeout(u)}},[Xt]);function An(u){if(!Lt||!ce)return;const S=Qr(u);S!==In.current&&(In.current=S,Rn.current=S,ce(()=>({prompt:u.prompt,attachments:u.attachments})))}function ns(u,S){if(Lt){if($t.current!==null&&(window.clearTimeout($t.current),$t.current=null),S==="immediate"){An(u);return}$t.current=window.setTimeout(()=>{$t.current=null,An(hr.current)},Iu)}}function as(u=hr.current){ns(u,"immediate")}function Yt(u,S="immediate"){if(Lt){const H=u(hr.current);hr.current=H,re(H),ns(H,S);return}J(H=>u(H))}function $i(u){Yt(S=>{if(typeof u=="function"){const H=u(S.prompt,S.attachments);return{prompt:H.prompt,attachments:H.attachments??S.attachments}}return{prompt:u,attachments:S.attachments}})}async function _i(u){try{await navigator.clipboard.writeText(`$${u}`),j(u)}catch{j(null)}}async function Ai(){if(E){Pe(!0);try{await E(),Q(null)}finally{Pe(!1)}}}async function Di(u){if(V){Pe(!0);try{await V(u),Q(null)}finally{Pe(!1)}}}async function Bi(){const u=tt.trim();if(!u){Pt("Goal objective cannot be empty.");return}const S=Ze.trim(),H=qu(S);if(S.length>0&&(H===null||!Number.isInteger(H)||H<=0)){Pt("Token budget must be a positive number in thousands.");return}if(!B){Pt("/goal is unavailable in this view.");return}Xe(!0),Pt(null);try{await B({objective:u,status:"active",tokenBudget:H}),Ye(""),Ee(!1),Yt(()=>({prompt:"",attachments:[]}))}catch(ge){Pt(ge instanceof Error?ge.message:"Unable to set goal.")}finally{Xe(!1)}}function Fi(){var u;Q(null),Ie("root"),Ee(!0),Ye(Ku((u=Z.data)==null?void 0:u.tokenBudget)),Pt(null),O==null||O(),requestAnimationFrame(()=>{var S;(S=Ht.current)==null||S.focus()})}function ss(){Ee(!1),Pt(null)}const Dn=i.useMemo(()=>p.find(u=>u.model===l)??null,[l,p]),os=Ju(l,f),Bn=(Dn==null?void 0:Dn.supportedReasoningEfforts)??[],ls=i.useMemo(()=>$u(tt,Zt),[Zt,tt]),Fn=i.useMemo(()=>Object.entries(Wr).sort(([u],[S])=>u.localeCompare(S)).map(([u,S])=>`${u}:${S}`).join("|"),[Wr]);async function Gn(){if(!ve.hostConfigFiles||!_)throw new Error("Provider config editing is unavailable for this thread.");const u=await _();return ft(u.path),u}async function is(u){if(!ve.hostConfigFiles||!ne)throw new Error("Provider config editing is unavailable for this thread.");const S=await ne(u);return ft(S.path),S}function Gi(u){switch(u.action){case"fast":return c?"On":"Off";case"compact":return o?"Busy":"Run";case"goal":return Ae?"Composing":Z.data?Wu(Z.data.status):"Open";case"fork":return n?"Idle only":"Open";case"skills":case"mcp":case"hooks":return"View";default:return""}}function Oi(u){switch(u.action){case"fast":return a;case"compact":return o||n;case"fork":return n||se;default:return!1}}function Hi(u){var ge;return`${u.action==="fast"&&c||u.action==="goal"&&(Ae||((ge=Z.data)==null?void 0:ge.status)==="active")?"ui-status-warning":Me?"thread-composer-menu-item":"thread-graph-composer-menu-item"} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`}function Vi(u,S){switch(S.stopPropagation(),u.action){case"fast":Kr({fastMode:!c});break;case"compact":Q(null),Y==null||Y();break;case"goal":Ae?(ss(),Q(null)):Fi();break;case"fork":Ie("fork");break;case"skills":Ie("skills"),we==null||we();break;case"mcp":Ie("mcp"),me==null||me();break;case"hooks":Ie("hooks"),Re==null||Re();break}}function Ui(){wt(null),oe("project"),ct("preToolUse"),qe("Bash"),xt(ze("preToolUse")),kt("30"),mt("Running hook")}function Wi(u){const S=fo(u);if(!S){be("Only command hooks in global or project hooks.json can be edited here.");return}wt(S),oe(S.scope),ct(S.eventName),qe(S.matcher??""),xt(S.command),kt(S.timeoutSec?String(S.timeoutSec):""),mt(S.statusMessage??""),be(null),lt(null),Qe("edit")}async function qi(){const u=Xu(jt),S=nt.trim();if(!u){bt("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(S)){bt("HTTP MCP URL must start with http:// or https://");return}rt(!0),bt(null),Tt(null);try{const H=await Gn(),ge=go(H.content,u,Yu(u,S));await is(ge),Tt("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Ge("list"),it(""),It(""),me==null||me()}catch(H){bt(H instanceof Error?H.message:"Unable to update provider config.")}finally{rt(!1)}}async function Ki(){rt(!0),bt(null),Tt(null);try{await Gn(),Nt.trim()||ye(`[mcp_servers.example_stdio]
|
|
3481
|
+
command = "npx"
|
|
3482
|
+
args = ["-y", "your-mcp-server"]
|
|
3483
|
+
`),Ge("stdio")}catch(u){bt(u instanceof Error?u.message:"Unable to load provider config.")}finally{rt(!1)}}async function Xi(){const u=Zu(Nt);if(!u){bt("The raw MCP block must start with a header like [mcp_servers.name].");return}rt(!0),bt(null),Tt(null);try{const S=await Gn(),H=go(S.content,u,Nt);await is(H),Tt("MCP entry written to provider config. Restart the backend if it does not appear immediately."),Ge("list"),me==null||me()}catch(S){bt(S instanceof Error?S.message:"Unable to update provider config.")}finally{rt(!1)}}async function Zi(){if(Ve==="edit"&&!$){be("Hook editing is unavailable in this view.");return}if(Ve!=="edit"&&!X){be("Hook editing is unavailable in this view.");return}if(Ve==="edit"&&!yt){be("Select a hook to edit first.");return}const u=ht.trim();if(!u){be("Hook command cannot be empty.");return}const S=St.trim(),H=S?Number(S):null;if(S&&(H===null||!Number.isInteger(H)||H<=0)){be("Timeout must be a positive number of seconds.");return}A(!0),be(null),lt(null);try{const ge={scope:q,eventName:Le,matcher:ot.trim()||null,command:u,timeoutSec:H,statusMessage:pt.trim()||null};Ve==="edit"?await($==null?void 0:$({...ge,target:yt})):await(X==null?void 0:X(ge)),lt(`${q==="project"?"Project":"Global"} hook ${Ve==="edit"?"updated":"written"} in hooks.json and trusted.`),Qe("list"),wt(null)}catch(ge){be(ge instanceof Error?ge.message:"Unable to write hooks.json.")}finally{A(!1)}}async function Yi(u){if(!F||!u.currentHash){be("Hook trust is unavailable in this view.");return}A(!0),be(null),lt(null);try{await F({key:u.key,currentHash:u.currentHash}),lt("Hook trusted.")}catch(S){be(S instanceof Error?S.message:"Unable to trust hook.")}finally{A(!1)}}async function Ji(u){if(!P){be("Hook trust is unavailable in this view.");return}A(!0),be(null),lt(null);try{await P({key:u.key}),lt("Hook untrusted.")}catch(S){be(S instanceof Error?S.message:"Unable to untrust hook.")}finally{A(!1)}}i.useEffect(()=>{if(Me){ts({});return}const u={},S=new Set;for(const H of Zt){if(H.kind!=="photo")continue;S.add(H.clientId);let ge=Nr.current.get(H.clientId);ge||(ge=URL.createObjectURL(H.file),Nr.current.set(H.clientId,ge)),u[H.clientId]=ge}for(const[H,ge]of Nr.current.entries())S.has(H)||(URL.revokeObjectURL(ge),Nr.current.delete(H));ts(u)},[Zt,Me]),i.useEffect(()=>{const u=Nr.current;return()=>{for(const S of u.values())URL.revokeObjectURL(S);u.clear()}},[]);function Jt(){const u=Ht.current,S=window.getSelection();if(!u||!S||S.rangeCount===0)return null;const H=S.getRangeAt(0);return!u.contains(H.startContainer)||!u.contains(H.endContainer)?null:{start:ds(u,H.startContainer,H.startOffset),end:ds(u,H.endContainer,H.endOffset)}}function ds(u,S,H){var He;let ge=null,ke=H;if(S===u){const Be=Array.from(u.childNodes);let Je=0;for(let gt=0;gt<Math.min(H,Be.length);gt+=1){const Ue=Be[gt];Ue&&(Je+=nr(Ue).length)}return Je}if(S.nodeType===Node.TEXT_NODE)ge=S;else{const Be=Array.from(u.childNodes).find(Je=>Je.contains(S));if(!Be)return qr().length;if(ge=Be,Be instanceof HTMLElement&&Be.dataset.segmentType==="attachment"){const Je=document.createRange();Je.selectNodeContents(Be);const gt=nr(Be).length;try{Je.setEnd(S,H);const Ue=Je.toString().length,Dt=((He=Be.textContent)==null?void 0:He.length)??0;Dt===0?ke=gt:ke=Math.round(Math.min(1,Ue/Dt)*gt)}catch{ke=gt}}else{const Je=document.createRange();Je.selectNodeContents(Be);try{Je.setEnd(S,H),ke=Je.toString().length}catch{ke=nr(Be).length}}}const Te=Array.from(u.childNodes);let Se=0;for(const Be of Te){if(Be===ge)return Be.nodeType===Node.TEXT_NODE?Se+ke:Se+Math.min(ke,nr(Be).length);Se+=nr(Be).length}return Se}function cs(u,S){let H=Math.max(0,S);const ge=Array.from(u.childNodes);for(const[ke,Te]of ge.entries()){const He=nr(Te).length;if(Te.nodeType===Node.TEXT_NODE){if(H<=He)return{node:Te,offset:H};H-=He;continue}if(Te instanceof HTMLElement&&Te.dataset.segmentType==="attachment"){if(H===0)return{node:u,offset:ke};if(H<=He){const Be=ge[ke+1];return H===He&&(Be==null?void 0:Be.nodeType)===Node.TEXT_NODE?{node:Be,offset:0}:{node:u,offset:ke+1}}H-=He;continue}if(H<=He)return{node:u,offset:ke+1};H-=He}return{node:u,offset:u.childNodes.length}}const On=i.useCallback(u=>{const S=Ht.current;if(!S||!u)return;const H=cs(S,u.start),ge=cs(S,u.end),ke=document.createRange();ke.setStart(H.node,H.offset),ke.setEnd(ge.node,ge.offset);const Te=window.getSelection();Te==null||Te.removeAllRanges(),Te==null||Te.addRange(ke)},[]);function Qi(u){const S=Ur.current;if(S.length===0)return!1;const H=S.at(-1);if(!H)return!1;const ge=Array.from(u.childNodes).find(He=>He instanceof HTMLElement&&He.dataset.segmentType==="attachment"&&He.dataset.clientId===H);if(!(ge instanceof HTMLElement))return!1;const ke=document.createRange(),Te=ge.nextSibling;(Te==null?void 0:Te.nodeType)===Node.TEXT_NODE?ke.setStart(Te,0):ke.setStartAfter(ge),ke.collapse(!0);const Se=window.getSelection();return Se==null||Se.removeAllRanges(),Se==null||Se.addRange(ke),!0}const qr=i.useCallback(()=>{const u=Ht.current;if(!u)return tt;let S="";for(const H of Array.from(u.childNodes))S+=nr(H);return mo(S)},[tt]);function hs(u,S,H){const ge=u==="photo"?"PHOTO":"FILE";let ke=0;for(;;){const Te=ke===0?S:`${S} (${ke+1})`,Se=`[${ge} ${Te}]`;if(!H.has(Se))return Se;ke+=1}}function us(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function ms(u,S,H){const ge=S.start>0?u[S.start-1]:"",ke=S.end<u.length?u[S.end]:"",Te=!!(ge&&!/\s/.test(ge)),Se=!ke||!/\s/.test(ke);return`${Te?" ":""}${H.join(" ")}${Se?" ":""}`}function ps(u,S){if(!u||u.length===0)return;const H=Array.from(u),ge=new Set(Zt.map(Ue=>Ue.placeholder)),ke=H.map(Ue=>{const Dt=xo(Ue,S),Sr=hs(S,bo(Dt),ge);return ge.add(Sr),{clientId:us(),kind:S,originalName:Dt,placeholder:Sr,file:Ue}}),Te=Jt()??Et.current,Se=Te?{start:Te.start,end:Te.end}:{start:tt.length,end:tt.length},He=ms(tt,Se,ke.map(Ue=>Ue.placeholder)),Be=`${tt.slice(0,Se.start)}${He}${tt.slice(Se.end)}`;Yt(Ue=>({prompt:Be,attachments:[...Ue.attachments,...ke]}));const Je=He.endsWith(" ")?1:0,gt=Se.start+He.length-Je;cr.current={start:gt,end:gt},Et.current={start:gt,end:gt},Ur.current=ke.map(Ue=>Ue.clientId),Q(null)}function fs(u){if(u.length===0)return;const S={photo:u.filter(Ue=>aa(Ue)==="photo"),file:u.filter(Ue=>aa(Ue)==="file")},H=[...S.photo,...S.file],ge=new Set(Zt.map(Ue=>Ue.placeholder)),ke=H.map(Ue=>{const Dt=aa(Ue),Sr=xo(Ue,Dt),Os=hs(Dt,bo(Sr),ge);return ge.add(Os),{clientId:us(),kind:Dt,originalName:Sr,placeholder:Os,file:Ue}}),Te=Jt()??Et.current,Se=Te?{start:Te.start,end:Te.end}:{start:tt.length,end:tt.length},He=ms(tt,Se,ke.map(Ue=>Ue.placeholder)),Be=`${tt.slice(0,Se.start)}${He}${tt.slice(Se.end)}`;Yt(Ue=>({prompt:Be,attachments:[...Ue.attachments,...ke]}));const Je=He.endsWith(" ")?1:0,gt=Se.start+He.length-Je;cr.current={start:gt,end:gt},Et.current={start:gt,end:gt},Ur.current=ke.map(Ue=>Ue.clientId),Q(null)}function gs(u){if(!u)return;const S=Jt()??Et.current,H=(S==null?void 0:S.start)??tt.length,ge=(S==null?void 0:S.end)??H,ke=mo(u),Te=`${tt.slice(0,H)}${ke}${tt.slice(ge)}`;Yt(He=>({prompt:Te,attachments:He.attachments}));const Se=H+ke.length;cr.current={start:Se,end:Se},Et.current={start:Se,end:Se}}i.useEffect(()=>{function u(S){(typeof S.composedPath=="function"?S.composedPath():[]).some(ke=>ke instanceof HTMLElement&&(ke.dataset.composerMenuSurface==="true"||ke.dataset.composerMenuTrigger==="true"))||ae&&Q(null)}if(ae)return window.addEventListener("pointerdown",u),()=>{window.removeEventListener("pointerdown",u)}},[ae]),i.useLayoutEffect(()=>{const u=Ht.current;if(!u||Me)return;const S=cr.current,H=qr()!==tt||Ja.current!==Fn||Qa.current!==Mn;if(H){const ge=document.createDocumentFragment();for(const ke of ls){if(ke.type==="text"){ge.append(document.createTextNode(ke.text===" "?" ":ke.text));continue}const Te=ke.attachment,Se=document.createElement("span");if(Se.dataset.segmentType="attachment",Se.dataset.clientId=Te.clientId,Se.dataset.placeholder=Te.placeholder,Se.contentEditable="false",Se.className="thread-composer-attachment-chip mx-[0.12rem] inline-flex max-w-full align-baseline",Te.kind==="photo"){Se.classList.add("thread-composer-attachment-chip-photo","rounded-[0.95rem]","border","border-sky-300/35","bg-sky-300/10","p-1","shadow-sm","shadow-stone-950/20");const He=Wr[Te.clientId];if(He){const Je=document.createElement("img");Je.src=He,Je.alt=Te.originalName||"Pasted image",Je.className="thread-composer-attachment-thumb h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-950 object-contain",Je.draggable=!1,Se.append(Je)}else{const Je=document.createElement("span");Je.className="thread-composer-attachment-thumb inline-block h-[4.5rem] w-[6rem] rounded-[0.7rem] bg-stone-900/80",Je.setAttribute("aria-hidden","true"),Se.append(Je)}const Be=document.createElement("span");Be.className="thread-composer-attachment-caption ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",Be.textContent=ko(Te),Se.append(Be)}else{Se.classList.add("items-center","gap-2","rounded-[0.95rem]","border","border-emerald-300/35","bg-emerald-300/10","px-2.5","py-2","text-[10px]","font-medium","tracking-[0.08em]","text-emerald-50","shadow-sm","shadow-stone-950/20");const He=document.createElement("span");He.className="inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/25 bg-emerald-300/12 text-[9px]",He.textContent="FILE";const Be=document.createElement("span");Be.className="inline-flex max-w-[10rem] truncate",Be.textContent=ko(Te),Se.append(He,Be)}ge.append(Se)}u.replaceChildren(ge),Ja.current=Fn,Qa.current=Mn}S!==null?(u.focus(),Qi(u)||On(S),Et.current=S):document.activeElement===u&&H&&On(Et.current),cr.current=null,Ur.current=[]},[Wr,Mn,Me,Fn,tt,ls,On,qr]);function zt(){var u;(u=Ht.current)==null||u.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function ed(){var u;if(zt(),Q(null),!!((u=navigator.clipboard)!=null&&u.readText))try{const S=await navigator.clipboard.readText();gs(S)}catch{return}}async function xs(){if(Lt&&as(),Ae&&!Me){await Bi();return}if(!Me&&!tt.trim())return;const u=Me?tt:tt.trim(),S=Me?[]:Zt.filter(ge=>u.includes(ge.placeholder));await W(S.length>0?{prompt:u,attachments:S}:{prompt:u})!==!1&&Yt(()=>({prompt:"",attachments:[]}))}async function td(u){u.preventDefault(),await xs()}function rd(){const u=qr(),S=Jt();Et.current=S;const H=Ht.current;(H?Mu(H):!1)&&(cr.current=S,Pi(ke=>ke+1)),Yt(ke=>({prompt:u,attachments:ke.attachments.filter(Te=>u.includes(Te.placeholder))}),"deferred")}function nd(u){var H,ge,ke,Te;const S=ja((H=u.clipboardData)==null?void 0:H.items,(ge=u.clipboardData)==null?void 0:ge.files);if(S.length===0){const Se=((ke=u.clipboardData)==null?void 0:ke.getData("text/plain"))??"",He=((Te=u.clipboardData)==null?void 0:Te.getData("text/html"))??"",Be=Se||Pu(He);if(!Be&&!He)return;u.preventDefault(),gs(Be);return}u.preventDefault(),fs(S)}function ad(u){var S,H;vo((S=u.dataTransfer)==null?void 0:S.items,(H=u.dataTransfer)==null?void 0:H.files)&&(u.preventDefault(),Cr(!0))}function sd(u){var S,H;vo((S=u.dataTransfer)==null?void 0:S.items,(H=u.dataTransfer)==null?void 0:H.files)&&(u.preventDefault(),u.dataTransfer&&(u.dataTransfer.dropEffect="copy"),Cr(!0))}function od(u){u.currentTarget.contains(u.relatedTarget)||Cr(!1)}function ld(u){var H,ge;const S=ja((H=u.dataTransfer)==null?void 0:H.items,(ge=u.dataTransfer)==null?void 0:ge.files);S.length!==0&&(u.preventDefault(),Cr(!1),fs(S))}function bs(u){u.key==="Enter"&&(!u.metaKey&&!u.ctrlKey||(u.preventDefault(),!(n||T)&&xs()))}async function Kr(u){const S=Mt;u.collaborationMode&&Ln(u.collaborationMode);try{await(je==null?void 0:je(u)),Q(null)}catch(H){throw u.collaborationMode&&Ln(S),H}}const vs=Ae?"Describe the goal the backend should continue working toward...":y??(Me?"Send shell input to the attached terminal...":"Ask the backend to inspect, modify, or explain code..."),Xr=Me?"Send Ctrl-C":"Stop Current Turn",ks=Ae?Ne?"Setting...":"Set goal":!g&&n?"Connecting...":g&&n&&!Me?"Sending...":"Send",ws=g?Ae?"ui-action-info":"ui-action-primary":"ui-action-danger",ys=a,js=ys||Bn.length===0,id=c?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":Bn.length===0?"The selected model does not expose adjustable reasoning effort.":"Select reasoning effort",Ns=Me?"thread-composer-layer thread-shell-composer-layer":"thread-graph-composer-layer",dd=ae?`${Ns} relative z-[80] shrink-0`:`${Ns} relative z-20 shrink-0`,Hn=Me?"thread-composer-form":"thread-graph-composer-form",Cs=Me?"thread-composer-form-floating":"thread-graph-composer-form-floating",cd=Me?r||es?`${Hn} ${Cs} relative z-20 shrink-0 border-t border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-2 pb-[calc(env(safe-area-inset-bottom)+0.5rem)] sm:px-4 sm:py-3`:`${Hn} relative z-20 shrink-0 border-t border-[var(--theme-border)] bg-[var(--theme-surface)] px-3 py-2 pb-[calc(env(safe-area-inset-bottom)+0.5rem)] sm:px-4 sm:py-3`:`${Hn} ${r?Cs:""} relative z-20 shrink-0 border-t px-3 py-2 pb-[calc(env(safe-area-inset-bottom)+0.5rem)] sm:px-4 sm:py-3`,hd=Me?"thread-composer-shell":"thread-graph-composer-shell",ud=Me?"thread-composer-toolbar":"thread-graph-composer-toolbar",Ss=Me?"thread-composer-input":"thread-graph-composer-input",Vn=Me?"thread-composer-icon-button":"thread-graph-composer-icon-button",Ts=Me?"thread-composer-menu":"thread-graph-composer-menu",ur=Me?"thread-composer-menu-item":"thread-graph-composer-menu-item",Un=Me?"thread-composer-inline-toggle":"thread-graph-composer-inline-toggle",Wn=Me?"thread-composer-panel-button":"thread-graph-composer-panel-button",Qt=Me?"thread-composer-chip-button":"thread-graph-composer-chip-button",md=Me?"thread-composer-plan-toggle-active":"thread-graph-composer-plan-toggle-active",pd=Me?"thread-composer-send-button":"thread-graph-composer-send-button",Es=Me?"thread-composer-prompt-region":"thread-graph-composer-prompt-region",fd=`${Ss} min-h-[5.25rem] w-full px-4 pr-14 pt-3 outline-none transition sm:min-h-[5.75rem] ${rs?"is-drag-target border-sky-300/80 bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":""}`,gd=`thread-graph-composer-input-group relative border-0 bg-transparent shadow-none ring-0 ${n?"bg-amber-50/40 dark:bg-amber-400/10":"bg-transparent"}`,xd=`${Ss} min-h-[68px] max-h-32 w-full overflow-y-auto px-3 pt-3 text-[16px] leading-relaxed text-slate-800 outline-none transition sm:min-h-[92px] sm:max-h-40 sm:px-4 sm:pt-4 sm:text-[14px] dark:text-slate-100 ${rs?"is-drag-target bg-sky-300/[0.08] shadow-[0_0_0_1px_rgba(125,211,252,0.2)]":""}`;return e.jsxs("div",{className:dd,children:[e.jsx("input",{ref:Za,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:u=>{ps(u.target.files,"photo"),u.target.value=""}}),e.jsx("input",{ref:Ya,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:u=>{ps(u.target.files,"file"),u.target.value=""}}),t==="chat"&&e.jsx("button",{type:"button","aria-label":"Jump to latest",title:k?"Latest turn is in view":"Jump to the latest messages",onClick:()=>te==null?void 0:te(),className:"absolute left-1/2 top-3 z-40 inline-flex h-9 min-w-[5.75rem] -translate-x-1/2 -translate-y-[62%] items-start justify-center bg-transparent pt-1 touch-manipulation sm:top-4",children:e.jsx("span",{className:`thread-jump-latest-badge pointer-events-none inline-flex h-4 min-w-[3.75rem] items-center justify-center rounded-[0.7rem] border shadow-sm transition ${k?"is-active border-sky-300/36 bg-sky-300/[0.03] text-sky-100/86":"border-stone-500/70 bg-stone-950/[0.08] text-stone-200/86"}`,children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m4 6 4 4 4-4"})})})}),e.jsxs("form",{ref:Ri,"data-testid":t==="chat"?"chat-composer":void 0,onSubmit:td,className:cd,children:[e.jsxs("div",{className:`${hd} flex w-full flex-col overflow-hidden rounded-[16px] sm:rounded-[18px]`,children:[e.jsxs(Tu,{className:gd,children:[Me?null:e.jsx("div",{"data-slot":"input-group-control",className:`${Es} relative w-full`,children:e.jsxs("div",{className:xd,children:[tt.length===0&&e.jsx("span",{className:"pointer-events-none absolute left-3 top-3 text-slate-500 sm:left-4 sm:top-4 dark:text-slate-400",children:vs}),e.jsx("div",{ref:Ht,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!T,suppressContentEditableWarning:!0,onInput:()=>rd(),onPaste:nd,onKeyDown:bs,onKeyUp:()=>{Et.current=Jt()},onMouseUp:()=>{Et.current=Jt()},onBlur:()=>{Et.current=Jt(),Cr(!1),Lt&&as()},onDragEnter:ad,onDragOver:sd,onDragLeave:od,onDrop:ld,className:`relative z-[1] min-h-[4.25rem] whitespace-pre-wrap break-words pb-2 outline-none sm:min-h-[4.25rem] ${T?"cursor-not-allowed text-slate-500":""}`})]})}),e.jsxs(zu,{align:"block-end",className:`${ud} relative z-30 mb-0 flex items-center gap-2 text-xs`,children:[e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!Me&&e.jsxs("div",{className:"relative",children:[e.jsx(rr,{type:"button",variant:"ghost",size:"icon-xs","data-composer-menu-trigger":"true","aria-label":"Open slash toolbox",title:"Open slash toolbox",onClick:()=>Q(u=>u==="slash"?null:"slash"),className:`${Vn} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:e.jsx(Du,{})}),ae==="slash"&&e.jsx("div",{"data-composer-menu-surface":"true",className:`${Ts} absolute bottom-full left-0 z-40 mb-2 w-72 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20 backdrop-blur-xl`,onClick:u=>{u.stopPropagation()},onMouseDown:u=>{u.stopPropagation()},onPointerDown:u=>{u.stopPropagation()},onTouchStart:u=>{u.stopPropagation()},children:xe==="root"?e.jsxs("div",{className:"p-2",children:[fe.map((u,S)=>e.jsx("button",{type:"button",disabled:Oi(u),onClick:H=>Vi(u,H),className:`${Hi(u)} ${S===0?"mt-0":""}`,title:u.description??u.label,children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:u.command}),e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:Gi(u)})]})},`${u.action}:${u.command}`)),fe.length===0?e.jsx("p",{className:"px-3 py-2 text-sm text-stone-400",children:"No backend tools are available for this thread."}):null]}):e.jsx("div",{className:"max-h-80 overflow-auto",children:xe==="fork"?e.jsxs("div",{className:"p-2",children:[e.jsx("button",{type:"button",disabled:n||se,onClick:()=>void Ai(),className:`${ur} block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:"Fork from latest"}),e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:se?"Forking":"Run"})]})}),e.jsx("button",{type:"button",disabled:n||se,onClick:u=>{u.stopPropagation(),Ie("forkTurns"),N==null||N()},className:`${ur} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition disabled:cursor-not-allowed disabled:opacity-60`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:"Fork from selected turn"}),e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-400",children:"Pick"})]})}),n?e.jsx("p",{className:"mt-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Fork is only available while the thread is idle."}):null]}):xe==="forkTurns"?e.jsxs("div",{className:"p-2",children:[D.status==="loading"&&!D.data?e.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading turns…"}):null,D.error?e.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:D.error}):null,(zs=D.data)!=null&&zs.length?e.jsx("div",{className:"space-y-2",children:D.data.map(u=>e.jsx("button",{type:"button",disabled:se,onClick:()=>void Di(u.turnId),className:`${Wn} block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition disabled:cursor-not-allowed disabled:opacity-60`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"text-sm text-stone-100",children:["Turn ",u.turnIndex]}),e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:se?"Forking":u.status})]})},u.turnId))}):null,D.status!=="loading"&&!D.error&&(((Ls=D.data)==null?void 0:Ls.length)??0)===0?e.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No turns available to fork yet."}):null]}):xe==="skills"?e.jsxs("div",{className:"p-2",children:[I.status==="loading"&&!I.data?e.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading skills…"}):null,I.error?e.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:I.error}):null,(Rs=I.data)!=null&&Rs.skills.length?e.jsx("div",{className:"space-y-2",children:I.data.skills.map(u=>{var S,H;return e.jsx("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:((S=u.interface)==null?void 0:S.displayName)??u.name}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em]",children:[e.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1 text-stone-400",children:Fu(u.scope)}),e.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 rounded-full border px-2 py-1 normal-case tracking-normal transition ${Xt===u.name?"border-emerald-400/45 bg-emerald-400/12 text-emerald-100":`${Qt} border-stone-700 text-stone-300 hover:border-stone-500`}`,onClick:()=>void _i(u.name),title:`Copy $${u.name}`,"aria-label":`Copy $${u.name}`,children:[e.jsx(sa,{}),"$",u.name]})]}),e.jsx("p",{className:"text-xs leading-5 text-stone-400",children:((H=u.interface)==null?void 0:H.shortDescription)??u.shortDescription??u.description})]})},u.path)})}):null,(Is=I.data)!=null&&Is.errors.length?e.jsx("div",{className:"mt-2 space-y-2",children:I.data.errors.map(u=>e.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:[e.jsx("p",{className:"font-medium",children:u.message}),e.jsx("p",{className:"mt-1 break-all text-amber-100/60",children:u.path})]},`${u.path}:${u.message}`))}):null,I.status!=="loading"&&!I.error&&(((Ps=I.data)==null?void 0:Ps.skills.length)??0)===0&&(((Ms=I.data)==null?void 0:Ms.errors.length)??0)===0?e.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No skills available right now."}):null]}):xe==="hooks"?e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs text-stone-400",children:"Hook config sources"}),e.jsx("p",{className:"truncate text-[11px] text-stone-500",children:(($s=K.data)==null?void 0:$s.projectHooksPath)??"<workspace hooks config>"})]}),Ve==="list"&&ve.hostConfigFiles?e.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),Ui(),Qe("add"),be(null),lt(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add Hook"}):null]}),K.status==="loading"&&!K.data?e.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading hooks…"}):null,K.error?e.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:K.error}):null,ie?e.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:ie}):null,et?e.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:et}):null,Ve==="add"||Ve==="edit"?e.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[Ve==="edit"?e.jsxs("p",{className:"rounded-lg border border-stone-800 bg-stone-950 px-3 py-2 text-[11px] text-stone-400",children:["Editing"," ",Vu((yt==null?void 0:yt.eventName)??Le)," ","in"," ",(yt==null?void 0:yt.scope)==="global"?"global":"project"," ","hooks.json"]}):null,e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("label",{className:"block text-xs text-stone-400",children:["Scope",e.jsxs("select",{"aria-label":"Hook scope",value:q,onChange:u=>oe(u.target.value),disabled:Ve==="edit",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:[e.jsx("option",{value:"project",children:"Project"}),e.jsx("option",{value:"global",children:"Global"})]})]}),e.jsxs("label",{className:"block text-xs text-stone-400",children:["Event",e.jsx("select",{"aria-label":"Hook event",value:Le,onChange:u=>ct(u.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-2.5 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50",children:on.map(u=>e.jsx("option",{value:u.value,children:u.label},u.value))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Matcher"}),e.jsx("input",{"aria-label":"Hook matcher",value:ot,onChange:u=>qe(u.target.value),placeholder:"Bash",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"Command"}),e.jsx("textarea",{"aria-label":"Hook command",value:ht,onChange:u=>xt(u.target.value),rows:3,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 font-mono text-xs text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("label",{className:"block text-xs text-stone-400",children:["Timeout",e.jsx("input",{"aria-label":"Hook timeout seconds",value:St,onChange:u=>kt(u.target.value),inputMode:"numeric",className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]}),e.jsxs("label",{className:"block text-xs text-stone-400",children:["Status message",e.jsx("input",{"aria-label":"Hook status message",value:pt,onChange:u=>mt(u.target.value),className:"mt-1 w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none focus:border-sky-300/50"})]})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>{Qe("list"),wt(null)},className:`${Qt} rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition`,children:"Back"}),e.jsx("button",{type:"button",onClick:()=>void Zi(),disabled:L,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:L?"Saving…":Ve==="edit"?"Update Hook":"Write Hook"})]})]}):null,Ve==="list"&&((_s=K.data)!=null&&_s.warnings.length)?e.jsx("div",{className:"mb-2 space-y-2",children:K.data.warnings.map(u=>e.jsx("p",{className:"rounded-xl border border-amber-500/25 bg-amber-500/10 px-3 py-2 text-xs text-amber-100/85",children:u},u))}):null,Ve==="list"&&((As=K.data)!=null&&As.errors.length)?e.jsx("div",{className:"mb-2 space-y-2",children:K.data.errors.map(u=>e.jsxs("div",{className:"rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-2 text-xs text-rose-100/90",children:[e.jsx("p",{className:"font-medium",children:u.message}),e.jsx("p",{className:"mt-1 break-all text-rose-100/60",children:u.path})]},`${u.path}:${u.message}`))}):null,Ve==="list"&&((Ds=K.data)!=null&&Ds.hooks.length)?e.jsx("div",{className:"space-y-2",children:K.data.hooks.map(u=>e.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"truncate text-sm font-medium text-stone-100",children:[Gu(u.eventName),u.matcher?` · ${u.matcher}`:""]}),e.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-stone-400",children:u.command??u.handlerType}),u.statusMessage?e.jsx("p",{className:"mt-1 truncate text-[11px] text-stone-500",children:u.statusMessage}):null]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.08em] text-stone-500",children:[fo(u)?e.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),Wi(u)},className:`${Qt} rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-sky-100 transition hover:border-sky-300/35 hover:bg-sky-300/10`,children:"Edit"}):null,ve.hookTrust&&u.trustStatus==="trusted"&&!u.isManaged?e.jsx("button",{type:"button",disabled:L,onClick:S=>{S.stopPropagation(),Ji(u)},className:`${Qt} rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-amber-100 transition hover:border-amber-300/35 hover:bg-amber-300/10 disabled:cursor-not-allowed disabled:opacity-50`,children:"Untrust"}):null,(u.trustStatus==="untrusted"||u.trustStatus==="modified")&&!u.isManaged&&ve.hookTrust?e.jsx("button",{type:"button",disabled:L||!u.currentHash,onClick:S=>{S.stopPropagation(),Yi(u)},className:`${Qt} rounded-full border border-stone-700 px-2 py-0.5 text-[10px] normal-case tracking-normal text-emerald-100 transition hover:border-emerald-300/35 hover:bg-emerald-300/10 disabled:cursor-not-allowed disabled:opacity-50`,children:"Trust"}):null,e.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-0.5 text-stone-300",children:Hu(u.trustStatus)})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[10px] uppercase tracking-[0.14em] text-stone-500",children:[e.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:Ou(u.source)}),e.jsx("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:u.enabled?"Enabled":"Disabled"}),e.jsxs("span",{className:"rounded-full border border-stone-700 px-2 py-1",children:[u.timeoutSec,"s"]})]})]},u.key))}):null,Ve==="list"&&K.status!=="loading"&&!K.error&&(((Bs=K.data)==null?void 0:Bs.hooks.length)??0)===0?e.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No hooks configured for this workspace."}):null]}):e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs text-stone-400",children:"MCP config source"}),e.jsx("p",{className:"truncate text-[11px] text-stone-500",children:Oe??"<provider config>"})]}),We==="list"&&ve.mcpConfigEditing?e.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),Ge("add"),bt(null),Tt(null)},className:"shrink-0 rounded-full border border-sky-300/35 px-3 py-1.5 text-xs text-sky-100 transition hover:bg-sky-300/10",children:"Add MCP"}):null]}),R.status==="loading"&&!R.data?e.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"Loading MCP servers…"}):null,R.error?e.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:R.error}):null,Gt?e.jsx("p",{className:"mb-2 rounded-xl border border-rose-500/35 bg-rose-500/10 px-3 py-3 text-sm text-rose-100/90",children:Gt}):null,jr?e.jsx("p",{className:"mb-2 rounded-xl border border-emerald-500/35 bg-emerald-500/10 px-3 py-3 text-sm text-emerald-100/90",children:jr}):null,We==="add"?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),Ge("http"),bt(null),Tt(null)},className:`${Wn} block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-sm text-stone-100",children:"HTTP / Streamable HTTP"}),e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"Form"})]}),e.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Add an MCP server with a name and URL, then write the matching block into provider config."})]}),e.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),Ki()},className:`${Wn} block w-full rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-left transition`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-sm text-stone-100",children:"stdio / raw block"}),e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-stone-500",children:"TOML"})]}),e.jsx("p",{className:"mt-1 text-xs text-stone-400",children:"Write a single `[mcp_servers.name]` block, then save it back into provider config."})]})]}):null,We==="http"?e.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"MCP name"}),e.jsx("input",{"aria-label":"MCP name",value:jt,onChange:u=>it(u.target.value),placeholder:"openaiDeveloperDocs",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-stone-400",children:"URL"}),e.jsx("input",{"aria-label":"URL",value:nt,onChange:u=>It(u.target.value),placeholder:"https://developers.openai.com/mcp",className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>Ge("add"),className:`${Qt} rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition`,children:"Back"}),e.jsx("button",{type:"button",onClick:()=>void qi(),disabled:Ke,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:Ke?"Saving…":"Write HTTP MCP"})]})]}):null,We==="stdio"?e.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[e.jsx("label",{className:"block text-xs text-stone-400",children:"MCP block for provider config"}),e.jsx("textarea",{"aria-label":"MCP block for provider config",value:Nt,onChange:u=>ye(u.target.value),rows:8,className:"w-full rounded-lg border border-stone-700 bg-stone-950 px-3 py-2 text-sm text-stone-100 outline-none placeholder:text-stone-500 focus:border-sky-300/50"}),e.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>Ge("add"),className:`${Qt} rounded-full border border-stone-700 px-3 py-1.5 text-xs text-stone-300 transition`,children:"Back"}),e.jsx("button",{type:"button",onClick:()=>void Xi(),disabled:Ke,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:Ke?"Saving…":"Write raw block"})]})]}):null,We==="list"&&((Fs=R.data)!=null&&Fs.servers.length)?e.jsx("div",{className:"space-y-2",children:R.data.servers.map(u=>e.jsxs("div",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:u.name}),e.jsxs("p",{className:"mt-0.5 text-xs text-stone-400",children:[u.tools.length," tools ·"," ",u.resourceCount," resources ·"," ",u.resourceTemplateCount," ","templates"]})]}),e.jsx("span",{className:"shrink-0 rounded-full border border-stone-700 px-2 py-1 text-[10px] uppercase tracking-[0.14em] text-stone-300",children:Bu(u.authStatus)})]}),u.tools.length>0?e.jsx("p",{className:"mt-2 line-clamp-2 text-xs text-stone-500",children:u.tools.slice(0,4).map(S=>S.title??S.name).join(" · ")}):null]},u.name))}):null,We==="list"&&R.status!=="loading"&&!R.error&&(((Gs=R.data)==null?void 0:Gs.servers.length)??0)===0?e.jsx("p",{className:"rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3 text-sm text-stone-400",children:"No MCP servers available right now."}):null]})})})]}),!Me&&e.jsxs("div",{className:"relative",children:[e.jsx(rr,{type:"button",variant:"ghost",size:"icon-xs","data-composer-menu-trigger":"true","aria-label":"Add attachment",title:"Add attachment",onClick:()=>Q(u=>u==="attachments"?null:"attachments"),className:`${Vn} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:e.jsx(Au,{})}),ae==="attachments"&&e.jsx("div",{"data-composer-menu-surface":"true",className:`${Ts} absolute bottom-full left-0 mb-2 w-32 overflow-hidden rounded-2xl border bg-stone-900/72 shadow-2xl shadow-stone-950/20`,children:e.jsxs("div",{className:"p-2",children:[e.jsx("button",{type:"button",onClick:()=>{var u;zt(),(u=Za.current)==null||u.click()},className:`${ur} block w-full rounded-xl px-3 py-2 text-left text-sm transition`,children:"Photo"}),e.jsx("button",{type:"button",onClick:()=>{var u;zt(),(u=Ya.current)==null||u.click()},className:`${ur} mt-1 block w-full rounded-xl px-3 py-2 text-left text-sm transition`,children:"File"})]})})]}),Ii&&e.jsx(rr,{type:"button",variant:"ghost",size:"icon-xs","aria-label":Me?"Switch to chat":"Switch to shell",title:Me?"Switch to chat":"Switch to shell",onClick:()=>ee==null?void 0:ee(),className:`${Vn} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:Me?e.jsx(tm,{}):e.jsx(_u,{})})]}),e.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-1.5",children:[!Me&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative min-w-0",children:[e.jsx(rr,{type:"button",variant:"ghost",size:"xs","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":ae==="model","aria-label":l??"Select model",disabled:ys||p.length===0,onClick:()=>Q(u=>u==="model"?null:"model"),title:c?`Fast mode is on. Turn it off from the slash toolbox to edit model. ${os}`:os,className:`${Un} relative min-w-0 max-w-[8.75rem] overflow-hidden rounded-full px-2.5 text-left text-stone-300 disabled:cursor-not-allowed disabled:text-stone-600 sm:max-w-[11rem]`,children:e.jsx("span",{className:"relative z-[1] block min-w-0 truncate whitespace-nowrap [direction:rtl]",children:l??"Select model"})}),l?e.jsx(Qu,{contextUsage:f}):null,ae==="model"&&e.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[9rem] max-w-[14rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:e.jsx("div",{className:"max-h-72 overflow-auto p-2",children:p.map(u=>e.jsx("button",{type:"button",onClick:()=>void Kr({model:u.model,reasoningEffort:u.defaultReasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${u.model===l?"ui-status-warning":`${ur} text-stone-300`}`,children:e.jsx("p",{className:"text-sm font-medium",children:u.model})},u.id))})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(rr,{type:"button",variant:"ghost",size:"xs","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":ae==="effort",disabled:js,onClick:()=>Q(u=>u==="effort"?null:"effort"),title:id,className:`${Un} rounded-full px-2 disabled:cursor-not-allowed disabled:text-stone-700 ${js?"text-stone-500":"text-stone-300 hover:text-stone-100"}`,children:po(d)}),ae==="effort"&&e.jsx("div",{"data-composer-menu-surface":"true",className:"absolute bottom-full left-0 mb-2 w-max min-w-[8rem] max-w-[12rem] overflow-hidden rounded-2xl border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:e.jsx("div",{className:"max-h-72 overflow-auto p-2",children:Bn.map(u=>e.jsx("button",{type:"button",onClick:()=>void Kr({reasoningEffort:u.reasoningEffort}),className:`block w-full rounded-xl px-3 py-2 text-left transition ${u.reasoningEffort===d?"ui-status-warning":`${ur} text-stone-300`}`,children:e.jsx("p",{className:"text-sm font-medium",children:po(u.reasoningEffort)})},u.reasoningEffort))})})]}),ve.planMode&&e.jsx(rr,{type:"button",variant:"ghost",size:"xs","aria-pressed":_n==="plan",disabled:a,onClick:()=>void Kr({collaborationMode:_n==="plan"?"default":"plan"}),className:`${Un} rounded-full px-2.5 ${_n==="plan"?md:"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"}),e.jsx(rr,{type:Ce?"button":"submit",variant:Ce?"ghost":"default",size:"icon-xs","aria-label":Ce?Xr:Ae?"Set goal":"Send Prompt",title:Ce?Xr:ks,onClick:u=>{Ce&&(u.preventDefault(),G==null||G())},disabled:Ce?!1:Ne||n||(t==="chat"?T:!1),className:`${pd} h-9 w-9 rounded-full text-sm font-medium disabled:cursor-not-allowed sm:h-8 sm:w-8 ${Ce?"ui-action-danger":ws}`,children:Ce?e.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"}):e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M8 13V3"}),e.jsx("path",{d:"m4 7 4-4 4 4"})]})})]}),Me&&Pn&&e.jsx(Ru,{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:Pn,children:Pn}),es&&e.jsxs("div",{className:"relative",children:[e.jsx("button",{type:"button","data-composer-menu-trigger":"true","aria-label":ae==="shellTools"?"Close shell tools":"Open shell tools","aria-haspopup":"menu","aria-expanded":ae==="shellTools",title:ae==="shellTools"?"Close shell tools":"Open shell tools",onClick:()=>{zt(),Q(u=>u==="shellTools"?null:"shellTools")},className:"inline-flex h-7 w-7 items-center justify-center rounded-full border border-stone-700 bg-stone-900/92 text-stone-200 transition hover:bg-stone-800",children:e.jsx(rm,{})}),ae==="shellTools"&&e.jsx("div",{"data-composer-menu-surface":"true",className:"absolute right-0 top-full z-40 mt-2 w-[11.5rem] max-w-[calc(100vw-1.5rem)] rounded-[1rem] border border-stone-700/90 bg-stone-950/96 p-2 shadow-2xl shadow-stone-950/40 sm:w-48",onMouseDown:u=>{u.stopPropagation()},onPointerDown:u=>{u.stopPropagation()},onTouchStart:u=>{u.stopPropagation()},children:e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void ed(),className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2 py-2 text-sky-50",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(sa,{}),e.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),e.jsx("button",{type:"button",onClick:()=>{zt(),Q(null),pe==null||pe()},className:"inline-flex items-center justify-center rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-2 text-stone-100",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(sa,{}),e.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),e.jsx("button",{type:"button",disabled:n,onClick:()=>{zt(),Q(null),W({prompt:"clear"})},className:"disabled:cursor-not-allowed disabled:opacity-45",children:e.jsx(ar,{label:"CLEAR",tone:"sky"})}),e.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled)||!(C!=null&&C.isCommandRunning),onClick:()=>{zt(),Q(null),he==null||he("ctrl_c")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:e.jsx(ar,{label:"CTRL-C",tone:"rose"})}),e.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{zt(),Q(null),he==null||he("ctrl_d")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:e.jsx(ar,{label:"CTRL-D"})}),e.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{zt(),Q(null),he==null||he("esc")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:e.jsx(ar,{label:"ESC"})}),e.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{zt(),Q(null),he==null||he("tab")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:e.jsx(ar,{label:"TAB"})}),e.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{zt(),Q(null),he==null||he("up")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:e.jsx(ar,{label:"UP"})}),e.jsx("button",{type:"button",disabled:!(C!=null&&C.shellInputEnabled),onClick:()=>{zt(),Q(null),he==null||he("down")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:e.jsx(ar,{label:"DOWN"})})]})})]})]})]})]}),Ae&&!Me&&e.jsxs("div",{className:"thread-goal-compose-card relative z-20 mb-1.5 flex flex-wrap items-center gap-2 rounded-2xl border px-3 py-2 text-xs shadow-sm",children:[e.jsx("span",{className:"thread-goal-compose-label font-medium uppercase tracking-[0.16em]",children:"Goal"}),e.jsxs("label",{className:"thread-goal-compose-field flex items-center gap-2",children:[e.jsx("span",{children:"Max tokens (k)"}),e.jsx("input",{"aria-label":"Goal token budget",value:Ze,onChange:u=>Ye(u.target.value),inputMode:"numeric",placeholder:"Optional",className:"thread-goal-compose-input h-7 w-24 rounded-full border px-3 text-xs outline-none"})]}),Ot?e.jsx("span",{className:"thread-goal-compose-error min-w-0 flex-1",children:Ot}):null,e.jsx("button",{type:"button",onClick:ss,className:"thread-goal-compose-cancel rounded-full border px-2.5 py-1 text-[11px] transition",children:"Cancel"})]}),Me?e.jsxs("div",{className:`${Es} relative`,children:[e.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:tt,onChange:u=>$i(u.target.value),onKeyDown:bs,rows:2,placeholder:vs,className:`${fd} resize-y pb-10`}),e.jsx("button",{type:"button","aria-label":Xr,title:Xr,onClick:()=>void(G==null?void 0:G()),disabled:!Ce,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${Ce?"border-rose-300/55 bg-rose-300/[0.14] text-rose-50 shadow-lg shadow-rose-950/20 hover:bg-rose-300/[0.22]":"cursor-not-allowed border-stone-700/30 bg-stone-400/[0.02] text-stone-500/55 opacity-55"}`,children:e.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}),e.jsx("button",{type:"submit","aria-label":"Send Shell Input",onMouseDown:u=>{u.preventDefault()},onPointerDown:u=>{u.preventDefault()},onTouchStart:u=>{u.preventDefault()},disabled:Ne||n,className:`absolute bottom-2.5 right-2.5 rounded-full px-3.5 py-1.5 text-sm font-medium shadow-lg shadow-stone-950/30 transition disabled:cursor-not-allowed disabled:bg-stone-700 disabled:text-stone-300 ${ws}`,children:ks})]}):null]}),s&&e.jsx("div",{className:"mt-2 rounded-2xl border border-rose-500/40 bg-rose-500/10 px-4 py-3 text-sm text-rose-200",children:s})]})]})}var nm=i.createContext(null);function am(){return i.useContext(nm)}function Cn(t){return t?new Date(t).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"Time unavailable"}function Ua(t){return t?new Date(t).toLocaleString():"Time unavailable"}function sm(t){switch(t){case"idle":return"Idle";case"running":return"Running";case"interrupted":return"Interrupted";case"failed":return"Failed";case"not_loaded":return"Not Loaded";case"system_error":return"System Error"}}function om(t){switch(t){case"idle":return"ui-status-neutral";case"running":return"ui-status-info";case"interrupted":return"ui-status-warning";case"failed":case"system_error":return"ui-status-danger";case"not_loaded":return"ui-status-neutral"}}function ii(t){switch(t){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function lm({open:t,title:r,label:n,value:a,busy:o=!1,onChange:s,onCancel:l,onSubmit:d}){if(i.useEffect(()=>{if(!t)return;function h(p){p.key==="Escape"&&!o&&l()}return window.addEventListener("keydown",h),()=>{window.removeEventListener("keydown",h)}},[o,l,t]),!t)return null;function c(h){h.preventDefault(),d()}return bn.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[e.jsx("button",{type:"button","aria-label":"Close rename dialog",onClick:l,disabled:o,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),e.jsxs("form",{role:"dialog","aria-modal":"true","aria-label":r,onSubmit:c,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-stone-100",children:r}),e.jsx("p",{className:"mt-1 text-sm text-stone-500",children:"Changes are saved only after confirmation."})]}),e.jsx("button",{type:"button","aria-label":"Close dialog",onClick:l,disabled:o,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:e.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),e.jsxs("div",{className:"mt-5",children:[e.jsx("label",{htmlFor:"rename-dialog-input",className:"text-sm font-medium text-stone-200",children:n}),e.jsx("input",{id:"rename-dialog-input","aria-label":n,autoFocus:!0,value:a,onChange:h=>s(h.target.value),className:"mt-2 w-full rounded-2xl border border-stone-700 bg-stone-950 px-4 py-3 text-stone-100 outline-none transition focus:border-amber-300"})]}),e.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:l,disabled:o,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:o||!a.trim(),className:"ui-action-success rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:"Save"})]})]})]}),document.body)}function im({children:t,effectiveTheme:r,layoutMode:n,themeMode:a,viewportConstrained:o}){return e.jsx("div",{className:`thread-ui-shell ${r==="dark"?"thread-ui-theme-dark dark":""} ${o?"thread-ui-viewport-constrained":""} ${o?"h-[100svh] max-h-[100svh] min-h-0 overflow-hidden overscroll-none":"min-h-[100svh] overflow-hidden"} bg-[#f6f8fb] text-slate-900 transition-colors duration-200 sm:p-2`,"data-theme-effective":r,"data-theme-mode":a??r,"data-thread-layout":n,children:t})}function dm({children:t,roomsRailCollapsed:r}){return e.jsx("div",{className:`thread-shell-frame relative h-full min-h-0 ${r?"is-rail-collapsed sm:grid-cols-[56px_minmax(0,1fr)]":"sm:grid-cols-[264px_minmax(0,1fr)]"}`,children:t})}function cm({onClose:t,open:r}){return r?e.jsx("button",{type:"button","aria-hidden":"true",tabIndex:-1,className:"thread-mobile-only-block thread-mobile-scrim fixed inset-0 z-40 bg-slate-950/35 backdrop-blur-[1px]",onClick:t}):null}function hm({children:t,collapsed:r,mobileOpen:n}){return e.jsx("aside",{className:`thread-graph-rooms-surface thread-rooms-rail fixed inset-y-0 left-0 z-50 flex min-h-0 min-w-0 w-[min(20rem,calc(100vw-2rem))] flex-col overflow-x-hidden border-r border-slate-200/80 bg-white shadow-[0_20px_50px_rgba(15,23,42,0.18)] transition-transform duration-200 ease-out sm:static sm:z-auto sm:w-auto sm:translate-x-0 sm:rounded-[12px] sm:border sm:shadow-[0_10px_30px_rgba(15,23,42,0.04)] ${n?"translate-x-0":"pointer-events-none -translate-x-full sm:pointer-events-auto"} ${r?"thread-ui-rail-collapsed sm:items-center":""}`,children:t})}function um({children:t}){return e.jsx("main",{className:"thread-shell-main h-full min-h-0 min-w-0 overflow-hidden",children:e.jsx("div",{className:"thread-main-panel thread-shell-card flex h-full min-h-0 flex-col overflow-hidden bg-white shadow-[0_10px_30px_rgba(15,23,42,0.04)] sm:rounded-[12px] sm:border sm:border-slate-200/80",children:t})})}function mm({children:t}){return e.jsx("div",{className:"thread-topbar-surface flex shrink-0 flex-col border-b border-slate-200 bg-white pt-[env(safe-area-inset-top)] sm:pt-0",children:t})}function pm({children:t}){return e.jsx("div",{className:"thread-split-region min-h-0 flex-1 overflow-hidden p-0 sm:p-2",children:t})}function di(...t){return t.filter(Boolean).join(" ")}function ci({className:t,...r}){return e.jsx(ai,{"data-slot":"resizable-panel-group",className:di("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...r})}function pn({...t}){return e.jsx(Fl,{"data-slot":"resizable-panel",...t})}function hi({withHandle:t,className:r,...n}){return e.jsx(si,{"data-slot":"resizable-handle",className:di("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",r),...n,children:t?e.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:e.jsx(Od,{className:"size-2.5"})}):null})}function wo({...t}){return e.jsx(Nc,{"data-slot":"dialog",...t})}function yo({...t}){return e.jsx(Cc,{"data-slot":"dialog-trigger",...t})}function fm({...t}){return e.jsx(Lc,{"data-slot":"dialog-portal",...t})}function gm({className:t,...r}){return e.jsx(Rc,{"data-slot":"dialog-overlay",className:vt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",t),...r})}function jo({children:t,className:r,showCloseButton:n=!0,...a}){return e.jsxs(fm,{"data-slot":"dialog-portal",children:[e.jsx(gm,{}),e.jsxs(Sc,{"data-slot":"dialog-content",className:vt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",r),...a,children:[t,n?e.jsxs(Tc,{"data-slot":"dialog-close",className:"absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(kl,{}),e.jsx("span",{className:"sr-only",children:"Close"})]}):null]})]})}function No({className:t,...r}){return e.jsx("div",{"data-slot":"dialog-header",className:vt("flex flex-col gap-2 text-center sm:text-left",t),...r})}function Co({className:t,...r}){return e.jsx(Ec,{"data-slot":"dialog-title",className:vt("text-lg font-semibold leading-none",t),...r})}function So({className:t,...r}){return e.jsx(zc,{"data-slot":"dialog-description",className:vt("text-sm text-muted-foreground",t),...r})}var xm=[{value:"system",label:"Follow system",icon:kc},{value:"dark",label:"Dark",icon:wc},{value:"light",label:"Light",icon:yc}];function bm({thread:t,currentThreadId:r,currentWorkspaceId:n,workspaceLabels:a={},onOpenThread:o,getThreadHref:s,renderThreadLink:l,onBeginRenameThread:d,onDeleteThread:c,showDeleteButton:h=!1,showSessionCopyButton:p=!1,collapsed:f=!1}){const[m,x]=i.useState("idle"),v=i.useRef(null),b=a[t.workspaceId],k=b&&!n?b:null,g=r===t.id;i.useEffect(()=>()=>{v.current!==null&&window.clearTimeout(v.current)},[]);async function w(){const M=t.providerSessionId;if(M)try{await navigator.clipboard.writeText(M),x("copied"),v.current!==null&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>x("idle"),1200)}catch{x("failed"),v.current!==null&&window.clearTimeout(v.current),v.current=window.setTimeout(()=>x("idle"),1600)}}const T=()=>o(t.id),y=`thread-graph-room-card group flex w-full items-center gap-3 rounded-xl border text-left transition ${g?"is-active":""} ${f?"justify-center px-2 py-2":"px-3 py-2.5"}`,C=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`thread-graph-room-card-icon flex h-8 w-8 shrink-0 items-center justify-center rounded-full ${g?"is-active":""}`,children:e.jsx(bl,{className:"h-4 w-4"})}),e.jsxs("div",{className:`min-w-0 flex-1 ${f?"thread-desktop-collapsed-hidden":""}`,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx("p",{className:"thread-graph-room-card-title min-w-0 flex-1 truncate text-sm font-medium",title:t.title,children:t.title}),d&&!f?e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),M.preventDefault(),d(t)},"aria-label":`Rename thread ${t.title}`,title:"Rename thread",className:"thread-card-quiet-button inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition",children:e.jsx(bc,{className:"h-3 w-3"})}):null,p&&t.providerSessionId?e.jsx("button",{type:"button","aria-label":"Copy session ID",title:m==="copied"?"Copied":m==="failed"?"Copy failed":"Copy session ID",onClick:M=>{M.stopPropagation(),M.preventDefault(),w()},className:"thread-card-quiet-button thread-card-session-copy-button inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full transition",children:e.jsx(Dr,{className:"h-3.5 w-3.5"})}):null]}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2",children:[k?e.jsx("p",{className:"thread-graph-room-card-meta min-w-0 flex-1 truncate text-[11px] text-[var(--theme-fg-muted)]",title:k,children:k}):e.jsx("span",{className:"min-w-0 flex-1","aria-hidden":"true"}),e.jsx("span",{className:`shrink-0 rounded-full border px-1.5 py-0.5 text-[9px] uppercase tracking-normal ${om(t.status)}`,children:sm(t.status)}),e.jsx("time",{className:"shrink-0 text-[11px] text-[var(--theme-fg-muted)]",dateTime:t.lastTurnStartedAt??t.updatedAt,children:Cn(t.lastTurnStartedAt??t.updatedAt)})]})]}),h&&c&&!f?e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),M.preventDefault(),c(t)},"aria-label":`Delete thread ${t.title}`,className:"thread-card-danger-button shrink-0 rounded-full p-1 transition",title:"Delete thread",children:e.jsx(wr,{className:"h-3.5 w-3.5"})}):null]}),z=s==null?void 0:s(t.id);return l?e.jsx(e.Fragment,{children:l({thread:t,children:C,className:y,onClick:T})}):z?e.jsx("a",{href:z,onClick:M=>{M.preventDefault(),T()},title:f?t.title:void 0,className:y,children:C}):e.jsx("div",{role:"link",tabIndex:0,onClick:T,onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),T())},title:f?t.title:void 0,className:y,children:C})}function vm({threads:t,currentThreadId:r,currentWorkspaceId:n,workspaceLabels:a={},onOpenThread:o,getThreadHref:s,renderThreadLink:l,onBeginRenameThread:d,onDeleteThread:c,scrollable:h=!1,maxHeightClassName:p="max-h-full",showDeleteButton:f=!1,showSessionCopyButton:m=!1,collapsed:x=!1}){const v=h?`min-h-0 min-w-0 overflow-x-hidden overflow-y-auto overscroll-contain pr-1 ${p}`:"";return e.jsx("div",{className:v,children:e.jsx("div",{className:"min-w-0 space-y-1",children:t.map(b=>e.jsx(bm,{thread:b,currentThreadId:r,currentWorkspaceId:n,workspaceLabels:a,onOpenThread:o,showDeleteButton:f,showSessionCopyButton:m,collapsed:x,...s?{getThreadHref:s}:{},...l?{renderThreadLink:l}:{},...d?{onBeginRenameThread:d}:{},...c?{onDeleteThread:c}:{}},b.id))})})}function km({threads:t,status:r,loading:n=!1,error:a,viewportConstrained:o=!1,layoutMode:s="responsive",effectiveTheme:l,themeMode:d,onThemeModeChange:c,showMobileAppMenu:h=!1,showMobileThreadNavToggle:p=!1,showMobileNewThreadShortcut:f=!0,mobileHeaderAction:m,currentThreadId:x,currentThreadLabel:v=null,currentWorkspaceId:b=null,currentWorkspaceLabel:k=null,sessionLabel:g=null,usageLabel:w=null,topbarActions:T,metaContent:y,settingsContent:C,globalSettingsContent:z,workspaceLabels:M={},appMenuButton:I,appNavigationMenu:R,workspaceReturnHref:K,onWorkspaceReturn:Z,getThreadHref:D,onOpenThread:ce,getNewThreadHref:W,newThreadHref:G,newThreadLabel:Y="New Chat",onNewThread:we,onNewThreadTitle:me,renderThreadLink:Re,onCloseAppNavigation:X,onRenameThread:$,onDeleteThread:F,workspaceContent:P,workspaceTitle:O="Workspace",workspaceActions:B,children:N}){const E=am(),[V,_]=i.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1),ne=d??(E==null?void 0:E.themeMode)??"system",te=l??(E==null?void 0:E.effectiveTheme)??(ne==="system"?V?"dark":"light":ne),[je,ee]=i.useState(!1),[pe,he]=i.useState(!1),[Ce,Fe]=i.useState(!1),[J,U]=i.useState(()=>typeof window<"u"?window.matchMedia("(max-width: 639px)").matches:s==="mobile"),[re,ae]=i.useState("chat"),[Q,xe]=i.useState(null),[Ie,We]=i.useState(""),[Ge,Ve]=i.useState(null),[Qe,q]=i.useState(!1),[oe,ve]=i.useState(""),[fe,ue]=i.useState(!1),[ze,_e]=i.useState(!1),[Le,ct]=i.useState("session");i.useEffect(()=>{if(typeof window>"u")return;const ye=window.matchMedia("(max-width: 639px)"),Oe=()=>{U(ye.matches)};return Oe(),ye.addEventListener("change",Oe),()=>{ye.removeEventListener("change",Oe)}},[]),i.useEffect(()=>{if(typeof window>"u")return;const ye=window.matchMedia("(prefers-color-scheme: dark)"),Oe=()=>{_(ye.matches)};return Oe(),ye.addEventListener("change",Oe),()=>{ye.removeEventListener("change",Oe)}},[]);const ot=i.useMemo(()=>[...b?t.filter(Oe=>Oe.workspaceId===b):t].sort((Oe,ft)=>{if(Oe.id===x)return-1;if(ft.id===x)return 1;const Ke=Date.parse(Oe.lastTurnStartedAt??Oe.updatedAt);return Date.parse(ft.lastTurnStartedAt??ft.updatedAt)-Ke}),[x,b,t]),qe=G??(W==null?void 0:W(b)),ht=k??b??"all",xt=g??v??x??"default_session",St=w??(r!=null&&r.state?`runtime ${r.state}`:"waiting for agent usage"),kt=c??(E==null?void 0:E.setThemeMode),pt=!!kt,mt=()=>{ee(!1),X==null||X()};async function yt(ye){if(!$)return;const Oe=Ie.trim();if(Oe){Ve(ye);try{await $(ye,Oe),xe(null),We("")}finally{Ve(null)}}}function wt(ye){xe(ye.id),We(ye.title)}function L(){xe(null),We("")}function A(ye){ce==null||ce(ye),mt()}function ie(ye){if(!qe||!ye.trim())return qe;try{const Oe=new URL(qe,window.location.origin);return Oe.searchParams.set("title",ye.trim()),`${Oe.pathname}${Oe.search}${Oe.hash}`}catch{const Oe=qe.includes("?")?"&":"?";return`${qe}${Oe}title=${encodeURIComponent(ye.trim())}`}}async function be(){const ye=oe.trim();ue(!0);try{if(ye&&me){await me(ye),ve(""),q(!1),mt();return}if(qe){window.location.assign(ie(ye)??qe);return}await(we==null?void 0:we()),ve(""),q(!1),mt()}finally{ue(!1)}}function et(ye,Oe=!1){const ft=Oe?e.jsxs(e.Fragment,{children:[e.jsx(va,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:Y})]}):e.jsxs(e.Fragment,{children:[e.jsx(va,{className:"h-4 w-4"}),e.jsx("span",{children:Y})]});return e.jsxs(wo,{open:Qe,onOpenChange:Ke=>{fe||q(Ke)},children:[e.jsx(yo,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":Oe?Y:void 0,title:Y,className:ye,children:ft})}),e.jsxs(jo,{"data-testid":"create-thread-dialog","data-theme-effective":te,"data-theme-mode":ne,className:"thread-graph-create-thread-dialog thread-graph-dialog",children:[e.jsxs(No,{children:[e.jsx(Co,{children:"Create New Chat"}),e.jsx(So,{children:"Name the room so it is easy to find later."})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsx("input",{id:"thread-graph-create-thread-title",name:"thread-title",value:oe,onChange:Ke=>ve(Ke.target.value),onKeyDown:Ke=>{Ke.key==="Enter"&&(Ke.preventDefault(),be())},placeholder:"Chat name","aria-label":"Chat name",autoComplete:"off",className:"thread-graph-create-thread-input h-10 rounded-md border px-3 text-sm outline-none transition"}),e.jsx("button",{type:"button",onClick:()=>void be(),disabled:fe,className:"thread-graph-create-thread-submit inline-flex h-10 items-center justify-center rounded-md px-4 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:fe?"Creating...":"Create"})]})]})]})}function lt(){if(!C&&!y&&!z&&!pt)return null;const ye=!!(C||y),Oe=!!z,ft=Le==="global"&&Oe||!ye&&Oe?"global":"session";return e.jsxs(wo,{children:[e.jsx(yo,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":"Open settings",title:"Settings",className:"thread-icon-button inline-flex h-10 w-10 items-center justify-center rounded-full sm:h-9 sm:w-9",children:e.jsx(vc,{className:"h-4 w-4"})})}),e.jsxs(jo,{"data-testid":"settings-dialog","data-theme-effective":te,"data-theme-mode":ne,className:"thread-graph-settings-dialog thread-graph-dialog",children:[e.jsxs(No,{children:[e.jsx(Co,{children:"Settings"}),e.jsx(So,{children:"Manage this session and host-wide preferences."})]}),pt?e.jsx("div",{className:"thread-graph-settings-card rounded-lg border p-3",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-[var(--theme-fg)]",children:"Appearance"}),e.jsxs("p",{className:"mt-1 text-xs leading-5 text-[var(--theme-fg-muted)]",children:["Current theme: ",te]})]}),e.jsx("div",{className:"thread-graph-theme-mode-group grid grid-cols-3 gap-1 rounded-lg border p-1",role:"group","aria-label":"Theme mode",children:xm.map(Ke=>{const rt=Ke.icon,Gt=ne===Ke.value;return e.jsxs("button",{type:"button","data-testid":`theme-mode-${Ke.value}`,"aria-pressed":Gt,disabled:!pt,onClick:()=>kt==null?void 0:kt(Ke.value),className:`thread-graph-theme-mode-button inline-flex min-h-9 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-medium transition ${Gt?"is-selected":""}`,children:[e.jsx(rt,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"truncate",children:Ke.label})]},Ke.value)})})]})}):null,e.jsxs("div",{className:"thread-graph-settings-tabs grid grid-cols-2 gap-1 rounded-lg border p-1",children:[e.jsx("button",{type:"button","aria-pressed":ft==="session",onClick:()=>ct("session"),className:`thread-graph-settings-tab-button rounded-md px-3 py-2 text-sm font-medium transition ${ft==="session"?"is-active":""}`,children:"Session"}),e.jsx("button",{type:"button","aria-pressed":ft==="global",disabled:!Oe,onClick:()=>ct("global"),className:`thread-graph-settings-tab-button rounded-md px-3 py-2 text-sm font-medium transition ${ft==="global"?"is-active":""}`,children:"Global"})]}),e.jsx("div",{className:"thread-graph-settings-body mt-4 min-h-0 overflow-y-auto pr-1 text-sm",children:ft==="session"?e.jsxs("div",{className:"grid gap-4",children:[C?e.jsx("div",{className:"thread-graph-settings-card rounded-lg border p-3",children:C}):null,y?e.jsx("div",{className:"thread-graph-settings-card rounded-lg border p-3",children:y}):null,ye?null:e.jsx("div",{className:"thread-graph-settings-card rounded-lg border p-3 text-[var(--theme-fg-muted)]",children:"No session settings are available."})]}):e.jsx("div",{className:"thread-graph-settings-global-content",children:z})})]})]})}function jt(ye=!1){return e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:e.jsxs("section",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:`mb-3 flex items-center gap-2 px-2 text-xs font-medium tracking-normal text-[var(--theme-fg-muted)] ${ye?"justify-center":""}`,children:[e.jsx(jc,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:ye?"sr-only":"",children:"Rooms"}),!ye&&n?e.jsx("span",{className:"ml-auto text-xs text-[var(--theme-fg-muted)]",children:"Refreshing..."}):null]}),e.jsxs("div",{className:"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto px-1",children:[a?e.jsx("div",{className:"rounded-xl border border-rose-500/30 bg-rose-500/10 px-3 py-3 text-sm text-rose-900 dark:text-rose-100",children:a}):null,!a&&ot.length===0&&!n?e.jsx("div",{className:"rounded-xl border border-dashed border-[var(--theme-border)] bg-[var(--theme-surface)] px-4 py-6 text-sm text-[var(--theme-fg-muted)]",children:"No threads available in this view."}):null,ot.length>0?e.jsx(vm,{threads:ot,currentThreadId:x,currentWorkspaceId:b,workspaceLabels:M,onOpenThread:A,collapsed:ye,...$?{onBeginRenameThread:wt}:{},showDeleteButton:!!F,...D?{getThreadHref:D}:{},...Re?{renderThreadLink:Re}:{},...F?{onDeleteThread:F}:{}}):null]})]})})}function it(){return P?e.jsxs("div",{className:"thread-workspace-panel relative flex h-full min-h-0 flex-col overflow-hidden rounded-[12px] border",children:[e.jsx("button",{type:"button",onClick:()=>Fe(!0),className:"thread-workspace-collapse-tab thread-desktop-only-inline-flex",title:"Collapse workspace","aria-label":"Collapse workspace",children:e.jsx(dn,{className:"h-4 w-4"})}),B?e.jsx("div",{className:"pointer-events-none absolute right-12 top-2 z-20 flex items-center gap-1",children:e.jsx("div",{className:"pointer-events-auto",children:B})}):null,e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:P})]}):e.jsxs("div",{className:"thread-workspace-panel flex h-full min-h-0 flex-col overflow-hidden rounded-[12px] border",children:[e.jsxs("div",{className:"thread-workspace-panel-header flex h-12 shrink-0 items-center justify-between gap-3 border-b border-[var(--theme-border)] px-3 sm:h-[60px] sm:px-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-base font-semibold text-[var(--theme-fg)] sm:text-[18px]",children:O}),e.jsx("p",{className:"truncate text-xs text-[var(--theme-fg-muted)]",children:k??b??"Current context"})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[B,e.jsx("button",{type:"button",onClick:()=>Fe(!0),className:"thread-workspace-small-toggle thread-desktop-only-inline-flex",title:"Collapse workspace","aria-label":"Collapse workspace",children:e.jsx(dn,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:P??e.jsxs("div",{className:"grid h-full min-h-0 gap-3 overflow-y-auto p-3 text-sm text-[var(--theme-fg-soft)]",children:[e.jsxs("div",{className:"thread-workspace-card rounded-lg border p-3",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.14em] text-[var(--theme-fg-muted)]",children:"Runtime"}),e.jsx("p",{className:"mt-2 text-[var(--theme-fg)]",children:(r==null?void 0:r.state)??"unknown"})]}),e.jsxs("div",{className:"thread-workspace-card rounded-lg border p-3",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.14em] text-[var(--theme-fg-muted)]",children:"Workspace"}),e.jsx("p",{className:"mt-2 break-words text-[var(--theme-fg)]",children:k??b??"All threads"})]})]})})]})}const nt=!!P,It=s==="mobile"||s==="responsive"&&J,Nt=It;return e.jsxs(e.Fragment,{children:[e.jsx(im,{effectiveTheme:te,layoutMode:s,themeMode:ne,viewportConstrained:o,children:e.jsxs(dm,{roomsRailCollapsed:pe,children:[e.jsx(cm,{open:je,onClose:()=>ee(!1)}),e.jsxs(hm,{collapsed:pe,mobileOpen:je,children:[e.jsx("div",{className:`thread-rooms-rail-header flex h-[calc(3.75rem+env(safe-area-inset-top))] shrink-0 items-end border-b border-[var(--theme-border)] px-4 pb-3 sm:h-16 sm:items-center sm:pb-0 ${pe?"sm:w-full sm:justify-center sm:px-2":""}`,children:e.jsxs("div",{className:`flex w-full items-center gap-3 ${pe?"sm:justify-center":"justify-between"}`,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>he(ye=>!ye),className:"thread-icon-button thread-desktop-only-flex h-9 w-9 shrink-0 items-center justify-center rounded-full",title:pe?"Expand rooms":"Collapse rooms","aria-label":pe?"Expand rooms":"Collapse rooms",children:pe?e.jsx(pc,{className:"h-4 w-4"}):e.jsx(fc,{className:"h-4 w-4"})}),e.jsx("div",{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[var(--theme-accent-solid)] text-sm font-semibold text-[var(--theme-accent-solid-fg)] ${pe?"thread-desktop-collapsed-hidden":""}`,children:(k??"R").charAt(0).toUpperCase()}),e.jsxs("div",{className:`min-w-0 ${pe?"thread-desktop-collapsed-hidden":""}`,children:[e.jsx("p",{className:"truncate text-sm font-semibold text-[var(--theme-fg)]",children:k??"Remote Codex"}),e.jsx("p",{className:"truncate text-xs text-[var(--theme-fg-muted)]",children:b??"Thread workspace"})]})]}),e.jsxs("div",{className:`flex shrink-0 items-center gap-1 ${pe?"thread-desktop-collapsed-hidden":""}`,children:[lt(),K||Z?e.jsx("a",{href:K??"#",onClick:ye=>{Z&&(ye.preventDefault(),Z())},className:"thread-icon-button inline-flex h-10 w-10 items-center justify-center rounded-full sm:h-9 sm:w-9",title:"Back to workspace","aria-label":"Back to workspace",children:e.jsx(gc,{className:"h-4 w-4"})}):null,e.jsx("button",{type:"button",onClick:()=>ee(!1),"aria-label":"Close rooms",title:"Close rooms",className:"thread-icon-button thread-mobile-only-inline-flex h-10 w-10 items-center justify-center rounded-full",children:e.jsx(kl,{className:"h-4 w-4"})})]})]})}),e.jsx("div",{className:`thread-graph-new-room-strip flex shrink-0 items-center border-b ${pe?"h-12 w-full justify-center px-2 sm:h-12":"h-[68px] px-4"}`,children:et(`thread-graph-new-room-button inline-flex items-center justify-center rounded-xl font-medium transition ${pe?"h-9 w-9 p-0":"h-11 w-full gap-2 px-3 text-sm sm:h-9"}`,pe)}),e.jsx("div",{className:`flex min-h-0 flex-1 flex-col ${pe?"w-full px-2 py-2":"px-3 py-3"}`,children:jt(pe)})]}),e.jsxs(um,{children:[e.jsxs(mm,{children:[e.jsx("div",{className:"thread-topbar-row flex min-h-12 items-center px-3 py-1.5 sm:min-h-12 sm:px-4",children:e.jsxs("div",{className:"flex w-full items-center justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 sm:gap-3",children:[Nt&&p&&!je?e.jsx("button",{type:"button",onClick:()=>ee(!0),"aria-label":"Open rooms",title:"Open rooms",className:"thread-icon-button thread-mobile-only-inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full",children:e.jsx(xc,{className:"h-4 w-4"})}):null,e.jsxs("div",{className:"min-w-0",children:[Nt?e.jsx("h1",{className:"thread-mobile-only-block min-w-0 truncate text-sm font-semibold leading-none text-[var(--theme-fg)]",children:v??"Shared Workspace"}):null,e.jsxs("div",{className:"relative flex min-w-0 items-center gap-1.5",children:[e.jsxs("button",{type:"button",onClick:()=>{var ye;ht&&((ye=navigator.clipboard)==null||ye.writeText(ht))},className:"thread-topbar-meta-row flex min-w-0 max-w-full items-center gap-1 text-left text-[11px] leading-none sm:text-xs",title:"Copy room ID",children:[e.jsx("span",{className:"shrink-0",children:"Room"}),e.jsx("span",{className:"truncate font-mono",children:ht})]}),e.jsx("button",{type:"button","aria-expanded":ze,"aria-haspopup":"dialog",onClick:()=>_e(ye=>!ye),className:"thread-topbar-details-trigger inline-flex h-6 shrink-0 items-center rounded-full border px-2 text-[11px] font-medium leading-none transition",title:"Session and usage",children:"Details"}),ze?e.jsxs("div",{className:"thread-topbar-details-popover absolute left-0 top-[calc(100%+0.5rem)] z-50 w-[min(26rem,calc(100vw-1.5rem))] rounded-lg border p-2.5 shadow-lg",role:"dialog","aria-label":"Session and usage",children:[e.jsxs("button",{type:"button",onClick:()=>{var ye;xt&&((ye=navigator.clipboard)==null||ye.writeText(xt))},className:"thread-topbar-meta-row flex min-w-0 max-w-full items-center gap-2 text-left text-xs leading-5",title:"Copy session ID",children:[e.jsx("span",{className:"w-12 shrink-0",children:"Session"}),e.jsx("span",{className:"truncate font-mono",children:xt})]}),e.jsxs("div",{className:"thread-topbar-meta-row mt-1 flex min-w-0 max-w-full items-center gap-2 text-xs leading-5",title:"Room token usage",children:[e.jsx("span",{className:"w-12 shrink-0",children:"Usage"}),e.jsx("span",{className:"truncate font-mono",children:St})]})]}):null]})]})]}),e.jsxs("div",{className:"inline-flex shrink-0 items-center gap-2",children:[T?e.jsx("div",{className:"thread-graph-topbar-actions thread-desktop-only-inline-flex items-center rounded-lg border p-0.5 shadow-none",children:T}):null,Nt?m:null,Nt&&f?et("thread-secondary-action inline-flex h-10 items-center justify-center gap-2 rounded-lg border px-3 text-sm font-medium sm:h-9"):null]})]})}),Nt&&nt?e.jsxs("div",{className:"thread-mobile-view-switch thread-mobile-only-grid grid-cols-2 gap-1 px-3 pb-2",children:[e.jsx("button",{type:"button",onClick:()=>ae("chat"),className:`thread-mobile-segment h-10 rounded-lg text-sm font-medium transition ${re==="chat"?"is-active":""}`,children:"Chat"}),e.jsx("button",{type:"button",onClick:()=>ae("workspace"),className:`thread-mobile-segment h-10 rounded-lg text-sm font-medium transition ${re==="workspace"?"is-active":""}`,children:"Workspace"})]}):null]}),e.jsx(pm,{children:nt&&!Ce?It?e.jsxs("div",{className:"thread-split-container thread-graph-shell-mobile-split h-full min-h-0 overflow-hidden",children:[e.jsx("div",{className:`h-full min-h-0 overflow-hidden ${re==="chat"?"block":"thread-mobile-chat-hidden"}`,children:N}),e.jsx("div",{className:`h-full min-h-0 overflow-hidden ${re==="workspace"?"block":"thread-mobile-workspace-hidden"}`,children:it()})]}):e.jsxs(ci,{direction:"horizontal",className:"thread-split-container thread-graph-shell-resizable thread-graph-shell-desktop-split h-full min-h-0 overflow-hidden",children:[e.jsx(pn,{defaultSize:47,minSize:30,maxSize:75,className:"thread-split-chat-pane min-w-0 overflow-hidden",children:N}),e.jsx(hi,{className:"thread-resize-handle w-2 bg-transparent after:w-px after:bg-slate-200/80 after:transition-colors hover:after:bg-slate-300 dark:after:bg-[#303642] dark:hover:after:bg-[#475063]"}),e.jsx(pn,{defaultSize:53,minSize:30,maxSize:70,className:"thread-split-workspace-pane min-w-0 overflow-hidden",children:it()})]}):e.jsxs("div",{className:"thread-split-container relative h-full min-h-0 overflow-hidden",children:[nt&&Ce?e.jsx("button",{type:"button",onClick:()=>Fe(!1),className:"thread-workspace-expand-fab thread-desktop-only-inline-flex",title:"Expand workspace","aria-label":"Expand workspace",children:e.jsx(Ba,{className:"h-4 w-4"})}):null,N]})})]})]})}),e.jsx(lm,{open:Q!==null,title:"Rename Thread",label:"Thread Title",value:Ie,busy:Ge!==null,onChange:We,onCancel:L,onSubmit:()=>Q?yt(Q):void 0})]})}function wm({open:t,title:r,text:n,onClose:a}){return i.useEffect(()=>{if(!t)return;function o(s){s.key==="Escape"&&a()}return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}},[a,t]),t?bn.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[90] flex items-center justify-center p-4 sm:p-6",children:[e.jsx("button",{type:"button","aria-label":"Close full text",onClick:a,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":r,className:"relative z-[1] flex max-h-[min(82vh,52rem)] w-full max-w-4xl flex-col overflow-hidden rounded-[1.8rem] border border-stone-700 bg-stone-900 shadow-2xl shadow-stone-950/40",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-stone-800 px-4 py-3 sm:px-5",children:[e.jsx("p",{className:"truncate text-sm font-medium text-stone-100",children:r}),e.jsx("button",{type:"button","aria-label":"Close dialog",onClick:a,className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:e.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-4 sm:px-5",children:e.jsx("pre",{className:"whitespace-pre-wrap break-words text-sm leading-6 text-stone-200",children:n})})]})]}),document.body):null}function ym({entries:t,expandedGroups:r,onToggleGroupedItem:n,renderCommandGroup:a,renderFileChangeGroup:o,renderFileReadGroup:s,renderItem:l,renderSearchGroup:d}){return e.jsx(e.Fragment,{children:t.map(c=>{const h=r[c.key]??!1,p=()=>n(c.key);return c.kind==="commandGroup"?a(c,h,p):c.kind==="fileChangeGroup"?o(c,h,p):c.kind==="searchGroup"?d(c,h,p):c.kind==="fileReadGroup"?s(c,h,p):l(c)})})}function jm(t){return!t||typeof t!="object"?!1:Array.isArray(t.content)}function Nm(t){return t.trim().toLowerCase()==="extxyz"?"xyz":t.trim().toLowerCase()}function Cm({artifact:t,expanded:r,onToggleExpanded:n}){const a=jm(t.payload)?t.payload:null;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-3 text-left",children:[e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-medium text-[var(--theme-fg)]",children:t.title}),e.jsx("span",{className:"mt-1 block text-xs text-[var(--theme-fg-muted)]",children:t.summaryText??t.type})]}),e.jsx("span",{className:"rounded-full border border-[var(--theme-border)] px-2 py-1 text-[10px] uppercase tracking-[0.16em] text-[var(--theme-fg-muted)]",children:r?"Hide":"Open"})]}),r&&a&&e.jsx("div",{className:"h-[min(56vh,34rem)] min-h-[26rem]",children:e.jsx(oi,{source:a,moleculeId:t.id,title:t.title})}),r&&!a&&e.jsx("pre",{className:"max-h-80 overflow-auto rounded-[0.9rem] border border-[var(--theme-border)] bg-[var(--theme-surface-strong)] p-3 text-xs text-[var(--theme-fg-soft)]",children:JSON.stringify(t.payload,null,2)})]})}function Sm({code:t,isIncomplete:r,language:n}){const[a,o]=i.useState(!0),[s,l]=i.useState(!1),d=Nm(n),c=i.useMemo(()=>({content:[t.endsWith(`
|
|
3484
|
+
`)?t:`${t}
|
|
3485
|
+
`],format:d,name:`${d.toUpperCase()} structure`,uuid:`inline:${d}:${t.length}`}),[t,d]);return r||!Nu(t,d)?null:e.jsxs("div",{className:"my-3 overflow-hidden rounded-[1rem] border border-[var(--theme-border)] bg-[var(--theme-surface)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-[var(--theme-border)] px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-[var(--theme-fg)]",children:[d.toUpperCase()," molecule"]}),e.jsx("p",{className:"mt-0.5 text-xs text-[var(--theme-fg-muted)]",children:"Rendered from message source"})]}),e.jsxs("div",{className:"inline-flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>l(h=>!h),className:"rounded-full border border-[var(--theme-border)] px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-fg-muted)] transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]",children:s?"Hide source":"Source"}),e.jsx("button",{type:"button",onClick:()=>o(h=>!h),className:"rounded-full border border-[var(--theme-border)] px-2.5 py-1 text-[10px] font-medium uppercase tracking-[0.16em] text-[var(--theme-fg-muted)] transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]",children:a?"Collapse":"Open"})]})]}),a&&e.jsx("div",{className:"h-[min(52vh,32rem)] min-h-[24rem]",children:e.jsx(oi,{source:c,moleculeId:c.uuid,title:`${d.toUpperCase()} molecule`})}),s&&e.jsx("pre",{className:"max-h-96 overflow-auto border-t border-[var(--theme-border)] bg-[var(--theme-surface-strong)] px-3 py-3 text-xs leading-5 text-[var(--theme-fg-soft)]",children:t})]})}var Pr=[{manifest:mu,threadPanels:[{id:"terminal",kind:"terminal",label:"Terminal"}]},{manifest:cu,renderArtifact:t=>e.jsx(Cm,{...t}),inlineCodeRenderers:[{languages:["xyz","extxyz","cif","pdb"],render:t=>e.jsx(Sm,{...t})}]}];function Ca(t,r){const n=new Map(r.map(s=>[s.id,s])),a=t.map(s=>{var l,d;return{...s.manifest,enabled:((l=n.get(s.manifest.id))==null?void 0:l.enabled)??!0,source:((d=n.get(s.manifest.id))==null?void 0:d.source)??"builtin"}}),o=new Set(t.map(s=>s.manifest.id));for(const s of r)o.has(s.id)||a.push(s);return a}function Wa(){const t=Ca(Pr,[]),r=Pr;return{plugins:t,loading:!1,error:null,async refresh(){},async importPluginManifest(){},async setPluginEnabled(){},async uninstallPlugin(){},renderArtifact:o=>{var l;const s=r.find(d=>d.renderArtifact&&d.manifest.capabilities.artifactTypes.some(c=>c.type===o.artifact.type));return((l=s==null?void 0:s.renderArtifact)==null?void 0:l.call(s,o))??null},renderInlineCode:o=>{for(const s of r)for(const l of s.inlineCodeRenderers??[]){if(!l.languages.includes(o.language.trim().toLowerCase()))continue;const d=l.render(o);if(d)return d}return null},hasRendererForArtifact:o=>r.some(s=>!!s.renderArtifact&&s.manifest.capabilities.artifactTypes.some(l=>l.type===o.type)),getThreadPanels:()=>r.flatMap(o=>o.threadPanels??[])}}var ui=i.createContext(Wa());function qa(){return i.useContext(ui)??Wa()}var Tm=[/^(?: {0,3})#{1,6}\s+\S/m,/^(?: {0,3})>{1,}\s*\S/m,/^(?: {0,3})(?:[-+*]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?\S/m,/^(?: {0,3})(?:```|~~~)/m,/^(?: {0,3})(?:[-*_]\s*){3,}$/m],Em=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,zm=/!?\[[^\]\n]+\]\([^)]+\)/,Lm=/`[^`\n]+`/,Rm=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,Im=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,Pm=/~~[^~\n]+~~/;function Mm(t){const r=t.trim();return r?Tm.some(n=>n.test(r))||Em.test(r)?!0:/[`[\]*_~!]/.test(r)?zm.test(r)||Lm.test(r)||Rm.test(r)||Im.test(r)||Pm.test(r):!1:!1}function Ka(...t){return t.filter(Boolean).join(" ")}function Fr({...t}){return e.jsx(Rd,{"data-slot":"accordion",...t})}function Gr({className:t,...r}){return e.jsx(Id,{"data-slot":"accordion-item",className:Ka("border-b last:border-b-0",t),...r})}function Or({className:t,children:r,...n}){return e.jsx(Pd,{className:"flex",children:e.jsxs(Md,{"data-slot":"accordion-trigger",className:Ka("flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium outline-none transition-all hover:underline disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...n,children:[r,e.jsx(ml,{className:"pointer-events-none size-4 shrink-0 translate-y-0.5 text-[var(--theme-fg-muted)] transition-transform duration-200"})]})})}function Hr({className:t,children:r,...n}){return e.jsx($d,{"data-slot":"accordion-content",className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:e.jsx("div",{className:Ka("pb-4 pt-0",t),children:r})})}function mi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function To(t){return mi(t)?Object.entries(t):t==null||t===""?[]:[["value",t]]}function pi(t){return typeof t=="string"?e.jsxs("span",{className:"thread-graph-tool-string",children:['"',t,'"']}):typeof t=="number"?e.jsx("span",{className:"thread-graph-tool-number",children:t}):typeof t=="boolean"?e.jsx("span",{className:"thread-graph-tool-boolean",children:String(t)}):t===null?e.jsx("span",{className:"thread-graph-tool-null",children:"null"}):typeof t=="object"?e.jsx("span",{className:"thread-graph-tool-object",children:JSON.stringify(t)}):e.jsx("span",{children:String(t)})}function $m(t,r){return typeof r=="string"&&(t==="stdout"||t==="stderr"||t==="result")?e.jsx("pre",{className:"thread-graph-tool-output",children:r||"(empty)"}):typeof r=="object"&&r!==null?e.jsx("pre",{className:"thread-graph-tool-output",children:JSON.stringify(r,null,2)}):pi(r)}function Eo({callId:t,toolName:r,status:n,parameters:a,result:o}){const s=i.useMemo(()=>{switch(n){case"completed":return{className:"is-completed",icon:e.jsx(Da,{className:"h-3.5 w-3.5"}),label:"Completed"};case"failed":return{className:"is-failed",icon:e.jsx(vn,{className:"h-3.5 w-3.5"}),label:"Failed"};default:return{className:"is-pending",icon:e.jsx(Aa,{className:"h-3.5 w-3.5 animate-spin"}),label:"Running"}}},[n]),l=i.useMemo(()=>To(o),[o]),d=i.useMemo(()=>To(a),[a]),c=i.useMemo(()=>typeof o=="string"?o.length>0:mi(o)?["stdout","stderr","result"].some(m=>{const x=o[m];return typeof x=="string"&&x.length>0}):!1,[o]),h=n==="pending"||c,[p,f]=i.useState(h?"item-1":void 0);return i.useEffect(()=>{h&&f("item-1")},[t,h]),e.jsx("div",{className:"thread-graph-tool-call my-2 w-full font-sans not-prose",children:e.jsx(Fr,{type:"single",collapsible:!0,onValueChange:m=>f(m||void 0),className:"thread-graph-tool-accordion w-full overflow-hidden rounded-lg border",...p!==void 0?{value:p}:{},children:e.jsxs(Gr,{value:"item-1",className:"border-0",children:[e.jsx(Or,{className:"thread-graph-tool-trigger px-4 py-3 hover:no-underline",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(_a,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-sm font-semibold",children:r}),e.jsxs("span",{className:`thread-graph-tool-badge ${s.className}`,children:[s.icon,s.label]})]})}),e.jsxs(Hr,{className:"thread-graph-tool-content px-4 pb-4 pt-1",children:[e.jsxs("section",{children:[e.jsx("h4",{children:"Parameters"}),e.jsxs("div",{className:"thread-graph-tool-json",children:["{",e.jsx("br",{}),d.length>0?d.map(([m,x],v)=>e.jsxs("div",{children:[e.jsxs("span",{className:"thread-graph-tool-key",children:['"',m,'"']}),e.jsx("span",{className:"thread-graph-tool-punctuation",children:": "}),pi(x),v<d.length-1?e.jsx("span",{className:"thread-graph-tool-punctuation",children:","}):null]},m)):e.jsx("div",{children:e.jsx("span",{className:"thread-graph-tool-null",children:"empty"})}),"}"]})]}),l.length>0?e.jsxs("section",{children:[e.jsx("h4",{children:"Result"}),e.jsxs("div",{className:"thread-graph-tool-json",children:["{",e.jsx("br",{}),l.map(([m,x],v)=>e.jsxs("div",{children:[e.jsxs("span",{className:"thread-graph-tool-key",children:['"',m,'"']}),e.jsx("span",{className:"thread-graph-tool-punctuation",children:": "}),$m(m,x),v<l.length-1?e.jsx("span",{className:"thread-graph-tool-punctuation",children:","}):null]},m)),"}"]})]}):null]})]})})})}var zo=null;function _m(){return zo??(zo=Promise.all([st(()=>import("./core-DIQen2lE.js"),__vite__mapDeps([0,1,2])),st(()=>import("./engine-javascript-DBd1bXLz.js"),[]),st(()=>import("./ayu-light-BA47KaF1.js"),[]),st(()=>import("./ayu-dark-DYE7WIF3.js"),[]),st(()=>import("./javascript-wDzz0qaB.js"),[]),st(()=>import("./typescript-BPQ3VLAy.js"),[]),st(()=>import("./tsx-COt5Ahok.js"),[]),st(()=>import("./jsx-g9-lgVsj.js"),[]),st(()=>import("./python-B6aJPvgy.js"),[]),st(()=>import("./json-Cp-IABpG.js"),[]),st(()=>import("./shellscript-CEILq0vU.js").then(t=>t.b),[]),st(()=>import("./shellscript-CEILq0vU.js").then(t=>t.s),[]),st(()=>import("./yaml-Buea-lGh.js"),[]),st(()=>import("./toml-vGWfd6FD.js"),[]),st(()=>import("./markdown-Cvjx9yec.js"),[]),st(()=>import("./html-pp8916En.js"),__vite__mapDeps([3,4,5])),st(()=>import("./css-CLj8gQPS.js"),[]),st(()=>import("./sql-CRqJ_cUM.js"),[]),st(()=>import("./csv-fuZLfV_i.js"),[])]).then(([{createHighlighterCore:t},{createJavaScriptRegexEngine:r},n,a,o,s,l,d,c,h,p,f,m,x,v,b,k,g,w])=>t({engine:r(),themes:[n.default,a.default],langs:[o.default,s.default,l.default,d.default,c.default,h.default,p.default,f.default,m.default,x.default,v.default,b.default,k.default,g.default,w.default]}))),zo}function Sn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Sa(t){if(!t)return{};if(Sn(t)&&Object.prototype.hasOwnProperty.call(t,"0"))try{const r=Object.keys(t).map(Number).filter(n=>Number.isFinite(n)).sort((n,a)=>n-a).map(n=>String(t[String(n)]??"")).join("");return JSON.parse(r)}catch{return t}if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}function Ta(){return{finalResult:null,stdout:"",stderr:""}}function Am(t){return typeof t=="string"?{result:t}:t}function fi(t){const r=Sn(t.finalResult)?{...t.finalResult}:t.finalResult!=null?{result:t.finalResult}:{};return t.stdout&&(r.stdout=t.stdout),t.stderr&&(r.stderr=t.stderr),!("status"in r)&&(t.stdout||t.stderr)&&(r.status="pending"),r}function Lo(t){if(!t)return"pending";if(!Sn(t))return"completed";const r=t.status;return r==="stream"||r==="pending"||r==="running"?"pending":r==="failed"||r==="error"||r==="timed_out"||typeof t.exit_code=="number"&&t.exit_code!==0?"failed":"completed"}function Dm(t){const r=new Map,n=/```tool-result\s*([\s\S]*?)\s*```/g,a=t.replace(n,(l,d)=>{try{const c=JSON.parse(d),h=c.call_id;if(typeof h!="string")return l;const p=Am(c.result),f=r.get(h)??Ta();return Sn(p)&&p.status==="stream"&&typeof p.chunk=="string"?p.stream==="stderr"?f.stderr+=p.chunk:f.stdout+=p.chunk:f.finalResult=p,r.set(h,f),""}catch{return l}}),o=/```tool-call\s*([\s\S]*?)\s*```/g;return{processedContent:a.replace(o,(l,d)=>{try{const c=JSON.parse(d),h=c.call_id,p=c.tool;if(typeof p!="string")return l;const f=Sa(c.args);if(typeof h=="string"&&r.has(h)){const m=fi(r.get(h)??Ta());return`\`\`\`tool-merged
|
|
3486
|
+
${JSON.stringify({call:{tool:p,args:f,call_id:h},result:m},null,2)}
|
|
3487
|
+
\`\`\``}return l}catch{return l}}),resultMap:r}}function Ro(t){return t.replace(/background-color:[^;"]+;?/g,"background-color: transparent;").replace(/background:[^;"]+;?/g,"background: transparent;")}function Io(t){return Array.isArray(t)?t.map(r=>String(r)).join(""):String(t??"")}function Bm(t){if(!t||typeof t!="object"||!("position"in t))return{startLine:void 0,endLine:void 0};const r=t.position;if(!r||typeof r!="object")return{startLine:void 0,endLine:void 0};const n=r.start,a=r.end,o=n&&typeof n=="object"?n.line:void 0,s=a&&typeof a=="object"?a.line:void 0;return{startLine:typeof o=="number"?o:void 0,endLine:typeof s=="number"?s:void 0}}function Fm({children:t,...r}){return Gm(t)?e.jsx(e.Fragment,{children:t}):e.jsx("pre",{...r,children:t})}function Gm(t){var n;if(!t||typeof t!="object"||!("props"in t))return!1;const r=(n=t.props)==null?void 0:n.className;return typeof r!="string"?!1:r.includes("language-tool-call")||r.includes("language-tool-merged")||r.includes("language-tool-result")}var Om=i.memo(function({className:r="thread-graph-markdown",content:n}){const a=i.useRef(null),o=qa(),[s,l]=i.useState(null),[d,c]=i.useState({}),[h,p]=i.useState(!1),{processedContent:f,resultMap:m}=i.useMemo(()=>Dm(n),[n]);i.useEffect(()=>{let b=!0;return _m().then(k=>{b&&l(k)}).catch(()=>{}),()=>{b=!1}},[]),i.useEffect(()=>{const b=a.current,k=b==null?void 0:b.closest(".thread-ui-shell"),g=()=>k?k.getAttribute("data-theme-effective")==="dark"||k.classList.contains("dark")||k.classList.contains("thread-ui-theme-dark"):document.documentElement.classList.contains("dark");if(p(g()),!k)return;const w=new MutationObserver(()=>p(g()));return w.observe(k,{attributes:!0,attributeFilter:["class","data-theme-effective"]}),()=>w.disconnect()},[]);async function x(b,k){try{await navigator.clipboard.writeText(k),c(g=>({...g,[b]:"copied"})),window.setTimeout(()=>{c(g=>{const w={...g};return delete w[b],w})},1200)}catch{c(g=>({...g,[b]:"failed"}))}}const v=({children:b,className:k,inline:g,node:w,...T})=>{var Z;const y=/language-(\w+(?:-\w+)*)/.exec(k||""),C=y?y[1]??"":"",z=Io(b).replace(/\n$/,""),{startLine:M,endLine:I}=Bm(w),R=g===!1||!!k||z.includes(`
|
|
3488
|
+
`)||M!==I;if(C==="tool-merged"){let D={call:{tool:"Unknown",args:{},call_id:void 0},result:null};try{D=JSON.parse(z)}catch{D={call:{tool:"Error",args:{raw:z}},result:{status:"failed"}}}const ce=typeof D.call.tool=="string"?D.call.tool:"Unknown",W=typeof D.call.call_id=="string"?D.call.call_id:void 0;return e.jsx(Eo,{callId:W,toolName:ce,status:Lo(D.result),parameters:Sa(D.call.args),result:D.result})}if(C==="tool-call"){let D={tool:"Unknown",args:{},call_id:void 0};try{D=JSON.parse(z)}catch{D={tool:"Error",args:{raw:z}}}const ce=typeof D.call_id=="string"?D.call_id:void 0,W=ce&&m.has(ce)?fi(m.get(ce)??Ta()):void 0;return e.jsx(Eo,{callId:ce,toolName:typeof D.tool=="string"?D.tool:"Unknown",status:W?Lo(W):"pending",parameters:Sa(D.args),result:W})}if(C==="tool-result")return null;if(["xyz","extxyz","cif","pdb"].includes(C)){const D=o.renderInlineCode({code:z,isIncomplete:!1,language:C});if(i.isValidElement(D))return D}if(R){const ce=(((Z=s==null?void 0:s.getLoadedLanguages)==null?void 0:Z.call(s))??[]).includes(C)?C:"text",W=h?"ayu-dark":"ayu-light",G=`${C||"text"}:${z.length}:${z.slice(0,32)}`;let Y="";if(s)try{Y=Ro(s.codeToHtml(z,{lang:ce,theme:W}))}catch{Y=Ro(s.codeToHtml(z,{lang:"text",theme:W}))}return e.jsxs("div",{className:"thread-graph-code-block not-prose relative my-3 overflow-auto rounded-xl border p-3 text-sm shadow-sm",children:[e.jsx(Ar,{type:"button",onClick:()=>void x(G,z),variant:"ghost",size:"sm",className:"thread-graph-code-copy absolute right-2 top-2 z-10 rounded-md p-1.5",title:d[G]==="copied"?"Copied":d[G]==="failed"?"Copy failed":"Copy","aria-label":"Copy code",children:e.jsx(Dr,{className:"h-3.5 w-3.5"})}),Y?e.jsx("div",{dangerouslySetInnerHTML:{__html:Y}}):e.jsx("pre",{children:e.jsx("code",{className:"whitespace-pre",children:z})})]})}const K=Io(b).replace(/`+/g,"");return e.jsx("code",{className:`thread-graph-inline-code rounded px-1 py-0.5 font-mono font-normal text-[0.9em] ${k||""}`,...T,children:K})};return e.jsx("div",{ref:a,className:`thread-graph-message-markdown ${r}`,children:e.jsx(Bc,{remarkPlugins:[Gc,Oc],rehypePlugins:[Fc],components:{code:v,pre:Fm},children:f})})}),Po=4e3,Hm=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,Vm=/[),.;:!?]+$/;function Um(t){return t.startsWith("www.")?`https://${t}`:t}function Mo(t){const r=t.replace(/[\\/]+$/,"").trim();return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function Wm(t){var s;if(!t)return[];const r=/\[(PHOTO|FILE)\s+([^\]]+)\]/g,n=[];let a=0,o=0;for(const l of t.matchAll(r)){const d=l.index??0;d>a&&(n.push({type:"text",key:`text-${o}`,text:t.slice(a,d)}),o+=1);const c=l[1],h=((s=l[2])==null?void 0:s.trim())??"";c==="PHOTO"&&h?n.push({type:"photo",key:`photo-${o}`,path:h}):c==="FILE"&&h?n.push({type:"file",key:`file-${o}`,path:h}):n.push({type:"text",key:`text-${o}`,text:l[0]}),o+=1,a=d+l[0].length}return a<t.length&&n.push({type:"text",key:`text-${o}`,text:t.slice(a)}),n}function kr({text:t}){var a;const r=[];let n=0;for(const o of t.matchAll(Hm)){const s=o[0],l=o.index??0,d=((a=s.match(Vm))==null?void 0:a[0])??"",c=d?s.slice(0,-d.length):s;c&&(l>n&&r.push(t.slice(n,l)),r.push(e.jsx("a",{href:Um(c),target:"_blank",rel:"noreferrer",className:"thread-inline-link",children:c},`${l}-${c}`)),d&&r.push(d),n=l+s.length)}return n<t.length&&r.push(t.slice(n)),e.jsx(e.Fragment,{children:r.length>0?r:t})}var gi=i.memo(function({text:r,scrollRootRef:n,streaming:a=!1,containerClassName:o="",plainTextClassName:s="thread-graph-plain-text whitespace-pre-wrap break-words text-[15px] leading-6",markdownClassName:l="thread-graph-markdown",onBeforeResize:d}){const c=i.useRef(null),h=i.useRef(null),[p,f]=i.useState(!1),m=Mm(r),x=!a&&r.length>Po,v=x&&!p?`${r.slice(0,Po).trimEnd()}
|
|
3489
|
+
|
|
3490
|
+
...`:r,[b,k]=i.useState(a||typeof IntersectionObserver>"u"),g=i.useCallback(()=>{const w=n.current,T=c.current,y=(T==null?void 0:T.getBoundingClientRect().top)??null;d==null||d(),h.current=w&&y!==null?{root:w,top:y}:null,f(C=>!C)},[d,n]);return i.useLayoutEffect(()=>{const w=h.current,T=c.current;if(!w||!T)return;h.current=null;const y=()=>{const z=T.getBoundingClientRect().top;w.root.scrollTop+=z-w.top};y();const C=window.requestAnimationFrame(y);return()=>{window.cancelAnimationFrame(C)}},[p]),i.useEffect(()=>{if(a||typeof IntersectionObserver>"u"){k(!0);return}if(b||!c.current)return;const w=new IntersectionObserver(T=>{for(const y of T)if(y.isIntersecting){k(!0),w.disconnect();break}},{root:n.current,threshold:0});return w.observe(c.current),()=>{w.disconnect()}},[b,n,a]),e.jsxs("div",{ref:c,className:o,children:[b&&m?e.jsx(Om,{content:v,className:l}):e.jsx("p",{className:s,children:e.jsx(kr,{text:v})}),x?e.jsx("button",{type:"button",onClick:g,className:"thread-graph-show-more timeline-meta-text mt-1.5 flex w-full items-center justify-center rounded-md border border-[var(--theme-border)] px-2 py-0.5 text-[10px] leading-4 transition hover:bg-[var(--theme-hover)] hover:text-[var(--theme-fg)]",children:p?"Show less":`Show more (${r.length.toLocaleString()} chars)`}):null]})}),qm=i.memo(function({text:r,scrollRootRef:n,streaming:a=!1,onBeforeResize:o}){return e.jsx(gi,{text:r,scrollRootRef:n,streaming:a,containerClassName:"thread-graph-message-prose",...o?{onBeforeResize:o}:{}})}),Km=i.memo(function({threadId:r,text:n,getImageAssetUrl:a}){const o=i.useMemo(()=>Wm(n),[n]);return e.jsx("div",{className:"thread-graph-message-prose whitespace-pre-wrap break-words text-[15px] leading-6",children:o.map(s=>{if(s.type==="text")return e.jsx("span",{children:s.text},s.key);if(s.type==="photo"){const d=r?(a==null?void 0:a({threadId:r,path:s.path}))??null:null,c=Mo(s.path)||"Attached image";return e.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:e.jsxs("span",{className:"inline-flex max-w-full flex-col rounded-[1rem] border border-sky-300/28 bg-sky-300/[0.08] p-1.5 shadow-sm shadow-stone-950/20",children:[d?e.jsx("img",{src:d,alt:c,className:"h-[4.5rem] w-[6rem] rounded-[0.75rem] bg-stone-950 object-contain",loading:"lazy"}):e.jsx("span",{className:"inline-flex h-[4.5rem] w-[6rem] items-center justify-center rounded-[0.75rem] bg-stone-950 text-[10px] text-sky-100",children:"PHOTO"}),e.jsx("span",{className:"mt-1 max-w-[7rem] truncate text-[10px] font-medium tracking-[0.08em] text-sky-50",title:s.path,children:c})]})},s.key)}const l=Mo(s.path)||"Attached file";return e.jsx("span",{className:"mx-[0.14rem] inline-flex align-middle",children:e.jsxs("span",{className:"inline-flex max-w-[12rem] items-center gap-2 rounded-[0.95rem] border border-emerald-300/28 bg-emerald-300/[0.08] px-2.5 py-2 text-[10px] font-medium tracking-[0.08em] text-emerald-50 shadow-sm shadow-stone-950/20",title:s.path,children:[e.jsx("span",{className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-emerald-200/20 bg-emerald-300/12 text-[9px]",children:"FILE"}),e.jsx("span",{className:"min-w-0 truncate",children:l})]})},s.key)})})});function Tn({children:t,className:r,count:n,countBadgeClassName:a,desktopIconClassName:o,expanded:s,expandedListClassName:l,icon:d,onToggleExpanded:c,runningIndicator:h,summary:p,toggleAriaLabel:f,trailingSummary:m}){return e.jsx("div",{className:`thread-graph-history-group ${r} relative min-w-0 w-full overflow-hidden rounded-[0.9rem] border px-3 py-2.5`,children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("div",{className:"thread-graph-history-group-icon mt-0.5 flex shrink-0 items-center",children:[e.jsxs("span",{className:`relative inline-flex h-8 w-8 items-center justify-center rounded-[0.9rem] border shadow-sm shadow-stone-950/20 ${o}`,children:[d,e.jsx("span",{className:`absolute -right-1 -top-1 inline-flex min-w-[1.1rem] items-center justify-center rounded-full border bg-stone-950/90 px-1 text-[9px] font-semibold leading-4 ${a}`,children:n})]}),h]}),e.jsxs("div",{className:"thread-graph-history-group-card min-w-0 flex-1 rounded-[0.85rem] border px-3 py-2",children:[e.jsxs("button",{type:"button","aria-expanded":s,"aria-label":f,onClick:c,className:"thread-graph-history-group-toggle flex w-full min-w-0 items-center justify-between gap-3 text-left",children:[e.jsx("div",{className:"thread-graph-history-group-summary min-w-0 flex flex-1 flex-wrap items-center gap-2 pr-1",children:p}),m]}),s?e.jsx("div",{className:`thread-graph-history-group-list mt-3 space-y-2 border-t pt-3 ${l}`,children:t}):null]})]})})}var Xm=Br("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium outline-none transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function En({asChild:t=!1,className:r,variant:n,...a}){const o=t?pl:"span";return e.jsx(o,{"data-slot":"badge",className:vt(Xm({variant:n,className:r})),...a})}function zn(t){if(!t)return!1;const r=t.trim().toLowerCase();return r==="running"||r==="in_progress"||r==="in progress"||r==="pending"}function Zm(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),e.jsx("path",{d:"M9 2.75v2h2"}),e.jsx("path",{d:"M6.2 8h3.6"}),e.jsx("path",{d:"M6.2 10h1.7"})]})}function Ym(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M5 2.75h4l2 2v6.5a1.5 1.5 0 0 1-1.5 1.5h-4A1.5 1.5 0 0 1 4 11.25v-7A1.5 1.5 0 0 1 5.5 2.75Z"}),e.jsx("path",{d:"M9 2.75v2h2"}),e.jsx("path",{d:"M6.15 7.25h3.7"}),e.jsx("path",{d:"M6.15 9.25h2.8"}),e.jsx("path",{d:"m10.4 10.7 1.2 1.2"}),e.jsx("circle",{cx:"9.25",cy:"9.55",r:"1.45"})]})}function Jm(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2.75",y:"3",width:"8.5",height:"3",rx:"1.1"}),e.jsx("rect",{x:"4.25",y:"6.5",width:"8.5",height:"3",rx:"1.1"}),e.jsx("rect",{x:"5.75",y:"10",width:"7.5",height:"3",rx:"1.1"}),e.jsx("path",{d:"m6.25 4.5 1 1-1 1"}),e.jsx("path",{d:"M7.9 5.5h1.7"}),e.jsx("path",{d:"m7.75 8 1 1-1 1"}),e.jsx("path",{d:"M9.4 9h1.7"})]})}function Qm(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"6",cy:"6",r:"2.3"}),e.jsx("path",{d:"m8 8 1.6 1.6"}),e.jsx("circle",{cx:"9.3",cy:"8.8",r:"2"}),e.jsx("path",{d:"m10.75 10.25 1.65 1.65"}),e.jsx("circle",{cx:"11.2",cy:"4.75",r:"1.8"}),e.jsx("path",{d:"m12.45 6 1.1 1.1"})]})}function ep(t){const r=t.trim();if(!r)return"";const n=r.match(/(, \+\d+ more.*)$/),a=(n==null?void 0:n[1])??"",s=(a?r.slice(0,-a.length):r).replace(/\\/g,"/");if(!s.startsWith("/"))return`${s.replace(/^\.\//,"")}${a}`;const l=["/apps/","/packages/","/src/","/test/","/tests/","/docs/","/config/","/scripts/","/e2e/","/.agents/","/.codex/"];for(const d of l){const c=s.indexOf(d);if(c>=0)return`${s.slice(c+1)}${a}`}return r}function xi(t,r=42){const n=ep(t);if(!n)return"";const a=n.match(/(, \+\d+ more.*)$/),o=(a==null?void 0:a[1])??"",s=o?n.slice(0,-o.length):n;if(s.length<=r)return`${s}${o}`;const d=s.replace(/\\/g,"/").split("/").filter(Boolean);if(d.length>1){const c=[];let h=o.length+4;for(let p=d.length-1;p>=0;p-=1){const f=d[p],m=h+f.length+(c.length>0?1:0);if(c.length>0&&m>r)break;c.unshift(f),h=m}if(c.length>0)return`.../${c.join("/")}${o}`}return`...${s.slice(-(r-o.length-3))}${o}`}function tp(t){var a;const r=[];if(typeof t.changedFiles=="number"&&t.changedFiles>0&&r.push(`${t.changedFiles} ${t.changedFiles===1?"file":"files"}`),typeof t.addedLines=="number"&&t.addedLines>0&&r.push(`+${t.addedLines}`),typeof t.removedLines=="number"&&t.removedLines>0&&r.push(`-${t.removedLines}`),r.length>0)return r;const n=(a=t.previewText)==null?void 0:a.trim();return n?n.replace(/\bfiles changed\b/gi,"files").replace(/\bfile changed\b/gi,"file").split("·").map(o=>o.trim()).filter(Boolean):[]}function Ea({tone:t="amber"}){const r=t==="emerald"?"bg-sky-200/90":t==="sky"?"bg-sky-300/90":"bg-amber-200/90";return e.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>e.jsx("span",{className:`h-1.5 w-1.5 animate-pulse rounded-full ${r}`,style:{animationDelay:`${n*180}ms`}},n))})}function rp(t){var n;const r=t.replace(/\r\n/g,`
|
|
3491
|
+
`).split(`
|
|
3492
|
+
`);for(;r.length>1&&((n=r.at(-1))==null?void 0:n.trim())==="";)r.pop();return r}function At(t){const r=rp(t);return r.length===1?{firstLine:r[0]??"",showGap:!1,isTruncated:!1}:{firstLine:r[0]??"",showGap:!0,isTruncated:!0}}function bi(t){const r=(t==null?void 0:t.trim().toLowerCase())??"";return r==="completed"||r==="complete"||r==="success"||r==="succeeded"?{className:"is-completed",icon:e.jsx(Da,{className:"h-3.5 w-3.5"}),label:"Completed"}:r==="failed"||r==="failure"||r==="error"||r==="errored"?{className:"is-failed",icon:e.jsx(vn,{className:"h-3.5 w-3.5"}),label:"Failed"}:zn(t)?{className:"is-pending",icon:e.jsx(Aa,{className:"h-3.5 w-3.5 animate-spin"}),label:(t==null?void 0:t.trim())||"Running"}:{className:"is-neutral",icon:null,label:(t==null?void 0:t.trim())||"Event"}}function np(t){switch(t){case"command":return"is-command";case"tool":return"is-tool";case"agent":return"is-agent";case"skill":return"is-skill";case"search":return"is-search";case"fileRead":return"is-file-read"}}function ap(t){switch(t){case"plan":return"is-plan";case"context":return"is-context";case"generic":return"is-generic";case"image":return"is-image";case"fileChange":return"is-file-change";case"artifact":return"is-artifact";case"hook":return"is-hook"}}function dr({actions:t,children:r,className:n,headerMeta:a,icon:o,item:s,title:l,tone:d}){const c=bi(s.status);return e.jsxs("div",{className:`thread-graph-event thread-graph-history-event ${ap(d)} ${n??""}`,children:[e.jsx("div",{className:"thread-graph-history-event-icon","aria-hidden":"true",children:o}),e.jsxs("div",{className:"thread-graph-history-event-card",children:[e.jsxs("div",{className:"thread-graph-history-event-header",children:[e.jsxs("div",{className:"thread-graph-history-event-heading flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"thread-graph-history-event-title min-w-0 truncate font-mono text-sm font-semibold",children:l}),s.status?e.jsxs(En,{variant:"outline",className:`thread-graph-tool-badge ${c.className} rounded-full px-2 py-0.5 text-xs font-normal`,children:[c.icon,c.label]}):null,a]}),t?e.jsx("div",{className:"thread-graph-history-event-actions",children:t}):null]}),r?e.jsx("div",{className:"thread-graph-history-event-body",children:r}):null]})]})}function yr({actionLabel:t="Open details",actionTitle:r,className:n,details:a,icon:o,item:s,onOpen:l,preview:d,title:c,tone:h}){const p=bi(s.status),[f,m]=i.useState(zn(s.status)?"item-1":void 0);return e.jsx("div",{className:`thread-graph-event thread-graph-history-tool ${np(h)} ${n??""}`,children:e.jsx(Fr,{type:"single",collapsible:!0,onValueChange:x=>m(x||void 0),className:"thread-graph-tool-accordion thread-graph-history-tool-accordion w-full overflow-hidden rounded-lg border",...f!==void 0?{value:f}:{},children:e.jsxs(Gr,{value:"item-1",className:"border-0",children:[e.jsx(Or,{className:"thread-graph-tool-trigger thread-graph-history-tool-trigger px-4 py-3 hover:no-underline",children:e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e.jsx("span",{className:"thread-graph-history-tool-icon shrink-0",children:o}),e.jsx("span",{className:"min-w-0 truncate font-mono text-sm font-semibold",children:c}),e.jsxs(En,{variant:"outline",className:`thread-graph-tool-badge ${p.className} ml-1 sm:ml-2 rounded-full px-2 py-0.5 text-xs font-normal`,children:[p.icon,p.label]})]})}),e.jsxs(Hr,{className:"thread-graph-tool-content thread-graph-history-tool-content px-4 pb-4 pt-1",children:[e.jsxs("section",{children:[e.jsx("h4",{children:"Summary"}),e.jsxs("div",{className:"thread-graph-history-tool-summary",children:[e.jsx(kr,{text:d.firstLine}),d.showGap?e.jsx("span",{className:"thread-graph-history-tool-ellipsis",children:"..."}):null]})]}),a?e.jsx("section",{children:a}):null,e.jsxs("button",{type:"button","aria-label":t,onClick:l,className:"thread-graph-history-tool-open inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition",children:[e.jsx(Ld,{className:"h-3.5 w-3.5"}),r]})]})]})})})}var sp=i.memo(function({item:r,scrollRootRef:n,onBeforeResize:a}){return e.jsx(dr,{className:"thread-graph-event-plan",icon:e.jsx(vd,{className:"h-4 w-4"}),item:r,title:"plan",tone:"plan",children:e.jsx("div",{className:"thread-graph-history-event-prose",children:e.jsx(gi,{text:r.text,scrollRootRef:n,plainTextClassName:"thread-graph-plain-text whitespace-pre-wrap break-words text-sm leading-6",markdownClassName:"thread-graph-markdown text-sm",...a?{onBeforeResize:a}:{}})})})}),op=i.memo(function({item:r}){const n=zn(r.status)||r.text==="Compacting context",a=n?"Compacting context":"Context compacted",o=r.detailText&&r.detailText!==a?r.detailText:null;return e.jsxs(dr,{className:"thread-graph-event-context",icon:e.jsx(kd,{className:"h-4 w-4"}),item:r,title:"context",tone:"context",children:[e.jsxs("div",{className:"thread-graph-history-event-line",children:[e.jsx("span",{className:"thread-graph-history-event-primary",children:a}),n?e.jsx(Ea,{tone:"emerald"}):null]}),o?e.jsx("p",{className:"thread-graph-history-event-secondary",title:o,children:o}):null]})}),lp=i.memo(function({item:r}){return e.jsx(dr,{className:"thread-graph-event-generic",icon:e.jsx(wd,{className:"h-4 w-4"}),item:r,title:r.kind,tone:"generic",children:e.jsx("pre",{className:"thread-graph-history-event-pre",children:e.jsx(kr,{text:r.text})})})}),ip=i.memo(function({item:r,onOpen:n}){const a=At(r.previewText??r.text);return e.jsx(yr,{actionLabel:"Open full command",actionTitle:"Command Output",className:"thread-graph-event-command",icon:e.jsx(ul,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Command Output"),preview:a,title:"command",tone:"command"})}),dp=i.memo(function({item:r,onOpen:n}){const a=At(r.text);return e.jsx(yr,{actionLabel:"Open full tool call",actionTitle:"Tool Call Details",className:"thread-graph-event-tool",icon:e.jsx(_a,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Tool Call Details"),preview:a,title:"tool_call",tone:"tool"})}),cp=i.memo(function({item:r,onOpen:n}){const a=At(r.text);return e.jsx(yr,{actionLabel:"Open agent details",actionTitle:"Agent Details",className:"thread-graph-event-agent-tool",icon:e.jsx(yd,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Agent Details"),preview:a,title:"agent",tone:"agent"})}),hp=i.memo(function({item:r,onOpen:n}){const a=At(r.text);return e.jsx(yr,{actionLabel:"Open skill details",actionTitle:"Skill Details",className:"thread-graph-event-skill-tool",icon:e.jsx(jd,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Skill Details"),preview:a,title:"skill",tone:"skill"})}),up=i.memo(function({item:r,onOpen:n}){var l,d;const a=((l=r.previewText)==null?void 0:l.trim())||r.text||"Web search",o=((d=r.detailText)==null?void 0:d.trim())||r.text||"Web search",s=At(a);return e.jsx(yr,{actionLabel:"Open full web search",actionTitle:"Web Search Details",className:"thread-graph-event-search",icon:e.jsx(Nd,{className:"h-4 w-4"}),item:r,onOpen:()=>n("Web Search Details",o),preview:s,title:"web_search",tone:"search"})}),mp=i.memo(function({item:r,onOpen:n}){var l,d;const a=((l=r.previewText)==null?void 0:l.trim())||r.text||"File read",o=((d=r.detailText)==null?void 0:d.trim())||r.text||"File read",s=At(a);return e.jsx(yr,{actionLabel:"Open full file read",actionTitle:"File Read Details",className:"thread-graph-event-file-read",icon:e.jsx(Cd,{className:"h-4 w-4"}),item:r,onOpen:()=>n("File Read Details",o),preview:s,title:"file_read",tone:"fileRead"})}),pp=i.memo(function({threadId:r,item:n,onOpen:a,getImageAssetUrl:o}){const s=n.assetPath??n.detailText??null,l=r&&s?(o==null?void 0:o({threadId:r,path:s}))??null:null;return e.jsxs(dr,{className:"thread-graph-event-image",icon:e.jsx(Sd,{className:"h-4 w-4"}),item:n,title:"image",tone:"image",children:[l?e.jsx("button",{type:"button",onClick:()=>a("Image Path",s??n.text),className:"block w-full text-left",children:e.jsx("img",{src:l,alt:n.text||"Image preview",className:"thread-graph-history-event-image",loading:"lazy"})}):e.jsx("div",{className:"thread-graph-history-event-summary",children:n.text}),s?e.jsx("button",{type:"button",onClick:()=>a("Image Path",s),className:"thread-graph-history-event-path",title:s,children:s}):null]})}),fp=i.memo(function({item:r,onOpen:n}){var p,f,m;const a=(p=r.previewText)!=null&&p.trim()&&r.text.trim()!==r.previewText.trim()?r.text.trim():null,o=((f=r.detailText)==null?void 0:f.trim())||null,s=xi(a??((m=r.previewText)==null?void 0:m.trim())??r.text,48),l=tp(r),d=!!(o||r.hasDeferredDetail),c=e.jsxs("div",{className:"thread-graph-event-line thread-graph-file-change-inline flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip text-sm",title:a??s,children:s}),l.length>0&&e.jsx("div",{className:"inline-flex shrink-0 items-center justify-end gap-1.5 text-xs",children:l.map(x=>e.jsx("span",{className:`thread-graph-history-delta-badge ${x.startsWith("+")?"is-add":x.startsWith("-")?"is-remove":"is-neutral"}`,children:x},x))})]}),h=d?e.jsx("button",{type:"button","aria-label":"Open file change details",onClick:()=>n("File Change Details",o??r.text),className:"thread-graph-file-change-inline-button min-w-0 flex-1 text-left",title:a??s,children:c}):c;return e.jsx(dr,{className:"thread-graph-event-file-change",headerMeta:h,icon:e.jsx(Td,{className:"h-4 w-4"}),item:r,title:"file_change",tone:"fileChange"})}),gp=i.memo(function({item:r,onSelect:n}){const a=qa(),[o,s]=i.useState(!1),l=r.artifact,d=l?a.renderArtifact({artifact:l,expanded:o,onToggleExpanded:()=>s(c=>!c)}):null;return e.jsx(dr,{actions:e.jsxs("span",{className:"inline-flex items-center gap-2",children:[l&&!a.hasRendererForArtifact(l)?e.jsx("span",{className:"thread-graph-history-event-secondary",children:"No renderer"}):null,l&&n?e.jsxs("button",{type:"button","aria-label":`Open artifact inspector for ${l.title}`,onClick:()=>n(r,l),className:"thread-graph-history-event-action",children:[e.jsx(Hs,{className:"h-3.5 w-3.5"}),"Inspect"]}):null]}),className:"thread-graph-event-artifact",icon:e.jsx(Hs,{className:"h-4 w-4"}),item:r,title:(l==null?void 0:l.type)??"artifact",tone:"artifact",children:d??e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:()=>s(c=>!c),className:"thread-graph-history-event-summary is-clickable flex w-full items-center justify-between gap-3 text-left",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"thread-graph-history-event-primary block truncate",children:(l==null?void 0:l.title)??r.text}),e.jsx("span",{className:"thread-graph-history-event-secondary mt-1 block truncate",children:(l==null?void 0:l.summaryText)??r.previewText??r.text})]}),e.jsx("span",{className:"thread-graph-history-event-pill",children:o?"Hide":"Open"})]}),o?e.jsx("pre",{className:"thread-graph-history-event-pre max-h-80 overflow-auto",children:JSON.stringify((l==null?void 0:l.payload)??r,null,2)}):null]})})}),xp=i.memo(function({item:r}){var c,h;const n=((c=r.hookOutputEntries)==null?void 0:c.map(p=>p.text.trim()).filter(Boolean).join(`
|
|
3493
|
+
`).trim())??"",a=r.hookEventLabel?`${r.hookEventLabel} hook`:r.text,o=((h=r.hookStatusMessage)==null?void 0:h.trim())||(r.previewText&&r.previewText!==r.hookStatusMessage?r.previewText.trim():"")||r.text.trim(),l=At(n||(o&&o!==a?o:a)),d=!!(n&&l.showGap);return e.jsx(dr,{className:"thread-graph-event-hook",icon:e.jsx(Ed,{className:"h-4 w-4"}),item:r,title:r.hookEventLabel?`${r.hookEventLabel}_hook`:"hook",tone:"hook",children:e.jsxs("div",{className:"thread-graph-history-event-line",children:[e.jsx("p",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:n?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"thread-graph-history-event-secondary mr-2 font-sans text-[11px] uppercase",children:a}),e.jsx(kr,{text:l.firstLine})]}):e.jsx(kr,{text:l.firstLine&&l.firstLine!==a?`${a} · ${l.firstLine}`:a})}),d?e.jsx("span",{className:"thread-graph-history-detail-meta shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})})}),bp=i.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.filter(d=>zn(d.status)).length,l=r.length===1?"1 command":`${r.length} commands`;return e.jsx(Tn,{className:"thread-graph-history-group-command",count:r.length,countBadgeClassName:"border-amber-200/35 text-amber-100",desktopIconClassName:"border-amber-300/30 bg-amber-300/[0.14] text-amber-100",expanded:n,expandedListClassName:"border-amber-300/12",icon:e.jsx(Jm,{}),onToggleExpanded:a,runningIndicator:s>0?e.jsx(Ea,{}):null,summary:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"rounded-full border border-amber-300/28 bg-amber-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-amber-100",children:"Batch"}),e.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:l}),s>0?e.jsx("span",{className:"inline-flex items-center text-xs text-amber-100/90",children:e.jsx(Ea,{})}):null]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} command entries`,children:r.map((d,c)=>{const h=At(d.text);return e.jsxs("button",{type:"button","aria-label":`Open grouped command ${c+1}`,onClick:()=>o(d,`Command Output ${c+1}`),className:"thread-graph-history-detail-row block w-full rounded-md border px-3 py-2 text-left transition",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"rounded-full border border-amber-300/18 bg-amber-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-amber-100",children:["Step ",c+1]}),d.status&&e.jsx("span",{className:"thread-graph-history-detail-meta text-xs",children:d.status})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[e.jsx("p",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?e.jsx("span",{className:"thread-graph-history-detail-meta shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},d.id)})})}),vp=i.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.length===1?"1 search":`${r.length} searches`;return e.jsx(Tn,{className:"thread-graph-history-group-search",count:r.length,countBadgeClassName:"border-sky-200/35 text-sky-100",desktopIconClassName:"border-sky-300/30 bg-sky-300/[0.14] text-sky-100",expanded:n,expandedListClassName:"border-sky-300/12",icon:e.jsx(Qm,{}),onToggleExpanded:a,summary:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"rounded-full border border-sky-300/28 bg-sky-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-sky-100",children:"Batch"}),e.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:s})]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} web search entries`,children:r.map((l,d)=>{var f,m;const c=((f=l.previewText)==null?void 0:f.trim())||l.text||"Web search",h=At(c),p=((m=l.detailText)==null?void 0:m.trim())||l.text||"Web search";return e.jsxs("button",{type:"button","aria-label":`Open grouped web search ${d+1}`,onClick:()=>o(`Web Search ${d+1}`,p),className:"thread-graph-history-detail-row block w-full rounded-md border px-3 py-2 text-left transition",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"rounded-full border border-sky-300/18 bg-sky-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-sky-100",children:["Search ",d+1]}),l.status&&e.jsx("span",{className:"thread-graph-history-detail-meta text-xs",children:l.status})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[e.jsx("p",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?e.jsx("span",{className:"thread-graph-history-detail-meta shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},l.id)})})}),kp=i.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.length===1?"1 file read":`${r.length} file reads`;return e.jsx(Tn,{className:"thread-graph-history-group-file-read",count:r.length,countBadgeClassName:"border-cyan-200/35 text-cyan-100",desktopIconClassName:"border-cyan-300/30 bg-cyan-300/[0.14] text-cyan-100",expanded:n,expandedListClassName:"border-cyan-300/12",icon:e.jsx(Ym,{}),onToggleExpanded:a,summary:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"rounded-full border border-cyan-300/28 bg-cyan-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-cyan-100",children:"Batch"}),e.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:s})]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} file read entries`,children:r.map((l,d)=>{var f,m;const c=((f=l.previewText)==null?void 0:f.trim())||l.text||"File read",h=At(c),p=((m=l.detailText)==null?void 0:m.trim())||l.text||"File read";return e.jsxs("button",{type:"button","aria-label":`Open grouped file read ${d+1}`,onClick:()=>o(`File Read ${d+1}`,p),className:"thread-graph-history-detail-row block w-full rounded-md border px-3 py-2 text-left transition",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"rounded-full border border-cyan-300/18 bg-cyan-300/[0.07] px-2 py-0.5 text-[10px] uppercase tracking-[0.18em] text-cyan-100",children:["Read ",d+1]}),l.status&&e.jsx("span",{className:"thread-graph-history-detail-meta text-xs",children:l.status})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 text-sm leading-6",children:[e.jsx("p",{className:"thread-graph-history-detail-text min-w-0 flex-1 overflow-hidden whitespace-nowrap text-clip",children:h.firstLine}),h.showGap?e.jsx("span",{className:"thread-graph-history-detail-meta shrink-0 text-[11px] font-medium tracking-[0.28em]",children:"..."}):null]})]},l.id)})})}),wp=i.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.reduce((h,p)=>h+(p.changedFiles??0),0),l=r.reduce((h,p)=>h+(p.addedLines??0),0),d=r.reduce((h,p)=>h+(p.removedLines??0),0),c=r.length===1?"1 file change":`${r.length} file changes`;return e.jsx(Tn,{className:"thread-graph-history-group-file-change",count:r.length,countBadgeClassName:"border-lime-200/35 text-lime-100",desktopIconClassName:"border-lime-300/30 bg-lime-300/[0.14] text-lime-100",expanded:n,expandedListClassName:"border-lime-300/12",icon:e.jsx(Zm,{}),onToggleExpanded:a,summary:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"rounded-full border border-lime-300/28 bg-lime-300/12 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.24em] text-lime-100",children:"Batch"}),e.jsx("span",{className:"rounded-full border border-stone-700/90 bg-stone-900/80 px-2 py-0.5 text-[10px] font-medium uppercase tracking-[0.16em] text-stone-300",children:c}),s>0?e.jsxs("span",{className:"thread-graph-history-detail-meta text-xs",children:[s," files"]}):null]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} file change entries`,trailingSummary:e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[l>0?e.jsxs("span",{className:"thread-graph-history-delta-badge is-add",children:["+",l]}):null,d>0?e.jsxs("span",{className:"thread-graph-history-delta-badge is-remove",children:["-",d]}):null]}),children:r.map((h,p)=>{var x,v,b,k;const f=((x=h.detailText)==null?void 0:x.trim())||((v=h.previewText)==null?void 0:v.trim())||h.text,m=(b=h.previewText)!=null&&b.trim()&&h.text.trim()!==h.previewText.trim()?h.text.trim():((k=h.previewText)==null?void 0:k.trim())||h.text;return e.jsx("button",{type:"button","aria-label":`Open grouped file change ${p+1}`,onClick:()=>o(`File Change ${p+1}`,f),className:"thread-graph-history-detail-row block w-full rounded-md border px-3 py-2 text-left transition",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"thread-graph-history-detail-text min-w-0 flex-1 text-sm leading-6",title:m,children:xi(m,34)}),e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5",children:[(h.addedLines??0)>0?e.jsxs("span",{className:"thread-graph-history-delta-badge is-add",children:["+",h.addedLines]}):null,(h.removedLines??0)>0?e.jsxs("span",{className:"thread-graph-history-delta-badge is-remove",children:["-",h.removedLines]}):null]})]})},h.id)})})});function yp(){return e.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(t=>e.jsx("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-sky-200/90",style:{animationDelay:`${t*180}ms`}},t))})}function $o({status:t}){if(!t)return null;const r=t.toLowerCase(),n=r.includes("running")||r.includes("generating")||r.includes("steering")?"ui-status-warning":r.includes("failed")||r.includes("error")?"ui-status-danger":r.includes("accepted")||r.includes("complete")?"ui-status-success":"ui-status-neutral";return e.jsxs("span",{className:`thread-graph-message-status inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-normal ${n}`,children:[r.includes("running")||r.includes("generating")?e.jsx(yp,{}):null,t]})}function jp({children:t,copyButton:r,kind:n,reasoning:a,status:o,timeLabel:s,timeTitle:l}){const d=n==="userMessage",c=s?e.jsx("time",{dateTime:l??void 0,title:l??void 0,className:"thread-graph-message-time text-[10px] leading-none sm:text-[11px]",children:s}):null;return e.jsx("div",{"data-testid":"chat-message","data-role":d?"user":"assistant",className:"thread-graph-message flex justify-start",children:e.jsxs("div",{className:`thread-graph-message-bubble min-w-0 w-full max-w-full ${d?"is-user":"is-assistant"}`,children:[d?null:e.jsxs("div",{className:"thread-graph-message-header mb-2 flex flex-col gap-1.5 sm:flex-row sm:items-start sm:justify-between sm:gap-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[e.jsx("span",{className:"thread-graph-message-sender rounded-full px-2.5 py-1 text-xs font-semibold tracking-[0.02em]",children:"Assistant"}),e.jsx($o,{status:o??"Complete"})]}),r||c?e.jsxs("div",{className:"thread-graph-message-header-actions flex shrink-0 items-center gap-2 sm:pt-1",children:[r,c]}):null]}),a,e.jsx("div",{className:`thread-graph-message-content min-w-0 ${d?"is-user":"is-assistant"}`,children:t}),d&&(o||c)?e.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[o?e.jsx($o,{status:o}):null,c]}):null]})})}function oa(t){if(!t)return!1;const r=t.toLowerCase();return r.includes("running")||r.includes("inprogress")||r.includes("in_progress")}function Np({tone:t="amber"}){const r=t==="sky"?"bg-sky-300/90":"bg-amber-200/90";return e.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>e.jsx("span",{className:`h-1.5 w-1.5 animate-pulse rounded-full ${r}`,style:{animationDelay:`${n*180}ms`}},n))})}var Mr=i.memo(function({threadId:r,item:n,scrollRootRef:a,streaming:o=!1,adapter:s,timeLabel:l,timeTitle:d,onBeforeMessageResize:c}){const[h,p]=i.useState("idle"),[f,m]=i.useState(!1),x=i.useRef(null),v=n.kind==="agentMessage"?n.reasoningItems??[]:[],b=v.map(y=>y.text.trim()).filter(Boolean).join(`
|
|
3494
|
+
|
|
3495
|
+
`),k=n.kind==="userMessage"&&(n.status==="Steering"||n.status==="Accepted"||n.status==="Awaiting response");i.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current)},[]);async function g(){try{await navigator.clipboard.writeText(n.text),p("copied"),x.current!==null&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>p("idle"),1200)}catch{p("failed"),x.current!==null&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>p("idle"),1600)}}const w=n.kind==="agentMessage"?e.jsx("button",{type:"button","aria-label":"Copy agent reply",title:h==="copied"?"Copied":h==="failed"?"Copy failed":"Copy agent reply",onClick:()=>void g(),className:`thread-graph-message-copy inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border transition ${h==="copied"?"ui-status-info":h==="failed"?"ui-status-danger":""}`,children:e.jsx(Dr,{className:"h-3.5 w-3.5"})}):null,T=n.kind==="agentMessage"&&b?e.jsx("div",{className:"thread-graph-message-thinking mb-3 mt-2",children:e.jsx(Fr,{type:"single",collapsible:!0,className:"thread-graph-thinking-accordion w-full border-none",onValueChange:y=>m(!!y),...f?{value:"thoughts"}:{},children:e.jsxs(Gr,{value:"thoughts",className:"border-b-0",children:[e.jsx(Or,{className:"thread-graph-thinking-trigger py-2 hover:no-underline",children:e.jsxs("div",{className:"thread-graph-thinking-label flex items-center gap-2 text-sm font-medium transition-colors",children:[e.jsx(zd,{className:`h-4 w-4 ${v.some(y=>oa(y.status))?"animate-pulse":""}`}),e.jsx("span",{children:v.some(y=>oa(y.status))?"Thinking...":"Thought Process"}),v.some(y=>oa(y.status))?e.jsx(Np,{tone:"sky"}):null]})}),e.jsx(Hr,{className:"thread-graph-thinking-content pb-0",children:e.jsx("pre",{className:"thread-graph-thinking-body my-1 max-h-56 overflow-auto whitespace-pre-wrap break-words rounded-xl border p-3 text-[12px] leading-5",children:e.jsx(kr,{text:b})})})]})})}):null;return e.jsx(jp,{kind:n.kind,status:k||n.kind==="agentMessage"?n.status:null,copyButton:w,reasoning:T,timeLabel:l,timeTitle:d,children:n.kind==="agentMessage"?e.jsx(qm,{text:n.text,scrollRootRef:a,streaming:o,...c?{onBeforeResize:c}:{}}):e.jsx(Km,{threadId:r,text:n.text,getImageAssetUrl:s==null?void 0:s.getImageAssetUrl})})});function Cp(t){const r=t.trim().toLowerCase();return r==="completed"||r==="done"||r==="complete"?"completed":r==="in_progress"||r==="in-progress"||r==="running"||r==="active"?"in_progress":r==="failed"||r==="error"||r==="cancelled"?"failed":r==="pending"||r==="todo"?"pending":"unknown"}function Sp({status:t}){const r=Cp(t),n=r==="completed"?"Plan step status: Completed":r==="in_progress"?"Plan step status: In progress":r==="pending"?"Plan step status: Pending":r==="failed"?"Plan step status: Failed":`Plan step status: ${t}`,a=r==="completed"?"thread-graph-plan-status is-completed":r==="in_progress"?"thread-graph-plan-status is-running":r==="pending"?"thread-graph-plan-status is-pending":r==="failed"?"thread-graph-plan-status is-failed":"thread-graph-plan-status is-unknown";return e.jsx(En,{"aria-label":n,title:n.replace("Plan step status: ",""),className:a,children:r==="completed"?e.jsx(Da,{className:"h-3.5 w-3.5"}):r==="in_progress"?e.jsx(Aa,{className:"h-3.5 w-3.5 animate-spin"}):r==="pending"?e.jsx(Hd,{className:"h-3.5 w-3.5"}):r==="failed"?e.jsx(vn,{className:"h-3.5 w-3.5"}):e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function Tp({livePlan:t}){return e.jsxs("div",{className:"thread-graph-plan-card rounded-xl border px-3 py-3",children:[e.jsxs("div",{className:"thread-graph-plan-header flex flex-wrap items-center justify-between gap-2",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Plan update"}),e.jsx(En,{className:"thread-graph-plan-badge",children:"Live"})]}),t.explanation?e.jsx("p",{className:"thread-graph-plan-explanation mt-3 text-sm",children:t.explanation}):null,e.jsx("div",{className:"mt-3 space-y-2",children:t.plan.map((r,n)=>e.jsxs("div",{className:"thread-graph-plan-step flex items-center justify-between gap-3 rounded-lg border px-3 py-2 text-sm",children:[e.jsx("span",{className:"thread-graph-plan-step-text min-w-0 flex-1",children:r.step}),e.jsx(Sp,{status:r.status})]},`${t.turnId}-${n}`))})]})}function Ep({footer:t,history:r,liveHookPrompt:n,liveOutput:a,livePlan:o}){return e.jsxs(e.Fragment,{children:[r,o?e.jsx(Tp,{livePlan:o}):null,n??a??null,t]})}function zp({absoluteIndex:t,body:r,collapsed:n,error:a,footer:o,headerStatus:s,isActive:l=!1,onToggleCollapse:d,refCallback:c,startedAt:h,timeLabel:p,timeTitle:f,tokenSummary:m}){return e.jsxs("article",{ref:c,"data-testid":"chat-turn","data-turn-active":l?"true":"false",className:"thread-graph-turn px-3 py-2 sm:px-5 sm:py-3",children:[e.jsxs("div",{className:"thread-graph-turn-header flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex flex-1 items-start gap-1.5",children:[e.jsxs("div",{className:"min-w-0 flex flex-1 items-center gap-1.5 overflow-hidden",children:[e.jsxs("span",{className:"thread-graph-turn-index rounded-[0.6rem] border px-1.5 py-0.5 text-[10px] uppercase tracking-[0.16em]",children:["Turn ",t]}),e.jsx("time",{dateTime:h??void 0,title:f,className:"thread-graph-turn-time shrink-0 text-[10px] sm:text-[11px]",children:p}),s,a?e.jsx("p",{className:"hidden truncate text-[11px] text-rose-200 sm:block",children:a}):null]}),m]}),e.jsx("button",{type:"button","aria-label":`${n?"Expand":"Collapse"} turn ${t}`,title:n?"Expand turn":"Collapse turn",onClick:d,className:"thread-graph-turn-collapse inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md transition",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:n?e.jsx("path",{d:"m4.5 10 3.5-3.5L11.5 10"}):e.jsx("path",{d:"m4.5 6 3.5 3.5L11.5 6"})})})]}),a?e.jsx("p",{className:"mt-1 text-[11px] text-rose-200 sm:hidden",children:a}):null,n?null:e.jsxs("div",{className:"thread-graph-turn-body mt-2 space-y-2",children:[r,o]})]})}var _o=10,Lp=10,za=80;function Rp(t){const r=i.useRef(null),n=i.useRef(0),a=r.current;return(a===null||a.length!==t.length||t.some((s,l)=>!Object.is(s,a[l])))&&(n.current+=1,r.current=t),n.current}function Ao(t){return t.replace(/"/g,'"').replace(/'/g,"'").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function La(t){const r=t.trim().match(/^<hook_prompt(?:\s+hook_run_id="([^"]+)")?>([\s\S]*)<\/hook_prompt>$/);if(!r)return null;const n=r[1]?Ao(r[1]):null,a=Ao(r[2]??"").trim(),o=(n==null?void 0:n.split(":")[0])??"hook",s=o==="stop"?"Stop":o,l=(n==null?void 0:n.split(":").slice(2).join(":"))||null;return{id:`live-hook-prompt:${n??"unknown"}`,kind:"hook",text:`${s} hook`,previewText:a||`${s} hook`,detailText:a||null,status:"Completed",hookEventName:o,hookEventLabel:s,hookHandlerType:"command",hookScope:"turn",hookSource:l?"project":null,hookSourcePath:l,hookStatusMessage:null,hookOutputEntries:a?[{kind:"warning",text:a}]:[]}}function Ip(t){return t==="userMessage"||t==="agentMessage"}function Pp(t){return t==="commandExecution"||t==="webSearch"||t==="fileRead"||t==="fileChange"||t==="image"||t==="contextCompaction"}function Mp(t){return t==="agentMessage"||t==="reasoning"||t==="agentToolCall"||t==="skillToolCall"||t==="toolCall"||t==="plan"}function $p(t,r){if(!r)return t;const n=[...t],a=n.findIndex(s=>s.kind==="userMessage");if(a<0)return n;for(let s=a+1;s<n.length;s+=1){const l=n[s];if(!l||l.kind!=="userMessage")continue;let d=s+1;for(;d<n.length&&Pp(n[d].kind);)d+=1;if(d===s+1)continue;const[c]=n.splice(s,1);n.splice(d-1,0,c),s=d-1}let o=!1;return n.map((s,l)=>s.kind!=="userMessage"?s:o?n.slice(l+1).some(c=>Mp(c.kind))?s:{...s,status:"Awaiting response"}:(o=!0,s))}function Ut(t){return typeof t.sequence=="number"&&Number.isFinite(t.sequence)}function en(t){return Ut(t)?t.sequence:Number.POSITIVE_INFINITY}function Do(t){var h;const r=[];let n=0;for(;n<t.length&&((h=t[n])==null?void 0:h.kind)==="userMessage"&&!Ut(t[n]);)r.push(t[n]),n+=1;const a=t.slice(n);if(!a.some(Ut))return t;const o=a.map(p=>en(p)).filter(Number.isFinite),s=o.length>0?Math.max(...o):0,l=[];let d=0;for(;d<a.length;){const p=a[d];if(Ut(p)){l.push({item:p,index:d,order:en(p)}),d+=1;continue}const f=d;for(;d<a.length&&!Ut(a[d]);)d+=1;const m=a.slice(f,d),x=[...a.slice(0,f)].reverse().find(Ut),v=a.slice(d).find(Ut),b=x?en(x):null,k=v?en(v):null;m.forEach((g,w)=>{let T;if(b===null&&k!==null)T=k-(m.length-w)/(m.length+1);else if(b!==null&&k!==null&&k>b){const y=k-b;T=b+(w+1)/(m.length+1)*y}else T=s+1+w/(m.length+1);l.push({item:g,index:f+w,order:T})})}const c=l.sort((p,f)=>{const m=p.order-f.order;return m===0?p.index-f.index:m}).map(p=>p.item);return[...r,...c]}function _p(t,r){if(!r||r.length===0)return Do(t);const n=new Map(r.map(s=>[s.id,s])),a=t.map(s=>{const l=n.get(s.id);if(!l)return s;n.delete(s.id);const d={...s,...l,text:l.text||s.text},c=l.detailText??s.detailText,h=l.previewText??s.previewText,p=l.status??s.status,f=l.sequence??s.sequence;return c!==void 0&&(d.detailText=c),h!==void 0&&(d.previewText=h),p!==void 0&&(d.status=p),f!==void 0&&(d.sequence=f),d}),o=[...n.values()];return o.length===0&&!a.some(Ut)||(a.push(...o),!a.some(s=>typeof s.sequence=="number"&&Number.isFinite(s.sequence)))?a:Do(a)}function Ap(t,r){if(!t)return"";const n=r.filter(c=>c.kind==="agentMessage").map(c=>c.text).filter(c=>c.length>0),a=n.at(-1)??"";if(a){const c=t.lastIndexOf(a);if(c>=0){const h=t.slice(c+a.length);return h.trim()?h:""}}const o=n.join("");if(!o)return t;const s=Math.min(t.length,o.length);let l=0;for(;l<s&&t[l]===o[l];)l+=1;if(l===0)return t;const d=t.slice(l);return d.trim()?d:""}function vi(t){if(!t)return!1;const r=t.toLowerCase();return r.includes("running")||r.includes("inprogress")||r.includes("in_progress")}function fn(t){return t==="inProgress"||t==="sending"}function Er(t,r=za){return t.scrollHeight-t.scrollTop-t.clientHeight<=r}function Dp(t,r){const n=t.getBoundingClientRect(),a=r.getBoundingClientRect(),o=Math.max(n.top,a.top),s=Math.min(n.bottom,a.bottom);return Math.max(0,s-o)>0}function Bp(t){var c,h;const r=[];let n=0;const a=new Set,o=[];function s(){const p=r.at(-1);return(p==null?void 0:p.kind)!=="item"||p.item.kind!=="agentMessage"?null:p}function l(p,f){if(f.length!==0){p.item={...p.item,reasoningItems:[...p.item.reasoningItems??[],...f]};for(const m of f)a.add(m.id)}}function d(){const p=o.splice(0);for(const f of p)r.push({kind:"item",key:f.id,item:f})}for(;n<t.length;){const p=t[n];if(!p)break;if(a.has(p.id)){n+=1;continue}if(p.kind==="reasoning"){let x=n;const v=[];for(;x<t.length&&((c=t[x])==null?void 0:c.kind)==="reasoning";)v.push(t[x]),x+=1;const b=s();b?l(b,v):o.push(...v),n=x;continue}if(p.kind==="agentMessage"){const x=o.splice(0),v={kind:"item",key:p.id,item:p};l(v,x),r.push(v),n+=1;continue}if(p.kind!=="commandExecution"&&p.kind!=="fileChange"&&p.kind!=="webSearch"&&p.kind!=="fileRead"){r.push({kind:"item",key:p.id,item:p}),n+=1;continue}const f=[];for(;n<t.length&&((h=t[n])==null?void 0:h.kind)===p.kind;)f.push(t[n]),n+=1;if(f.length===1){r.push({kind:"item",key:f[0].id,item:f[0]});continue}const m=f.map(x=>x.id).join(":");if(p.kind==="commandExecution"){r.push({kind:"commandGroup",key:m,items:f});continue}if(p.kind==="fileChange"){r.push({kind:"fileChangeGroup",key:m,items:f});continue}if(p.kind==="fileRead"){r.push({kind:"fileReadGroup",key:m,items:f});continue}r.push({kind:"searchGroup",key:m,items:f})}return d(),r}function Fp({tone:t="amber"}){const r=t==="emerald"?"bg-sky-200/90":t==="sky"?"bg-sky-300/90":"bg-amber-200/90";return e.jsx("span",{className:"ml-1.5 inline-flex items-center gap-1","aria-hidden":"true",children:[0,1,2].map(n=>e.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${r}`,style:{animationDelay:`${n*180}ms`}},n))})}function Bo(t){const r=t.trim().toLowerCase();return r==="completed"||r==="done"||r==="complete"?"completed":r==="in_progress"||r==="in progress"||r==="inprogress"||r==="running"||r==="active"?"in_progress":r==="pending"||r==="todo"||r==="not_started"||r==="not started"||r==="queued"?"pending":r==="failed"||r==="error"?"failed":"other"}function Gp(t){switch(t.kind){case"fileChange":case"webSearch":case"image":case"contextCompaction":return!0;case"commandExecution":case"toolCall":return!vi(t.status);default:return!1}}function Op(t,r,n){if(!t||!fn(n))return t;const a=t.plan.findIndex(d=>Bo(d.status)==="in_progress");if(a<0)return t;const o=t.plan.findIndex((d,c)=>c>a&&Bo(d.status)==="pending");if(o<0||!r.some(d=>Gp(d)))return t;const l=t.plan.map((d,c)=>c===a?{...d,status:"completed"}:c===o?{...d,status:"in_progress"}:d);return{...t,plan:l}}function Fo({status:t}){const r=ii(t);return t==="completed"?e.jsx("span",{"aria-label":r,title:r,className:"timeline-status-icon timeline-status-icon-success inline-flex h-4 w-4 items-center justify-center",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m3.75 8.25 2.5 2.5 6-6"})})}):t==="failed"?e.jsx("span",{"aria-label":r,title:r,className:"timeline-status-icon timeline-status-icon-failed inline-flex h-4 w-4 items-center justify-center",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m5 5 6 6M11 5l-6 6"})})}):t==="interrupted"?e.jsx("span",{"aria-label":r,title:r,className:"timeline-status-icon timeline-status-icon-warning inline-flex h-4 w-4 items-center justify-center",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M6 4.5v7M10 4.5v7"})})}):e.jsx("span",{"aria-label":r,title:r,className:"inline-flex min-w-[1.25rem] items-center justify-center text-sky-200",children:e.jsx(Fp,{tone:"emerald"})})}function Go({turn:t,variant:r="header"}){const n=ii(t.status),a=Jp(t),o=Kp(t),s=wi(t),l=fn(t.status),d=t.status==="failed"?"border-rose-300/20 bg-rose-300/[0.06] text-rose-100":l?"border-sky-300/22 bg-sky-300/[0.08] text-sky-100":"border-stone-700/90 bg-stone-900/70 text-stone-200";if(r==="footer")return e.jsxs("div",{className:`flex w-full flex-col gap-1.5 rounded-[0.95rem] border px-3 py-2 text-xs ${d}`,children:[e.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(Fo,{status:t.status}),e.jsx("span",{className:"timeline-soft-text min-w-0 truncate",children:a})]}),t.startedAt&&e.jsx("time",{dateTime:t.startedAt,title:Ua(t.startedAt),className:"timeline-meta-text shrink-0 text-[11px]",children:Cn(t.startedAt)})]}),(s||o.length>0)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[s?e.jsx("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${s.className}`,title:s.title,children:s.label}):null,o.map(h=>e.jsxs("span",{className:`inline-flex items-center rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${h.className}`,title:h.title,children:[h.icon?e.jsx("span",{className:"mr-1",children:h.icon}):null,h.label]},h.id))]})]});const c=`${n} · ${a}`;return e.jsxs("span",{className:`inline-flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 text-[10px] sm:text-[11px] ${d}`,title:c,children:[e.jsx(Fo,{status:t.status}),e.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:a})]})}function Hp(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M8 2.75v8"}),e.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.5"})]})}function Vp(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M8 13.25v-8"}),e.jsx("path",{d:"m11.25 8.5-3.25-3.25L4.75 8.5"})]})}function Up(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M3.25 5.25 8 2.75l4.75 2.5L8 7.75l-4.75-2.5Z"}),e.jsx("path",{d:"M3.25 8 8 10.5 12.75 8"}),e.jsx("path",{d:"M3.25 10.75 8 13.25l4.75-2.5"}),e.jsx("path",{d:"M3.25 5.25v5.5"}),e.jsx("path",{d:"M12.75 5.25v5.5"})]})}function Wp(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M6.2 3.2a2.3 2.3 0 0 0-2.95 3.5A2.4 2.4 0 0 0 4.5 11h.2c.25 1.1 1.1 1.8 2.3 1.8h1.8c1.2 0 2.05-.7 2.3-1.8h.2A2.4 2.4 0 0 0 12.75 6.7 2.3 2.3 0 0 0 9.8 3.2"}),e.jsx("path",{d:"M6.3 6.15c.45-.42 1.02-.65 1.7-.65s1.25.23 1.7.65"}),e.jsx("path",{d:"M8 5.5v4.75"}),e.jsx("path",{d:"M6.75 9.05 8 10.25l1.25-1.2"})]})}function tn(t){if(!Number.isFinite(t)||t<=0)return"0";if(t>=1e6){const r=t>=1e7?Math.round(t/1e6):t/1e6;return`${String(r.toFixed(1)).replace(/\.0$/,"")}m`}if(t>=1e3){const r=t>=1e4?Math.round(t/1e3):t/1e3;return`${String(r.toFixed(1)).replace(/\.0$/,"")}k`}return String(Math.round(t))}function qp(t){return!Number.isFinite(t)||t<=0?"$0":t>=100?`$${Math.round(t)}`:t>=10?`$${String(t.toFixed(1)).replace(/\.0$/,"")}`:t>=1?`$${String(t.toFixed(2)).replace(/0$/,"").replace(/\.$/,"")}`:t>=.1?`$${t.toFixed(2)}`:t>=.01?`$${t.toFixed(3)}`:t>=.001?`$${t.toFixed(4)}`:"<$0.001"}function Ir(t){return!Number.isFinite(t)||t<=0?"$0.0000":`$${t.toFixed(4)}`}function rn(t,r,n){const a=t??null;return!Number.isFinite(a??NaN)||a===null||r<=0||n<=0?null:a*n/r}function ki(t){var d,c,h,p,f;const r=(d=t.tokenUsage)==null?void 0:d.total;if(!r)return[];const n=Math.max(r.inputTokens-r.cachedInputTokens,0),a=Math.max(r.cachedInputTokens,0),o=Math.max(r.reasoningOutputTokens,0),s=Math.max(r.outputTokens-o,0);return[n>0?{id:"in",label:"Input",tokenCompactValue:tn(n),tokenRawValue:n,usdCompactValue:t.priceEstimate?Ir(t.priceEstimate.inputUsd):"--",usdRawValue:((c=t.priceEstimate)==null?void 0:c.inputUsd)??null,className:"token-badge-in",icon:e.jsx(Hp,{})}:null,a>0?{id:"cache",label:"Cached input",tokenCompactValue:tn(a),tokenRawValue:a,usdCompactValue:t.priceEstimate?Ir(t.priceEstimate.cachedInputUsd):"--",usdRawValue:((h=t.priceEstimate)==null?void 0:h.cachedInputUsd)??null,className:"token-badge-cache",icon:e.jsx(Up,{})}:null,s>0?{id:"out",label:"Output",tokenCompactValue:tn(s),tokenRawValue:s,usdCompactValue:t.priceEstimate?Ir(rn(t.priceEstimate.outputUsd,Math.max(r.outputTokens,0),s)??0):"--",usdRawValue:rn((p=t.priceEstimate)==null?void 0:p.outputUsd,Math.max(r.outputTokens,0),s),className:"token-badge-out",icon:e.jsx(Vp,{})}:null,o>0?{id:"reason",label:"Reasoning",tokenCompactValue:tn(o),tokenRawValue:o,usdCompactValue:t.priceEstimate?Ir(rn(t.priceEstimate.outputUsd,Math.max(r.outputTokens,0),o)??0):"--",usdRawValue:rn((f=t.priceEstimate)==null?void 0:f.outputUsd,Math.max(r.outputTokens,0),o),className:"token-badge-reason",icon:e.jsx(Wp,{})}:null].filter(m=>m!==null)}function Kp(t){return ki(t).map(r=>({id:r.id,label:r.tokenCompactValue,title:`${r.label}: ${r.tokenRawValue} tokens`,className:r.className,icon:r.icon}))}function wi(t){return{label:t.priceEstimate?qp(t.priceEstimate.totalUsd):"--",title:t.priceEstimate===null||t.priceEstimate===void 0?"Price estimate unavailable for this model.":`Estimated cost: ${Ir(t.priceEstimate.totalUsd)}`,className:t.priceEstimate?"token-badge-total":"token-badge-empty"}}var la="inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-normal leading-none sm:text-[11px]";function Xp({turn:t}){const r=ki(t),n=wi(t),[a,o]=i.useState(!1),[s,l]=i.useState(!1),[d,c]=i.useState(0),h=i.useRef(null),p=i.useRef(null),f=i.useRef(null);if(i.useLayoutEffect(()=>{if(!a||r.length===0){c(0);return}const x=()=>{const v=h.current,b=f.current;if(!v||!b)return;const k=v.getBoundingClientRect(),g=b.offsetWidth||b.getBoundingClientRect().width;if(g<=0)return;const w=window.innerWidth||document.documentElement.clientWidth,T=12,y=k.left+k.width/2-g/2,C=T,z=Math.max(C,w-T-g),M=Math.min(Math.max(y,C),z);c(Math.round(M-y))};return x(),window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}},[r.length,a]),i.useEffect(()=>{if(!a&&!s)return;const x=v=>{v.target instanceof Node&&(h.current&&!h.current.contains(v.target)&&o(!1),p.current&&!p.current.contains(v.target)&&l(!1))};return document.addEventListener("pointerdown",x),()=>{document.removeEventListener("pointerdown",x)}},[s,a]),!n&&r.length===0)return null;const m=()=>e.jsx("div",{className:"thread-token-popover min-w-[12rem] rounded-2xl border p-2.5 shadow-2xl shadow-black/20 backdrop-blur",children:e.jsx("div",{className:"space-y-1",children:r.map(x=>e.jsxs("div",{className:"thread-token-popover-row flex items-center justify-between gap-3 rounded-xl border px-2.5 py-1.5 text-[11px]",title:`${x.label}: ${x.tokenRawValue} tokens`,children:[e.jsxs("span",{className:"thread-token-popover-text inline-flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"inline-flex shrink-0",children:x.icon}),e.jsx("span",{className:"thread-token-popover-strong font-medium",children:x.usdCompactValue})]}),e.jsx("span",{className:"thread-token-popover-text shrink-0 font-medium",children:x.tokenCompactValue})]},x.id))})});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden shrink-0 items-center gap-1.5 md:inline-flex",children:[n?e.jsxs("div",{ref:p,className:"relative shrink-0",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[e.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":s,onFocus:()=>l(!0),onBlur:()=>l(!1),className:`${la} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}),s&&r.length>0?e.jsx("div",{className:"absolute left-1/2 top-full z-30 mt-1.5 -translate-x-1/2",children:m()}):null]}):null,r.map(x=>e.jsxs("span",{className:`${la} ${x.className}`,title:`${x.label}: ${x.usdCompactValue}, ${x.tokenRawValue} tokens`,children:[x.icon,e.jsx("span",{className:"thread-token-badge-value font-medium",children:x.tokenCompactValue})]},x.id))]}),e.jsxs("div",{ref:h,className:"relative shrink-0 md:hidden",children:[n?e.jsx("button",{type:"button","aria-label":"Show token and price details","aria-expanded":a,onClick:()=>o(x=>!x),className:`${la} appearance-none whitespace-nowrap bg-transparent !text-[10px] !font-normal !leading-none transition hover:bg-[var(--theme-hover)] sm:!text-[11px] ${n.className}`,title:n.title,children:n.label}):null,a&&r.length>0?e.jsx("div",{ref:f,className:"absolute left-1/2 top-full z-30 mt-1.5",style:{transform:`translateX(${d}px) translateX(-50%)`},children:m()}):null]})]})}function Zp(t){return t.map(n=>{const a=n.createdAt;return typeof a=="string"&&a.trim()?a:null}).filter(n=>!!n).sort()[0]??null}function Yp(t,r){return{id:t,startedAt:Zp(r),status:"inProgress",error:null,model:null,reasoningEffort:null,reasoningEffortAvailable:null,tokenUsage:null,priceEstimate:null,items:[]}}function Jp(t){var a;const r=(a=t.model)!=null&&a.trim()?t.model.trim():"--";let n="--";return t.reasoningEffortAvailable===null||t.reasoningEffortAvailable===void 0?n="--":t.reasoningEffortAvailable===!1?n="-":n=t.reasoningEffort??"--",[r,n].join(" · ")}var Xa=i.memo(function({threadId:r,item:n,scrollRootRef:a,onOpenExpandedText:o,onOpenCommandDetail:s,onOpenToolCallDetail:l,onOpenDeferredHistoryItemDetail:d,onSelectArtifact:c,onBeforeMessageResize:h,adapter:p,timeLabel:f,timeTitle:m}){var x,v,b;if(Ip(n.kind))return e.jsx(Mr,{threadId:r,item:n,scrollRootRef:a,timeLabel:f,timeTitle:m,...h?{onBeforeMessageResize:h}:{},...p?{adapter:p}:{}});if(n.kind==="artifact")return e.jsx(gp,{item:n,...c?{onSelect:(k,g)=>c({item:k,artifact:g})}:{}});if(n.kind==="commandExecution")return e.jsx(ip,{item:n,onOpen:s});if(n.kind==="toolCall")return e.jsx(dp,{item:n,onOpen:l});if(n.kind==="agentToolCall")return e.jsx(cp,{item:n,onOpen:l});if(n.kind==="skillToolCall")return e.jsx(hp,{item:n,onOpen:l});if(n.kind==="webSearch"){const k=n,g=((x=k.detailText)==null?void 0:x.trim())||k.text||"Web search";return e.jsx(up,{item:k,onOpen:()=>d(k,"Web Search Details",g,"Loading full web search details...","Unable to load full web search details.")})}if(n.kind==="fileRead"){const k=n,g=((v=k.detailText)==null?void 0:v.trim())||k.text||"File read";return e.jsx(mp,{item:k,onOpen:()=>d(k,"File Read Details",g,"Loading full file read details...","Unable to load full file read details.")})}if(n.kind==="image")return e.jsx(pp,{threadId:r,item:n,onOpen:o,getImageAssetUrl:p==null?void 0:p.getImageAssetUrl});if(n.kind==="plan")return e.jsx(sp,{item:n,scrollRootRef:a,...h?{onBeforeResize:h}:{}});if(n.kind==="fileChange"){const k=n,g=((b=k.detailText)==null?void 0:b.trim())||k.text||"File change";return e.jsx(fp,{item:k,onOpen:()=>d(k,"File Change Details",g,"Loading full file change details...","Unable to load full file change details.")})}return n.kind==="contextCompaction"?e.jsx(op,{item:n}):n.kind==="hook"?e.jsx(xp,{item:n}):e.jsx(lp,{item:n})});function nn({request:t,busy:r=!1,onRespond:n}){const[a,o]=i.useState({}),[s,l]=i.useState({}),[d,c]=i.useState(null),h=t.questions[0]??null,p="__other__",f=t.kind==="planDecision"?"Plan":t.kind==="requestUserInput"?"Answer Required":t.title;function m(g){const w=/\s*\(recommended\)\s*$/i.test(g);return{rawLabel:g,displayLabel:g.replace(/\s*\(recommended\)\s*$/i,"").trim(),recommended:w}}function x(g){h&&(c(g),n==null||n(t.id,{answers:{[h.id]:{answers:[g]}}}))}function v(g){const w=a[g.id]??"";return Array.isArray(w)?w.map(T=>T===p?(s[g.id]??"").trim():T.trim()).filter(Boolean).join(", "):w===p?(s[g.id]??"").trim():w.trim()}function b(g){const w=a[g.id]??"";if(Array.isArray(w))return w.map(y=>y===p?(s[g.id]??"").trim():y.trim()).filter(Boolean);if(w===p){const y=(s[g.id]??"").trim();return y?[y]:[]}const T=w.trim();return T?[T]:[]}function k(g,w){o(T=>{const y=T[g],C=Array.isArray(y)?y:[],z=C.includes(w)?C.filter(M=>M!==w):[...C,w];return{...T,[g]:z}})}return e.jsxs("div",{className:"timeline-pending-card w-full rounded-[1rem] border px-3 py-3 sm:rounded-[1.2rem] sm:px-4",children:[e.jsx("div",{className:"flex items-center justify-between gap-3",children:e.jsxs("div",{children:[e.jsx("p",{className:"timeline-primary-text text-sm font-medium",children:f}),t.kind!=="planDecision"&&t.description&&e.jsx("p",{className:"timeline-soft-text mt-1 text-[13px] leading-5",children:t.description})]})}),e.jsx("div",{className:"mt-3 space-y-3",children:t.questions.map(g=>e.jsxs("div",{className:"timeline-question-section rounded-xl border p-2.5 sm:p-3",children:[e.jsx("p",{className:"timeline-meta-text text-xs uppercase tracking-[0.2em]",children:g.header}),e.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5 sm:text-sm",children:g.question}),t.kind==="planDecision"&&g.options&&g.options.length>0?e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:g.options.map((w,T)=>{const y=m(w.label),C=y.displayLabel.toLowerCase()==="implement";return e.jsxs("button",{type:"button",disabled:r,onClick:()=>x(w.label),className:`relative rounded-2xl border px-2.5 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${T===0?"ui-action-info":"border-stone-700 text-stone-200 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:w.description,children:[y.recommended?e.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/18 text-[10px] leading-none text-current",children:"✦"}):null,r&&d===w.label?C?"Starting...":"Saving...":y.displayLabel]},w.label)})}):g.options&&g.options.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[g.options.map(w=>{const T=m(w.label),y=a[g.id];return e.jsxs("button",{type:"button",disabled:r,onClick:()=>g.multiSelect?k(g.id,w.label):o(C=>({...C,[g.id]:w.label})),className:`relative rounded-2xl border px-3 py-1.5 pr-6 text-[12px] leading-4 transition sm:text-[13px] ${(g.multiSelect?Array.isArray(y)&&y.includes(w.label):y===w.label)?"ui-status-warning":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,title:w.description,children:[T.recommended?e.jsx("span",{"aria-hidden":"true",className:"absolute right-1.5 top-1 inline-flex h-3.5 w-3.5 items-center justify-center rounded-full bg-white/10 text-[10px] leading-none text-amber-100/90",children:"✦"}):null,T.displayLabel]},w.label)}),g.isOther&&(()=>{const w=a[g.id];return e.jsx("button",{type:"button",disabled:r,onClick:()=>g.multiSelect?k(g.id,p):o(T=>({...T,[g.id]:p})),className:`rounded-2xl border px-3 py-1.5 text-[12px] leading-4 transition sm:text-[13px] ${(g.multiSelect?Array.isArray(w)&&w.includes(p):w===p)?"ui-status-info":"border-stone-700 text-stone-300 hover:bg-stone-800"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Not from above"})})()]}),g.isOther&&(()=>{const w=a[g.id];return(g.multiSelect?Array.isArray(w)&&w.includes(p):w===p)?e.jsx("input",{"aria-label":`${g.header} custom answer`,value:s[g.id]??"",onChange:y=>l(C=>({...C,[g.id]:y.target.value})),placeholder:"Enter a custom answer",className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-sky-300"}):null})()]}):e.jsx("input",{"aria-label":g.header,value:a[g.id]??"",onChange:w=>o(T=>({...T,[g.id]:w.target.value})),className:"mt-3 w-full rounded-xl border border-stone-700 bg-stone-900 px-3 py-2 text-sm text-stone-100 outline-none transition focus:border-amber-300"})]},g.id))}),t.kind!=="planDecision"&&e.jsx("div",{className:"mt-3 flex justify-end",children:e.jsx("button",{type:"button",disabled:r||t.questions.some(g=>!v(g)),onClick:()=>void(n==null?void 0:n(t.id,{answers:Object.fromEntries(t.questions.map(g=>[g.id,{answers:b(g)}]))})),className:"ui-action-info rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:r?"Submitting...":"Submit"})})]})}function an({note:t}){return e.jsxs("div",{className:"timeline-note-card w-full rounded-2xl border px-3 py-2.5",children:[e.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:t.title}),e.jsx("div",{className:"mt-1 space-y-1",children:t.summaryLines.map((r,n)=>e.jsxs("p",{className:"timeline-primary-text text-[13px] leading-5",children:["You selected ",r]},`${t.id}-${n}`))})]})}function pr({note:t,onOpenThread:r,onOpenLinkedThread:n}){const a=t.kind==="forkCreated"?"Fork":t.kind==="forkSource"?"Fork source":"System",o=t.kind==="forkCreated"?`Thread forked from Turn ${t.turnIndex??"?"}`:t.kind==="forkSource"?`Forked from ${t.linkedThreadTitle??"source thread"} at Turn ${t.turnIndex??"?"}`:t.text??"";return e.jsxs("div",{className:"timeline-activity-card w-full rounded-2xl border px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("p",{className:"timeline-meta-text text-[11px] uppercase tracking-[0.2em]",children:a}),e.jsx("time",{dateTime:t.createdAt,title:Ua(t.createdAt),className:"timeline-meta-text text-[10px]",children:Cn(t.createdAt)})]}),e.jsx("p",{className:"timeline-primary-text mt-1 text-[13px] leading-5",children:o}),t.linkedThreadId?e.jsx("button",{type:"button",onClick:()=>{const s=t.linkedThreadId;s&&(n==null||n(s),r==null||r(s))},className:"relative z-10 mt-2 inline-flex cursor-pointer rounded-full border border-amber-300/30 px-3 py-1.5 text-xs text-amber-100 transition hover:bg-amber-300/10",children:t.kind==="forkCreated"?"Open fork":"Back to source"}):null]})}var ia=i.memo(function({threadId:r,adapter:n,turn:a,absoluteIndex:o,isCollapsed:s,livePlan:l,liveItems:d,liveOutput:c,forceActive:h=!1,onToggleCollapse:p,onOpenExpandedText:f,onOpenCommandDetail:m,onOpenToolCallDetail:x,onOpenDeferredHistoryItemDetail:v,onSelectArtifact:b,onBeforeMessageResize:k,scrollRootRef:g,articleRef:w,isLatestVisibleTurn:T=!1}){const y=!!l||!!c||!!(d&&d.length>0),C=h||fn(a.status)||y||T,z=C&&!fn(a.status)?{...a,status:"inProgress"}:a,M=i.useMemo(()=>_p(a.items,d),[d,a.items]),I=i.useMemo(()=>Op(l,M,a.status),[l,M,a.status]),R=i.useMemo(()=>Ap(c,M),[c,M]),K=i.useMemo(()=>$p(M,C),[C,M]),Z=i.useMemo(()=>Bp(K),[K]),D=Cn(a.startedAt),ce=Ua(a.startedAt),W=i.useMemo(()=>La(R),[R]),[G,Y]=i.useState({}),we=i.useCallback(P=>{Y(O=>({...O,[P]:!O[P]}))},[]),me=e.jsx(Qp,{entries:Z,expandedGroups:G,onToggleGroupedItem:we,threadId:r,scrollRootRef:g,onOpenExpandedText:f,onOpenCommandDetail:m,onOpenToolCallDetail:x,onOpenDeferredHistoryItemDetail:v,...k?{onBeforeMessageResize:k}:{},timeLabel:D,timeTitle:ce,...b?{onSelectArtifact:b}:{},...n?{adapter:n}:{}}),Re=W?e.jsx(Xa,{threadId:r,item:W,scrollRootRef:g,onOpenExpandedText:f,onOpenCommandDetail:m,onOpenToolCallDetail:x,onOpenDeferredHistoryItemDetail:v,timeLabel:D,timeTitle:ce,...b?{onSelectArtifact:b}:{},...n?{adapter:n}:{}}):null,X=!W&&R?e.jsx(Mr,{item:{id:"live-agent-message",kind:"agentMessage",text:R},scrollRootRef:g,timeLabel:D,timeTitle:ce,streaming:!0,...k?{onBeforeMessageResize:k}:{}}):null,$=C?e.jsx(Go,{turn:z,variant:"footer"}):null,F=e.jsx(Ep,{footer:$,history:me,liveHookPrompt:Re,liveOutput:X,livePlan:I});return e.jsx(zp,{absoluteIndex:o,body:F,collapsed:s,error:a.error,headerStatus:e.jsx(Go,{turn:a}),isActive:C,onToggleCollapse:()=>p(a.id),refCallback:w,startedAt:a.startedAt,timeLabel:D,timeTitle:ce,tokenSummary:e.jsx(Xp,{turn:a})})});function Qp({entries:t,expandedGroups:r,onToggleGroupedItem:n,threadId:a,scrollRootRef:o,onOpenExpandedText:s,onOpenCommandDetail:l,onOpenToolCallDetail:d,onOpenDeferredHistoryItemDetail:c,onSelectArtifact:h,onBeforeMessageResize:p,adapter:f,timeLabel:m,timeTitle:x}){return e.jsx(ym,{entries:t,expandedGroups:r,onToggleGroupedItem:n,renderCommandGroup:(v,b,k)=>e.jsx(bp,{items:v.items,expanded:b,onToggleExpanded:k,onOpen:l},v.key),renderFileChangeGroup:(v,b,k)=>e.jsx(wp,{items:v.items,expanded:b,onToggleExpanded:k,onOpen:s},v.key),renderSearchGroup:(v,b,k)=>e.jsx(vp,{items:v.items,expanded:b,onToggleExpanded:k,onOpen:s},v.key),renderFileReadGroup:(v,b,k)=>e.jsx(kp,{items:v.items,expanded:b,onToggleExpanded:k,onOpen:s},v.key),renderItem:v=>e.jsx(Xa,{threadId:a,item:v.item,scrollRootRef:o,timeLabel:m,timeTitle:x,onOpenExpandedText:s,onOpenCommandDetail:l,onOpenToolCallDetail:d,onOpenDeferredHistoryItemDetail:c,...p?{onBeforeMessageResize:p}:{},...h?{onSelectArtifact:h}:{},...f?{adapter:f}:{}},v.key)})}function ef({threadId:t,turns:r,totalTurnCount:n,pendingRequests:a=[],activeTurnId:o=null,threadRunning:s=!1,pendingSteers:l=[],livePlan:d=null,liveItems:c=null,respondingRequestId:h=null,onRespondToRequest:p,liveOutput:f,scrollRequestKey:m=0,bottomSpacer:x=0,className:v="",onTailVisibilityChange:b,loadingEarlier:k=!1,onLoadEarlier:g,ephemeralUserNote:w=null,answeredRequestNotes:T=[],activityNotes:y=[],optimisticSteers:C=[],optimisticTurn:z=null,onLoadHistoryItemDetail:M,onOpenThread:I,onSelectArtifact:R,onSelectHistoryItemDetail:K,adapter:Z}){var Gt,bt,jr,Tt,Xt;const D=i.useRef(null),ce=i.useRef(null),W=i.useRef(m),G=i.useRef(null),Y=i.useRef(x),we=i.useRef(0),me=i.useRef(0),Re=i.useRef(null),X=i.useRef(null),$=i.useRef(!0),F=i.useRef(!0),P=i.useRef(!1),O=i.useRef(!1),B=i.useRef(!1),N=i.useRef(0),E=i.useRef(new Map),[V,_]=i.useState(_o),[ne,te]=i.useState(0),[je,ee]=i.useState(null),[pe,he]=i.useState({}),[Ce,Fe]=i.useState(!0),J=(Z==null?void 0:Z.onLoadHistoryItemDetail)??M,U=Z==null?void 0:Z.onOpenLinkedThread,re=Rp([r,a,l,C,f,d,c,z,T,y,w,x]),ae=typeof g=="function"||n!==void 0,Q=i.useCallback(j=>{he(se=>({...se,[j]:!se[j]}))},[]),xe=i.useCallback((j,se)=>{ee({title:j,text:se})},[]),Ie=i.useCallback((j,se)=>{if(K){K({item:j,detail:se});return}ee({title:se.title,text:se.text})},[K]),We=i.useCallback(async(j,se)=>{var Ze;const Pe=((Ze=j.detailText)==null?void 0:Ze.trim())||j.text||"Command output";if(!j.hasDeferredDetail||!J){Ie(j,{id:j.id,kind:j.kind,title:se,text:Pe});return}const Ae=E.current.get(j.id);if(Ae){Ie(j,Ae);return}const Ee=N.current+1;N.current=Ee,K||ee({title:se,text:"Loading full command output..."});try{const Ye=await J(j.id);if(E.current.set(j.id,Ye),N.current!==Ee)return;Ie(j,Ye)}catch(Ye){if(N.current!==Ee)return;const Ne=Ye instanceof Error?Ye.message:"Unable to load full command output.";Ie(j,{id:j.id,kind:j.kind,title:se,text:Ne})}},[Ie,J,K]),Ge=i.useCallback(async(j,se)=>{var Ze;const Pe=((Ze=j.detailText)==null?void 0:Ze.trim())||j.text||"Tool call";if(!j.hasDeferredDetail||!J){Ie(j,{id:j.id,kind:j.kind,title:se,text:Pe});return}const Ae=E.current.get(j.id);if(Ae){Ie(j,Ae);return}const Ee=N.current+1;N.current=Ee,K||ee({title:se,text:"Loading full tool call details..."});try{const Ye=await J(j.id);if(E.current.set(j.id,Ye),N.current!==Ee)return;Ie(j,Ye)}catch(Ye){if(N.current!==Ee)return;const Ne=Ye instanceof Error?Ye.message:"Unable to load full tool call details.";Ie(j,{id:j.id,kind:j.kind,title:se,text:Ne})}},[Ie,J,K]),Ve=i.useCallback(async(j,se,Pe,Ae,Ee)=>{if(!j.hasDeferredDetail||!J){ee({title:se,text:Pe});return}const Ze=E.current.get(j.id);if(Ze){ee({title:Ze.title,text:Ze.text});return}const Ye=N.current+1;N.current=Ye,ee({title:se,text:Ae});try{const Ne=await J(j.id);if(E.current.set(j.id,Ne),N.current!==Ye)return;ee({title:Ne.title,text:Ne.text})}catch(Ne){if(N.current!==Ye)return;ee({title:se,text:Ne instanceof Error?Ne.message:Ee})}},[J]),Qe=i.useCallback(()=>{const j=D.current,se=Re.current;if(!j)return;const Pe=se?Dp(j,se):Er(j);$.current=Pe,Fe(Ae=>Ae===Pe?Ae:Pe)},[]),q=i.useCallback(()=>{const j=D.current;if(j){O.current=!0;const se=j.scrollTop,Pe=me.current,Ae=se-Pe;me.current=se,Er(j,1)?(P.current=!1,F.current=!0):Ae<-1?(P.current=!0,F.current=!1):Ae>1&&(F.current=!P.current&&Er(j,za))}Qe()},[Qe]),oe=i.useCallback(()=>{const j=D.current;j&&(j.scrollTop=j.scrollHeight,me.current=j.scrollTop,we.current=j.scrollHeight,$.current=!0,Fe(se=>se||!0),P.current=!1,F.current=!0)},[]),ve=i.useCallback(()=>{const j=D.current;j&&(me.current=j.scrollTop,we.current=j.scrollHeight,F.current=!1,P.current=!0)},[]);i.useLayoutEffect(()=>{const j=window.requestAnimationFrame(()=>{oe()});return()=>{window.cancelAnimationFrame(j)}},[t,oe]),i.useEffect(()=>{B.current=!1,O.current=!1},[t]),i.useEffect(()=>{_(j=>j>=r.length-1?r.length:Math.max(j,_o))},[r.length]),i.useEffect(()=>{const j=D.current;j&&(we.current=j.scrollHeight,me.current=j.scrollTop,Er(j,1)?(P.current=!1,F.current=!0):(P.current||!Er(j,za))&&(F.current=!1)),Qe()},[x,T,w,f,c,d,a.length,Qe,r.length,V]),i.useEffect(()=>{const j=m!==W.current,se=G.current!==re;if(G.current=re,!(j||se&&F.current&&!P.current))return;const Ae=window.requestAnimationFrame(()=>{oe()});return m!==W.current&&(W.current=m),()=>{window.cancelAnimationFrame(Ae)}},[re,Ce,oe,m]),i.useEffect(()=>{const j=D.current,se=ce.current;if(!j||!se||typeof ResizeObserver>"u")return;we.current=j.scrollHeight;const Pe=new ResizeObserver(()=>{const Ae=j.scrollHeight,Ee=we.current;if(we.current=Ae,Ae<=Ee)return;const Ze=Ee>0&&Ee-j.scrollTop-j.clientHeight<=1;P.current||!(F.current||Ze||$.current)||window.requestAnimationFrame(()=>{oe()})});return Pe.observe(se),()=>{Pe.disconnect()}},[oe]),i.useEffect(()=>{if(!F.current||P.current){Y.current=x;return}if(x===Y.current)return;Y.current=x;const j=window.requestAnimationFrame(()=>{oe()});return()=>{window.cancelAnimationFrame(j)}},[x,oe]),i.useEffect(()=>{b==null||b(Ce)},[Ce,b]);const fe=n??r.length,ue=ae?0:Math.max(0,r.length-V),ze=ae?Math.max(0,fe-r.length):0,_e=ae?r:r.slice(ue),Le=ze+ue,ct=fe+1,ot=ae?0:r.length-_e.length,qe=ae?Math.max(0,fe-r.length):0,ht=ae?qe+ot:ot,xt=!ae&&ht>0&&ne>=2,St=ae&&qe>0&&ot===0&&typeof g=="function";i.useEffect(()=>{const j=D.current,se=X.current;if(!j||!se||!St||k||B.current||typeof IntersectionObserver>"u")return;const Pe=new IntersectionObserver(Ae=>{!O.current||k||B.current||!Ae.some(Ee=>Ee.isIntersecting)||(B.current=!0,g==null||g())},{root:j,threshold:.01});return Pe.observe(se),()=>{Pe.disconnect()}},[St,k,g]);const kt=s&&(!o||!_e.some(j=>j.id===o)&&(z==null?void 0:z.id)!==o),pt=(z==null?void 0:z.id)??((Gt=_e.at(-1))==null?void 0:Gt.id)??null,mt=kt&&pt!==null,yt=!!c&&(_e.some(j=>j.id===c.turnId)||(z==null?void 0:z.id)===c.turnId),wt=c&&yt?c.turnId:c&&mt?pt:null,L=z&&wt===z.id?(c==null?void 0:c.items)??null:null,A=((c==null?void 0:c.items.length)??0)>0,ie=c&&wt===null?c.items:null,be=i.useMemo(()=>c&&wt===null&&c.items.length>0?Yp(c.turnId,c.items):null,[c,wt]),et=Math.max(1,fe+(z?1:0)),lt=!!f&&!!z&&z.status!=="failed"&&!L,jt=f&&_e.length>0?o&&_e.some(j=>j.id===o)?o:((bt=_e.findLast(j=>vi(j.status)))==null?void 0:bt.id)??(mt?pt:null):null,it=!!jt,nt=new Set(_e.map(j=>j.id)),It=T.reduce((j,se)=>{if(!se.turnId||!nt.has(se.turnId))return j;const Pe=j.get(se.turnId)??[];return Pe.push(se),j.set(se.turnId,Pe),j},new Map),Nt=a.reduce((j,se)=>{if(!se.turnId||!nt.has(se.turnId))return j;const Pe=j.get(se.turnId)??[];return Pe.push(se),j.set(se.turnId,Pe),j},new Map),ye=[...l.map(j=>({id:j.id,prompt:j.prompt,status:"Accepted",createdAt:j.createdAt})),...C.map(j=>({id:j.id,prompt:j.prompt,status:j.status==="steering"?"Steering":null,createdAt:j.createdAt}))].sort((j,se)=>j.createdAt.localeCompare(se.createdAt)),Oe=T.filter(j=>!j.turnId||!nt.has(j.turnId)),ft=a.filter(j=>!j.turnId||!nt.has(j.turnId)),Ke=i.useMemo(()=>{const j=[..._e.map(Ee=>({id:Ee.id,startedAt:Ee.startedAt??""})),...z?[{id:z.id,startedAt:z.startedAt??""}]:[]],se=new Map,Pe=[],Ae=[...Oe.map(Ee=>({kind:"note",id:Ee.id,createdAt:Ee.createdAt??"",note:Ee})),...ft.map(Ee=>({kind:"request",id:Ee.id,createdAt:Ee.createdAt,request:Ee}))].sort((Ee,Ze)=>Ee.createdAt.localeCompare(Ze.createdAt));for(const Ee of Ae){const Ze=j.find(Ne=>Ee.createdAt&&Ne.startedAt&&Ee.createdAt.localeCompare(Ne.startedAt)<=0);if(!Ze){Pe.push(Ee);continue}const Ye=se.get(Ze.id)??[];Ye.push(Ee),se.set(Ze.id,Ye)}return{beforeTurnId:se,trailing:Pe}},[z,Oe,ft,_e]),rt=i.useMemo(()=>{const j=[...y].sort((Xe,Ot)=>Xe.createdAt.localeCompare(Ot.createdAt)),se=[..._e.map(Xe=>({id:Xe.id,startedAt:Xe.startedAt??""})),...z?[{id:z.id,startedAt:z.startedAt??""}]:[]],Pe=[],Ae=new Map,Ee=new Map,Ze=[],Ne=se.map(Xe=>Xe.startedAt).filter(Xe=>!!Xe).sort().at(-1)??null;for(const Xe of j){if(Xe.anchorTurnId==="__leading__"){Pe.push(Xe);continue}if(Xe.anchorTurnId){if(se.some(Mt=>Mt.id===Xe.anchorTurnId)){const Mt=Ee.get(Xe.anchorTurnId)??[];Mt.push(Xe),Ee.set(Xe.anchorTurnId,Mt)}else Pe.push(Xe);continue}const Ot=se.find(Mt=>Mt.startedAt&&Xe.createdAt.localeCompare(Mt.startedAt)<=0);if(!Ot){!Ne||Xe.createdAt.localeCompare(Ne)<=0?Pe.push(Xe):Ze.push(Xe);continue}const Pt=Ae.get(Ot.id)??[];Pt.push(Xe),Ae.set(Ot.id,Pt)}return{leading:Pe,beforeTurnId:Ae,afterTurnId:Ee,trailing:Ze}},[y,z,_e]);return e.jsxs(e.Fragment,{children:[e.jsx("section",{className:`flex min-h-0 flex-1 flex-col ${v}`.trim(),children:e.jsx("div",{ref:D,"data-testid":"chat-scroll-container",onScroll:q,className:"thread-graph-scroll-container min-h-0 flex-1 overflow-y-auto overscroll-contain",style:x>0?{paddingBottom:x}:void 0,children:e.jsxs("div",{ref:ce,className:"thread-graph-scroll-content",children:[e.jsx("div",{ref:X,"aria-hidden":"true",className:"h-px"}),r.length>0&&e.jsx("div",{className:"thread-graph-history-control px-3 pb-1 pt-2 sm:px-5 sm:pb-1.5 sm:pt-3",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-xs sm:text-sm",children:[ht>0&&e.jsx("button",{type:"button",onClick:()=>{if(ae&&ot===0){g==null||g();return}_(j=>Math.min(r.length,j+Lp)),te(j=>j+1)},disabled:k,className:"thread-graph-history-button rounded-full border px-2.5 py-1.5 transition",children:k?"Loading earlier...":"Load 10 earlier"}),xt&&e.jsx("button",{type:"button",onClick:()=>_(r.length),className:"rounded-full border border-amber-300/40 px-2.5 py-1.5 text-amber-200 transition hover:bg-amber-300/10",children:"Load full history"}),e.jsxs("p",{className:"timeline-meta-text",children:["Showing ",_e.length," of ",fe," turns",ht>0?` · ${ht} earlier hidden${ot>0&&qe>0?` (${ot} loaded)`:""}`:""]})]})}),r.length===0&&!f&&!z&&e.jsx("div",{className:"thread-graph-empty-state px-3 py-8 text-sm sm:px-5",children:"Send the first prompt to start the thread."}),(_e.length>0||z||rt.leading.length>0||rt.trailing.length>0)&&e.jsxs("div",{className:"thread-graph-message-list",children:[rt.leading.length>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:rt.leading.map(j=>e.jsx(pr,{note:j,onOpenThread:I,onOpenLinkedThread:U},j.id))}):null,_e.map((j,se)=>{var Pe,Ae,Ee,Ze,Ye;return e.jsxs("div",{children:[(((Pe=rt.beforeTurnId.get(j.id))==null?void 0:Pe.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(rt.beforeTurnId.get(j.id)??[]).map(Ne=>e.jsx(pr,{note:Ne,onOpenThread:I,onOpenLinkedThread:U},Ne.id))}):null,(((Ae=Ke.beforeTurnId.get(j.id))==null?void 0:Ae.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(Ke.beforeTurnId.get(j.id)??[]).map(Ne=>Ne.kind==="note"?e.jsx(an,{note:Ne.note},Ne.id):e.jsx(nn,{request:Ne.request,busy:h===Ne.request.id,onRespond:p??void 0},Ne.id))}):null,e.jsx(ia,{threadId:t,...Z?{adapter:Z}:{},turn:j,absoluteIndex:Le+se+1,isCollapsed:pe[j.id]??!1,livePlan:(d==null?void 0:d.turnId)===j.id?d:null,liveItems:wt===j.id?(c==null?void 0:c.items)??null:null,liveOutput:jt===j.id?f:"",forceActive:o===j.id||mt&&pt===j.id,onToggleCollapse:Q,onOpenExpandedText:xe,onOpenCommandDetail:We,onOpenToolCallDetail:Ge,onOpenDeferredHistoryItemDetail:Ve,onBeforeMessageResize:ve,...R?{onSelectArtifact:R}:{},scrollRootRef:D,articleRef:void 0}),(((Ee=rt.afterTurnId.get(j.id))==null?void 0:Ee.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(rt.afterTurnId.get(j.id)??[]).map(Ne=>e.jsx(pr,{note:Ne,onOpenThread:I,onOpenLinkedThread:U},Ne.id))}):null,(Ze=It.get(j.id))!=null&&Ze.length||(Ye=Nt.get(j.id))!=null&&Ye.length?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:[...(It.get(j.id)??[]).map(Ne=>({kind:"note",id:Ne.id,createdAt:Ne.createdAt??"",note:Ne})),...(Nt.get(j.id)??[]).map(Ne=>({kind:"request",id:Ne.id,createdAt:Ne.createdAt,request:Ne}))].sort((Ne,Xe)=>Ne.createdAt.localeCompare(Xe.createdAt)).map(Ne=>Ne.kind==="note"?e.jsx(an,{note:Ne.note},Ne.id):e.jsx(nn,{request:Ne.request,busy:h===Ne.request.id,onRespond:p??void 0},Ne.id))}):null]},j.id)}),z&&_e.every(j=>j.id!==z.id)&&e.jsxs(e.Fragment,{children:[(((jr=rt.beforeTurnId.get(z.id))==null?void 0:jr.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(rt.beforeTurnId.get(z.id)??[]).map(j=>e.jsx(pr,{note:j,onOpenThread:I,onOpenLinkedThread:U},j.id))}):null,(((Tt=Ke.beforeTurnId.get(z.id))==null?void 0:Tt.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(Ke.beforeTurnId.get(z.id)??[]).map(j=>j.kind==="note"?e.jsx(an,{note:j.note},j.id):e.jsx(nn,{request:j.request,busy:h===j.request.id,onRespond:p??void 0},j.id))}):null,e.jsx(ia,{threadId:t,...Z?{adapter:Z}:{},turn:z,absoluteIndex:ct,isCollapsed:pe[z.id]??!1,livePlan:null,liveItems:L,liveOutput:lt?f:"",forceActive:o===z.id||mt&&pt===z.id,onToggleCollapse:Q,onOpenExpandedText:xe,onOpenCommandDetail:We,onOpenToolCallDetail:Ge,onOpenDeferredHistoryItemDetail:Ve,onBeforeMessageResize:ve,...R?{onSelectArtifact:R}:{},scrollRootRef:D}),(((Xt=rt.afterTurnId.get(z.id))==null?void 0:Xt.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(rt.afterTurnId.get(z.id)??[]).map(j=>e.jsx(pr,{note:j,onOpenThread:I,onOpenLinkedThread:U},j.id))}):null]})]}),ye.length>0&&e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:ye.map(j=>e.jsx(Mr,{threadId:t,item:{id:j.id,kind:"userMessage",text:j.prompt,status:j.status},scrollRootRef:D,onBeforeMessageResize:ve,...Z?{adapter:Z}:{}},j.id))}),(Ke.trailing.length>0||rt.trailing.length>0)&&e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:[...rt.trailing.map(j=>({kind:"activity",id:j.id,createdAt:j.createdAt,note:j})),...Ke.trailing].sort((j,se)=>j.createdAt.localeCompare(se.createdAt)).map(j=>j.kind==="activity"?e.jsx(pr,{note:j.note,onOpenThread:I,onOpenLinkedThread:U},j.id):j.kind==="note"?e.jsx(an,{note:j.note},j.id):e.jsx(nn,{request:j.request,busy:h===j.request.id,onRespond:p??void 0},j.id))}),w&&e.jsx("div",{className:"thread-graph-message-section px-3 py-2.5 sm:px-5",children:e.jsx(Mr,{threadId:t,item:{id:"ephemeral-plan-decision-note",kind:"userMessage",text:w},scrollRootRef:D,onBeforeMessageResize:ve})}),be&&ie&&ie.length>0&&e.jsx(ia,{threadId:t,...Z?{adapter:Z}:{},turn:be,absoluteIndex:et,isCollapsed:pe[be.id]??!1,livePlan:(d==null?void 0:d.turnId)===be.id?d:null,liveItems:ie,liveOutput:"",forceActive:!0,onToggleCollapse:Q,onOpenExpandedText:xe,onOpenCommandDetail:We,onOpenToolCallDetail:Ge,onOpenDeferredHistoryItemDetail:Ve,onBeforeMessageResize:ve,...R?{onSelectArtifact:R}:{},scrollRootRef:D}),f&&!it&&!lt&&!A&&e.jsx("div",{className:"thread-graph-message-section px-3 py-2.5 sm:px-5",children:La(f)?e.jsx(Xa,{threadId:t,item:La(f),scrollRootRef:D,onOpenExpandedText:xe,onOpenCommandDetail:We,onOpenToolCallDetail:Ge,onOpenDeferredHistoryItemDetail:Ve,onBeforeMessageResize:ve,...R?{onSelectArtifact:R}:{},...Z?{adapter:Z}:{}}):e.jsx(Mr,{threadId:t,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:f},scrollRootRef:D,streaming:!0,onBeforeMessageResize:ve,...Z?{adapter:Z}:{}})}),e.jsx("div",{ref:Re,"aria-hidden":"true",className:"h-px w-full"})]})})}),e.jsx(wm,{open:je!==null,title:(je==null?void 0:je.title)??"Full text",text:(je==null?void 0:je.text)??"",onClose:()=>{N.current+=1,ee(null)}})]})}var yi=i.memo(ef);function Oo(t){return{background:t==="light"?"#f2ede5":"#0c1117",foreground:t==="light"?"#3f3a36":"#d6dde6",cursor:t==="light"?"#3f3a36":"#d6dde6",black:t==="light"?"#d8cfc2":"#0f1720",brightBlack:t==="light"?"#8a7f73":"#475569",red:"#f87171",brightRed:"#fb7185",green:t==="light"?"#16a34a":"#86efac",brightGreen:t==="light"?"#22c55e":"#4ade80",yellow:"#fbbf24",brightYellow:"#fcd34d",blue:t==="light"?"#2563eb":"#93c5fd",brightBlue:t==="light"?"#3b82f6":"#60a5fa",magenta:t==="light"?"#7c3aed":"#c4b5fd",brightMagenta:t==="light"?"#8b5cf6":"#a78bfa",cyan:t==="light"?"#0891b2":"#67e8f9",brightCyan:t==="light"?"#06b6d4":"#22d3ee",white:t==="light"?"#5b5148":"#e2e8f0",brightWhite:t==="light"?"#2c2723":"#f8fafc"}}function da(t){switch(t){case"not_created":return"Not created";case"creating":return"Creating";case"running":return"Running";case"attached":return"Attached";case"detached":return"Detached";case"exited":return"Exited";case"not_found":return"Missing";case"workspace_missing":return"Workspace missing"}}function Ho(t,r,n,a,o){const s=r.replace(/\r\n/g,`
|
|
3496
|
+
`),l=s.split(`
|
|
3497
|
+
`);s.endsWith(`
|
|
3498
|
+
`)&&l.at(-1)===""&&l.pop();let c=l.join(`\r
|
|
3499
|
+
`);if(n!==void 0&&a!==void 0){const p=(o!==void 0?Math.max(0,l.length-o):0)+a,f=Math.max(0,l.length-p-1);f>0&&(c+=`\x1B[${f}A`),c+=`\r\x1B[${n+1}G`}t.reset(),t.write(c,()=>{t.scrollToBottom()})}function tf(t){return/^[a-z]$/i.test(t)?String.fromCharCode(t.toUpperCase().charCodeAt(0)-64):null}function Vo(t){return t?Array.from(t.querySelectorAll(".xterm-rows > div")).map(n=>n.textContent??"").filter((n,a,o)=>n.length>0||a<o.length-1).join(`
|
|
3500
|
+
`).trimEnd():""}function Ra(t){return t.replace(/\r\n/g,`
|
|
3501
|
+
`)}function Uo(t){const r=Ra(t),n=r.split(`
|
|
3502
|
+
`);return r.endsWith(`
|
|
3503
|
+
`)&&n.at(-1)===""&&n.pop(),n}function rf(t){const r=t.trim();return r?/(?:[$%#>])\s*$/.test(r):!1}function nf(t,r){const n=r.trim();if(!n||t.length===0)return t;const[a,...o]=t;if(a===void 0)return t;const s=a.trim();return s===n||s.endsWith(` ${n}`)||s.endsWith(`$ ${n}`)||s.endsWith(`% ${n}`)||s.endsWith(`# ${n}`)||s.endsWith(`> ${n}`)?o:t}function af(t,r,n){var c,h;const a=Uo(t),o=Uo(r);let s=0;for(;s<a.length&&s<o.length&&a[s]===o[s];)s+=1;let l=0;for(;l<a.length-s&&l<o.length-s&&a[a.length-1-l]===o[o.length-1-l];)l+=1;let d=o.slice(s,o.length-l);for(d=nf(d,n);d.length>0&&((c=d[0])==null?void 0:c.trim())==="";)d.shift();for(;d.length>0&&(((h=d.at(-1))==null?void 0:h.trim())===""||rf(d.at(-1)??""));)d.pop();return d.join(`
|
|
3504
|
+
`).trimEnd()}function gn(t){if(!t)return"";const r=t.replace(/[\\/]+$/,"");return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function Ia(t,r){const n=[r==null?void 0:r.trim(),t==null?void 0:t.trim()].filter(Boolean);return n.length>0?n.join(" "):null}function ca(t){return Math.min(75,Math.max(25,t))}function sf(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"h-4 w-4 fill-current",children:[e.jsx("path",{fillRule:"evenodd",d:"M14.5 10C16.9853 10 19 7.98528 19 5.5C19 5.01783 18.9242 4.55338 18.7838 4.11791C18.6792 3.79367 18.2734 3.72683 18.0325 3.96772L15.3402 6.66002C15.2098 6.79041 15.0168 6.84163 14.8466 6.77074C14.1172 6.46695 13.5334 5.88351 13.2292 5.15431C13.1582 4.98403 13.2094 4.79088 13.3398 4.66042L16.0327 1.9676C16.2735 1.72672 16.2067 1.32092 15.8825 1.21636C15.4469 1.07588 14.9823 1 14.5 1C12.0147 1 10 3.01472 10 5.5C10 5.59783 10.0031 5.69494 10.0093 5.79122C10.065 6.66418 9.88174 7.59855 9.20974 8.15855L1.98017 14.1832C1.3591 14.7008 1 15.4674 1 16.2759C1 17.7804 2.21962 19 3.7241 19C4.53256 19 5.29925 18.6409 5.81681 18.0198L11.8414 10.7903C12.4014 10.1183 13.3358 9.93497 14.2088 9.99073C14.3051 9.99688 14.4022 10 14.5 10ZM5 16C5 16.5523 4.55228 17 4 17C3.44772 17 3 16.5523 3 16C3 15.4477 3.44772 15 4 15C4.55228 15 5 15.4477 5 16Z",clipRule:"evenodd"}),e.jsx("path",{d:"M14.5 11.5C14.6731 11.5 14.8445 11.4927 15.0138 11.4783L18.7678 15.2323C19.7441 16.2086 19.7441 17.7915 18.7678 18.7678C17.7915 19.7441 16.2086 19.7441 15.2323 18.7678L10.8216 14.3571L12.9938 11.7505C13.0455 11.6885 13.1413 11.6131 13.3357 11.5552C13.5378 11.4951 13.805 11.468 14.1132 11.4877C14.2413 11.4959 14.3702 11.5 14.5 11.5Z"}),e.jsx("path",{d:"M6.00003 4.58582L8.33056 6.91635C8.3027 6.95627 8.27496 6.98497 8.24946 7.00622L6.79994 8.21415L4.58582 6.00003H3.30905C3.11966 6.00003 2.94653 5.89303 2.86184 5.72364L1.1612 2.32237C1.06495 2.12987 1.10268 1.89739 1.25486 1.74521L1.74521 1.25486C1.89739 1.10268 2.12987 1.06495 2.32237 1.1612L5.72364 2.86184C5.89303 2.94653 6.00003 3.11966 6.00003 3.30905V4.58582Z"})]})}function of({connected:t}){return t?e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})}):e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",className:"h-4.5 w-4.5 fill-none stroke-current",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9"})})}function Wo(){return e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-3.5 w-3.5 fill-none stroke-current",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M5.5 3.25h5"}),e.jsx("path",{d:"M6.4 2h3.2a.9.9 0 0 1 .9.9v.35h1.3a1.2 1.2 0 0 1 1.2 1.2v7.35a1.2 1.2 0 0 1-1.2 1.2H4.2A1.2 1.2 0 0 1 3 11.8V4.45a1.2 1.2 0 0 1 1.2-1.2h1.3V2.9a.9.9 0 0 1 .9-.9Z"})]})}function ha({label:t,tone:r="stone"}){const n=r==="rose"?"border-rose-300/35 bg-rose-300/14 text-rose-600 dark:text-rose-50":r==="sky"?"border-sky-300/35 bg-sky-300/14 text-sky-600 dark:text-sky-50":"shell-control-chip border";return e.jsx("span",{className:`inline-flex min-w-[3.45rem] items-center justify-center rounded-full border px-2.5 py-1.5 text-[11px] font-medium tracking-[0.12em] ${n}`,children:t})}function lf(t){switch(t){case"ctrl_c":return"";case"ctrl_d":return"";case"esc":return"\x1B";case"tab":return" ";case"up":return"\x1B[A";case"down":return"\x1B[B"}}var qo=i.forwardRef(function({paneId:r,shell:n,isActive:a,isVisible:o,isMobileShell:s,effectiveTheme:l,workspacePathMissing:d,shellAdapter:c,onActivate:h,onShellUpdate:p,onRuntimeStateChange:f,onFeedback:m},x){const v=i.useRef(null),b=i.useRef(null),k=i.useRef(null),g=i.useRef(null),w=i.useRef(null),T=i.useRef(null),y=i.useRef(null),C=i.useRef(null),z=i.useRef(!1),M=i.useRef(null),I=i.useRef(""),R=i.useRef(null),K=i.useRef(""),Z=i.useRef(null),D=i.useRef(null),ce=i.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),W=i.useRef(!1),G=i.useRef(null),Y=i.useRef(o),we=i.useRef(s),me=i.useRef(()=>!1),Re=i.useRef(()=>null),X=i.useRef(()=>{}),$=i.useRef(null),[F,P]=i.useState(null),[O,B]=i.useState(!1),[N,E]=i.useState(null),[V,_]=i.useState(!1),[ne,te]=i.useState(null),[je,ee]=i.useState(null),[pe,he]=i.useState(!1),[Ce,Fe]=i.useState(0),J=(n==null?void 0:n.status)??"not_created",U=!!(n&&!d&&n.status!=="exited"&&n.status!=="not_found"),re=i.useMemo(()=>Ia(gn(n==null?void 0:n.cwd),null),[n==null?void 0:n.cwd]),ae=je??re,Q=i.useCallback(q=>{g.current=q,E(q)},[]),xe=i.useCallback(q=>{const oe=$.current;if(oe){$.current=null,oe.timer!==null&&window.clearTimeout(oe.timer);for(const ve of oe.waiters)ve(q)}},[]);i.useEffect(()=>{Y.current=o},[o]),i.useEffect(()=>{we.current=s},[s]),i.useEffect(()=>{w.current=(n==null?void 0:n.id)??null},[n==null?void 0:n.id]);const Ie=i.useCallback(q=>{const oe=k.current,ve=w.current,fe=g.current;return!oe||!ve||!fe?!1:(oe.send({type:"shell.input",shellId:ve,viewerId:fe,data:q}),!0)},[]);i.useEffect(()=>{me.current=Ie},[Ie]);const We=i.useCallback(()=>{const q=k.current,oe=w.current,ve=g.current;return!q||!oe||!ve?!1:(q.send({type:"shell.clear",shellId:oe,viewerId:ve}),!0)},[]),Ge=i.useCallback(()=>{if(!o||!F)return!1;const q=F.getBoundingClientRect();return q.width>0&&q.height>0},[o,F]),Ve=i.useCallback(q=>{const oe=v.current,ve=b.current;if(!oe||!ve||!Ge()||(ve.fit(),oe.cols<=0||oe.rows<=0))return null;const fe={cols:oe.cols,rows:oe.rows};if((q==null?void 0:q.syncBackendSize)===!1)return fe;const ue=D.current;return(ue==null?void 0:ue.cols)===fe.cols&&ue.rows===fe.rows||(D.current=fe,k.current&&w.current&&g.current&&k.current.send({type:"shell.resize",shellId:w.current,viewerId:g.current,cols:fe.cols,rows:fe.rows})),fe},[Ge]);i.useEffect(()=>{Re.current=Ve},[Ve]);const Qe=i.useCallback(q=>{const oe=v.current;!oe||!Ge()||(Ve((q==null?void 0:q.syncBackendSize)===void 0?void 0:{syncBackendSize:q.syncBackendSize}),I.current&&!Vo(F)?Ho(oe,I.current,ce.current.cursorX,ce.current.cursorY,ce.current.paneHeight):oe.scrollToBottom(),q!=null&&q.focus&&!s&&oe.focus())},[s,Ge,Ve,F]);return i.useEffect(()=>{X.current=()=>Qe()},[Qe]),i.useEffect(()=>{f({status:N?"attached":J,shellInputEnabled:!!(N&&n),isConnecting:V,isCommandRunning:pe,promptLabel:ae,error:ne,hasShell:!!n})},[ne,V,pe,f,ae,n,J,N]),i.useEffect(()=>{if(!F||v.current||W.current)return;let q=!1;return W.current=!0,(async()=>{const[{Terminal:oe},{FitAddon:ve}]=await Promise.all([st(()=>import("./terminal-vendor-CLGgN91S.js").then(ze=>ze.x),__vite__mapDeps([6,2,7])),st(()=>import("./terminal-vendor-CLGgN91S.js").then(ze=>ze.a),__vite__mapDeps([6,2,7]))]);if(q||!F){W.current=!1;return}const fe=new oe({cursorBlink:!0,disableStdin:we.current,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:Oo(l)}),ue=new ve;fe.loadAddon(ue),fe.open(F),v.current=fe,b.current=ue,Re.current(),fe.attachCustomKeyEventHandler(ze=>{if(we.current||ze.type!=="keydown")return!0;if(ze.ctrlKey&&!ze.altKey&&!ze.metaKey&&!ze.shiftKey){const _e=tf(ze.key);if(!_e)return!0;if(me.current(_e))return ze.preventDefault(),!1}return!0}),B(!0),W.current=!1,Z.current=new ResizeObserver(()=>{X.current()}),Z.current.observe(F),G.current=fe.onData(ze=>{we.current||me.current(ze)})})(),()=>{var oe,ve,fe;q=!0,W.current=!1,(oe=G.current)==null||oe.dispose(),G.current=null,(ve=Z.current)==null||ve.disconnect(),Z.current=null,B(!1),(fe=v.current)==null||fe.dispose(),v.current=null,b.current=null,D.current=null}},[l,F]),i.useEffect(()=>{var q;n||(Q(null),_(!1),xe(!1),te(null),ee(null),he(!1),I.current="",K.current="",R.current=null,(q=v.current)==null||q.reset())},[Q,xe,n]),i.useEffect(()=>{const q=v.current;q&&(q.options.theme=Oo(l))},[l]),i.useEffect(()=>{const q=v.current;q&&(q.options.disableStdin=s)},[s]),i.useEffect(()=>{if(!o||!O)return;const q=window.requestAnimationFrame(()=>{Qe({focus:a,syncBackendSize:!1}),!k.current&&(n!=null&&n.id)&&M.current!==n.id&&Fe(oe=>oe+1)});return()=>{window.cancelAnimationFrame(q)}},[a,o,Qe,n==null?void 0:n.id,O]),i.useEffect(()=>{const q=n==null?void 0:n.id;if(!q||!O||!Y.current||!U||M.current===q)return;const oe=v.current;if(!oe)return;const ve=Re.current();if(!ve){C.current===null&&(C.current=window.setTimeout(()=>{C.current=null,Fe(ue=>ue+1)},120));return}if(C.current!==null&&(window.clearTimeout(C.current),C.current=null),k.current&&w.current===q)return;T.current!==null&&(window.clearTimeout(T.current),T.current=null),w.current=q,oe.reset(),te(null),Q(null),_(!0),z.current=!1;const fe=c.connectSocket({onConnected:()=>{var ue;((ue=k.current)==null?void 0:ue.socket)===fe.socket&&(fe.send({type:"shell.attach",shellId:q,cols:ve.cols,rows:ve.rows}),y.current!==null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>{var ze,_e,Le;y.current=null,!(fe.socket&&((ze=k.current)==null?void 0:ze.socket)!==fe.socket)&&(g.current||(te("Shell connection timed out. Reconnecting..."),_(!1),xe(!1),(_e=fe.close)==null||_e.call(fe),(Le=fe.socket)==null||Le.close()))},4e3))},onShellEvent:ue=>{var _e;if(fe.socket&&((_e=k.current)==null?void 0:_e.socket)!==fe.socket||ue.shellId!==q)return;if(ue.type==="shell.connected"){y.current!==null&&(window.clearTimeout(y.current),y.current=null);const Le=String(ue.payload.viewerId??"");Q(Le||null),_(!1),xe(!!Le),p(q,ct=>({...ct,status:"attached",attachedViewerId:Le}),"attached");return}if(ue.type==="shell.output"){const Le=typeof ue.payload.data=="string"?ue.payload.data:"",ct=ue.payload.replace===!0,ot=typeof ue.payload.cursorX=="number"?ue.payload.cursorX:void 0,qe=typeof ue.payload.cursorY=="number"?ue.payload.cursorY:void 0,ht=typeof ue.payload.paneHeight=="number"?ue.payload.paneHeight:void 0,xt=typeof ue.payload.cwdBaseName=="string"?ue.payload.cwdBaseName:null,St=typeof ue.payload.envPrefix=="string"?ue.payload.envPrefix:null,kt=Ia(xt??gn(n==null?void 0:n.cwd),St),pt=ue.payload.isCommandRunning===!0;if(ce.current={cursorX:ot,cursorY:qe,paneHeight:ht},ee(kt),he(pt),Le)if(ct){const mt=Ra(Le);I.current=mt,Ho(oe,Le,ot,qe,ht),!pt&&R.current&&(K.current=af(R.current.beforeSnapshot,mt,R.current.command),R.current=null)}else I.current=Ra(`${I.current}${Le}`),oe.write(Le);return}if(ue.type==="shell.error"){te(String(ue.payload.message??"Shell connection failed.")),_(!1),xe(!1),ue.payload.code==="viewer_conflict"&&p(q,Le=>({...Le,status:"detached",attachedViewerId:null}),"detached");return}if(ue.type==="shell.detached"){const Le=String(ue.payload.viewerId??""),ct=String(ue.payload.reason??"");Le&&Le===g.current&&(Q(null),_(!1),xe(!1),p(q,ot=>({...ot,status:"detached",attachedViewerId:null}),"detached"),ct==="replaced"?(z.current=!0,te("This shell connection was taken over by another pane or device.")):te(null),he(!1),fe.socket.close());return}if(ue.type==="shell.exited"){Q(null),he(!1),_(!1),xe(!1),z.current=!0;const Le=ue.payload.state==="exited"?"exited":"not_found";p(q,ct=>({...ct,status:Le,attachedViewerId:null}),Le),fe.socket.close();return}const ze=ue.payload.state;ze&&(ze!=="attached"&&(Q(null),he(!1),_(!1),xe(!1)),p(q,Le=>({...Le,status:ze==="attached"||ze==="detached"?ze:Le.status,attachedViewerId:ze==="attached"?Le.attachedViewerId:null}),ze))}});return k.current=fe,fe.socket.addEventListener("close",()=>{var ze;if(((ze=k.current)==null?void 0:ze.socket)!==fe.socket)return;y.current!==null&&(window.clearTimeout(y.current),y.current=null),k.current=null;const ue=!!g.current;Q(null),_(!1),xe(!1),ue&&p(q,_e=>({..._e,status:_e.status==="attached"?"detached":_e.status,attachedViewerId:null}),"detached"),!z.current&&M.current!==q&&(T.current=window.setTimeout(()=>{T.current=null,Fe(_e=>_e+1)},800))}),()=>{var ze;const ue=g.current;z.current=!0,C.current!==null&&(window.clearTimeout(C.current),C.current=null),ue&&fe.socket.readyState===WebSocket.OPEN&&fe.send({type:"shell.detach",shellId:q,viewerId:ue}),Q(null),_(!1),xe(!1),y.current!==null&&(window.clearTimeout(y.current),y.current=null),fe.socket.close(),((ze=k.current)==null?void 0:ze.socket)===fe.socket&&(k.current=null)}},[U,p,Ce,Q,xe,n==null?void 0:n.cwd,n==null?void 0:n.id,O]),i.useEffect(()=>()=>{T.current!==null&&window.clearTimeout(T.current),y.current!==null&&window.clearTimeout(y.current),C.current!==null&&window.clearTimeout(C.current),xe(!1)},[xe]),i.useImperativeHandle(x,()=>({disconnect(){const q=k.current,oe=w.current,ve=g.current;M.current=oe,z.current=!0,q&&oe&&ve&&q.send({type:"shell.detach",shellId:oe,viewerId:ve}),Q(null),_(!1),xe(!1),q==null||q.socket.close(),k.current=null,D.current=null,oe&&p(oe,fe=>({...fe,status:"detached",attachedViewerId:null}),"detached")},reconnect(){if(!w.current||!O||d)return Promise.resolve(!1);if(g.current)return Promise.resolve(!0);if($.current)return new Promise(oe=>{var ve;(ve=$.current)==null||ve.waiters.push(oe)});const q=new Promise(oe=>{const ve=window.setTimeout(()=>{_(!1),$.current=null,oe(!1)},4500);$.current={waiters:[oe],timer:ve}});return M.current===w.current&&(M.current=null),z.current=!1,te(null),_(!0),Fe(oe=>oe+1),q},sendInput(q){return Ie(q)},sendCommand(q){const oe={command:q,beforeSnapshot:I.current};if(R.current=oe,q.trim()==="clear"){const ue=We();return!ue&&R.current===oe&&(R.current=null),ue}const ve=q.endsWith(`
|
|
3505
|
+
`)?q:`${q}
|
|
3506
|
+
`,fe=Ie(ve);return!fe&&R.current===oe&&(R.current=null),fe},sendControl(q){return q==="clear"?We():Ie(lf(q))},async copyLastCommandOutput(){const q=K.current.trim()||Vo(F);if(!q)return m==null||m("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(q),m==null||m("done","Copied"),!0}catch{return m==null||m("failed","Copy failed"),!1}},focus(){var q;(q=v.current)==null||q.focus()},refreshLayout(q){Qe(q)}}),[m,p,Qe,We,Ie,Q,xe,F,O,d]),e.jsxs("div",{className:`relative min-h-0 flex-1 overflow-hidden ${a?"shell-pane-active":""}`,onMouseDown:h,"data-pane-id":r,children:[e.jsx("div",{ref:P,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${s?"mobile-shell-selectable":""}`,onMouseDown:()=>{var q;h(),(q=v.current)==null||q.focus()}}),a&&e.jsx("div",{className:"pointer-events-none absolute right-2 top-2 rounded-md border border-sky-300/30 bg-sky-300/10 px-2 py-1 text-[10px] uppercase tracking-[0.12em] text-sky-100",children:"Active"})]})}),df=i.forwardRef(function({threadId:r,shellAdapter:n,isVisible:a=!0,showHeader:o=!0,showFloatingToolbox:s=!0,effectiveTheme:l="dark",loadSplitRatio:d,saveSplitRatio:c,onStateChange:h},p){const f=i.useRef(null),m=i.useRef(null),x=i.useRef(null),v=i.useRef(null),b=i.useRef(null),k=i.useRef(!1),[g,w]=i.useState(null),[T,y]=i.useState(!0),[C,z]=i.useState(!1),[M,I]=i.useState(null),[R,K]=i.useState("primary"),[Z,D]=i.useState(null),[ce,W]=i.useState(null),[G,Y]=i.useState("single"),[we,me]=i.useState(50),[Re,X]=i.useState(null),[$,F]=i.useState(""),[P,O]=i.useState(!1),[B,N]=i.useState(!1),[E,V]=i.useState(!1),[_,ne]=i.useState({primary:{status:"not_created",shellInputEnabled:!1,isConnecting:!1,isCommandRunning:!1,promptLabel:null,error:null,hasShell:!1},secondary:{status:"not_created",shellInputEnabled:!1,isConnecting:!1,isCommandRunning:!1,promptLabel:null,error:null,hasShell:!1}}),[te,je]=i.useState(null),ee=(g==null?void 0:g.state)??"not_created",pe=i.useMemo(()=>(g==null?void 0:g.shells)??[],[g==null?void 0:g.shells]),he=i.useMemo(()=>pe.filter(L=>L.status!=="exited"&&L.status!=="not_found"),[pe]),Ce=i.useMemo(()=>he.find(L=>L.id===Z)??null,[he,Z]),Fe=i.useMemo(()=>he.find(L=>L.id===ce)??null,[he,ce]),J=R==="secondary"?Fe:Ce,U=_[R],re=(g==null?void 0:g.workspacePathStatus)==="missing",ae=C||T||ee==="creating"||re,Q=R==="secondary"?m:f,xe=U.shellInputEnabled?"Disconnect shell":J&&(J.status==="exited"||J.status==="not_found")?"Restart shell":J?"Connect shell":"Create shell",Ie=U.shellInputEnabled?"border-emerald-300/45 bg-emerald-300/18 text-emerald-50 ring-1 ring-emerald-300/20 hover:bg-emerald-300/24":(J==null?void 0:J.status)==="exited"||(J==null?void 0:J.status)==="not_found"?"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800":re?"border-rose-300/35 bg-rose-300/12 text-rose-100":"border-stone-600 bg-stone-800/90 text-stone-100 hover:border-stone-500 hover:bg-stone-800",We=(te==null?void 0:te.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(te==null?void 0:te.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",Ge=i.useCallback((L,A)=>{je({tone:L,text:A}),x.current!==null&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>{je(null),x.current=null},1800)},[]),Ve=i.useCallback((L,A,ie)=>{w(be=>{var jt;if(!be)return be;const et=be.shells.map(it=>it.id===L?A(it):it),lt=((jt=be.shell)==null?void 0:jt.id)===L?A(be.shell):et.find(it=>{var nt;return it.id===((nt=be.shell)==null?void 0:nt.id)})??be.shell;return{...be,...ie?{state:ie}:{},shell:lt,shells:et}})},[]),Qe=i.useCallback(async()=>{y(!0);try{const L=await n.fetchState(r);w(L),I(null)}catch(L){I(L instanceof Error?L.message:"Unable to load shell state.")}finally{y(!1)}},[n,r]);i.useEffect(()=>{Qe()},[Qe]),i.useEffect(()=>{const L=d==null?void 0:d(r);if(L==null){me(50);return}const A=typeof L=="number"?L:Number.parseFloat(String(L));me(Number.isFinite(A)?ca(A):50)},[d,r]),i.useEffect(()=>{if(!g){D(null),W(null);return}const L=ie=>ie.status!=="exited"&&ie.status!=="not_found",A=(g.activeShellId?g.shells.find(ie=>ie.id===g.activeShellId&&L(ie)):null)??(g.shell&&L(g.shell)?g.shell:null)??g.shells.find(L)??null;D(ie=>ie&&g.shells.some(be=>be.id===ie&&L(be))?ie:(A==null?void 0:A.id)??null),W(ie=>{if(G!=="columns")return null;if(ie&&g.shells.some(et=>et.id===ie&&L(et)))return ie;const be=g.shells.find(et=>L(et)&&et.id!==(A==null?void 0:A.id));return(be==null?void 0:be.id)??null})},[g,G]),i.useEffect(()=>{G!=="columns"&&(K("primary"),W(null))},[G]),i.useEffect(()=>{if(G!=="columns"||ce||he.length<2)return;const L=he.find(A=>A.id!==(Ce==null?void 0:Ce.id))??null;L&&W(L.id)},[he,Ce==null?void 0:Ce.id,ce,G]),i.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const L=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),A=()=>{O(L.matches),L.matches||(V(!1),N(!1))};return A(),L.addEventListener("change",A),()=>{L.removeEventListener("change",A)}},[]),i.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current),b.current!==null&&window.cancelAnimationFrame(b.current)},[]);const q=i.useCallback((L,A)=>{ne(ie=>{const be=ie[L];return be.status===A.status&&be.shellInputEnabled===A.shellInputEnabled&&be.isConnecting===A.isConnecting&&be.isCommandRunning===A.isCommandRunning&&be.promptLabel===A.promptLabel&&be.error===A.error&&be.hasShell===A.hasShell?ie:{...ie,[L]:A}})},[]),oe=i.useCallback(L=>q("primary",L),[q]),ve=i.useCallback(L=>q("secondary",L),[q]),fe=i.useCallback(L=>{var ie;if((ie=L.label)!=null&&ie.trim())return L.label.trim();const A=pe.findIndex(be=>be.id===L.id);return`Shell ${A>=0?A+1:""}`.trim()},[pe]),ue=i.useCallback(L=>{var A;X(L.id),F(((A=L.label)==null?void 0:A.trim())||fe(L))},[fe]),ze=i.useCallback(()=>{X(null),F("")},[]),_e=i.useCallback(async()=>{if(Re){z(!0);try{const L=$.trim(),A=await n.updateShell(Re,{label:L.length>0?L:null});w(ie=>{var be;return ie&&{...ie,state:ie.activeShellId===A.id?A.status:ie.state,shell:((be=ie.shell)==null?void 0:be.id)===A.id?A:ie.shell,shells:ie.shells.map(et=>et.id===A.id?A:et)}}),X(null),F(""),I(null)}catch(L){I(L instanceof Error?L.message:"Unable to rename shell.")}finally{z(!1)}}},[$,Re,n]),Le=i.useCallback((L,A)=>{if(L==="primary"){D(A),W(ie=>ie===A?null:ie);return}W(A),D(ie=>ie===A?null:ie)},[]),ct=i.useCallback(L=>{var A,ie;if(L==="primary"){(A=f.current)==null||A.disconnect(),D(null),G==="columns"&&K("secondary");return}(ie=m.current)==null||ie.disconnect(),W(null),K("primary"),Y("single")},[G]),ot=i.useCallback((L,A=R)=>{const ie=G==="columns"?A:"primary";Le(ie,L.id),G!=="columns"&&W(null),K(ie)},[R,Le,G]),qe=i.useCallback(async(L=R)=>{var A;if(!k.current){k.current=!0,z(!0);try{const ie=await n.createShell(r);w(ie);const be=ie.activeShellId??((A=ie.shell)==null?void 0:A.id)??null;if(be){const et=G==="columns"?L:"primary";Le(et,be),G!=="columns"&&W(null),K(et)}I(null)}catch(ie){I(ie instanceof Error?ie.message:"Unable to create shell.")}finally{k.current=!1,z(!1)}}},[R,Le,n,G,r]);i.useEffect(()=>{!a||!g||T||C||re||ee==="creating"||he.length>0||qe("primary")},[C,qe,a,he.length,T,g,ee,re]);const ht=i.useCallback(async(L=(J==null?void 0:J.id)??"")=>{if(L){z(!0);try{await n.terminateShell(L),D(A=>A===L?null:A),W(A=>A===L?null:A),await Qe(),I(null)}catch(A){I(A instanceof Error?A.message:"Unable to terminate shell.")}finally{z(!1)}}},[J==null?void 0:J.id,Qe,n]),xt=i.useCallback(async()=>{var L,A;if(!ae){if(U.shellInputEnabled){(L=Q.current)==null||L.disconnect();return}if(!J||J.status==="exited"||J.status==="not_found"){await qe(R);return}await((A=Q.current)==null?void 0:A.reconnect())}},[R,Q,U.shellInputEnabled,J,ae,qe]),St=i.useCallback(L=>{typeof window>"u"||c==null||c(r,ca(L))},[c,r]),kt=i.useCallback(()=>{var L,A;(L=f.current)==null||L.refreshLayout({syncBackendSize:!0}),(A=m.current)==null||A.refreshLayout({syncBackendSize:!0})},[]),pt=i.useCallback(L=>{var lt,jt;if(G!=="columns")return;const A=v.current;if(!A)return;L.preventDefault(),(jt=(lt=L.currentTarget).setPointerCapture)==null||jt.call(lt,L.pointerId);const ie=it=>{const nt=A.getBoundingClientRect();if(nt.width<=0)return;const It=ca((it-nt.left)/nt.width*100);me(It),b.current!==null&&window.cancelAnimationFrame(b.current),b.current=window.requestAnimationFrame(()=>{b.current=null,kt()})},be=it=>{ie(it.clientX)},et=it=>{ie(it.clientX);const nt=A.getBoundingClientRect();nt.width>0&&St((it.clientX-nt.left)/nt.width*100),window.removeEventListener("pointermove",be),window.removeEventListener("pointerup",et)};window.addEventListener("pointermove",be),window.addEventListener("pointerup",et,{once:!0})},[St,kt,G]),mt=i.useCallback((L,A)=>{Le(A,L.id),K(A)},[Le]),yt=i.useCallback(async()=>{var A;return await((A=Q.current)==null?void 0:A.copyLastCommandOutput())?!0:(Ge("failed","Nothing to copy"),!1)},[Q,Ge]);i.useEffect(()=>{h==null||h({status:U.status,connectionButtonDisabled:ae,connectionButtonLabel:xe,shellInputEnabled:U.shellInputEnabled,isConnecting:U.isConnecting,isCommandRunning:U.isCommandRunning,promptLabel:U.promptLabel??(J?Ia(gn(J.cwd),null):null),isMobileShell:P,hasShell:!!J,busy:C,loading:T,error:U.error??M})},[U,J,C,ae,xe,M,P,T,h]),i.useImperativeHandle(p,()=>({async toggleConnection(){await xt()},sendInput(L){var A;return((A=Q.current)==null?void 0:A.sendInput(L))??!1},sendCommand(L){var A;return((A=Q.current)==null?void 0:A.sendCommand(L))??!1},sendControl(L){var A;return((A=Q.current)==null?void 0:A.sendControl(L))??!1},async copyLastCommandOutput(){var L;return await((L=Q.current)==null?void 0:L.copyLastCommandOutput())??!1},async terminate(){await ht()},focus(){var L;(L=Q.current)==null||L.focus()},refreshLayout(L){var A,ie;(A=f.current)==null||A.refreshLayout(L),G==="columns"&&((ie=m.current)==null||ie.refreshLayout(L))}}),[Q,xt,ht,G]);const wt=L=>e.jsx("div",{className:`rounded-md border px-2 py-1.5 text-xs ${L.id===(J==null?void 0:J.id)?"border-sky-300/40 bg-sky-300/12 text-sky-50":"border-stone-800 bg-stone-900/40 text-stone-300"}`,children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[Re===L.id?e.jsx("form",{className:"min-w-0 flex-1",onSubmit:A=>{A.preventDefault(),_e()},children:e.jsx("input",{value:$,onChange:A=>F(A.currentTarget.value),onKeyDown:A=>{A.key==="Escape"&&(A.preventDefault(),ze())},autoFocus:!0,className:"w-full rounded border border-sky-300/35 bg-stone-950/70 px-2 py-1 text-xs text-stone-100 outline-none","aria-label":"Shell name"})}):e.jsxs("button",{type:"button",onClick:()=>ot(L),onDoubleClick:()=>ue(L),className:"min-w-0 flex-1 text-left",title:L.tmuxSessionName,children:[e.jsx("span",{className:"block truncate",children:fe(L)}),e.jsxs("span",{className:"block truncate text-[10px] text-[var(--theme-fg-muted)]",children:[da(L.status)," · ",gn(L.cwd)||L.cwd]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Re===L.id?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>void _e(),className:"rounded border border-sky-300/35 bg-sky-300/12 px-1.5 py-1 text-[10px] text-sky-50",title:"Save shell name",children:"Save"}),e.jsx("button",{type:"button",onClick:ze,className:"rounded border border-stone-700 px-1.5 py-1 text-[10px] text-stone-200",title:"Cancel rename",children:"Cancel"})]}):e.jsx("button",{type:"button",onClick:()=>ue(L),className:"rounded border border-stone-700 px-1.5 py-1 text-[10px] text-stone-200 hover:border-sky-300/40",title:"Rename shell",children:"Rename"}),G==="columns"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>mt(L,"primary"),className:"rounded border border-stone-700 px-1.5 py-1 text-[10px] text-stone-200 hover:border-sky-300/40",title:"Open in left pane",children:"L"}),e.jsx("button",{type:"button",onClick:()=>mt(L,"secondary"),className:"rounded border border-stone-700 px-1.5 py-1 text-[10px] text-stone-200 hover:border-sky-300/40",title:"Open in right pane",children:"R"})]}),e.jsx("button",{type:"button",disabled:C,onClick:()=>void ht(L.id),className:"rounded border border-rose-300/35 bg-rose-300/12 px-1.5 py-1 text-[10px] text-rose-100 disabled:cursor-not-allowed disabled:opacity-50",title:"Kill shell process",children:"Kill"})]})]})},L.id);return e.jsxs("div",{className:"shell-panel flex min-h-0 flex-1 flex-col",children:[o&&e.jsxs("div",{className:"shell-header shrink-0 border-b px-3 py-3 sm:px-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.24em] text-[var(--theme-fg-muted)]",children:"Shell"}),e.jsx("p",{className:"mt-1 truncate text-sm text-[var(--theme-fg-soft)]",children:U.promptLabel??(J==null?void 0:J.cwd)??"Create a terminal for this thread."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button","aria-label":xe,title:`${xe} (${da(U.status)})`,disabled:ae,onClick:()=>void xt(),className:`inline-flex h-10 w-10 items-center justify-center rounded-full border shadow-lg shadow-stone-950/25 transition disabled:cursor-not-allowed disabled:opacity-60 ${Ie}`,children:e.jsx(of,{connected:U.shellInputEnabled})}),J&&e.jsx("button",{type:"button",disabled:C,onClick:()=>void ht(J.id),className:"rounded-full border border-rose-300/35 bg-rose-300/12 px-3 py-2 text-sm text-rose-600 transition hover:bg-rose-300/18 dark:text-rose-100 disabled:cursor-not-allowed disabled:opacity-60",children:"Terminate"})]})]}),(M||T||re)&&e.jsxs("div",{className:"shell-banner mt-3 rounded-2xl border px-3 py-3 text-sm",children:[T&&e.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!T&&re&&e.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!T&&M&&e.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:M})]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("div",{className:"shell-terminal-bar flex shrink-0 items-center gap-2 border-b px-2 py-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-1",children:[e.jsx("span",{className:"min-w-0 truncate text-xs text-[var(--theme-fg-soft)]",children:J?fe(J):"No live shell process"}),J&&e.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-[0.12em] text-[var(--theme-fg-muted)]",children:da(U.status)})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[e.jsxs("span",{className:"hidden text-xs text-[var(--theme-fg-muted)] sm:inline",children:["Live ",he.length]}),e.jsx("button",{type:"button","aria-expanded":B,"aria-label":B?"Hide shell processes":"Show shell processes",onClick:()=>N(L=>!L),className:"rounded-md border border-stone-700/80 bg-stone-900/50 px-2.5 py-1.5 text-xs text-stone-200 sm:hidden",children:"Processes"})]})]}),B&&e.jsxs("div",{className:"shrink-0 border-b border-stone-800/80 bg-stone-950/55 p-2 sm:hidden",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.16em] text-[var(--theme-fg-muted)]",children:"Processes"}),e.jsxs("span",{className:"text-[10px] text-[var(--theme-fg-muted)]",children:[he.length," live"]})]}),e.jsxs("div",{className:"max-h-52 space-y-1 overflow-y-auto",children:[he.map(wt),he.length===0&&e.jsx("p",{className:"px-2 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No live shell processes"})]}),e.jsx("div",{className:"mt-2 flex justify-end border-t border-stone-800/80 pt-2",children:e.jsx("button",{type:"button","aria-label":"New shell",title:"New shell",disabled:C||T||re,onClick:()=>void qe(R),className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-sky-300/35 bg-sky-300/12 text-base leading-none text-sky-50 disabled:cursor-not-allowed disabled:opacity-50",children:"+"})})]}),ee==="not_created"||re?e.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center",children:e.jsxs("div",{className:"shell-empty-state max-w-md rounded-[1.6rem] border px-6 py-8",children:[e.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Durable thread shell"}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"The shell runs under a supervisor-managed PTY and reconnects after browser disconnects. Create it explicitly when you want to inspect or take over the workspace."}),!re&&e.jsx("button",{type:"button",disabled:C||T,onClick:()=>void qe("primary"),className:"mt-5 rounded-md border border-sky-300/35 bg-sky-300/12 px-3 py-2 text-sm text-sky-50 disabled:cursor-not-allowed disabled:opacity-50",children:"New Shell"})]})}):e.jsxs("div",{className:"grid h-full min-h-0 grid-cols-1 gap-2 p-2 sm:grid-cols-[minmax(0,1fr)_16rem] sm:p-3",children:[e.jsxs("div",{className:"shell-terminal-frame relative min-h-0 overflow-hidden rounded-[1.4rem] border shadow-inner",children:[!o&&(M||T||re)&&e.jsxs("div",{className:"shell-banner absolute left-2 right-2 top-2 z-10 rounded-2xl border px-3 py-3 text-sm backdrop-blur sm:left-3 sm:right-3 sm:top-3",children:[T&&e.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"Loading shell state..."}),!T&&re&&e.jsx("p",{className:"text-rose-600 dark:text-rose-100",children:"Workspace path is missing on this machine. Restore the path before creating a shell."}),!T&&M&&e.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:M})]}),e.jsxs("div",{ref:v,className:`relative grid h-full min-h-0 ${G==="columns"?"grid-cols-1 sm:grid-cols-[var(--shell-left)_0.35rem_var(--shell-right)]":"grid-cols-1"}`,style:G==="columns"?{"--shell-left":`${we}fr`,"--shell-right":`${100-we}fr`}:void 0,"data-shell-split-ratio":we,children:[e.jsx(qo,{ref:f,paneId:"primary",shell:Ce,isActive:R==="primary",isVisible:a,isMobileShell:P,effectiveTheme:l,workspacePathMissing:re,shellAdapter:n,onActivate:()=>K("primary"),onShellUpdate:Ve,onRuntimeStateChange:oe,onFeedback:Ge}),G==="columns"&&e.jsx("button",{type:"button",onClick:()=>ct("primary"),className:"absolute left-2 top-2 z-10 rounded-md border border-stone-700/80 bg-stone-950/70 px-2 py-1 text-[10px] text-stone-200 hover:border-rose-300/40",title:"Close left pane",children:"Close"}),G==="columns"&&e.jsx("button",{type:"button","aria-label":"Resize shell panes",title:"Resize shell panes",onPointerDown:pt,className:"hidden cursor-col-resize border-x border-stone-800/80 bg-stone-900/60 transition hover:border-sky-300/40 hover:bg-sky-300/10 sm:block"}),G==="columns"&&e.jsxs("div",{className:"relative min-h-0 border-t border-stone-800/80 sm:border-l sm:border-t-0",children:[e.jsx(qo,{ref:m,paneId:"secondary",shell:Fe,isActive:R==="secondary",isVisible:a,isMobileShell:P,effectiveTheme:l,workspacePathMissing:re,shellAdapter:n,onActivate:()=>K("secondary"),onShellUpdate:Ve,onRuntimeStateChange:ve,onFeedback:Ge}),e.jsx("button",{type:"button",onClick:()=>ct("secondary"),className:"absolute left-2 top-2 z-10 rounded-md border border-stone-700/80 bg-stone-950/70 px-2 py-1 text-[10px] text-stone-200 hover:border-rose-300/40",title:"Close right pane",children:"Close"})]})]}),s&&P&&e.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[te&&e.jsx("div",{className:`pointer-events-auto rounded-full border px-3 py-1.5 text-[11px] shadow-lg shadow-stone-950/30 backdrop-blur ${We}`,children:te.text}),E&&e.jsx("div",{className:"shell-toolbox pointer-events-auto rounded-[1.2rem] border p-2 shadow-2xl backdrop-blur",children:e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{Ge("idle","Use the prompt box tools to paste")},className:"inline-flex items-center justify-center rounded-full border border-sky-300/35 bg-sky-300/12 px-2.5 py-2 text-sky-600 dark:text-sky-50",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(Wo,{}),e.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),e.jsx("button",{type:"button",onClick:()=>void yt(),className:"shell-toolbox-copy inline-flex items-center justify-center rounded-full border px-2.5 py-2",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(Wo,{}),e.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Copy"})]})}),e.jsx("button",{type:"button",disabled:!U.shellInputEnabled,onClick:()=>{var L;(L=Q.current)!=null&&L.sendControl("clear")?Ge("done","Cleared"):Ge("failed","Connect the shell first")},className:"disabled:opacity-45",children:e.jsx(ha,{label:"CLEAR",tone:"sky"})}),e.jsx("button",{type:"button",disabled:!U.shellInputEnabled||!U.isCommandRunning,onClick:()=>{var L;(L=Q.current)!=null&&L.sendInput("")?Ge("done","Sent Ctrl-C"):Ge("failed","Connect the shell first")},className:"disabled:opacity-45",children:e.jsx(ha,{label:"CTRL-C",tone:"rose"})}),["ctrl_d","esc","tab","up","down"].map(L=>e.jsx("button",{type:"button",disabled:!U.shellInputEnabled,onClick:()=>{var A;(A=Q.current)!=null&&A.sendControl(L)?Ge("done",`Sent ${L.toUpperCase().replace("_","-")}`):Ge("failed","Connect the shell first")},className:"disabled:opacity-45",children:e.jsx(ha,{label:L.toUpperCase().replace("_","-"),tone:"stone"})},L))]})}),e.jsx("button",{type:"button","aria-expanded":E,"aria-label":E?"Close shell tools":"Open shell tools",onClick:()=>V(L=>!L),className:"shell-toolbox-trigger pointer-events-auto inline-flex h-11 w-11 items-center justify-center rounded-full border shadow-2xl backdrop-blur transition",children:e.jsx(sf,{})})]})]}),e.jsxs("aside",{className:"hidden min-h-0 overflow-hidden rounded-[1rem] border border-stone-800/80 bg-stone-950/30 p-2 sm:flex sm:flex-col",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.16em] text-[var(--theme-fg-muted)]",children:"Processes"}),e.jsxs("span",{className:"text-[10px] text-[var(--theme-fg-muted)]",children:[he.length," live"]})]}),e.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto",children:[he.map(wt),he.length===0&&e.jsx("p",{className:"px-2 py-3 text-xs text-[var(--theme-fg-muted)]",children:"No live shell processes"})]}),e.jsx("div",{className:"mt-2 flex justify-end border-t border-stone-800/80 pt-2",children:e.jsx("button",{type:"button","aria-label":"New shell",title:"New shell",disabled:C||T||re,onClick:()=>void qe(R),className:"inline-flex h-8 w-8 items-center justify-center rounded-md border border-sky-300/35 bg-sky-300/12 text-base leading-none text-sky-50 disabled:cursor-not-allowed disabled:opacity-50",children:"+"})})]})]})]})})]})}),ji=new Set(["xyz","extxyz","cif","pdb"]),cf=new Set(["png","jpg","jpeg","gif","webp","svg"]),hf=new Set(["pdf"]);function uf(t){var n;const r=[];for(const a of t.turns)for(const o of a.items)o.kind==="artifact"&&o.artifact&&r.push(o.artifact);for(const a of((n=t.liveItems)==null?void 0:n.items)??[])a.kind==="artifact"&&a.artifact&&r.push(a.artifact);return r}function mf(t){return t.trim().replace(/^\/+|\/+$/g,"").replace(/[^\w.-]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function Vr(t){var r;return((r=t.split(".").pop())==null?void 0:r.toLowerCase())||""}function pf(t){return t.split("/").filter(Boolean).at(-1)??t}function Ni(t){const r=t.kind==="directory"?"directory":"file";return{id:`workspace:${t.path}`,name:t.name,path:t.path,kind:r,...t.size!==void 0?{size:t.size}:{},workspaceNode:t,children:(t.children??[]).map(Ni)}}function Ci(t){if(t.kind==="file")return t;for(const r of t.children){const n=Ci(r);if(n)return n}return null}function Pa(t,r){return!t||!r?!1:t.path===r?!0:t.children.some(n=>Pa(n,r))}function ff(t){if(!t)return null;const r=Vr(t.path);return ji.has(r)?{content:[t.content.endsWith(`
|
|
3507
|
+
`)?t.content:`${t.content}
|
|
3508
|
+
`],format:r==="extxyz"?"xyz":r,name:t.name,uuid:t.path}:null}function gf(t){const r=Vr(t);return r==="tsx"||r==="jsx"?"tsx":r==="yml"?"yaml":r||"text"}function xf(t,r){let n=t,a="";for(const o of r){a=a?`${a}/${o}`:o;let s=n.children.find(l=>l.kind==="directory"&&l.name===o);s||(s={id:`dir:${a}`,name:o,path:a,kind:"directory",children:[]},n.children.push(s)),n=s}return n}function bf(t,r,n){const a=r.split("/").filter(Boolean),o=a.pop()??n.name;xf(t,a).children.push({...n,name:n.name||o,path:r})}function vf(t,r){return t.kind==="directory"&&r.kind!=="directory"?-1:t.kind!=="directory"&&r.kind==="directory"?1:t.name.localeCompare(r.name)}function Si(t){t.children.sort(vf);for(const r of t.children)Si(r);return t}function Ko(t,r,n,a){var p;const o={id:"root",name:t.workspace.label??"Workspace",path:"",kind:"directory",children:[]},s={id:"artifacts",name:"artifacts",path:"artifacts",kind:"directory",children:[]};for(const f of r){const m=f.title||f.id,x=mf(m)||f.id;s.children.push({id:`artifact:${f.id}`,name:`${x}.artifact`,path:`artifacts/${x}.artifact`,kind:"artifact",artifact:f,preview:f.summaryText??f.type,detail:JSON.stringify(f.payload,null,2),children:[]})}const l={id:"thread-events",name:"thread-events",path:"thread-events",kind:"directory",children:[]},d={id:"live",name:"live",path:"live",kind:"directory",children:[]};let c=0;const h=(f,m,x=!1)=>{c+=1;const v=m.kind.replace(/([A-Z])/g,"-$1").toLowerCase(),b=`${x?"live":`thread-events/${f}`}/${String(c).padStart(3,"0")}-${v}.json`,k="text"in m&&typeof m.text=="string"?m.text.slice(0,160):m.kind,g=m.kind==="artifact"&&m.artifact?m.artifact:null,w=g&&x?{id:`live-artifact:${g.id}`,name:g.title||g.id,path:b,kind:"live-artifact",artifact:g,item:m,preview:g.summaryText??g.type,detail:JSON.stringify(g.payload,null,2),children:[]}:{id:`event:${m.id}`,name:pf(b),path:b,kind:"event",item:m,preview:k,detail:JSON.stringify(m,null,2),children:[]};if(x){d.children.push(w);return}bf(l,b.replace(/^thread-events\//,""),w)};for(const f of t.turns)for(const m of f.items)(m.kind==="commandExecution"||m.kind==="webSearch"||m.kind==="fileRead"||m.kind==="fileChange"||m.kind==="agentToolCall"||m.kind==="skillToolCall"||m.kind==="toolCall"||m.kind==="hook"||m.kind==="plan"||m.kind==="reasoning")&&h(f.id,m);for(const f of((p=t.liveItems)==null?void 0:p.items)??[])h(t.thread.activeTurnId??"live",f,!0);return o.children.push(s,l,d),Si(o)}function kf(t){const r=new Map,n=a=>{r.set(a.id,a);for(const o of a.children)n(o)};return n(t),r}function Ti(t){if(t.kind==="artifact"||t.kind==="live-artifact"||t.kind==="event"||t.kind==="file")return t;for(const r of t.children){const n=Ti(r);if(n)return n}return null}function Xo(t){const r=t.split("/").filter(Boolean),n=[];for(let a=1;a<=r.length;a+=1)n.push(r.slice(0,a).join("/"));return n}function xr({label:t,children:r}){return e.jsxs("section",{className:"thread-workspace-card rounded-lg border p-3",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-[0.14em] text-[var(--theme-fg-muted)]",children:t}),e.jsx("div",{className:"mt-2 text-sm text-[var(--theme-fg)]",children:r})]})}function wf({className:t,decorative:r=!0,orientation:n="horizontal",...a}){return e.jsx(uc,{"data-slot":"separator",decorative:r,orientation:n,className:vt("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...a})}var yf=Br("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function jf({className:t,orientation:r,...n}){return e.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:vt(yf({orientation:r}),t),...n})}function Nf({className:t,orientation:r="vertical",...n}){return e.jsx(wf,{"data-slot":"button-group-separator",orientation:r,className:vt("relative !m-0 self-stretch bg-input data-[orientation=vertical]:h-auto",t),...n})}function Cf({delayDuration:t=0,...r}){return e.jsx(mc,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function Sf({...t}){return e.jsx(Cf,{children:e.jsx(lc,{"data-slot":"tooltip",...t})})}function Tf({...t}){return e.jsx(ic,{"data-slot":"tooltip-trigger",...t})}function Ef({children:t,className:r,sideOffset:n=0,...a}){return e.jsx(dc,{children:e.jsxs(cc,{"data-slot":"tooltip-content",sideOffset:n,className:vt("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md bg-foreground px-3 py-1.5 text-balance text-xs text-background animate-in fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",r),...a,children:[t,e.jsx(hc,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function zf(t){return(t==null?void 0:t.trim().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""))||"molecule"}function Zo(t,r){const n=new Blob([t],{type:"text/plain"}),a=URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.download=r,o.click(),URL.revokeObjectURL(a)}function dt({children:t,disabled:r,label:n,onClick:a}){return e.jsxs(Sf,{children:[e.jsx(Tf,{asChild:!0,children:e.jsx(Ar,{type:"button",variant:"outline",size:"icon",className:"thread-graph-molecule-button size-8",disabled:r,onClick:a,title:n,"aria-label":n,children:t})}),e.jsx(Ef,{children:e.jsx("p",{children:n})})]})}function Ma({children:t,className:r=""}){return e.jsx(jf,{className:`thread-graph-molecule-button-group ${r}`,children:t})}function Lf({cameraInfo:t,onClearSelection:r,onClearStaged:n,onSendSelection:a,onSendStaged:o,onStageSelection:s,onToggleUnitCell:l,selectedAtomLabels:d,selectedSerials:c,stagedAtoms:h,stagedMolecules:p,unitCellAvailable:f,unitCellVisible:m}){const x=c.length>0,v=h>0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex w-full justify-between gap-2 overflow-x-auto",children:[e.jsxs(Ma,{children:[e.jsx(dt,{label:"Distance",children:e.jsx(Jd,{className:"size-4"})}),e.jsx(dt,{label:"Connectivity",children:e.jsx(Qd,{className:"size-4"})}),e.jsx(dt,{label:"Angle",children:e.jsx(ec,{className:"size-4"})}),e.jsx(dt,{label:"Dihedral",children:e.jsx(tc,{className:"size-4"})}),e.jsx(dt,{label:"Add dummy atoms",children:e.jsx(rc,{className:"size-4"})}),e.jsx(dt,{label:"Delete atoms",children:e.jsx(vn,{className:"size-4"})}),e.jsx(dt,{label:"Rotate",children:e.jsx(nc,{className:"size-4"})})]}),e.jsxs(Ma,{children:[e.jsx(dt,{label:m?"Hide unit cell":"Show unit cell",disabled:!f,onClick:l,children:e.jsx(dl,{className:"size-4"})}),e.jsx(dt,{label:"Clear selection",disabled:!x,onClick:r,children:e.jsx(wr,{className:"size-4"})}),e.jsx(dt,{label:"Send selection",disabled:!x,onClick:a,children:e.jsx(ac,{className:"size-4"})}),e.jsx(dt,{label:"Stage current selection",disabled:!x,onClick:s,children:e.jsx($a,{className:"size-4"})}),e.jsx(dt,{label:"Clear staged selections",disabled:!v,onClick:n,children:e.jsx(sc,{className:"size-4"})}),e.jsx(dt,{label:"Send staged selections",disabled:!v,onClick:o,children:e.jsx(oc,{className:"size-4"})})]})]}),t?e.jsxs("div",{className:"thread-graph-molecule-camera",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"XYZ: "}),"x=",t.position.x.toFixed(1)," y=",t.position.y.toFixed(1)," z=",t.position.z.toFixed(1),e.jsx("br",{}),e.jsx("strong",{children:"Quat: "}),"qx=",t.position.qx.toFixed(2)," qy=",t.position.qy.toFixed(2)," qz=",t.position.qz.toFixed(2)," qw=",t.position.qw.toFixed(2)]}),e.jsx("div",{className:"thread-graph-molecule-camera-divider"}),e.jsxs("div",{className:"flex flex-col gap-1 text-[10px]",children:[e.jsxs("div",{children:["Selected atoms:"," ",c.length>0?c.map(b=>`${d[b]??"Atom"}(${b})`).join(", "):"None"]}),e.jsxs("div",{children:["Staged: ",p," molecule(s), ",h," atom(s)"]})]})]}):null]})}function Rf({currentIndex:t,exportContent:r,moleculeId:n,onScreenshot:a,viewerRef:o,xyzContent:s,xyzFormat:l}){const d=zf(n);async function c(){s&&await navigator.clipboard.writeText(s)}function h(){s&&Zo(s,`${d}_step_${t+1}.${l||"xyz"}`)}function p(){r&&Zo(r,`${d}_trajectory.${l||"xyz"}`)}function f(){o.current&&(o.current.zoom(1.2),o.current.render())}function m(){o.current&&(o.current.zoom(.8),o.current.render())}function x(){o.current&&(o.current.zoomTo(),o.current.setCameraParameters({}),o.current.render())}return e.jsxs(Ma,{className:"ml-auto justify-end",children:[e.jsx(dt,{label:"Copy current structure",onClick:()=>void c(),disabled:!s,children:e.jsx(Dr,{className:"size-3.5"})}),e.jsx(dt,{label:"Download current structure",onClick:h,disabled:!s,children:e.jsx(ln,{className:"size-3.5"})}),e.jsx(dt,{label:"Download full trajectory",onClick:p,disabled:!r,children:e.jsx($a,{className:"size-3.5"})}),e.jsx(dt,{label:"Copy screenshot",onClick:a,disabled:!o.current||!s,children:e.jsx(sl,{className:"size-3.5"})}),e.jsx(Nf,{className:"thread-graph-molecule-button-divider"}),e.jsx(dt,{label:"Zoom in",onClick:f,disabled:!o.current||!s,children:e.jsx(ol,{className:"size-3.5"})}),e.jsx(dt,{label:"Zoom out",onClick:m,disabled:!o.current||!s,children:e.jsx(ll,{className:"size-3.5"})}),e.jsx(dt,{label:"Reset camera",onClick:x,disabled:!o.current||!s,children:e.jsx(il,{className:"size-3.5"})})]})}var ua=null;async function If(){if(typeof window>"u")throw new Error("3Dmol is only available in a browser environment.");return window["3Dmol"]?window["3Dmol"]:(ua||(ua=new Promise((t,r)=>{const n=document.querySelector('script[data-remote-codex-3dmol="true"]'),a=()=>{if(window["3Dmol"]){t(window["3Dmol"]);return}r(new Error("3Dmol loaded without exposing the expected global."))};if(n){n.addEventListener("load",a,{once:!0}),n.addEventListener("error",()=>r(new Error("Unable to load 3Dmol viewer runtime.")),{once:!0});return}const o=document.createElement("script");o.src="/vendor/3Dmol-min.js",o.async=!0,o.dataset.remoteCodex3dmol="true",o.addEventListener("load",a,{once:!0}),o.addEventListener("error",()=>r(new Error("Unable to load 3Dmol viewer runtime.")),{once:!0}),document.head.appendChild(o)})),ua)}function Pf({className:t,defaultValue:r,max:n=100,min:a=0,value:o,...s}){const l=i.useMemo(()=>Array.isArray(o)?o:Array.isArray(r)?r:[a,n],[r,n,a,o]);return e.jsxs(Kd,{"data-slot":"slider",...r!==void 0?{defaultValue:r}:{},...o!==void 0?{value:o}:{},min:a,max:n,className:vt("relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...s,children:[e.jsx(Xd,{"data-slot":"slider-track",className:"relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",children:e.jsx(Zd,{"data-slot":"slider-range",className:"absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"})}),Array.from({length:l.length},(d,c)=>e.jsx(Yd,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"},c))]})}function Mf(t){const r=t==null?void 0:t.trim().toLowerCase();return!r||r==="extxyz"?"xyz":r}function $f(t){var o,s;const r=t.replace(/\r\n/g,`
|
|
3509
|
+
`).replace(/\r/g,`
|
|
3510
|
+
`).split(`
|
|
3511
|
+
`),n=[];let a=0;for(;a<r.length;){for(;a<r.length&&((o=r[a])==null?void 0:o.trim())==="";)a+=1;if(a>=r.length)break;const l=Number.parseInt(((s=r[a])==null?void 0:s.trim())??"",10);if(!Number.isFinite(l)||l<0)return[t];const d=l+2;if(a+d>r.length)return[t];n.push(`${r.slice(a,a+d).join(`
|
|
3512
|
+
`)}
|
|
3513
|
+
`),a+=d}return n.length>0?n:[t]}function Yo(t,r){return r!=="xyz"?t:t.flatMap(n=>$f(n))}function Jo(t){return t.map(r=>`${r.replace(/\s+$/g,"")}
|
|
3514
|
+
`).join("")}function _f(t){if(!t)return{format:"xyz",frames:[],exportContent:""};if(typeof t=="string"){const o=Yo([t],"xyz");return{frames:o,format:"xyz",exportContent:Jo(o)}}const r=Mf(t.format),n=t.content.filter(o=>o.trim().length>0);return{frames:Yo(n,r),format:r,exportContent:Jo(n)}}function Af({className:t="",moleculeId:r=null,onScreenshot:n,onSelectionChange:a,source:o,title:s="PyMOL-style (PDB/CIF)"}){const l=i.useRef(null),d=i.useRef(null),c=i.useRef(null),h=i.useRef(!1),p=i.useRef(!0),[f,m]=i.useState(null),[x,v]=i.useState(0),[b,k]=i.useState(null),[g,w]=i.useState(!1),[T,y]=i.useState({}),[C,z]=i.useState([]),[M,I]=i.useState({}),[R,K]=i.useState(!1),[Z,D]=i.useState(!1),[ce,W]=i.useState(null),G=i.useMemo(()=>_f(o),[o]),Y=G.frames,we=G.format,me=Y[x]??null,Re=Y.length>0&&x===Y.length-1,X=r??"current",$=Object.values(M).reduce((N,E)=>N+E.length,0),F=Object.keys(M).length;i.useEffect(()=>{if(Y.length===0){v(0);return}v(Y.length-1)},[Y.length]),i.useEffect(()=>{if(!g||Y.length<=1)return;const N=window.setInterval(()=>{v(E=>E>=Y.length-1?(window.clearInterval(N),w(!1),E):E+1)},200);return()=>window.clearInterval(N)},[g,Y.length]),i.useEffect(()=>{const N=l.current;if(!N||d.current)return;let E=!1;try{const _=document.createElement("canvas");if(!(_.getContext("webgl2")||_.getContext("webgl")||_.getContext("experimental-webgl"))){W("WebGL is unavailable in this browser environment. Unable to render 3D viewer.");return}}catch{W("WebGL is unavailable in this browser environment. Unable to render 3D viewer.");return}const V=()=>{var _,ne;(_=d.current)==null||_.resize(),(ne=d.current)==null||ne.render()};return If().then(_=>{if(!(E||d.current))try{const ne=_.createViewer(N,{});d.current=ne,ne.setBackgroundColor("#f8fafc",.8),window.addEventListener("resize",V),window.setTimeout(V,100)}catch(ne){console.error("Failed to initialize 3Dmol viewer:",ne),W("Failed to initialize 3D viewer. Please refresh or try another browser.")}}).catch(_=>{console.error("Failed to load 3Dmol viewer runtime:",_),W("Failed to load 3D viewer runtime. Please refresh or try another browser.")}),()=>{E=!0,window.removeEventListener("resize",V),d.current=null,c.current=null}},[]),i.useEffect(()=>{const N=d.current;if(!(!N||!me))try{N.removeAllModels(),N.removeAllShapes(),N.removeAllLabels();const E=N.addModel(me,we||"xyz");c.current=E,E.setStyle({},{stick:{radius:.2},sphere:{scale:.3}});const V=E.getCrystData(),_=!!(V&&typeof V=="object"&&Object.keys(V).length);K(_),D(_?p.current:!1),z([]),y({});const ne=me.split(`
|
|
3515
|
+
`).slice(2).map(te=>te.trim()).filter(Boolean).map(te=>te.split(/\s+/)[0]??"Atom");h.current||(N.zoomTo(),h.current=!0),E.setClickable({},!0,(te,je,ee)=>{const pe=te.serial??te.index;if(pe===void 0)return;const he=te.atom||te.elem||ne[pe]||"Atom";z(Ce=>{const J=!!(ee!=null&&ee.shiftKey||ee!=null&&ee.metaKey||ee!=null&&ee.ctrlKey)?Ce.includes(pe)?Ce.filter(U=>U!==pe):[...Ce,pe]:Ce.length===1&&Ce[0]===pe?[]:[pe];return y(U=>{if(J.length===0)return{};const re={};return J.forEach(ae=>{re[ae]=U[ae]||ne[ae]||he}),re}),J})}),E.setHoverable({},!0,(te,je,ee)=>{!ee||!te||k({x:ee.clientX,y:ee.clientY,label:`${te.atom||te.elem||"Atom"} (${te.serial??te.index??"?"})`,coords:{x:te.x.toFixed(2),y:te.y.toFixed(2),z:te.z.toFixed(2)}})},()=>k(null)),N.render()}catch(E){console.error("Failed to render molecule:",E),W("Unable to render this molecular structure.")}},[me,we]),i.useEffect(()=>{const N=d.current,E=c.current;if(!(!N||!E)){try{N.removeUnitCell(E)}catch{}if(Z&&R)try{N.addUnitCell(E,{box:{color:"black",opacity:1,linewidth:5},astyle:{radius:.12,mid:.85,color:"red",opacity:.6},bstyle:{radius:.12,mid:.85,color:"green",opacity:.6},cstyle:{radius:.12,mid:.85,color:"blue",opacity:.6},alabel:"a",blabel:"b",clabel:"c"})}catch{K(!1),D(!1)}N.render()}},[R,Z,me,we]),i.useEffect(()=>{const N=d.current,E=c.current;!N||!E||!me||(E.setStyle({},{stick:{radius:.2},sphere:{scale:.3}}),C.length>0&&E.setStyle({serial:C},{stick:{radius:.3,color:"yellow"},sphere:{scale:.4,color:"yellow"}}),N.render(),a==null||a({moleculeId:r,atoms:C}))},[r,a,C,me]),i.useEffect(()=>{if(!me)return;let N=0;const E=()=>{var _,ne;const V=(ne=(_=d.current)==null?void 0:_.getView)==null?void 0:ne.call(_);if(Array.isArray(V)&&V.length>=8){const[te,je,ee,pe,he,Ce,Fe,J]=V;if(typeof te=="number"&&typeof je=="number"&&typeof ee=="number"&&typeof pe=="number"&&typeof he=="number"&&typeof Ce=="number"&&typeof Fe=="number"&&typeof J=="number"){const U=Math.sqrt(he*he+Ce*Ce+Fe*Fe),re=U>0?{x:he/U,y:Ce/U,z:Fe/U}:{x:0,y:0,z:0};m({position:{x:te,y:je,z:ee,qx:he,qy:Ce,qz:Fe,qw:J},lookAt:re,zoom:pe})}}N=window.requestAnimationFrame(E)};return N=window.requestAnimationFrame(E),()=>window.cancelAnimationFrame(N)},[me]);const P=i.useCallback(async()=>{const N=d.current;if(!(N!=null&&N.pngURI))return;N.render();const E=N.pngURI();if(E){try{const _=await(await fetch(E)).blob(),ne=new ClipboardItem({[_.type||"image/png"]:_});await navigator.clipboard.write([ne])}catch{}n==null||n({moleculeId:r,image:E})}},[r,n]);function O(){R&&D(N=>{const E=!N;return p.current=E,E})}function B(){C.length!==0&&I(N=>{const E=N[X]??[];return{...N,[X]:Array.from(new Set([...E,...C]))}})}return e.jsxs("div",{className:`thread-graph-molecule-viewer flex h-full min-h-0 flex-col bg-white ${t}`,children:[e.jsxs("div",{className:"thread-graph-molecule-header flex shrink-0 items-center justify-between gap-3 border-b border-slate-200 px-3 py-2 sm:px-4 sm:py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"truncate text-sm font-semibold text-slate-900",children:s}),e.jsx("p",{className:"mt-1 hidden text-[11px] text-slate-400 sm:block",children:"cartoon + surface"})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-slate-400",children:"workspace preview"})]}),e.jsxs("div",{className:"thread-graph-molecule-body min-h-0 flex-1",children:[e.jsxs("div",{ref:l,"data-testid":"molecule-viewer",className:"thread-graph-molecule-stage relative min-h-0 flex-1 overflow-hidden",children:[ce?e.jsx("div",{"data-testid":"molecule-viewer-error",className:"thread-graph-molecule-error absolute inset-0 flex items-center justify-center bg-red-50 p-4 text-sm text-red-700",children:ce}):null,!ce&&!me?e.jsx("div",{className:"thread-graph-molecule-empty absolute inset-0 flex items-center justify-center p-4 text-sm text-slate-400",children:"No molecule data available."}):null,b?e.jsxs("div",{className:"thread-graph-molecule-tooltip pointer-events-none fixed z-[1000] rounded-md border border-gray-300 bg-white/95 px-2 py-1.5 text-[10px] text-gray-800 shadow-md",style:{left:b.x-20,top:b.y-50},children:[e.jsx("div",{className:"mb-0.5 font-semibold text-gray-900",children:b.label}),e.jsxs("div",{className:"space-x-2 text-gray-600",children:[e.jsxs("span",{children:["x: ",b.coords.x]}),e.jsxs("span",{children:["y: ",b.coords.y]}),e.jsxs("span",{children:["z: ",b.coords.z]})]})]}):null]}),e.jsxs("div",{className:"thread-graph-molecule-controls shrink-0",children:[e.jsxs("div",{className:"thread-graph-molecule-control-row",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"thread-graph-molecule-control-title",children:"Ball & Stick"}),e.jsx("p",{className:"thread-graph-molecule-control-subtitle",children:"XYZ / PDB / CIF preview"})]}),e.jsx(Rf,{currentIndex:x,exportContent:G.exportContent,moleculeId:r,onScreenshot:()=>void P(),viewerRef:d,xyzContent:me,xyzFormat:we})]}),Y.length>1?e.jsxs("div",{className:"thread-graph-molecule-trajectory",children:[e.jsxs("div",{className:"mb-2 flex justify-between gap-3 text-xs",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:["Trajectory ",x+1," / ",Y.length,e.jsx(Ar,{type:"button",variant:"ghost",size:"icon",className:"thread-graph-molecule-button h-5 w-5",onClick:()=>{w(N=>{const E=!N;return E&&x===Y.length-1&&v(0),E})},"aria-label":g?"Pause trajectory":"Play trajectory",title:g?"Pause trajectory":"Play trajectory",children:g&&x!==Y.length-1?e.jsx(cl,{className:"h-3 w-3"}):e.jsx(hl,{className:"h-3 w-3"})})]}),e.jsxs(Ar,{type:"button",variant:"ghost",onClick:()=>v(Y.length-1),className:"thread-graph-molecule-live-button",children:[e.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${Re?"animate-pulse bg-red-600":"bg-gray-300"}`}),"Live"]})]}),e.jsx(Pf,{value:[x],max:Y.length-1,step:1,onValueChange:N=>v(N[0]??0),"aria-label":"Trajectory frame"})]}):null,e.jsx(Lf,{cameraInfo:f,onClearSelection:()=>z([]),onClearStaged:()=>I({}),onSendSelection:()=>a==null?void 0:a({moleculeId:r,atoms:C}),onSendStaged:()=>{Object.entries(M).forEach(([N,E])=>{a==null||a({moleculeId:N==="current"?r:N,atoms:E})})},onStageSelection:B,onToggleUnitCell:O,selectedAtomLabels:T,selectedSerials:C,stagedAtoms:$,stagedMolecules:F,unitCellAvailable:R,unitCellVisible:Z})]})]})]})}function Df(t){return t&&(t.node.path||t.node.name)||null}function Bf(t){if(!t)return null;switch(t.kind){case"live-artifact":return{kind:"live-molecule",node:t};case"file":return{kind:"workspace-file",node:t};case"artifact":return{kind:"artifact",node:t};case"event":return{kind:"event",node:t};case"meta":return{kind:"meta",node:t};case"directory":return null}}var ma=i.memo(function({content:r}){return e.jsx("div",{className:"thread-graph-code-preview min-h-0 flex-1 overflow-auto",children:e.jsx("pre",{className:"thread-graph-plain-code-preview",children:e.jsx("code",{children:r})})})});function Ff({error:t,imageUrl:r,loadingMore:n,onLoadMore:a,onCollapse:o,pdfUrl:s,previewFile:l,previewLoading:d,plugins:c,selectedTarget:h}){const p=(h==null?void 0:h.node)??null,f=p!=null&&p.artifact?c.renderArtifact({artifact:p.artifact,expanded:!0,onToggleExpanded:()=>{}}):null,m=ff(l??null),x=(l==null?void 0:l.language)||gf((l==null?void 0:l.path)??""),v=l?Vr(l.path):"",b=Df(h),k=l!==null&&ji.has(v),g=(h==null?void 0:h.kind)==="live-molecule",w=!!(p!=null&&p.artifact&&f),T=!!m||w;return e.jsxs("section",{className:"thread-graph-viewer flex h-full min-h-0 flex-col overflow-hidden rounded-[12px]","data-preview-target-kind":(h==null?void 0:h.kind)??"none",children:[e.jsxs("div",{className:"thread-graph-viewer-header flex h-12 shrink-0 items-center justify-between gap-3 border-b px-3 sm:h-[60px] sm:px-5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("h2",{className:"text-base font-semibold text-slate-900 sm:text-[18px] dark:text-slate-100",children:"Viewer"}),b?e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-slate-500 dark:text-slate-400",children:b}):null]}),o?e.jsx("button",{type:"button",onClick:o,"data-testid":"collapse-viewer",className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-slate-500 transition hover:bg-slate-100 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-[#222733] dark:hover:text-slate-100",title:"Collapse workspace","aria-label":"Collapse workspace",children:e.jsx(dn,{className:"h-4 w-4"})}):null]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[t?e.jsx("div",{className:"border-b border-rose-200 bg-rose-50 px-5 py-3 text-sm text-rose-700 dark:border-rose-400/25 dark:bg-rose-400/10 dark:text-rose-200",children:t}):null,h?h.kind==="workspace-file"&&d?e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-5 text-center text-sm text-slate-400 dark:text-slate-500",children:"Loading file preview..."}):h.kind==="workspace-file"&&m?e.jsx("div",{className:"thread-graph-molecule-preview min-h-0 flex-1 overflow-hidden",children:e.jsx(Af,{source:m,moleculeId:m.uuid??h.node.path,title:"PyMOL-style (PDB/CIF)"})}):h.kind==="workspace-file"&&r?e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center overflow-auto p-5",children:e.jsx("img",{src:r,alt:h.node.path||h.node.name,className:"max-h-full max-w-full object-contain"})}):h.kind==="workspace-file"&&s?e.jsx("div",{className:"thread-graph-file-preview-frame min-h-0 flex-1 overflow-hidden",children:e.jsx("iframe",{src:s,title:`PDF preview: ${h.node.path||h.node.name}`,className:"h-full w-full border-0"})}):h.kind==="workspace-file"&&l?e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:"thread-graph-file-preview-header border-b px-4 py-3 text-xs uppercase tracking-[0.12em]",children:[k?"molecule":x||v||"text"," |"," ",l.size.toLocaleString()," bytes",l.truncated?e.jsxs("span",{className:"ml-2 text-amber-500",children:["showing ",l.nextOffset.toLocaleString()," bytes"]}):null]}),e.jsx(ma,{content:l.content}),l.truncated&&a?e.jsx("div",{className:"thread-graph-file-preview-footer flex justify-center border-t px-4 py-3",children:e.jsx("button",{type:"button",onClick:a,disabled:n,className:"thread-graph-load-more-button rounded-md px-4 py-1.5 text-xs disabled:opacity-50",children:n?"Loading...":`Load more (${(l.size-l.nextOffset).toLocaleString()} bytes remaining)`})}):null]}):(h.kind==="live-molecule"||h.kind==="artifact")&&h.node.artifact?e.jsx("div",{className:T||g?"min-h-0 flex-1 overflow-hidden":"min-h-0 flex-1 overflow-auto p-3",children:f}):h.kind==="meta"?e.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-3",children:e.jsx("div",{className:"grid gap-3",children:e.jsx(xr,{label:"Workspace Data",children:e.jsx(ma,{content:h.node.detail??""})})})}):e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsx("div",{className:"thread-graph-file-preview-header border-b px-4 py-3 text-xs uppercase tracking-[0.12em]",children:h.node.kind}),e.jsx(ma,{content:h.node.detail??h.node.preview??h.node.name})]}):e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center px-5 text-center text-sm text-slate-400 dark:text-slate-500",children:"Pick a live molecule, workspace file, artifact, or thread event to preview it."})]})]})}function Gf({files:t,onCancel:r,onConfirm:n}){return e.jsx("div",{className:"thread-graph-dialog-backdrop fixed inset-0 z-50 flex items-center justify-center bg-black/40 px-4",children:e.jsxs("div",{className:"thread-graph-dialog w-full max-w-sm rounded-xl border bg-[var(--theme-panel)] p-6 shadow-xl",children:[e.jsx("h3",{className:"text-base font-semibold text-[var(--theme-fg)]",children:"Empty garbage?"}),e.jsxs("p",{className:"mt-1 text-sm leading-5 text-[var(--theme-fg-muted)]",children:["Permanently delete all files in the"," ",e.jsx("code",{className:"rounded bg-[var(--theme-muted)] px-1 text-xs text-[var(--theme-fg-soft)]",children:"garbage/"})," ","folder."]}),t.length===0?e.jsx("p",{className:"mt-3 text-sm text-[var(--theme-fg-muted)]",children:"Garbage is empty."}):e.jsx("ul",{className:"mt-3 max-h-40 overflow-y-auto rounded-md border border-[var(--theme-border)] bg-[var(--theme-surface)] p-2 text-xs text-[var(--theme-fg-soft)]",children:t.map(a=>e.jsx("li",{className:"truncate py-0.5",title:a,children:a},a))}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:r,className:"thread-secondary-action rounded-md px-3 py-1.5 text-sm",children:"Cancel"}),t.length>0?e.jsx("button",{type:"button",onClick:n,className:"ui-action-danger rounded-md px-3 py-1.5 text-sm font-medium",children:"Yes, empty garbage"}):null]})]})})}var Qo=24e3,Of="remote-codex:graphchat:workspace:expanded:",Hf="thread-graph-explorer h-full min-h-0 overflow-hidden rounded-[12px]",Vf="thread-graph-explorer-header flex h-[60px] shrink-0 items-center justify-between border-b px-4",Uf="text-[18px] font-semibold text-slate-900 dark:text-slate-100",pa="thread-graph-explorer-icon-button flex h-8 w-8 items-center justify-center rounded-lg border shadow-none transition disabled:cursor-not-allowed disabled:opacity-50",Wf="thread-graph-explorer-collapse-button flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition hover:bg-slate-100 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-[#222733] dark:hover:text-slate-100",qf="thread-graph-workspace-label px-3 pb-1 pt-2 text-[11px] font-semibold tracking-normal text-slate-500 dark:text-slate-400",Kf="thread-graph-workspace-loading px-4 text-sm text-slate-400 dark:text-slate-500",Xf="thread-graph-workspace-empty mx-4 mt-3 rounded-lg border border-dashed border-slate-200 bg-slate-50 px-3 py-4 text-sm text-slate-500 dark:border-[#303642] dark:bg-[#1b1f29] dark:text-slate-400";function Ei(t){return`${Of}${t.workspaceId??"workspace"}:${t.threadId}`}function Zf(t){if(typeof window>"u")return[];try{const r=window.localStorage.getItem(Ei(t));if(!r)return[];const n=JSON.parse(r);return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}function Yf(t,r){if(!(typeof window>"u"))try{window.localStorage.setItem(Ei(t),JSON.stringify([...r]))}catch{}}function el(t,r){if(t.kind==="directory")return r?e.jsx(gl,{className:"h-4 w-4 text-slate-500 dark:text-slate-400"}):e.jsx(Ud,{className:"h-4 w-4 text-slate-500 dark:text-slate-400"});const n=Vr(t.name);return n==="zip"?e.jsx(Wd,{className:"h-4 w-4 text-amber-600"}):t.kind==="file"&&["png","jpg","jpeg","gif","webp","svg"].includes(n)?e.jsx(xl,{className:"h-4 w-4 text-sky-500"}):t.kind==="artifact"||["xyz","extxyz","cif","pdf","json","ts","tsx","js","jsx","md","yaml","yml","py"].includes(n)?e.jsx(vl,{className:"h-4 w-4 text-emerald-600"}):e.jsx(qd,{className:"h-4 w-4 text-slate-400 dark:text-slate-500"})}function zi({depth:t,expandedPaths:r,node:n,onDownload:a,onSelect:o,onToggle:s,selectedNodeId:l}){const d=n.kind==="directory",c=d&&(n.path===""||r.has(n.path)),h=l===n.id,p=`${t*.75+.5}rem`;return d?e.jsxs("div",{children:[e.jsxs("div",{className:"thread-graph-tree-row group flex items-center text-sm text-slate-600 transition hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-[#222733] dark:hover:text-slate-100",children:[e.jsxs("button",{type:"button",onClick:()=>s(n.path),className:"flex min-h-9 min-w-0 flex-1 items-center gap-2 px-2 py-2 text-left sm:min-h-0 sm:py-1.5",style:{paddingLeft:p},children:[c?e.jsx(ml,{className:"h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500"}):e.jsx(Vd,{className:"h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500"}),el(n,c),e.jsx("span",{className:"truncate",children:n.name})]}),a?e.jsx("button",{type:"button",onClick:()=>a(n),className:"thread-graph-tree-action mr-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-slate-400 transition hover:bg-white hover:text-slate-900 sm:h-7 sm:w-7 sm:opacity-0 sm:group-hover:opacity-100 sm:focus:opacity-100 dark:text-slate-500 dark:hover:bg-[#1d222c] dark:hover:text-slate-100",title:n.path?`Download ${n.name}`:"Download workspace","aria-label":n.path?`Download ${n.name}`:"Download workspace",children:e.jsx(ln,{className:"h-3.5 w-3.5"})}):null]}),c?e.jsx("div",{children:n.children.map(f=>e.jsx(zi,{depth:t+1,expandedPaths:r,node:f,...a?{onDownload:a}:{},onSelect:o,onToggle:s,selectedNodeId:l},f.id))}):null]}):e.jsxs("div",{className:`thread-graph-tree-row group flex items-center text-sm transition ${h?"is-selected":"text-slate-600 hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-[#222733] dark:hover:text-slate-100"}`,children:[e.jsxs("button",{type:"button",onClick:()=>o(n.id),className:"flex min-h-9 min-w-0 flex-1 items-center gap-2 px-2 py-2 text-left sm:min-h-0 sm:py-1.5",style:{paddingLeft:`${t*.75+2.2}rem`},children:[el(n,!1),e.jsx("span",{className:"truncate",children:n.name})]}),a&&n.kind==="file"?e.jsx("button",{type:"button",onClick:()=>a(n),className:`thread-graph-tree-action mr-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-md transition sm:h-7 sm:w-7 sm:opacity-0 sm:group-hover:opacity-100 sm:focus:opacity-100 ${h?"is-selected":"text-slate-400 hover:bg-white hover:text-slate-900 dark:text-slate-500 dark:hover:bg-[#1d222c] dark:hover:text-slate-100"}`,title:`Download ${n.name}`,"aria-label":`Download ${n.name}`,children:e.jsx(ln,{className:"h-3.5 w-3.5"})}):null]})}function Jf({liveNodes:t,onSelect:r,selectedNodeId:n}){return t.length===0?null:e.jsxs("div",{className:"border-b border-slate-200 py-2 dark:border-[#2a2f3a]",children:[e.jsx("div",{className:"thread-graph-workspace-label px-3 pb-1 text-[11px] font-semibold tracking-normal text-slate-500 dark:text-slate-400",children:"Live"}),e.jsx("div",{className:"space-y-0.5",children:t.map(a=>{var s;const o=n===a.id;return e.jsxs("button",{type:"button","data-testid":"live-molecule-item","data-molecule-id":((s=a.artifact)==null?void 0:s.id)??a.id,onClick:()=>r(a.id),className:`thread-graph-tree-row flex min-h-9 w-full items-center gap-2 px-3 py-2 text-left text-sm transition sm:min-h-0 sm:py-1.5 ${o?"is-selected":"text-slate-600 hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-[#222733] dark:hover:text-slate-100"}`,children:[e.jsx(vl,{className:`h-4 w-4 shrink-0 ${o?"text-current":"text-emerald-600 dark:text-emerald-300"}`}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.name})]},a.id)})})]})}function Qf({canEmptyGarbage:t,canUpload:r,onCollapse:n,expandedPaths:a,loading:o,onDownload:s,onEmptyGarbage:l,onRefresh:d,onSelect:c,onToggle:h,onUpload:p,selectedNodeId:f,tree:m,liveNodes:x}){const v=i.useMemo(()=>({...m,children:m.children.filter(b=>b.path!=="live")}),[m]);return e.jsxs("aside",{className:`${Hf} flex flex-col`,children:[e.jsxs("div",{className:Vf,children:[e.jsx("div",{className:"min-w-0",children:e.jsx("h2",{className:Uf,children:"Explorer"})}),e.jsxs("div",{className:"flex items-center gap-1",children:[n?e.jsxs("button",{type:"button","data-testid":"collapse-explorer",onClick:n,className:Wf,title:"Collapse Explorer","aria-label":"Collapse Explorer",children:[e.jsx(Ba,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Collapse Explorer"})]}):null,e.jsx("button",{type:"button",onClick:p,disabled:!r,className:pa,title:r?"Upload file":"Upload is unavailable for this workspace","aria-label":"Upload file",children:e.jsx(fl,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:d,className:pa,title:"Refresh workspace","aria-label":"Refresh workspace",children:e.jsx(cn,{className:`h-4 w-4 ${o?"animate-spin":""}`})}),l?e.jsx("button",{type:"button",onClick:l,disabled:!t,className:pa,title:t?"Empty garbage":"Garbage controls are unavailable","aria-label":"Empty garbage",children:e.jsx(wr,{className:"h-4 w-4"})}):null]})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto py-2",children:[e.jsx(Jf,{liveNodes:x??[],onSelect:c,selectedNodeId:f}),e.jsx("div",{className:qf,children:"Workspace"}),o?e.jsx("p",{className:Kf,children:"Loading workspace..."}):null,e.jsx(zi,{depth:0,expandedPaths:a,node:v,...s?{onDownload:s}:{},onSelect:c,onToggle:h,selectedNodeId:f}),v.children.length===0?e.jsx("p",{className:Xf,children:"This workspace is empty. Agent tool runs execute inside the thread workspace, so files should appear here as the session works."}):null]})]})}function eg({activeView:t,detail:r,artifacts:n,plugins:a,status:o,workspaceAdapter:s}){const[l,d]=i.useState(null),c=i.useMemo(()=>s&&l?null:Ko(r,n),[t,l,n,r,o,s]),h=l??c??Ko(r,n),p=i.useMemo(()=>kf(h),[h]),f=i.useMemo(()=>{var U;return((U=h.children.find(re=>re.path==="live"))==null?void 0:U.children)??[]},[h]),m=Ti(h),[x,v]=i.useState(()=>(m==null?void 0:m.id)??null),[b,k]=i.useState(()=>new Set(["","artifacts","thread-events","live",...Xo((m==null?void 0:m.path)??"")])),[g,w]=i.useState(null),[T,y]=i.useState(null),[C,z]=i.useState(!1),[M,I]=i.useState(!1),[R,K]=i.useState(!1),[Z,D]=i.useState(!1),[ce,W]=i.useState([]),[G,Y]=i.useState(null),[we,me]=i.useState(null),[Re,X]=i.useState(null),[$,F]=i.useState(0),[P,O]=i.useState(!1),B=i.useRef(null),N=i.useRef(null),E=(x?p.get(x):null)??m??null,V={threadId:r.thread.id,workspaceId:r.workspace.id??r.thread.workspaceId??null};i.useEffect(()=>{k(new Set(["","artifacts","thread-events","live",...Zf(V),...Xo((m==null?void 0:m.path)??"")]))},[V.threadId,V.workspaceId]),i.useEffect(()=>()=>{N.current!==null&&window.clearTimeout(N.current)},[]),i.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const U=window.matchMedia("(max-width: 639px)"),re=()=>O(U.matches);return re(),typeof U.addEventListener=="function"?(U.addEventListener("change",re),()=>U.removeEventListener("change",re)):(U.addListener(re),()=>U.removeListener(re))},[]);async function _(U){if(s){z(!0),y(null);try{const re=Ni(await s.listTree(V));d(re);const ae=Ci(re);v(Q=>{const xe=Q?p.get(Q):null;return U&&Pa(re,U)?`workspace:${U}`:xe!=null&&xe.path&&Pa(re,xe.path)?`workspace:${xe.path}`:(ae==null?void 0:ae.id)??Q}),F(Q=>Q+1)}catch(re){y(re instanceof Error?re.message:"Failed to load workspace"),d(null)}finally{z(!1)}}}i.useEffect(()=>{d(null),Y(null),me(null),X(null),y(null),_()},[s,r.thread.id,r.workspace.id,r.thread.workspaceId]),i.useEffect(()=>{if(!(s!=null&&s.subscribeWorkspaceChanged))return;const U=s.subscribeWorkspaceChanged(V,()=>{N.current!==null&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>{N.current=null,_((E==null?void 0:E.path)??null)},240)});return()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null),U==null||U()}},[s,V.threadId,V.workspaceId,E==null?void 0:E.path]),i.useEffect(()=>{const U=s&&(E==null?void 0:E.kind)==="file"?E.path:null;if(!U){Y(null),me(null),X(null);return}const re=U;let ae=!1;async function Q(){var xe;if(s){I(!0),y(null),Y(null),me(null),X(null);try{const Ie=Vr(re),We=(xe=s.getRawFileUrl)==null?void 0:xe.call(s,{...V,path:re});if(We&&cf.has(Ie)){ae||me(We);return}if(We&&hf.has(Ie)){ae||X(We);return}const Ge=await s.readFile({...V,path:re,limit:Qo});ae||Y(Ge)}catch(Ie){ae||y(Ie instanceof Error?Ie.message:"Failed to read file")}finally{ae||I(!1)}}}return Q(),()=>{ae=!0}},[s,E==null?void 0:E.id,$]);async function ne(){if(!(!s||!(G!=null&&G.truncated))){K(!0);try{const U=await s.readFile({...V,path:G.path,offset:G.nextOffset,limit:Qo});Y(re=>re&&{...re,content:re.content+U.content,truncated:U.truncated,nextOffset:U.nextOffset,size:U.size})}finally{K(!1)}}}async function te(U){var ae;const re=(ae=U.target.files)==null?void 0:ae[0];if(U.target.value="",!(!(s!=null&&s.uploadFile)||!re)){z(!0),y(null);try{const Q=await s.uploadFile({...V,path:re.name,file:re}),xe=Q.kind==="archive"?Q.paths[0]??null:Q.file.path;await _(xe)}catch(Q){y(Q instanceof Error?Q.message:"Failed to upload file")}finally{z(!1)}}}function je(U){var re;(re=s==null?void 0:s.downloadNode)==null||re.call(s,{...V,path:U.path,kind:U.kind==="directory"?"directory":"file"})}async function ee(){if(s!=null&&s.emptyGarbage){if(y(null),!s.listGarbage){W([]),D(!0);return}try{const U=await s.listGarbage(V);W(U.map(re=>`garbage/${re}`))}catch(U){W([]),y(U instanceof Error?U.message:"Failed to list garbage files")}finally{D(!0)}}}async function pe(){if(s!=null&&s.emptyGarbage){D(!1),y(null);try{await s.emptyGarbage(V),await _((E==null?void 0:E.path)??null)}catch(U){y(U instanceof Error?U.message:"Failed to empty garbage")}}}const he={...s!=null&&s.downloadNode?{onDownload:je}:{},...s!=null&&s.emptyGarbage?{onEmptyGarbage:ee}:{},...s?{onRefresh:()=>void _((E==null?void 0:E.path)??null)}:{},...s!=null&&s.uploadFile?{onUpload:()=>{var U;return(U=B.current)==null?void 0:U.click()}}:{}};function Ce(U){U&&k(re=>{const ae=new Set(re);return ae.has(U)?ae.delete(U):ae.add(U),Yf(V,ae),ae})}const Fe=e.jsx(Qf,{canEmptyGarbage:!!(s!=null&&s.emptyGarbage),canUpload:!!(s!=null&&s.uploadFile),...P?{}:{onCollapse:()=>w("explorer")},expandedPaths:b,loading:C,...he,onSelect:U=>{v(U)},onToggle:Ce,selectedNodeId:(E==null?void 0:E.id)??null,tree:h,liveNodes:f}),J=e.jsx(Ff,{error:T,imageUrl:we,loadingMore:R,onLoadMore:ne,...P?{}:{onCollapse:()=>w("viewer")},pdfUrl:Re,previewFile:G,previewLoading:M,plugins:a,selectedTarget:Bf(E)});return g==="explorer"?e.jsxs("div",{"data-testid":"workspace-panel",className:"relative h-full min-h-0 w-full overflow-hidden p-2",children:[e.jsx("button",{type:"button","data-testid":"expand-explorer",onClick:()=>w(null),className:"thread-graph-panel-expand-fab left-3",title:"Expand Explorer","aria-label":"Expand Explorer",children:e.jsx(dn,{className:"h-4 w-4"})}),J]}):g==="viewer"?e.jsxs("div",{"data-testid":"workspace-panel",className:"relative h-full min-h-0 w-full overflow-hidden p-2",children:[Fe,e.jsx("button",{type:"button","data-testid":"expand-viewer",onClick:()=>w(null),className:"thread-graph-panel-expand-fab right-3",title:"Expand Viewer","aria-label":"Expand Viewer",children:e.jsx(Ba,{className:"h-4 w-4"})})]}):e.jsxs("div",{"data-testid":"workspace-panel",className:"flex h-full min-h-0 w-full overflow-hidden bg-transparent p-2",children:[Z?e.jsx(Gf,{files:ce,onCancel:()=>D(!1),onConfirm:()=>void pe()}):null,P?e.jsxs("div",{className:"thread-graph-workspace-mobile-stack flex h-full min-h-0 w-full flex-col",children:[e.jsx("div",{className:"thread-graph-workspace-mobile-explorer h-[34%] min-h-[11rem] shrink-0 overflow-hidden border-b",children:Fe}),e.jsx("div",{className:"thread-graph-workspace-mobile-viewer min-h-0 flex-1 overflow-hidden",children:J})]}):e.jsxs(ci,{direction:"horizontal",className:"thread-graph-workspace-resizable",children:[e.jsx(pn,{defaultSize:33,minSize:20,children:e.jsx("div",{className:"thread-graph-workspace-explorer-pane h-full min-h-0 overflow-hidden",children:Fe})}),e.jsx(hi,{className:"thread-graph-workspace-resize-handle w-2 bg-transparent after:w-px after:bg-slate-200/80 after:transition-colors hover:after:bg-slate-300 dark:after:bg-[#303642] dark:hover:after:bg-[#475063]"}),e.jsx(pn,{defaultSize:67,minSize:30,children:e.jsx("div",{className:"thread-graph-workspace-viewer-pane h-full min-h-0 overflow-hidden",children:J})})]}),e.jsx("input",{ref:B,type:"file",className:"hidden",onChange:U=>void te(U)})]})}function fa({children:t}){return e.jsx("span",{className:"thread-guide-tag inline-flex items-center rounded px-1.5 py-0.5 font-mono text-[10px]",children:t})}function fr({items:t}){return e.jsx("ul",{className:"space-y-1 text-[12px] text-[var(--theme-fg-muted)]",children:t.map((r,n)=>e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"mt-[6px] h-1 w-1 shrink-0 rounded-full bg-[var(--theme-border-contrast)]"}),e.jsx("span",{children:r})]},n))})}function tg({children:t}){return e.jsx("span",{className:"thread-guide-icon flex h-5 w-5 shrink-0 items-center justify-center rounded-md",children:t})}function zr({value:t,title:r,icon:n,children:a}){return e.jsxs(Gr,{value:t,className:"thread-guide-section border-b border-[var(--theme-border)] last:border-b-0",children:[e.jsx(Or,{className:"py-3 hover:no-underline [&[data-state=open]]:pb-2",children:e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-[var(--theme-fg)]",children:[e.jsx(tg,{children:n}),r]})}),e.jsx(Hr,{className:"space-y-3 pb-3",children:a})]})}function rg(){return e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 border-b border-[var(--theme-border)] px-4 py-3",children:[e.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:"What can I do?"}),e.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--theme-fg-muted)]",children:"Upload files, ask in plain language, get results."})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 pb-6",children:e.jsxs(Fr,{type:"multiple",defaultValue:["start","workspace","remote-codex"],className:"space-y-0",children:[e.jsxs(zr,{value:"start",title:"Getting Started",icon:e.jsx(Bd,{className:"h-3 w-3"}),children:[e.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"graphchat connects a language model to your files and a set of tools. Each Remote Codex thread has its own isolated workspace."}),e.jsx(fr,{items:["Upload data files via the Workspace panel","Type a question or task in plain language","The agent calls tools, writes results to the workspace, and explains what it found","Agent-produced files appear in the workspace automatically when the host reports changes"]})]}),e.jsxs(zr,{value:"workspace",title:"Workspace Explorer",icon:e.jsx(gl,{className:"h-3 w-3"}),children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(fl,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Upload"}),e.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Upload files through the Workspace panel when the host exposes workspace upload support. Composer attachments stay available for prompt context."})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(va,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"New files and folders"}),e.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Remote Codex normally creates files through tools and shell commands. They appear in Explorer after workspace refreshes."})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Fd,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Move and organize"}),e.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Use the agent or terminal to reorganize files. Explorer keeps the GraphChat file tree and preview flow."})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(wr,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-rose-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Garbage folder"}),e.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"If the host exposes garbage controls, Explorer can permanently empty unwanted workspace files."})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(cn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Refresh"}),e.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Resync the file tree manually after shell commands, external changes, or agent tool runs."})]})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--theme-border)] p-2.5",children:[e.jsx("p",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:"Preview surfaces"}),e.jsx(fr,{items:[e.jsxs(e.Fragment,{children:[e.jsx(fa,{children:".xyz .extxyz .cif"})," use the 3D molecule plugin."]}),e.jsxs(e.Fragment,{children:[e.jsx(fa,{children:".png .jpg .gif .svg .webp"})," use inline image preview."]}),e.jsxs(e.Fragment,{children:[e.jsx(fa,{children:".py .json .ts .md .csv"})," use text/code preview."]}),"Large files load in chunks when the workspace adapter supports it."]})]})]}),e.jsxs(zr,{value:"viewer",title:"Viewer",icon:e.jsx(xl,{className:"h-3 w-3"}),children:[e.jsx("p",{className:"text-[11px] leading-5 text-[var(--theme-fg-muted)]",children:"Viewer is the GraphChat-style artifact surface. It opens Remote Codex artifacts through the same frontend plugin renderers used in rich message bubbles, and previews workspace files from Explorer."}),e.jsx(fr,{items:["Expand one artifact at a time for inspection","Fallback JSON preview is available for unknown artifact types","3D molecule artifacts remain interactive when the XYZ plugin is enabled"]})]}),e.jsxs(zr,{value:"usage",title:"Tool Usage & Chat",icon:e.jsx(ba,{className:"h-3 w-3"}),children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ba,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Usage tab"}),e.jsx(fr,{items:["Bar chart of tool and command counts for this thread","Expandable call log: inspect every input and output","Recent live events appear with persisted history"]})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(bl,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--theme-fg-muted)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-medium text-[var(--theme-fg)]",children:"Chat controls"}),e.jsx(fr,{items:["New Chat creates a fresh Remote Codex thread with its own workspace","Interrupt, compact, goal controls, and model controls remain in the composer","Shell view stays available when a shell adapter is attached"]})]})]})]}),e.jsx(zr,{value:"remote-codex",title:"Remote Codex Extras",icon:e.jsx(Gd,{className:"h-3 w-3"}),children:e.jsx(fr,{items:["Slash toolbox: skills, MCP, hooks, goals, forks, model controls, provider settings","Rich message bubbles: reasoning, commands, searches, file reads, file changes, plans, action requests, artifacts","Plugin surfaces: terminal, XYZ molecule viewer, inline code renderers, and imported plugin panels","Thread metadata stays in the left rail and Workspace tab instead of replacing chat"]})})]})})]})}function ng(t){if(t==null)return"—";if(typeof t=="string")return t.length>2e3?`${t.slice(0,2e3)}
|
|
3516
|
+
...(truncated)`:t;try{return JSON.stringify(t,null,2)}catch{return String(t)}}function tl({label:t,value:r}){return e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:t}),e.jsx("pre",{className:"max-h-48 overflow-auto whitespace-pre-wrap break-words rounded bg-[var(--theme-surface-strong)] p-2 text-[11px] leading-relaxed text-[var(--theme-fg-soft)]",children:ng(r)})]})}function ag({event:t}){return e.jsxs(Gr,{value:t.id,className:"thread-tool-call mb-2 overflow-hidden rounded-lg border border-[var(--theme-border)] last:mb-0",children:[e.jsxs(Or,{className:"px-3 py-2 text-xs font-medium text-[var(--theme-fg)] hover:bg-[var(--theme-hover)] hover:no-underline [&[data-state=open]]:bg-[var(--theme-hover)]",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--theme-accent-strong)]"}),e.jsx("span",{className:"truncate font-mono text-xs font-medium text-[var(--theme-fg)]",children:t.label}),t.status?e.jsx("span",{className:"shrink-0 rounded-full border border-[var(--theme-border)] px-1.5 py-0.5 text-[9px] uppercase tracking-[0.12em] text-[var(--theme-fg-muted)]",children:t.status}):null]}),e.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:t.turnId?e.jsx("span",{className:"max-w-20 truncate text-[10px] text-[var(--theme-fg-muted)]",children:t.turnId}):null})]}),e.jsx(Hr,{className:"px-3 pb-3",children:e.jsxs("div",{className:"space-y-2 px-3 pb-3 pt-1",children:[e.jsx(tl,{label:"Input",value:t.preview}),e.jsx(tl,{label:"Output",value:t.detail})]})})]})}function sg({formatToolKind:t,toolCounts:r,toolEvents:n,maxToolCount:a}){const[o,s]=i.useState(()=>{var d;return((d=n.at(-1))==null?void 0:d.id)??null}),l=i.useRef(null);return i.useEffect(()=>{s(d=>{var c;return d??((c=n.at(-1))==null?void 0:c.id)??null})},[n]),i.useEffect(()=>{var d;(d=l.current)==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})},[n.length]),r.length?e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 border-b border-[var(--theme-border)] p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:"Calls this session"}),e.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 rounded px-2 py-1 text-[11px] text-[var(--theme-fg-muted)] opacity-60",disabled:!0,title:"Remote Codex streams tool history from thread events",children:[e.jsx(cn,{className:"h-3 w-3"}),"Reload"]})]}),e.jsx("div",{className:"space-y-2",children:r.map(([d,c])=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-40 shrink-0 truncate text-right font-mono text-[11px] text-[var(--theme-fg-muted)]",title:t(d),children:t(d)}),e.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[e.jsx("div",{className:"relative h-4 flex-1 overflow-hidden rounded-sm bg-[var(--theme-muted)]",children:e.jsx("div",{className:"h-full rounded-sm bg-[var(--theme-accent-strong)] transition-all duration-300",style:{width:`${c/a*100}%`}})}),e.jsx("span",{className:"w-5 shrink-0 text-right text-[11px] font-medium text-[var(--theme-fg-soft)]",children:c})]})]},d))})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[e.jsx("h2",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-[var(--theme-fg-muted)]",children:"Call log"}),e.jsx(Fr,{type:"single",collapsible:!0,value:o??"",onValueChange:d=>s(d||null),className:"space-y-0",children:n.slice(-50).map(d=>e.jsx(ag,{event:d},d.id))}),e.jsx("div",{ref:l})]})]}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-sm text-[var(--theme-fg-muted)]",children:[e.jsx("span",{children:"No tool calls yet. Run the agent to see usage."}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded px-2 py-1 text-xs",children:[e.jsx(cn,{className:"h-3 w-3"}),"Reload from workspace"]})]})}function rl(t,r){const{width:n,height:a}=t.measured,o=t.internals.positionAbsolute,s=r.internals.positionAbsolute,l=n/2,d=a/2,c=o.x+l,h=o.y+d,p=s.x+r.measured.width/2,f=s.y+r.measured.height/2,m=(p-c)/(2*l)-(f-h)/(2*d),x=(p-c)/(2*l)+(f-h)/(2*d),v=1/(Math.abs(m)+Math.abs(x)),b=v*m,k=v*x,g=l*(b+k)+c,w=d*(-b+k)+h;return{x:g,y:w}}function nl(t,r){const n={...t.internals.positionAbsolute,...t},a=Math.round(n.x),o=Math.round(n.y),s=Math.round(r.x),l=Math.round(r.y);return s<=a+1?sr.Left:s>=a+n.measured.width-1?sr.Right:l<=o+1?sr.Top:l>=n.y+n.measured.height-1?sr.Bottom:sr.Top}function Li(t,r){const n=rl(t,r),a=rl(r,t),o=nl(t,n),s=nl(r,a);return{sx:n.x,sy:n.y,tx:a.x,ty:a.y,sourcePos:o,targetPos:s}}function og(t,r=900,n=620){if(!t||!Array.isArray(t))return{nodes:[],edges:[]};const a=(c,h,p,f)=>{const m=new Map,x=c.length;c.forEach((v,b)=>{const k=v.id.split("").reduce((g,w)=>{const T=(g<<5)-g+w.charCodeAt(0);return T&T},0);m.set(v.id,{x:Math.abs(k)%p+b*100%p,y:Math.abs(k>>16)%f+b*150%f,vx:0,vy:0})});for(let v=0;v<200;v+=1){for(let b=0;b<x;b+=1)for(let k=b+1;k<x;k+=1){const g=c[b],w=c[k];if(!g||!w)continue;const T=m.get(g.id),y=m.get(w.id);if(!T||!y)continue;const C=T.x-y.x,z=T.y-y.y,M=Math.sqrt(C*C+z*z)||1,R=(200-M)*.5,K=C/M*R,Z=z/M*R;T.vx+=K,T.vy+=Z,y.vx-=K,y.vy-=Z}h.forEach(b=>{const k=m.get(b.source),g=m.get(b.target);if(!k||!g)return;const w=g.x-k.x,T=g.y-k.y,y=Math.sqrt(w*w+T*T)||1,z=(y-120)*.3,M=w/y*z,I=T/y*z;k.vx+=M,k.vy+=I,g.vx-=M,g.vy-=I}),m.forEach(b=>{b.x+=b.vx*.1,b.y+=b.vy*.1,b.vx*=.9,b.vy*=.9,b.x=Math.max(80,Math.min(p-80,b.x)),b.y=Math.max(80,Math.min(f-80,b.y))})}return m},o=new Set(t.map(c=>c.id)),s=[];t.forEach(c=>{if(!c.out_node_id)return;(Array.isArray(c.out_node_id)?c.out_node_id:[c.out_node_id]).forEach(p=>{o.has(p)&&s.push({id:`${c.id}-${p}`,source:c.id,target:p,type:"floating",sourceHandle:null,targetHandle:null,markerEnd:{type:wl.Arrow}})})});const l=a(t,s,r,n);return{nodes:t.map(c=>({id:c.id,type:"styledNode",position:l.get(c.id)??{x:100,y:100},data:{label:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-sm font-semibold",children:c.name}),c.description?e.jsx("div",{className:"mt-1 max-w-32 overflow-hidden text-ellipsis text-xs text-slate-500 dark:text-slate-400",children:c.description}):null]})}})),edges:s}}function lg({toX:t,toY:r,fromPosition:n,toPosition:a,fromNode:o}){if(!o)return null;const s={id:"connection-target",measured:{width:1,height:1},internals:{positionAbsolute:{x:t,y:r}}},{sx:l,sy:d,tx:c,ty:h,sourcePos:p,targetPos:f}=Li(o,s),[m]=yl({sourceX:l,sourceY:d,sourcePosition:p||n,targetPosition:f||a,targetX:c||t,targetY:h||r});return e.jsxs("g",{children:[e.jsx("path",{fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"animated",d:m}),e.jsx("circle",{cx:c||t,cy:h||r,fill:"var(--theme-panel)",r:3,stroke:"currentColor",strokeWidth:1.5})]})}function ig({id:t,source:r,target:n,markerEnd:a,style:o}){const s=Us(r),l=Us(n);if(!s||!l)return null;const{sx:d,sy:c,tx:h,ty:p,sourcePos:f,targetPos:m}=Li(s,l),[x]=yl({sourceX:d,sourceY:c,sourcePosition:f,targetPosition:m,targetX:h,targetY:p});return e.jsx("path",{id:t,className:"react-flow__edge-path",d:x,markerEnd:a,style:o})}function dg({nodes:t}){const[r,n,a]=Ic([]),[o,s,l]=Pc([]),d=i.useMemo(()=>og(t),[t]),c=i.useMemo(()=>({floating:ig}),[]),h=i.useMemo(()=>({styledNode:({data:f,isConnectable:m})=>e.jsxs("div",{className:"thread-graph-flow-node",children:[f.label,e.jsx(Vs,{type:"target",position:sr.Top,isConnectable:m,style:{opacity:0,pointerEvents:"none"}}),e.jsx(Vs,{type:"source",position:sr.Bottom,isConnectable:m,style:{opacity:0,pointerEvents:"none"}})]})}),[]);i.useEffect(()=>{n(d.nodes),s(d.edges)},[d.edges,d.nodes,s,n]);const p=i.useCallback(f=>s(m=>Mc({...f,type:"floating",sourceHandle:null,targetHandle:null,markerEnd:{type:wl.Arrow}},m)),[s]);return e.jsx("div",{className:"thread-graph-flow h-full min-h-0",children:e.jsx($c,{children:e.jsxs(_c,{nodes:r,edges:o,onNodesChange:a,onEdgesChange:l,onConnect:p,fitView:!0,nodeTypes:h,edgeTypes:c,connectionLineComponent:lg,children:[e.jsx(Ac,{}),e.jsx(Dc,{gap:16})]})})})}var cg={workspace:!0,toolUsage:!0,guide:!0,threadGraph:!0,extensions:!0};function hg(t){return{...cg,...t}}function al(t,r){const n=a=>{switch(a){case"workspace":return t.workspace;case"tools":return t.toolUsage;case"guide":return t.guide;case"graph":return t.threadGraph;case"extensions":return t.extensions}};return r&&n(r)?r:["workspace","tools","guide","graph","extensions"].find(n)??null}function ug(t,r){switch(r){case"workspace":return t.workspace;case"tools":return t.toolUsage;case"guide":return t.guide;case"graph":return t.threadGraph;case"extensions":return t.extensions}}function mg(t){var o;const r=[],n=new Set(["toolCall","commandExecution","webSearch","fileRead","fileChange","agentToolCall","skillToolCall","hook"]);let a=0;for(const s of t.turns)for(const l of s.items)n.has(l.kind)&&(r.push({id:l.id,kind:l.kind,label:xn(l.kind),preview:l.previewText??l.text??l.kind,detail:l.detailText??l.text??l.previewText??l.kind,turnId:l.sourceTurnId??s.id,status:l.status??null,sequence:a}),a+=1);for(const s of((o=t.liveItems)==null?void 0:o.items)??[])n.has(s.kind)&&(r.push({id:s.id,kind:s.kind,label:xn(s.kind),preview:s.previewText??s.text??s.kind,detail:s.detailText??s.text??s.previewText??s.kind,turnId:s.sourceTurnId??null,status:s.status??null,sequence:a}),a+=1);return r}function xn(t){switch(t){case"toolCall":return"Tool call";case"agentToolCall":return"Agent tool";case"skillToolCall":return"Skill tool";case"commandExecution":return"Command";case"webSearch":return"Search";case"fileRead":return"File read";case"fileChange":return"File change";case"hook":return"Hook";default:return t.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase())}}function pg(t){switch(t.kind){case"userMessage":return"User";case"agentMessage":return"Agent";default:return xn(t.kind)}}function fg(t){return(t.previewText??t.text??t.detailText??t.kind).replace(/\s+/g," ").slice(0,96)}function gg(t,r){const n=[{id:`thread:${t.thread.id}`,name:t.thread.title||"Thread",description:t.thread.model??t.thread.status},{id:`workspace:${t.workspace.id}`,name:t.workspace.label??"Workspace",description:t.workspace.absPath,out_node_id:`thread:${t.thread.id}`}];let a=null;for(const s of t.turns){const l=`turn:${s.id}`;n.push({id:l,name:`Turn ${n.filter(c=>c.id.startsWith("turn:")).length+1}`,description:s.status,out_node_id:a?[`thread:${t.thread.id}`,a]:`thread:${t.thread.id}`}),a=l;let d=null;for(const c of s.items){const h=`item:${c.id}`,p=[l];d&&p.push(d),n.push({id:h,name:pg(c),description:fg(c),out_node_id:p}),d=h,c.kind==="artifact"&&c.artifact&&n.push({id:`artifact:${c.artifact.id}`,name:c.artifact.title||c.artifact.type,description:c.artifact.summaryText??c.artifact.type,out_node_id:h})}}const o=new Set(n.map(s=>s.id));for(const s of r){const l=`tool:${s.id}`;o.has(l)||o.has(`item:${s.id}`)||n.push({id:l,name:s.label,description:s.preview,out_node_id:s.turnId?`turn:${s.turnId}`:`thread:${t.thread.id}`})}return n.slice(0,120)}function xg({detail:t,status:r,plugins:n,workspaceAdapter:a,metaContent:o,settingsContent:s,activeView:l="chat",features:d}){const c=i.useMemo(()=>hg(d),[d]),h=al(c,d==null?void 0:d.defaultTab),[p,f]=i.useState(h),m=i.useMemo(()=>uf(t),[t]),x=i.useMemo(()=>mg(t),[t]),v=i.useMemo(()=>{const y=new Map;for(const C of x)y.set(C.kind,(y.get(C.kind)??0)+1);return[...y.entries()].sort((C,z)=>z[1]-C[1])},[x]),b=n.getThreadPanels(),k=Math.max(...v.map(([,y])=>y),1),g=i.useMemo(()=>gg(t,x),[t,x]),w=i.useMemo(()=>{const y=[];return c.workspace&&y.push({id:"workspace",label:"Workspace",icon:null}),c.toolUsage&&y.push({id:"tools",label:"Tool Usage",icon:ba}),c.guide&&y.push({id:"guide",label:"Guide",icon:_d}),y},[c.guide,c.toolUsage,c.workspace]),T=i.useMemo(()=>{const y=[];return c.threadGraph&&y.push({id:"graph",label:"Thread graph",icon:Ad}),c.extensions&&y.push({id:"extensions",label:"Remote Codex extensions",icon:_a}),y},[c.extensions,c.threadGraph]);return i.useEffect(()=>{(!p||!ug(c,p))&&f(al(c,d==null?void 0:d.defaultTab))},[p,d==null?void 0:d.defaultTab,c]),p?e.jsxs("div",{className:"thread-graph-right-panel flex h-full min-h-0 flex-col overflow-hidden",children:[e.jsxs("div",{className:"thread-graph-right-tabs flex shrink-0 items-center gap-1 overflow-hidden border-b px-3 py-2",children:[w.map(y=>{const C=y.icon;return e.jsxs("button",{type:"button",onClick:()=>f(y.id),className:`thread-graph-right-tab inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition ${p===y.id?"is-active":""}`,children:[C?e.jsx(C,{className:"h-3.5 w-3.5"}):null,y.label]},y.id)}),T.length?e.jsx("div",{className:"thread-graph-right-tab-secondary ml-auto flex min-w-0 shrink items-center gap-1 border-l pl-2","aria-label":"Remote Codex workspace extensions",children:T.map(y=>{const C=y.icon;return e.jsx("button",{type:"button",onClick:()=>f(y.id),className:`thread-graph-right-tab inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-xs font-medium transition ${p===y.id?"is-active":""}`,title:y.label,"aria-label":y.label,children:e.jsx(C,{className:"h-3.5 w-3.5"})},y.id)})}):null]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[p==="workspace"?e.jsx(eg,{activeView:l,detail:t,artifacts:m,plugins:n,status:r,workspaceAdapter:a??null}):null,p==="tools"?e.jsx(sg,{formatToolKind:xn,toolCounts:v,toolEvents:x,maxToolCount:k}):null,p==="graph"?e.jsx("div",{className:"thread-graph-visualization-panel h-full min-h-0 p-3",children:e.jsx(dg,{nodes:g})}):null,p==="extensions"?e.jsx("div",{className:"h-full min-h-0 overflow-y-auto p-3",children:e.jsxs("div",{className:"grid gap-3",children:[e.jsx(xr,{label:"Plugin Panels",children:b.length?e.jsx("div",{className:"flex flex-wrap gap-2",children:b.map(y=>e.jsx("span",{className:"rounded-full border border-[var(--theme-border)] px-2 py-1 text-xs text-[var(--theme-fg-soft)]",children:y.label},y.id))}):e.jsx("p",{className:"text-[var(--theme-fg-muted)]",children:"No thread panels are enabled."})}),e.jsx(xr,{label:"Enabled Renderers",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:n.plugins.filter(y=>y.enabled).map(y=>e.jsx("span",{className:"rounded-full border border-[var(--theme-border)] px-2 py-1 text-xs text-[var(--theme-fg-soft)]",children:y.name},y.id))})}),e.jsx(xr,{label:"Remote Codex Tools",children:e.jsxs("div",{className:"grid gap-2 text-[var(--theme-fg-muted)]",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ul,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"Terminal stays available when the Terminal plugin and shell adapter are attached."})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Dd,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"Composer attachments, slash panels, hooks, MCP, goals, and fork controls remain part of the chat surface."})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(wr,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:"Destructive actions stay explicit: delete thread, interrupt, compact, and hook trust controls remain host governed."})]})]})}),o?e.jsx(xr,{label:"Thread Meta",children:o}):null,s?e.jsx(xr,{label:"Settings",children:s}):null]})}):null,p==="guide"?e.jsx(rg,{}):null]})]}):null}var bg=i.memo(xg);function Rg({open:t,title:r,description:n,confirmLabel:a="Delete",busy:o=!1,onCancel:s,onConfirm:l}){return i.useEffect(()=>{if(!t)return;function d(c){c.key==="Escape"&&!o&&s()}return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[o,s,t]),t?bn.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[95] flex items-center justify-center p-4 sm:p-6",children:[e.jsx("button",{type:"button","aria-label":"Close confirmation dialog",onClick:s,disabled:o,className:"absolute inset-0 bg-stone-950/78 backdrop-blur-sm disabled:cursor-not-allowed"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":r,className:"relative z-[1] w-full max-w-md rounded-[1.6rem] border border-stone-700 bg-stone-900 p-5 shadow-2xl shadow-stone-950/40 sm:p-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-stone-100",children:r}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-stone-400",children:n})]}),e.jsx("button",{type:"button","aria-label":"Close dialog",onClick:s,disabled:o,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-700 text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:e.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),e.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:s,disabled:o,className:"rounded-full border border-stone-700 px-4 py-2 text-sm font-medium text-stone-300 transition hover:bg-stone-800 disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void l(),disabled:o,className:"ui-action-danger rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed",children:o?"Deleting...":a})]})]})]}),document.body):null}function vg(t){if(!t)return"No time";const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function kg(t){switch(t){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function Ig({open:t,busy:r=!1,turnsState:n,onCancel:a,onLoadTurns:o,onExport:s}){var z,M,I;const l=i.useMemo(()=>{var R;return((R=n.data)==null?void 0:R.turns)??[]},[(z=n.data)==null?void 0:z.turns]),d=i.useMemo(()=>l.slice(0,10).map(R=>R.turnId),[l]),[c,h]=i.useState("latest"),[p,f]=i.useState(()=>new Set),[m,x]=i.useState(!0),[v,b]=i.useState("pdf"),[k,g]=i.useState(()=>typeof document<"u"&&!document.documentElement.classList.contains("dark")?"light":"dark");if(i.useEffect(()=>{t&&(h("latest"),b("pdf"),x(!0),o())},[o,t]),i.useEffect(()=>{t&&l.length>0&&f(new Set(d))},[d,t,l.length]),i.useEffect(()=>{if(!t)return;function R(K){K.key==="Escape"&&!r&&a()}return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[r,a,t]),i.useEffect(()=>{if(!t)return;const R=document.querySelector(".thread-ui-shell"),K=()=>R?R.getAttribute("data-theme-effective")==="dark"||R.classList.contains("dark")||R.classList.contains("thread-ui-theme-dark")?"dark":"light":document.documentElement.classList.contains("dark")?"dark":"light";if(g(K()),!R)return;const Z=new MutationObserver(()=>g(K()));return Z.observe(R,{attributes:!0,attributeFilter:["class","data-theme-effective"]}),()=>Z.disconnect()},[t]),!t)return null;const w=c==="latest"?Math.min(10,((M=n.data)==null?void 0:M.totalTurnCount)??10):p.size,T=!r&&(c==="latest"||p.size>0);function y(R){f(K=>{const Z=new Set(K);return Z.has(R)?Z.delete(R):Z.add(R),Z})}function C(){const R={format:v,mode:c,...c==="latest"?{limit:10}:{turnIds:[...p]},profile:"review",options:{includeTokenAndPrice:m}};s(R)}return bn.createPortal(e.jsxs("div",{className:`thread-export-dialog-root thread-ui-theme-${k} fixed inset-0 z-[96] flex items-center justify-center p-3 sm:p-6`,"data-theme-effective":k,children:[e.jsx("button",{type:"button","aria-label":"Close export dialog",onClick:a,disabled:r,className:"thread-export-dialog-backdrop absolute inset-0 backdrop-blur-sm disabled:cursor-not-allowed"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Export transcript",className:"thread-export-dialog-panel relative z-[1] flex max-h-[min(46rem,calc(100vh-2rem))] w-full max-w-2xl flex-col rounded-[1.6rem] border shadow-2xl",children:[e.jsxs("div",{className:"thread-export-dialog-header flex items-start justify-between gap-3 border-b px-5 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"thread-export-dialog-title text-sm font-semibold",children:"Export transcript"}),e.jsx("p",{className:"thread-export-dialog-subtitle mt-1 text-xs",children:"Default review copy summarizes command batches and file changes."})]}),e.jsx("button",{type:"button","aria-label":"Close dialog",onClick:a,disabled:r,className:"thread-export-dialog-icon-button inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border transition disabled:cursor-not-allowed disabled:opacity-60",children:e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"h-4 w-4 fill-current",children:e.jsx("path",{d:"M3.22 2.47 8 7.25l4.78-4.78 1.06 1.06L9.06 8.31l4.78 4.78-1.06 1.06L8 9.37l-4.78 4.78-1.06-1.06 4.78-4.78-4.78-4.78 1.06-1.06Z"})})})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-auto px-5 py-4",children:[e.jsx("div",{className:"thread-export-dialog-segment inline-flex rounded-full border p-1",children:[["latest","Latest 10"],["selected","Custom selection"]].map(([R,K])=>e.jsx("button",{type:"button",onClick:()=>h(R),className:`rounded-full px-3 py-1.5 text-sm transition ${c===R?"ui-status-warning":"thread-export-dialog-muted-action"}`,children:K},R))}),e.jsx("div",{className:"thread-export-dialog-segment mt-4 inline-flex rounded-full border p-1",children:[["pdf","PDF"],["html","HTML"]].map(([R,K])=>e.jsx("button",{type:"button",onClick:()=>b(R),className:`rounded-full px-3 py-1.5 text-sm transition ${v===R?"ui-status-warning":"thread-export-dialog-muted-action"}`,children:K},R))}),c==="selected"?e.jsxs("div",{className:"thread-export-dialog-box mt-4 rounded-2xl border",children:[e.jsxs("div",{className:"thread-export-dialog-box-header flex flex-wrap items-center justify-between gap-2 border-b px-3 py-2.5",children:[e.jsxs("p",{className:"thread-export-dialog-subtitle text-xs",children:["Selected ",p.size," of ",((I=n.data)==null?void 0:I.totalTurnCount)??l.length]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>f(new Set(l.map(R=>R.turnId))),className:"thread-export-dialog-secondary-button rounded-full border px-2.5 py-1 text-xs transition",children:"Select all"}),e.jsx("button",{type:"button",onClick:()=>f(new Set),className:"thread-export-dialog-secondary-button rounded-full border px-2.5 py-1 text-xs transition",children:"Clear"})]})]}),n.status==="loading"?e.jsx("p",{className:"thread-export-dialog-subtitle px-3 py-6 text-sm",children:"Loading turns..."}):n.status==="failed"?e.jsx("p",{className:"px-3 py-6 text-sm text-rose-500 dark:text-rose-200",children:n.error}):e.jsx("div",{className:"max-h-80 overflow-auto p-2",children:l.map(R=>e.jsxs("label",{className:"thread-export-dialog-turn-row flex cursor-pointer items-center gap-3 rounded-xl px-2.5 py-2 text-sm transition",children:[e.jsx("input",{type:"checkbox",checked:p.has(R.turnId),onChange:()=>y(R.turnId),className:"thread-export-dialog-checkbox h-4 w-4"}),e.jsxs("span",{className:"thread-export-dialog-strong shrink-0 text-xs font-medium",children:["Turn ",R.turnNumber]}),e.jsx("span",{className:"thread-export-dialog-subtitle shrink-0 text-xs",children:vg(R.startedAt)}),e.jsx("span",{className:"thread-export-dialog-body-text min-w-0 flex-1 truncate text-left",children:R.userPromptPreview}),e.jsx("span",{className:"thread-export-dialog-status-pill hidden shrink-0 rounded-full border px-2 py-0.5 text-[10px] sm:inline",children:kg(R.status)})]},R.turnId))})]}):e.jsx("p",{className:"thread-export-dialog-box thread-export-dialog-body-text mt-4 rounded-2xl border px-3 py-3 text-sm",children:"Exports the latest 10 turns in chronological order."}),e.jsxs("div",{className:"thread-export-dialog-body-text mt-4 grid gap-2 text-sm sm:grid-cols-2",children:[e.jsxs("label",{className:"thread-export-dialog-box flex items-center gap-2 rounded-xl border px-3 py-2",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:R=>x(R.target.checked),className:"thread-export-dialog-checkbox h-4 w-4"}),"Token and price"]}),e.jsx("p",{className:"thread-export-dialog-box thread-export-dialog-subtitle flex items-center rounded-xl border px-3 py-2 text-xs",children:v==="html"?"HTML keeps the chat timeline styling and omits raw command output.":"Review exports keep message text readable and omit tool activity."})]})]}),e.jsxs("div",{className:"thread-export-dialog-footer flex items-center justify-between gap-3 border-t px-5 py-4",children:[e.jsxs("p",{className:"thread-export-dialog-subtitle min-w-0 text-xs",children:[w," ",w===1?"turn":"turns"," will be exported."]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:a,disabled:r,className:"thread-export-dialog-secondary-button rounded-full border px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:"Cancel"}),e.jsx("button",{type:"button",onClick:C,disabled:!T,className:"ui-status-warning rounded-full px-4 py-2 text-sm font-medium transition disabled:cursor-not-allowed disabled:opacity-60",children:r?"Exporting...":`Export ${v.toUpperCase()}`})]})]})]})]}),document.body)}function ga(t){if(t===void 0)return"-";if(Math.abs(t)>1e4){const r=Math.abs(t)>=1e5?0:1;return`${(t/1e3).toLocaleString(void 0,{maximumFractionDigits:r})}k`}return t.toLocaleString()}function wg(t){return`in ${ga(t.input)} / out ${ga(t.output)} / cache ${ga(t.cache)}`}function yg(t,r){var s,l;const n=t.turns.at(-1),a=(s=t.liveItems)==null?void 0:s.items.at(-1),o=t.pendingRequests.at(-1);return[t.thread.id,t.turns.length,(n==null?void 0:n.id)??"",(n==null?void 0:n.items.length)??0,((l=t.liveItems)==null?void 0:l.items.length)??0,(a==null?void 0:a.id)??"",t.pendingRequests.length,(o==null?void 0:o.id)??"",r?r.length:0].join(":")}function jg({detail:t,adapter:r,timelineAdapter:n,TimelineComponent:a=yi,liveOutput:o="",beforeTimelineContent:s,composerProps:l,timelineProps:d,threadUsageSummary:c,transcriptItemCount:h,useFloatingMobileComposer:p=!1,floatingMobileComposerBottomOffset:f=0,composerHostRef:m}){const[x,v]=i.useState(!0),[b,k]=i.useState(!1),[g,w]=i.useState(0),[T,y]=i.useState(0),[C,z]=i.useState(0),[M,I]=i.useState(!1),R=i.useRef(null),K=i.useRef(null);i.useMemo(()=>yg(t,o),[t,o]);const Z=d==null?void 0:d.onTailVisibilityChange,D=t.pendingRequests.length>0;i.useEffect(()=>{R.current=null,v(!0)},[t.thread.id]);const ce=i.useCallback($=>{v($),Z==null||Z($)},[Z]);i.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const $=window.matchMedia("(max-width: 639px)"),F=()=>k($.matches);return F(),$.addEventListener("change",F),()=>{$.removeEventListener("change",F)}},[]),i.useEffect(()=>{var F,P;if(typeof window>"u")return;const $=()=>{const O=window.visualViewport,B=O?Math.max(0,Math.round(window.innerHeight-O.height-O.offsetTop)):0;z(B)};return $(),(F=window.visualViewport)==null||F.addEventListener("resize",$),(P=window.visualViewport)==null||P.addEventListener("scroll",$),window.addEventListener("resize",$),()=>{var O,B;(O=window.visualViewport)==null||O.removeEventListener("resize",$),(B=window.visualViewport)==null||B.removeEventListener("scroll",$),window.removeEventListener("resize",$)}},[]),i.useLayoutEffect(()=>{const $=K.current;if(!$||!b){w(0);return}const F=()=>{w(Math.ceil($.getBoundingClientRect().height))};if(F(),typeof ResizeObserver>"u")return;const P=new ResizeObserver(F);return P.observe($),()=>{P.disconnect()}},[b,l,D]),i.useLayoutEffect(()=>{var O,B;const $=K.current;if(!$||!b){y(0);return}const F=()=>{const N=$.getBoundingClientRect();y(Math.max(0,Math.ceil(window.innerHeight-N.top)))};F(),window.addEventListener("resize",F),(O=window.visualViewport)==null||O.addEventListener("resize",F),(B=window.visualViewport)==null||B.addEventListener("scroll",F);let P=null;return typeof ResizeObserver<"u"&&(P=new ResizeObserver(F),P.observe($)),()=>{var N,E;window.removeEventListener("resize",F),(N=window.visualViewport)==null||N.removeEventListener("resize",F),(E=window.visualViewport)==null||E.removeEventListener("scroll",F),P==null||P.disconnect()}},[b,C,M,l,D]),i.useEffect(()=>{if(!b){I(!1);return}const $=P=>{var B;const O=P.target;O instanceof HTMLElement&&((B=K.current)!=null&&B.contains(O))&&I(!0)},F=P=>{var B;const O=P.relatedTarget;O instanceof HTMLElement&&((B=K.current)!=null&&B.contains(O))||I(!1)};return document.addEventListener("focusin",$),document.addEventListener("focusout",F),()=>{document.removeEventListener("focusin",$),document.removeEventListener("focusout",F)}},[b]);const W=i.useCallback($=>{K.current=$,m&&(m.current=$)},[m]),G=b&&M?C:0,Y=Math.max(g,144),we=Math.max(T,Y+G),me=b?we+12:0,Re=me>0?{"--thread-graph-chat-scroll-bottom-spacer":`${me}px`}:void 0,X=p&&b?{bottom:`${f+G}px`,paddingBottom:"env(safe-area-inset-bottom)"}:void 0;return e.jsxs("div",{"data-testid":"chat-panel",className:"thread-graph-chat-panel relative flex h-full min-h-0 flex-col",style:Re,children:[s,e.jsx(a,{threadId:t.thread.id,turns:t.turns,totalTurnCount:t.totalTurnCount??t.turns.length,pendingRequests:t.pendingRequests,activeTurnId:t.thread.activeTurnId,threadRunning:t.thread.status==="running"||t.thread.activeTurnId!==null,liveOutput:o,className:"thread-timeline-surface min-h-0 flex-1",...d,adapter:n,onOpenThread:(d==null?void 0:d.onOpenThread)??r.openThread,onTailVisibilityChange:ce}),e.jsxs("div",{className:"thread-chat-usage-footer hidden shrink-0 items-center justify-between gap-3 px-4 py-1 text-[10px] leading-4 sm:flex",children:[e.jsxs("span",{className:"min-w-0 truncate",children:[t.turns.length," turn",t.turns.length!==1?"s":"",e.jsx("span",{className:"mx-1 text-[var(--theme-border-contrast)]",children:"|"}),h," item",h!==1?"s":""]}),e.jsxs("span",{className:"shrink-0",children:["Usage"," ",c&&c.turns>0?wg(c):"waiting for agent usage"]})]}),l?p?e.jsx("div",{ref:W,className:"fixed inset-x-0 bottom-0 z-50 overflow-visible sm:hidden",style:X??{bottom:`${f}px`,paddingBottom:"env(safe-area-inset-bottom)"},children:e.jsx(Na,{...l,activeView:"chat",edgeToEdgeMobile:!0,onSubmit:r.sendPrompt})}):e.jsx("div",{ref:W,className:"thread-graph-composer-host shrink-0",children:e.jsx(Na,{...l,activeView:"chat",onSubmit:r.sendPrompt})}):null]})}function Ng(t){return t.turns.reduce((r,n)=>{var o;const a=(o=n.tokenUsage)==null?void 0:o.total;return a?{input:r.input+a.inputTokens,output:r.output+a.outputTokens,cache:r.cache+a.cachedInputTokens,turns:r.turns+1}:r},{input:0,output:0,cache:0,turns:0})}function xa(t){return typeof t!="number"||!Number.isFinite(t)||t<=0?"0":t>=1e6?`${(t/1e6).toFixed(t>=1e7?0:1)}m`:t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)}k`:String(Math.round(t))}function Cg(t){return!t||t.turns<=0?"waiting for agent usage":`in ${xa(t.input)} / out ${xa(t.output)} / cache ${xa(t.cache)}`}function Pg({threads:t,detail:r,loading:n,error:a,status:o=null,plugins:s,adapter:l,metaContent:d,settingsContent:c,globalSettingsContent:h,mobileHeaderAction:p,appMenuButton:f,appNavigationMenu:m,workspaceReturnHref:x,onWorkspaceReturn:v,surfaceActions:b,floatingPanel:k,workspaceContent:g,workspaceTitle:w,workspaceActions:T,workspaceFeatures:y,beforeTimelineContent:C,errorContent:z,workspaceMissingContent:M,dialogs:I,currentThreadId:R,currentWorkspaceId:K,currentWorkspaceLabel:Z,onCloseAppNavigation:D,className:ce="thread-detail-surface relative flex h-full min-h-0 flex-1 flex-col overflow-hidden",activeView:W="chat",liveOutput:G="",timelineProps:Y,composerProps:we,shellComposerProps:me,useFloatingMobileComposer:Re=!1,floatingMobileComposerBottomOffset:X=0,composerHostRef:$,shellPanelRef:F,shellEffectiveTheme:P="dark",shellThemeMode:O=P,onShellThemeModeChange:B,onShellStateChange:N,shellUnavailableContent:E,shellDisconnectedContent:V,timelineComponent:_=yi,shellPanelComponent:ne=df,shellContent:te,loadingContent:je,emptyContent:ee}){const pe=qa(),he=s??pe??Wa(),Ce=i.useMemo(()=>({...l.getImageAssetUrl?{getImageAssetUrl:xe=>{var Ie;return((Ie=l.getImageAssetUrl)==null?void 0:Ie.call(l,xe.path))??""}}:{},onOpenLinkedThread:l.openThread,...l.loadHistoryItemDetail?{onLoadHistoryItemDetail:l.loadHistoryItemDetail}:{}}),[l.getImageAssetUrl,l.loadHistoryItemDetail,l.openThread]),Fe=he.getThreadPanels().some(xe=>xe.kind==="terminal"),J=i.useMemo(()=>r?Ng(r):null,[r]),U=i.useMemo(()=>Cg(J),[J]),re=i.useMemo(()=>{var xe;return r?r.turns.reduce((Ie,We)=>Ie+We.items.length,((xe=r.liveItems)==null?void 0:xe.items.length)??0):0},[r]),ae=g??(r?e.jsx(bg,{detail:r,status:o,plugins:he,workspaceAdapter:l.workspace??null,metaContent:d,settingsContent:c,activeView:W,features:y}):null),Q=n?je??e.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-[var(--theme-fg-muted)]",children:"Loading thread detail..."}):r?e.jsxs("div",{className:ce,children:[k?e.jsx("div",{className:"fixed right-3 top-20 z-50 lg:absolute lg:right-4 lg:top-16",children:k}):null,a&&!n&&(z??e.jsx("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:a})),r.workspacePathStatus==="missing"&&(M??e.jsxs("div",{className:"shrink-0 border-b border-rose-500/20 bg-rose-500/10 px-5 py-4 text-sm text-rose-100 sm:px-6",children:[e.jsx("p",{className:"font-medium text-rose-50",children:"Workspace path missing"}),e.jsx("p",{className:"mt-1 break-words text-rose-100/90",children:r.workspace.absPath})]})),e.jsx("div",{className:W==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:e.jsx(jg,{detail:r,adapter:l,timelineAdapter:Ce,TimelineComponent:_,liveOutput:G,threadUsageSummary:J,transcriptItemCount:re,useFloatingMobileComposer:Re,floatingMobileComposerBottomOffset:X,...C?{beforeTimelineContent:C}:{},...we?{composerProps:we}:{},...Y?{timelineProps:Y}:{},...$?{composerHostRef:$}:{}})}),e.jsxs("div",{className:W==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[te??(r.thread.isLoaded&&Fe&&l.shell?e.jsx(ne,{ref:F,threadId:r.thread.id,shellAdapter:l.shell,effectiveTheme:P,isVisible:W==="shell",showHeader:!1,showFloatingToolbox:!1,...N?{onStateChange:N}:{}}):r.thread.isLoaded&&!Fe?E??e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:e.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[e.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Terminal plugin disabled"}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-muted)]",children:"Enable the Terminal plugin in Settings to use the shell panel."})]})}):V??e.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-4 sm:p-6",children:e.jsxs("div",{className:"thread-empty-surface max-w-md rounded-[1.6rem] border px-6 py-8 text-center",children:[e.jsx("p",{className:"text-base font-medium text-[var(--theme-fg)]",children:"Thread disconnected"}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-[var(--theme-fg-soft)]",children:"Reconnect this thread before creating or attaching a shell."})]})})),W==="shell"&&me&&!te?e.jsx(Na,{...me,activeView:"shell",onSubmit:l.sendPrompt}):null]}),I]}):ee??e.jsx("div",{className:"flex flex-1 items-center justify-center px-6 py-12 text-center text-[var(--theme-fg-muted)]",children:"Select a thread to inspect."});return e.jsx(km,{threads:t,status:o,loading:n,error:n?null:a,viewportConstrained:!0,currentThreadId:R??(r==null?void 0:r.thread.id),currentThreadLabel:r==null?void 0:r.thread.title,currentWorkspaceId:K??(r==null?void 0:r.thread.workspaceId),currentWorkspaceLabel:Z??(r==null?void 0:r.workspace.label),sessionLabel:(r==null?void 0:r.thread.providerSessionId)??(r==null?void 0:r.thread.id),usageLabel:U,topbarActions:b,metaContent:d,settingsContent:c,globalSettingsContent:h,mobileHeaderAction:p,effectiveTheme:P,themeMode:O,appMenuButton:f,appNavigationMenu:m,workspaceReturnHref:x,...v?{onWorkspaceReturn:v}:{},showMobileAppMenu:!!f,showMobileThreadNavToggle:!0,showMobileNewThreadShortcut:!1,onOpenThread:l.openThread,workspaceContent:ae,workspaceTitle:w??"Workspace",workspaceActions:T,...D?{onCloseAppNavigation:D}:{},...B?{onThemeModeChange:B}:{},...l.getThreadHref?{getThreadHref:l.getThreadHref}:{},...l.getNewThreadHref?{getNewThreadHref:l.getNewThreadHref}:{},...l.renameThread?{onRenameThread:l.renameThread}:{},...l.deleteThread?{onDeleteThread:l.deleteThread}:{},children:Q})}function Mg({adapter:t={},children:r}){const[n,a]=i.useState(()=>Ca(Pr,[])),[o,s]=i.useState(!1),[l,d]=i.useState(null),c=i.useCallback(async()=>{s(!0),d(null);try{const w=t.fetchPlugins?await t.fetchPlugins():[];a(Ca(Pr,w))}catch(w){d(w instanceof Error?w.message:"Unable to load plugins.")}finally{s(!1)}},[t]);i.useEffect(()=>{c()},[c]);const h=i.useCallback(async(w,T)=>{if(t.updatePlugin){const y=await t.updatePlugin(w,{enabled:T});a(C=>C.map(z=>z.id===y.id?y:z));return}a(y=>y.map(C=>C.id===w?{...C,enabled:T}:C))},[t]),p=i.useCallback(async w=>{if(!t.importPlugin)throw new Error("Plugin import is not available.");const T=await t.importPlugin(w);a(y=>[...y.filter(z=>z.id!==T.id),T])},[t]),f=i.useCallback(async w=>{if(!t.deletePlugin)throw new Error("Plugin uninstall is not available.");const T=await t.deletePlugin(w);a(y=>y.filter(C=>C.id!==T.id))},[t]),m=i.useMemo(()=>{const w=new Set(n.filter(T=>T.enabled).map(T=>T.id));return Pr.filter(T=>w.has(T.manifest.id))},[n]),x=i.useCallback(w=>{var y;const T=m.find(C=>C.renderArtifact&&C.manifest.capabilities.artifactTypes.some(z=>z.type===w.artifact.type));return((y=T==null?void 0:T.renderArtifact)==null?void 0:y.call(T,w))??null},[m]),v=i.useCallback(w=>{for(const T of m)for(const y of T.inlineCodeRenderers??[]){if(!y.languages.includes(w.language.trim().toLowerCase()))continue;const C=y.render(w);if(C)return C}return null},[m]),b=i.useCallback(w=>m.some(T=>!!T.renderArtifact&&T.manifest.capabilities.artifactTypes.some(y=>y.type===w.type)),[m]),k=i.useCallback(()=>m.flatMap(w=>w.threadPanels??[]),[m]),g=i.useMemo(()=>({plugins:n,loading:o,error:l,refresh:c,importPluginManifest:p,setPluginEnabled:h,uninstallPlugin:f,renderArtifact:x,renderInlineCode:v,hasRendererForArtifact:b,getThreadPanels:k}),[l,k,b,p,o,n,c,x,v,h,f]);return e.jsx(ui.Provider,{value:g,children:r})}export{Rg as C,Ig as E,wm as L,Mg as P,Pg as T,df as a,yi as b,km as c,vm as d,Ua as f,sm as t,qa as u};
|