remote-codex 0.11.1 → 0.11.3
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/relay-server/dist/index.js +1221 -0
- package/apps/supervisor-api/dist/index.js +2822 -780
- 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-CBIze1VS.css +1 -0
- package/apps/supervisor-web/dist/assets/index-YpGAPjED.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-D92BViLH.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-CF80LEEN.js +3613 -0
- package/apps/supervisor-web/dist/assets/ui-vendor-CW6egZBG.js +430 -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/bin/remote-codex.mjs +73 -16
- package/package.json +7 -1
- package/packages/agent-runtime/src/types.ts +1 -0
- package/packages/agent-runtime/src/unavailable-runtime.ts +5 -13
- package/packages/claude/src/runtimeAdapter.ts +7 -5
- package/packages/codex/src/appServerManager.ts +3 -3
- package/packages/codex/src/historyItems.test.ts +2 -4
- package/packages/codex/src/historyItems.ts +13 -18
- 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/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 +213 -0
- package/apps/supervisor-api/dist/chunk-6M32PPHZ.js +0 -24507
- package/apps/supervisor-api/dist/chunk-7AA2MFXK.js +0 -24499
- package/apps/supervisor-api/dist/chunk-HKBFCPHH.js +0 -24511
- package/apps/supervisor-api/dist/worker-index.js +0 -33
- 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-p31aS0f0.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-BiuFei_K.css +0 -32
- package/apps/supervisor-web/dist/assets/index-D1R9CUnx.js +0 -2161
- 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
- /package/apps/{supervisor-api/dist/worker-index.d.ts → relay-server/dist/index.d.ts} +0 -0
|
@@ -0,0 +1,3613 @@
|
|
|
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 vn}from"./react-vendor-o1Xrx7m4.js";import{C as Dr,D as dn,B as Aa,a as ol,Z as ll,b as il,R as dl,c as cl,T as wr,P as hl,d as ul,e as vd,A as kd,I as wd,f as ml,W as Da,g as yd,S as jd,h as Nd,F as Cd,i as Sd,j as Td,k as Vs,l as Ed,m as zd,E as Ld,n as Rd,o as Id,H as Pd,p as Md,q as pl,r as $d,s as ka,t as _d,G as Ad,u as Dd,L as kn,v as Br,w as wn,x as fl,y as cn,z as Ba,J as hn,K as Bd,U as gl,M as wa,N as Fd,O as xl,Q as bl,V as vl,X as Gd,Y as Od,_ as Hd,$ as Vd,a0 as kl,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 wl,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,aH as Ic}from"./ui-vendor-CW6egZBG.js";import"./terminal-vendor-CLGgN91S.js";import{u as Pc,a as Mc,H as Us,P as sr,b as $c,M as yl,R as _c,i as Ac,C as Dc,B as Bc,c as Ws,g as jl}from"./graph-vendor-CGzY-MFv.js";import{M as Fc,r as Gc,a as Oc,b as Hc}from"./markdown-vendor-hBDTCSB-.js";const Vc="modulepreload",Uc=function(t){return"/"+t},qs={},at=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=Uc(h),h in qs)return;qs[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":Vc,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 Nl(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=Nl(t[r]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function Cl(){for(var t,r,n=0,a="",o=arguments.length;n<o;n++)(t=arguments[n])&&(r=Nl(t))&&(a&&(a+=" "),a+=r);return a}const Ks=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Xs=Cl,Fr=(t,r)=>n=>{var a;if((r==null?void 0:r.variants)==null)return Xs(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=Ks(p)||Ks(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 Xs(t,l,c,n==null?void 0:n.class,n==null?void 0:n.className)},Wc=(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},qc=(t,r)=>({classGroupId:t,validator:r}),Sl=(t=new Map,r=null,n)=>({nextPart:t,validators:r,classGroupId:n}),un="-",Zs=[],Kc="arbitrary..",Xc=t=>{const r=Yc(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Zc(l);const d=l.split(un),c=d[0]===""&&d.length>1?1:0;return Tl(d,c,r)},getConflictingClassGroupIds:(l,d)=>{if(d){const c=a[l],h=n[l];return c?h?Wc(h,c):c:h||Zs}return n[l]||Zs}}},Tl=(t,r,n)=>{if(t.length-r===0)return n.classGroupId;const o=t[r],s=n.nextPart.get(o);if(s){const h=Tl(t,r+1,s);if(h)return h}const l=n.validators;if(l===null)return;const d=r===0?t.join(un):t.slice(r).join(un),c=l.length;for(let h=0;h<c;h++){const p=l[h];if(p.validator(d))return p.classGroupId}},Zc=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?Kc+a:void 0})(),Yc=t=>{const{theme:r,classGroups:n}=t;return Jc(n,r)},Jc=(t,r)=>{const n=Sl();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];Qc(l,r,n,a)}},Qc=(t,r,n,a)=>{if(typeof t=="string"){eh(t,r,n);return}if(typeof t=="function"){th(t,r,n,a);return}rh(t,r,n,a)},eh=(t,r,n)=>{const a=t===""?r:El(r,t);a.classGroupId=n},th=(t,r,n,a)=>{if(nh(t)){Fa(t(a),r,n,a);return}r.validators===null&&(r.validators=[]),r.validators.push(qc(n,t))},rh=(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,El(r,d),n,a)}},El=(t,r)=>{let n=t;const a=r.split(un),o=a.length;for(let s=0;s<o;s++){const l=a[s];let d=n.nextPart.get(l);d||(d=Sl(),n.nextPart.set(l,d)),n=d}return n},nh=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,ah=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)}}},ya="!",Ys=":",sh=[],Js=(t,r,n,a,o)=>({modifiers:t,hasImportantModifier:r,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),oh=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===Ys){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(ya)?(m=f.slice(0,-1),x=!0):f.startsWith(ya)&&(m=f.slice(1),x=!0);const v=h&&h>c?h-c:void 0;return Js(s,x,m,v)};if(r){const o=r+Ys,s=a;a=l=>l.startsWith(o)?s(l.slice(o.length)):Js(sh,!1,l,void 0,!0)}if(n){const o=a;a=s=>n({className:s,parseClassName:o})}return a},lh=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}},ih=t=>({cache:ah(t.cacheSize),parseClassName:oh(t),sortModifiers:lh(t),postfixLookupClassGroupIds:dh(t),...Xc(t)}),dh=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},ch=/\s+/,hh=(t,r)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:l}=r,d=[],c=t.trim().split(ch);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 P=b.substring(0,k);w=a(P);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+ya:T,C=y+w;if(d.indexOf(C)>-1)continue;d.push(C);const z=o(w,g);for(let P=0;P<z.length;++P){const I=z[P];d.push(y+I)}h=f+(h.length>0?" "+h:h)}return h},uh=(...t)=>{let r=0,n,a,o="";for(;r<t.length;)(n=t[r++])&&(a=zl(n))&&(o&&(o+=" "),o+=a);return o},zl=t=>{if(typeof t=="string")return t;let r,n="";for(let a=0;a<t.length;a++)t[a]&&(r=zl(t[a]))&&(n&&(n+=" "),n+=r);return n},mh=(t,...r)=>{let n,a,o,s;const l=c=>{const h=r.reduce((p,f)=>f(p),t());return n=ih(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=hh(c,n);return o(c,p),p};return s=l,(...c)=>s(uh(...c))},ph=[],ht=t=>{const r=n=>n[t]||ph;return r.isThemeGetter=!0,r},Ll=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,gh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xh=/\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$/,bh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ot=t=>fh.test(t),Fe=t=>!!t&&!Number.isNaN(Number(t)),Mt=t=>!!t&&Number.isInteger(Number(t)),Xn=t=>t.endsWith("%")&&Fe(t.slice(0,-1)),At=t=>gh.test(t),Il=()=>!0,wh=t=>xh.test(t)&&!bh.test(t),Ga=()=>!1,yh=t=>vh.test(t),jh=t=>kh.test(t),Nh=t=>!le(t)&&!ce(t),Ch=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)),Sh=t=>qt(t,$l,Ga),le=t=>Ll.test(t),tr=t=>qt(t,_l,wh),Qs=t=>qt(t,Mh,Fe),Th=t=>qt(t,Dl,Il),Eh=t=>qt(t,Al,Ga),eo=t=>qt(t,Pl,Ga),zh=t=>qt(t,Ml,jh),Yr=t=>qt(t,Bl,yh),ce=t=>Rl.test(t),Tr=t=>ir(t,_l),Lh=t=>ir(t,Al),to=t=>ir(t,Pl),Rh=t=>ir(t,$l),Ih=t=>ir(t,Ml),Jr=t=>ir(t,Bl,!0),Ph=t=>ir(t,Dl,!0),qt=(t,r,n)=>{const a=Ll.exec(t);return a?a[1]?r(a[1]):n(a[2]):!1},ir=(t,r,n=!1)=>{const a=Rl.exec(t);return a?a[1]?r(a[1]):n:!1},Pl=t=>t==="position"||t==="percentage",Ml=t=>t==="image"||t==="url",$l=t=>t==="length"||t==="size"||t==="bg-size",_l=t=>t==="length",Mh=t=>t==="number",Al=t=>t==="family-name",Dl=t=>t==="number"||t==="weight",Bl=t=>t==="shadow",$h=()=>{const t=ht("color"),r=ht("font"),n=ht("text"),a=ht("font-weight"),o=ht("tracking"),s=ht("leading"),l=ht("breakpoint"),d=ht("container"),c=ht("spacing"),h=ht("radius"),p=ht("shadow"),f=ht("inset-shadow"),m=ht("text-shadow"),x=ht("drop-shadow"),v=ht("blur"),b=ht("perspective"),k=ht("aspect"),g=ht("ease"),w=ht("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(),ce,le],z=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],I=()=>[ce,le,c],R=()=>[Ot,"full","auto",...I()],K=()=>[Mt,"none","subgrid",ce,le],Z=()=>["auto",{span:["full",Mt,ce,le]},Mt,ce,le],F=()=>[Mt,"auto",ce,le],ie=()=>["auto","min","max","fr",ce,le],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],_=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...I()],ye=()=>[Ot,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],ue=()=>[Ot,"screen","full","dvw","lvw","svw","min","max","fit",...I()],Le=()=>[Ot,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],X=()=>[t,ce,le],$=()=>[...y(),to,eo,{position:[ce,le]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",Rh,Sh,{size:[ce,le]}],A=()=>[Xn,Tr,tr],O=()=>["","none","full",h,ce,le],N=()=>["",Fe,Tr,tr],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"],D=()=>[Fe,Xn,to,eo],re=()=>["","none",v,ce,le],ne=()=>["none",Fe,ce,le],Ne=()=>["none",Fe,ce,le],ee=()=>[Fe,ce,le],me=()=>[Ot,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[At],breakpoint:[At],color:[Il],container:[At],"drop-shadow":[At],ease:["in","out","in-out"],font:[Nh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[At],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[At],shadow:[At],spacing:["px",Fe],text:[At],"text-shadow":[At],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ot,le,ce,k]}],container:["container"],"container-type":[{"@container":["","normal","size",ce,le]}],"container-named":[Ch],columns:[{columns:[Fe,le,ce,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:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],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:[Mt,"auto",ce,le]}],basis:[{basis:[Ot,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,Ot,"auto","initial","none",le]}],grow:[{grow:["",Fe,ce,le]}],shrink:[{shrink:["",Fe,ce,le]}],order:[{order:[Mt,"first","last","none",ce,le]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[..._(),"normal"]}],"justify-self":[{"justify-self":["auto",..._()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[..._(),{baseline:["","last"]}]}],"align-self":[{self:["auto",..._(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[..._(),"baseline"]}],"place-self":[{"place-self":["auto",..._()]}],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:ye()}],"inline-size":[{inline:["auto",...ue()]}],"min-inline-size":[{"min-inline":["auto",...ue()]}],"max-inline-size":[{"max-inline":["none",...ue()]}],"block-size":[{block:["auto",...Le()]}],"min-block-size":[{"min-block":["auto",...Le()]}],"max-block-size":[{"max-block":["none",...Le()]}],w:[{w:[d,"screen",...ye()]}],"min-w":[{"min-w":[d,"screen","none",...ye()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[l]},...ye()]}],h:[{h:["screen","lh",...ye()]}],"min-h":[{"min-h":["screen","lh","none",...ye()]}],"max-h":[{"max-h":["screen","lh",...ye()]}],"font-size":[{text:["base",n,Tr,tr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ph,Th]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Xn,le]}],"font-family":[{font:[Lh,Eh,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,ce,le]}],"line-clamp":[{"line-clamp":[Fe,"none",ce,Qs]}],leading:[{leading:[s,...I()]}],"list-image":[{"list-image":["none",ce,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,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:[Fe,"from-font","auto",ce,tr]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Fe,"auto",ce,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:[Mt,ce,le]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,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",ce,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:G()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mt,ce,le],radial:["",ce,le],conic:[Mt,ce,le]},Ih,zh]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:A()}],"gradient-via-pos":[{via:A()}],"gradient-to-pos":[{to:A()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"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":[Fe,ce,le]}],"outline-w":[{outline:["",Fe,Tr,tr]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",p,Jr,Yr]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",f,Jr,Yr]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Fe,tr]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",m,Jr,Yr]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Fe,ce,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":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"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":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"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":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"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":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"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":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"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":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"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":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[ce,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"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":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"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:G()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,le]}],filter:[{filter:["","none",ce,le]}],blur:[{blur:re()}],brightness:[{brightness:[Fe,ce,le]}],contrast:[{contrast:[Fe,ce,le]}],"drop-shadow":[{"drop-shadow":["","none",x,Jr,Yr]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Fe,ce,le]}],"hue-rotate":[{"hue-rotate":[Fe,ce,le]}],invert:[{invert:["",Fe,ce,le]}],saturate:[{saturate:[Fe,ce,le]}],sepia:[{sepia:["",Fe,ce,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,le]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,ce,le]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,ce,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,ce,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,ce,le]}],"backdrop-invert":[{"backdrop-invert":["",Fe,ce,le]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,ce,le]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,ce,le]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,ce,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",ce,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",ce,le]}],ease:[{ease:["linear","initial",g,ce,le]}],delay:[{delay:[Fe,ce,le]}],animate:[{animate:["none",w,ce,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ce,le]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[ce,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],zoom:[{zoom:[Mt,ce,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",ce,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",ce,le]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Fe,Tr,tr,Qs]}],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=mh($h),yn=i.createContext(null);yn.displayName="PanelGroupContext";const nt={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,ro=bd.useId,Ah=typeof ro=="function"?ro:()=>null;let Dh=0;function Ha(t=null){const r=Ah(),n=i.useRef(t||r||null);return n.current===null&&(n.current=""+Dh++),t??n.current}function Fl({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(yn);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:P,registerPanel:I,resizePanel:R,unregisterPanel:K}=k,Z=Ha(l),F=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:q,constraints:_}=F.current,Y={..._};F.current.id=Z,F.current.idIsFromProps=l!==void 0,F.current.order=m,q.onCollapse=h,q.onExpand=p,q.onResize=f,_.collapsedSize=n,_.collapsible=a,_.defaultSize=o,_.maxSize=d,_.minSize=c,(Y.collapsedSize!==_.collapsedSize||Y.collapsible!==_.collapsible||Y.maxSize!==_.maxSize||Y.minSize!==_.minSize)&&P(F.current,Y)}),or(()=>{const q=F.current;return I(q),()=>{K(q)}},[m,Z,I,K]),i.useImperativeHandle(s,()=>({collapse:()=>{g(F.current)},expand:q=>{w(F.current,q)},getId(){return Z},getSize(){return T(F.current)},isCollapsed(){return z(F.current)},isExpanded(){return!z(F.current)},resize:q=>{R(F.current,q)}}),[g,w,T,z,Z,R]);const ie=y(F.current,o);return i.createElement(v,{...b,children:t,className:r,id:Z,style:{...ie,...x},[nt.groupId]:C,[nt.panel]:"",[nt.panelCollapsible]:a||void 0,[nt.panelId]:Z,[nt.panelSize]:parseFloat(""+ie.flexGrow).toFixed(1)})}const Gl=i.forwardRef((t,r)=>i.createElement(Fl,{...t,forwardedRef:r}));Fl.displayName="Panel";Gl.displayName="forwardRef(Panel)";let ja=null,on=-1,Ut=null;function Bh(t,r,n){const a=(r&Wl)!==0,o=(r&ql)!==0,s=(r&Kl)!==0,l=(r&Xl)!==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 Fh(){Ut!==null&&(document.head.removeChild(Ut),ja=null,Ut=null,on=-1)}function Zn(t,r,n){var a,o;const s=Bh(t,r);if(ja!==s){if(ja=s,Ut===null&&(Ut=document.createElement("style"),document.head.appendChild(Ut)),on>=0){var l;(l=Ut.sheet)===null||l===void 0||l.removeRule(on)}on=(a=(o=Ut.sheet)===null||o===void 0?void 0:o.insertRule(`*{cursor: ${s} !important;}`))!==null&&a!==void 0?a:-1}}function Ol(t){return t.type==="keydown"}function Hl(t){return t.type.startsWith("pointer")}function Vl(t){return t.type.startsWith("mouse")}function jn(t){if(Hl(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(Vl(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Gh(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Oh(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 Hh(t,r){if(t===r)throw new Error("Cannot compare node with itself");const n={a:so(t),b:so(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:ao(no(n.a)),b:ao(no(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 Vh=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Uh(t){var r;const n=getComputedStyle((r=Ul(t))!==null&&r!==void 0?r:t).display;return n==="flex"||n==="inline-flex"}function Wh(t){const r=getComputedStyle(t);return!!(r.position==="fixed"||r.zIndex!=="auto"&&(r.position!=="static"||Uh(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"||Vh.test(r.willChange)||r.webkitOverflowScrolling==="touch")}function no(t){let r=t.length;for(;r--;){const n=t[r];if(_e(n,"Missing node"),Wh(n))return n}return null}function ao(t){return t&&Number(getComputedStyle(t).zIndex)||0}function so(t){const r=[];for(;t;)r.push(t),t=Ul(t);return r}function Ul(t){const{parentNode:r}=t;return r&&r instanceof ShadowRoot?r.host:r}const Wl=1,ql=2,Kl=4,Xl=8,qh=Gh()==="coarse";let zt=[],vr=!1,Wt=new Map,Nn=new Map;const $r=new Set;function Kh(t,r,n,a,o){var s;const{ownerDocument:l}=r,d={direction:n,element:r,hitAreaMargins:a,setResizeHandlerState:o},c=(s=Wt.get(l))!==null&&s!==void 0?s:0;return Wt.set(l,c+1),$r.add(d),mn(),function(){var p;Nn.delete(t),$r.delete(d);const f=(p=Wt.get(l))!==null&&p!==void 0?p:1;if(Wt.set(l,f-1),mn(),f===1&&Wt.delete(l),zt.includes(d)){const m=zt.indexOf(d);m>=0&&zt.splice(m,1),Cn(),o("up",!0,null)}}}function Xh(t){const{target:r}=t,{x:n,y:a}=jn(t);vr=!0,Va({target:r,x:n,y:a}),mn(),zt.length>0&&(pn("down",t),Cn(),t.preventDefault(),Zl(r)||t.stopImmediatePropagation())}function Yn(t){const{x:r,y:n}=jn(t);if(vr&&t.type!=="pointerleave"&&t.buttons===0&&(vr=!1,pn("up",t)),!vr){const{target:a}=t;Va({target:a,x:r,y:n})}pn("move",t),Cn(),zt.length>0&&t.preventDefault()}function Jn(t){const{target:r}=t,{x:n,y:a}=jn(t);Nn.clear(),vr=!1,zt.length>0&&(t.preventDefault(),Zl(r)||t.stopImmediatePropagation()),pn("up",t),Va({target:r,x:n,y:a}),Cn(),mn()}function Zl(t){let r=t;for(;r;){if(r.hasAttribute(nt.resizeHandle))return!0;r=r.parentElement}return!1}function Va({target:t,x:r,y:n}){zt.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=qh?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)&&Hh(a,s)>0){let v=a,b=!1;for(;v&&!v.contains(s);){if(Oh(v.getBoundingClientRect(),d)){b=!0;break}v=v.parentElement}if(b)return}zt.push(o)}})}function Qn(t,r){Nn.set(t,r)}function Cn(){let t=!1,r=!1;zt.forEach(a=>{const{direction:o}=a;o==="horizontal"?t=!0:r=!0});let n=0;Nn.forEach(a=>{n|=a}),t&&r?Zn("intersection",n):t?Zn("horizontal",n):r?Zn("vertical",n):Fh()}let ea;function mn(){var t;(t=ea)===null||t===void 0||t.abort(),ea=new AbortController;const r={capture:!0,signal:ea.signal};$r.size&&(vr?(zt.length>0&&Wt.forEach((n,a)=>{const{body:o}=a;n>0&&(o.addEventListener("contextmenu",Jn,r),o.addEventListener("pointerleave",Yn,r),o.addEventListener("pointermove",Yn,r))}),Wt.forEach((n,a)=>{const{body:o}=a;o.addEventListener("pointerup",Jn,r),o.addEventListener("pointercancel",Jn,r)})):Wt.forEach((n,a)=>{const{body:o}=a;n>0&&(o.addEventListener("pointerdown",Xh,r),o.addEventListener("pointermove",Yn,r))}))}function pn(t,r){$r.forEach(n=>{const{setResizeHandlerState:a}=n,o=zt.includes(n);a(t,o,r)})}function Zh(){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 Dt(t,r,n=Oa){return lr(t,r,n)===0}function Nt(t,r,n){return lr(t,r,n)===0}function Yh(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(!Nt(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(Nt(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}`),Nt(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}`),Nt(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(!Nt(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(Yh(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,!Nt(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(Nt(w,y)||(b-=y-w,l[g]=y),Nt(b,0))break;t>0?g--:g++}}}const p=l.reduce((f,m)=>m+f,0);return Nt(p,100)?l:o}function Jh({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(`[${nt.resizeHandleId}][data-panel-group-id="${t}"]`))}function Yl(t,r,n=document){const o=_r(t,n).findIndex(s=>s.getAttribute(nt.resizeHandleId)===r);return o??null}function Jl(t,r,n){const a=Yl(t,r,n);return a!=null?[a,a+1]:[-1,-1]}function Qh(t){return t instanceof HTMLElement?!0:typeof t=="object"&&t!==null&&"tagName"in t&&"getAttribute"in t}function Ql(t,r=document){if(Qh(r)&&r.dataset.panelGroupId==t)return r;const n=r.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return n||null}function Sn(t,r=document){const n=r.querySelector(`[${nt.resizeHandleId}="${t}"]`);return n||null}function eu(t,r,n,a=document){var o,s,l,d;const c=Sn(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 tu({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}=Jh({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=Ql(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(nt.resizeHandleId);_e(x,"Resize handle element has no handle id attribute");const[v,b]=eu(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:P=0}=T.constraints;if(y!=null&&z){const I=Lr({delta:Nt(y,C)?P-C:C-y,initialLayout:a,panelConstraints:c.map(R=>R.constraints),pivotIndices:Jl(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 oo(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 ei(t,r){const n=t==="horizontal",{x:a,y:o}=jn(r);return n?a:o}function ru(t,r,n,a,o){const s=n==="horizontal",l=Sn(r,o);_e(l,`No resize handle element found for id "${r}"`);const d=l.getAttribute(nt.groupId);_e(d,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=a;const h=ei(n,t),p=Ql(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 nu(t,r,n,a,o,s){if(Ol(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:ru(t,r,n,a,s)}function au({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||Dt(f,h))&&!Dt(a,h)&&x(),m&&(f==null||!Dt(f,h))&&Dt(a,h)&&m())}})}function Qr(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 su({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 ou(t,r=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...o)},r)}}function lo(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 ti(t){return`react-resizable-panels:${t}`}function ri(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 ni(t,r){try{const n=ti(t),a=r.getItem(n);if(a){const o=JSON.parse(a);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function lu(t,r,n){var a,o;const s=(a=ni(t,n))!==null&&a!==void 0?a:{},l=ri(r);return(o=s[l])!==null&&o!==void 0?o:null}function iu(t,r,n,a,o){var s;const l=ti(t),d=ri(r),c=(s=ni(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 io({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(!Nt(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(!Nt(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,Nt(o,0)))break}return n}const du=100,Rr={getItem:t=>(lo(Rr),Rr.getItem(t)),setItem:(t,r)=>{lo(Rr),Rr.setItem(t,r)}},co={};function ai({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=Zh(),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}),P=i.useRef({layout:k,panelDataArray:[],panelDataArrayChanged:!1});i.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),i.useImperativeHandle(o,()=>({getId:()=>z.current.id,getLayout:()=>{const{layout:M}=P.current;return M},setLayout:M=>{const{onLayout:A}=z.current,{layout:O,panelDataArray:N}=P.current,E=io({layout:M,panelConstraints:N.map(V=>V.constraints)});oo(O,E)||(g(E),P.current.layout=E,A&&A(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}),tu({committedValuesRef:z,eagerValuesRef:P,groupId:m,layout:k,panelDataArray:P.current.panelDataArray,setLayout:g,panelGroupElement:x.current}),i.useEffect(()=>{const{panelDataArray:M}=P.current;if(t){if(k.length===0||k.length!==M.length)return;let A=co[t];A==null&&(A=ou(iu,du),co[t]=A);const O=[...M],N=new Map(y.current);A(t,O,N,k,c)}},[t,k,c]),i.useEffect(()=>{});const I=i.useCallback(M=>{const{onLayout:A}=z.current,{layout:O,panelDataArray:N}=P.current;if(M.constraints.collapsible){const E=N.map(ne=>ne.constraints),{collapsedSize:V=0,panelSize:D,pivotIndices:re}=rr(N,M,O);if(_e(D!=null,`Panel size not found for panel "${M.id}"`),!Dt(D,V)){y.current.set(M.id,D);const Ne=gr(N,M)===N.length-1?D-V:V-D,ee=Lr({delta:Ne,initialLayout:O,panelConstraints:E,pivotIndices:re,prevLayout:O,trigger:"imperative-api"});Qr(O,ee)||(g(ee),P.current.layout=ee,A&&A(ee),mr(N,ee,T.current))}}},[]),R=i.useCallback((M,A)=>{const{onLayout:O}=z.current,{layout:N,panelDataArray:E}=P.current;if(M.constraints.collapsible){const V=E.map(me=>me.constraints),{collapsedSize:D=0,panelSize:re=0,minSize:ne=0,pivotIndices:Ne}=rr(E,M,N),ee=A??ne;if(Dt(re,D)){const me=y.current.get(M.id),pe=me!=null&&me>=ee?me:ee,Oe=gr(E,M)===E.length-1?re-pe:pe-re,J=Lr({delta:Oe,initialLayout:N,panelConstraints:V,pivotIndices:Ne,prevLayout:N,trigger:"imperative-api"});Qr(N,J)||(g(J),P.current.layout=J,O&&O(J),mr(E,J,T.current))}}},[]),K=i.useCallback(M=>{const{layout:A,panelDataArray:O}=P.current,{panelSize:N}=rr(O,M,A);return _e(N!=null,`Panel size not found for panel "${M.id}"`),N},[]),Z=i.useCallback((M,A)=>{const{panelDataArray:O}=P.current,N=gr(O,M);return su({defaultSize:A,dragState:v,layout:k,panelData:O,panelIndex:N})},[v,k]),F=i.useCallback(M=>{const{layout:A,panelDataArray:O}=P.current,{collapsedSize:N=0,collapsible:E,panelSize:V}=rr(O,M,A);return _e(V!=null,`Panel size not found for panel "${M.id}"`),E===!0&&Dt(V,N)},[]),ie=i.useCallback(M=>{const{layout:A,panelDataArray:O}=P.current,{collapsedSize:N=0,collapsible:E,panelSize:V}=rr(O,M,A);return _e(V!=null,`Panel size not found for panel "${M.id}"`),!E||lr(V,N)>0},[]),q=i.useCallback(M=>{const{panelDataArray:A}=P.current;A.push(M),A.sort((O,N)=>{const E=O.order,V=N.order;return E==null&&V==null?0:E==null?-1:V==null?1:E-V}),P.current.panelDataArrayChanged=!0,w()},[w]);or(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:M,onLayout:A,storage:O}=z.current,{layout:N,panelDataArray:E}=P.current;let V=null;if(M){const re=lu(M,E,O);re&&(y.current=new Map(Object.entries(re.expandToSizes)),V=re.layout)}V==null&&(V=au({panelDataArray:E}));const D=io({layout:V,panelConstraints:E.map(re=>re.constraints)});oo(N,D)||(g(D),P.current.layout=D,A&&A(D),mr(E,D,T.current))}}),or(()=>{const M=P.current;return()=>{M.layout=[]}},[]);const _=i.useCallback(M=>{let A=!1;const O=x.current;return O&&window.getComputedStyle(O,null).getPropertyValue("direction")==="rtl"&&(A=!0),function(E){E.preventDefault();const V=x.current;if(!V)return()=>null;const{direction:D,dragState:re,id:ne,keyboardResizeBy:Ne,onLayout:ee}=z.current,{layout:me,panelDataArray:pe}=P.current,{initialLayout:Te}=re??{},Oe=Jl(ne,M,V);let J=nu(E,M,D,re,Ne,V);const U=D==="horizontal";U&&A&&(J=-J);const te=pe.map(we=>we.constraints),ae=Lr({delta:J,initialLayout:Te??me,panelConstraints:te,pivotIndices:Oe,prevLayout:me,trigger:Ol(E)?"keyboard":"mouse-or-touch"}),Q=!Qr(me,ae);(Hl(E)||Vl(E))&&C.current!=J&&(C.current=J,!Q&&J!==0?U?Qn(M,J<0?Wl:ql):Qn(M,J<0?Kl:Xl):Qn(M,0)),Q&&(g(ae),P.current.layout=ae,ee&&ee(ae),mr(pe,ae,T.current))}},[]),Y=i.useCallback((M,A)=>{const{onLayout:O}=z.current,{layout:N,panelDataArray:E}=P.current,V=E.map(me=>me.constraints),{panelSize:D,pivotIndices:re}=rr(E,M,N);_e(D!=null,`Panel size not found for panel "${M.id}"`);const Ne=gr(E,M)===E.length-1?D-A:A-D,ee=Lr({delta:Ne,initialLayout:N,panelConstraints:V,pivotIndices:re,prevLayout:N,trigger:"imperative-api"});Qr(N,ee)||(g(ee),P.current.layout=ee,O&&O(ee),mr(E,ee,T.current))},[]),ye=i.useCallback((M,A)=>{const{layout:O,panelDataArray:N}=P.current,{collapsedSize:E=0,collapsible:V}=A,{collapsedSize:D=0,collapsible:re,maxSize:ne=100,minSize:Ne=0}=M.constraints,{panelSize:ee}=rr(N,M,O);ee!=null&&(V&&re&&Dt(ee,E)?Dt(E,D)||Y(M,D):ee<Ne?Y(M,Ne):ee>ne&&Y(M,ne))},[Y]),ue=i.useCallback((M,A)=>{const{direction:O}=z.current,{layout:N}=P.current;if(!x.current)return;const E=Sn(M,x.current);_e(E,`Drag handle element not found for id "${M}"`);const V=ei(O,A);b({dragHandleId:M,dragHandleRect:E.getBoundingClientRect(),initialCursorPosition:V,initialLayout:N})},[]),Le=i.useCallback(()=>{b(null)},[]),X=i.useCallback(M=>{const{panelDataArray:A}=P.current,O=gr(A,M);O>=0&&(A.splice(O,1),delete T.current[M.id],P.current.panelDataArrayChanged=!0,w())},[w]),$=i.useMemo(()=>({collapsePanel:I,direction:a,dragState:v,expandPanel:R,getPanelSize:K,getPanelStyle:Z,groupId:m,isPanelCollapsed:F,isPanelExpanded:ie,reevaluatePanelConstraints:ye,registerPanel:q,registerResizeHandle:_,resizePanel:Y,startDragging:ue,stopDragging:Le,unregisterPanel:X,panelGroupElement:x.current}),[I,v,a,R,K,Z,m,F,ie,ye,q,_,Y,ue,Le,X]),G={display:"flex",flexDirection:a==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return i.createElement(yn.Provider,{value:$},i.createElement(p,{...f,children:r,className:n,id:s,ref:x,style:{...G,...h},[nt.group]:"",[nt.groupDirection]:a,[nt.groupId]:m}))}const si=i.forwardRef((t,r)=>i.createElement(ai,{...t,forwardedRef:r}));ai.displayName="PanelGroup";si.displayName="forwardRef(PanelGroup)";function gr(t,r){return t.findIndex(n=>n===r||n.id===r.id)}function rr(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 cu({disabled:t,handleId:r,resizeHandler:n,panelGroupElement:a}){i.useEffect(()=>{if(t||n==null||a==null)return;const o=Sn(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(nt.groupId);_e(d,`No group element found for id "${d}"`);const c=_r(d,a),h=Yl(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 oi({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(yn);if(T===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:C,registerResizeHandle:z,startDragging:P,stopDragging:I,panelGroupElement:R}=T,K=Ha(o),[Z,F]=i.useState("inactive"),[ie,q]=i.useState(!1),[_,Y]=i.useState(null),ye=i.useRef({state:Z});or(()=>{ye.current.state=Z}),i.useEffect(()=>{if(n)Y(null);else{const $=z(K);Y(()=>$)}},[n,K,z]);const ue=(b=a==null?void 0:a.coarse)!==null&&b!==void 0?b:15,Le=(k=a==null?void 0:a.fine)!==null&&k!==void 0?k:5;i.useEffect(()=>{if(n||_==null)return;const $=g.current;_e($,"Element ref not attached");let G=!1;return Kh(K,$,y,{coarse:ue,fine:Le},(A,O,N)=>{if(!O){F("inactive");return}switch(A){case"down":{F("drag"),G=!1,_e(N,'Expected event to be defined for "down" action'),P(K,N);const{onDragging:E,onPointerDown:V}=w.current;E==null||E(!0),V==null||V();break}case"move":{const{state:E}=ye.current;G=!0,E!=="drag"&&F("hover"),_e(N,'Expected event to be defined for "move" action'),_(N);break}case"up":{F("hover"),I();const{onClick:E,onDragging:V,onPointerUp:D}=w.current;V==null||V(!1),D==null||D(),G||E==null||E();break}}})},[ue,y,n,Le,z,K,_,P,I]),cu({disabled:n,handleId:K,resizeHandler:_,panelGroupElement:R});const X={touchAction:"none",userSelect:"none"};return i.createElement(x,{...v,children:t,className:r,id:o,onBlur:()=>{q(!1),s==null||s()},onFocus:()=>{q(!0),c==null||c()},ref:g,role:"separator",style:{...X,...f},tabIndex:m,[nt.groupDirection]:y,[nt.groupId]:C,[nt.resizeHandle]:"",[nt.resizeHandleActive]:Z==="drag"?"pointer":ie?"keyboard":void 0,[nt.resizeHandleEnabled]:!n,[nt.resizeHandleId]:K,[nt.resizeHandleState]:Z})}oi.displayName="PanelResizeHandle";var ta="chemistry.molecule3d",hu={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:ta,title:"3D Molecule",fileExtensions:["xyz","extxyz","cif","pdb"]}],timelineRenderers:[ta],threadPanels:[{id:"xyz-viewer",label:"Molecules",artifactTypes:[ta]}],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"}}},uu=["xyz","extxyz","cif","pdb"];new Set(uu);var mu="remote-codex.terminal",pu={id:mu,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 fu=["xyz","extxyz","cif","pdb"];new Set(fu);function gu(t){const r=t==null?void 0:t.trim().toLowerCase();return!r||r==="extxyz"?"xyz":r}function xu(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 ho(t,r){return r!=="xyz"?t:t.flatMap(n=>xu(n))}function uo(t){return t.map(r=>`${r.replace(/\s+$/g,"")}
|
|
8
|
+
`).join("")}function bu(t){if(!t)return{format:"xyz",frames:[],exportContent:""};if(typeof t=="string"){const a=ho([t],"xyz");return{frames:a,format:"xyz",exportContent:uo(a)}}const r=gu(t.format),n=t.content.filter(a=>a.trim().length>0);return{frames:ho(n,r),format:r,exportContent:uo(n)}}let ra=null;async function vu(){if(typeof window>"u")throw new Error("3Dmol is only available in a browser environment.");return window["3Dmol"]?window["3Dmol"]:(ra||(ra=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)})),ra)}function ku(){try{const t=document.createElement("canvas");return!!(t.getContext("webgl2")||t.getContext("webgl")||t.getContext("experimental-webgl"))}catch{return!1}}function mo(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 wu(t){return(t==null?void 0:t.trim().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""))||"molecule"}function li({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),[P,I]=i.useState(null),[R,K]=i.useState(!1),[Z,F]=i.useState(!1),ie=i.useMemo(()=>bu(t),[t]),q=ie.frames,_=q[x]??"",Y=wu(r),ye=q.length>0&&x===q.length-1;i.useEffect(()=>{if(q.length===0){v(0);return}v(q.length-1)},[q.length]),i.useEffect(()=>{if(!b||q.length<=1)return;const $=window.setInterval(()=>{v(G=>G>=q.length-1?(window.clearInterval($),k(!1),G):G+1)},200);return()=>window.clearInterval($)},[q.length,b]),i.useEffect(()=>{const $=l.current;if(!$||d.current)return;let G=!1;if(!ku()){m("WebGL is unavailable in this browser environment. Unable to render the 3D viewer.");return}const M=()=>{var A,O;(A=d.current)==null||A.resize(),(O=d.current)==null||O.render()};return vu().then(A=>{if(!(G||d.current))try{const O=A.createViewer($,{});d.current=O,O.setBackgroundColor("#fbfbfb",1),window.addEventListener("resize",M),window.setTimeout(M,100)}catch(O){console.error("Failed to initialize 3Dmol viewer:",O),m("Failed to initialize the 3D molecule viewer.")}}).catch(A=>{console.error("Failed to load 3Dmol viewer runtime:",A),m("Failed to load the 3D molecule viewer runtime.")}),()=>{G=!0,window.removeEventListener("resize",M),d.current=null,c.current=null}},[]),i.useEffect(()=>{const $=d.current;if(!(!$||!_))try{$.removeAllModels(),$.removeAllShapes(),$.removeAllLabels();const G=$.addModel(_,ie.format);c.current=G,G.setStyle({},{stick:{radius:.2},sphere:{scale:.3}});const M=G.getCrystData(),A=!!(M&&typeof M=="object"&&Object.keys(M).length>0);F(A),K(A?p.current:!1);const O=_.split(`
|
|
9
|
+
`).slice(2).map(N=>N.trim()).filter(Boolean).map(N=>N.split(/\s+/)[0]??"Atom");y(O),w([]),h.current||($.zoomTo(),h.current=!0),G.setClickable({},!0,(N,E,V)=>{const D=N.serial??N.index;D!==void 0&&w(re=>!(V!=null&&V.shiftKey||V!=null&&V.metaKey||V!=null&&V.ctrlKey)?re.length===1&&re[0]===D?[]:[D]:re.includes(D)?re.filter(Ne=>Ne!==D):[...re,D])}),G.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(G){console.error("Failed to render molecule:",G),m("Unable to render this molecular structure.")}},[_,ie.format]),i.useEffect(()=>{const $=d.current,G=c.current;if(!(!$||!G)){try{$.removeUnitCell(G)}catch{}if(R&&Z)try{$.addUnitCell(G,{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{F(!1),K(!1)}$.render()}},[Z,R,_]),i.useEffect(()=>{const $=d.current,G=c.current;!$||!G||!_||(G.setStyle({},{stick:{radius:.2},sphere:{scale:.3}}),g.length>0&&G.setStyle({serial:g},{stick:{radius:.3,color:"yellow"},sphere:{scale:.4,color:"yellow"}}),$.render(),s==null||s({moleculeId:r,atoms:g}))},[_,r,s,g]),i.useEffect(()=>{if(!_)return;let $=0;const G=()=>{var A,O;const M=(O=(A=d.current)==null?void 0:A.getView)==null?void 0:O.call(A);if(Array.isArray(M)&&M.length>=8){const[N,E,V,D,re,ne,Ne,ee]=M;typeof N=="number"&&typeof E=="number"&&typeof V=="number"&&typeof D=="number"&&typeof re=="number"&&typeof ne=="number"&&typeof Ne=="number"&&typeof ee=="number"&&I({x:N,y:E,z:V,zoom:D,qx:re,qy:ne,qz:Ne,qw:ee})}$=window.requestAnimationFrame(G)};return $=window.requestAnimationFrame(G),()=>window.cancelAnimationFrame($)},[_]);const ue=i.useCallback(async()=>{_&&await navigator.clipboard.writeText(_)},[_]),Le=i.useCallback(async()=>{const $=d.current;if(!($!=null&&$.pngURI))return;$.render();const G=$.pngURI();if(G){try{const A=await(await fetch(G)).blob(),O={[A.type||"image/png"]:A},N=new ClipboardItem(O);await navigator.clipboard.write([N])}catch{}o==null||o({moleculeId:r,image:G})}},[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:[ie.format.toUpperCase()," structure preview"]})]}),e.jsx("span",{children:q.length>1?`${q.length} frames`:"single frame"})]}),e.jsxs("div",{className:"xyz-viewer-plugin__toolbar","aria-label":"Molecule controls",children:[e.jsx("button",{type:"button",onClick:ue,disabled:!_,title:"Copy current frame",children:e.jsx(Dr,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>mo(_,`${Y}_frame_${x+1}.${ie.format}`),disabled:!_,title:"Download current frame",children:e.jsx(dn,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>mo(ie.exportContent,`${Y}_trajectory.${ie.format}`),disabled:!ie.exportContent,title:"Download all frames",children:e.jsx(Aa,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:Le,disabled:!_,title:"Capture screenshot",children:e.jsx(ol,{"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:!_,title:"Zoom in",children:e.jsx(ll,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>{var $;return($=d.current)==null?void 0:$.zoom(.8)},disabled:!_,title:"Zoom out",children:e.jsx(il,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:X,disabled:!_,title:"Reset camera",children:e.jsx(dl,{"aria-hidden":"true"})}),e.jsx("button",{type:"button",onClick:()=>K($=>{const G=!$;return p.current=G,G}),disabled:!Z,title:R?"Hide unit cell":"Show unit cell",children:e.jsx(cl,{"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&&!_&&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]})]})]}),q.length>1&&e.jsxs("div",{className:"xyz-viewer-plugin__timeline",children:[e.jsx("button",{type:"button",onClick:()=>{k($=>{const G=!$;return G&&x===q.length-1&&v(0),G})},title:b?"Pause trajectory":"Play trajectory",children:b&&x!==q.length-1?e.jsx(hl,{"aria-hidden":"true"}):e.jsx(ul,{"aria-hidden":"true"})}),e.jsx("input",{type:"range",min:0,max:q.length-1,step:1,value:x,onChange:$=>v(Number($.currentTarget.value)),"aria-label":"Trajectory frame"}),e.jsx("button",{type:"button",className:ye?"is-live":"",onClick:()=>v(q.length-1),children:"Live"}),e.jsxs("span",{children:[x+1," / ",q.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"]}),P&&e.jsxs("span",{children:["Camera x=",P.x.toFixed(1)," y=",P.y.toFixed(1)," z=",P.z.toFixed(1)]})]})]})}function na(t){return typeof t=="string"&&t.trim()!==""&&Number.isFinite(Number(t))}function yu(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]??"")&&na(s[1])&&na(s[2])&&na(s[3])})}function ju(t){return t.split(/\r?\n/).some(r=>/^(ATOM|HETATM)\s+/i.test(r))}function Nu(t){return/\bdata_[^\s]*/i.test(t)&&/_atom_site\./i.test(t)}function Cu(t,r){switch(r){case"xyz":case"extxyz":return yu(t);case"pdb":return ju(t);case"cif":return Nu(t);default:return!1}}function Su(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))}Su(`.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-meta-row[aria-expanded=true] {
|
|
274
|
+
color: var(--theme-fg);
|
|
275
|
+
}
|
|
276
|
+
.thread-ui-shell .thread-topbar-details-trigger {
|
|
277
|
+
border-color: var(--theme-border);
|
|
278
|
+
background: var(--theme-surface);
|
|
279
|
+
color: var(--theme-fg-soft);
|
|
280
|
+
}
|
|
281
|
+
.thread-ui-shell .thread-topbar-details-trigger:hover,
|
|
282
|
+
.thread-ui-shell .thread-topbar-details-trigger[aria-expanded=true] {
|
|
283
|
+
border-color: var(--theme-border-strong);
|
|
284
|
+
background: var(--theme-hover);
|
|
285
|
+
color: var(--theme-fg);
|
|
286
|
+
}
|
|
287
|
+
.thread-ui-shell .thread-topbar-details-popover {
|
|
288
|
+
border-color: var(--theme-border);
|
|
289
|
+
background: var(--theme-panel);
|
|
290
|
+
color: var(--theme-fg);
|
|
291
|
+
box-shadow: var(--theme-shadow);
|
|
292
|
+
}
|
|
293
|
+
.thread-ui-shell .thread-topbar-meta-row .font-mono {
|
|
294
|
+
color: var(--theme-fg-soft);
|
|
295
|
+
}
|
|
296
|
+
.thread-ui-shell button.thread-topbar-meta-row:hover .font-mono {
|
|
297
|
+
color: var(--theme-fg);
|
|
298
|
+
}
|
|
299
|
+
.thread-ui-shell .thread-graph-topbar-actions {
|
|
300
|
+
border-color: var(--theme-border);
|
|
301
|
+
background: var(--theme-surface);
|
|
302
|
+
}
|
|
303
|
+
.thread-ui-shell .thread-graph-topbar-actions > * {
|
|
304
|
+
display: inline-flex;
|
|
305
|
+
align-items: center;
|
|
306
|
+
gap: 0.25rem;
|
|
307
|
+
}
|
|
308
|
+
.thread-ui-shell .thread-graph-topbar-actions button,
|
|
309
|
+
.thread-ui-shell .thread-graph-topbar-actions a {
|
|
310
|
+
min-width: 2rem;
|
|
311
|
+
height: 2rem;
|
|
312
|
+
border-radius: 0.375rem;
|
|
313
|
+
border-color: transparent;
|
|
314
|
+
background: transparent;
|
|
315
|
+
color: var(--theme-fg-soft);
|
|
316
|
+
box-shadow: none;
|
|
317
|
+
}
|
|
318
|
+
.thread-ui-shell .thread-graph-topbar-actions button:hover,
|
|
319
|
+
.thread-ui-shell .thread-graph-topbar-actions a:hover {
|
|
320
|
+
background: var(--theme-hover);
|
|
321
|
+
color: var(--theme-fg);
|
|
322
|
+
}
|
|
323
|
+
.thread-ui-shell .thread-graph-topbar-actions button:disabled,
|
|
324
|
+
.thread-ui-shell .thread-graph-topbar-actions a[aria-disabled=true] {
|
|
325
|
+
cursor: not-allowed;
|
|
326
|
+
opacity: 0.5;
|
|
327
|
+
}
|
|
328
|
+
.thread-ui-shell .thread-graph-dialog,
|
|
329
|
+
.thread-graph-dialog {
|
|
330
|
+
border-color: var(--theme-border);
|
|
331
|
+
color: var(--theme-fg);
|
|
332
|
+
}
|
|
333
|
+
.thread-ui-shell .thread-graph-settings-dialog,
|
|
334
|
+
.thread-graph-settings-dialog,
|
|
335
|
+
.thread-graph-create-thread-dialog {
|
|
336
|
+
border-color: var(--theme-border);
|
|
337
|
+
background: var(--theme-panel);
|
|
338
|
+
color: var(--theme-fg);
|
|
339
|
+
}
|
|
340
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-description],
|
|
341
|
+
.thread-graph-settings-dialog [data-slot=dialog-description],
|
|
342
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-description] {
|
|
343
|
+
color: var(--theme-fg-muted);
|
|
344
|
+
}
|
|
345
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-close],
|
|
346
|
+
.thread-graph-settings-dialog [data-slot=dialog-close],
|
|
347
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-close] {
|
|
348
|
+
color: var(--theme-fg-muted);
|
|
349
|
+
}
|
|
350
|
+
.thread-ui-shell .thread-graph-settings-dialog [data-slot=dialog-close]:hover,
|
|
351
|
+
.thread-graph-settings-dialog [data-slot=dialog-close]:hover,
|
|
352
|
+
.thread-graph-create-thread-dialog [data-slot=dialog-close]:hover {
|
|
353
|
+
color: var(--theme-fg);
|
|
354
|
+
}
|
|
355
|
+
.thread-ui-shell .thread-graph-settings-card,
|
|
356
|
+
.thread-ui-shell .thread-graph-theme-mode-group,
|
|
357
|
+
.thread-ui-shell .thread-graph-settings-tabs,
|
|
358
|
+
.thread-graph-settings-dialog .thread-graph-settings-card,
|
|
359
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-group,
|
|
360
|
+
.thread-graph-settings-dialog .thread-graph-settings-tabs {
|
|
361
|
+
border-color: var(--theme-border);
|
|
362
|
+
background: var(--theme-surface);
|
|
363
|
+
}
|
|
364
|
+
.thread-ui-shell .thread-graph-theme-mode-button,
|
|
365
|
+
.thread-ui-shell .thread-graph-settings-tab-button,
|
|
366
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button,
|
|
367
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button {
|
|
368
|
+
color: var(--theme-fg-muted);
|
|
369
|
+
}
|
|
370
|
+
.thread-ui-shell .thread-graph-theme-mode-button:hover:not(:disabled),
|
|
371
|
+
.thread-ui-shell .thread-graph-settings-tab-button:hover:not(:disabled),
|
|
372
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button:hover:not(:disabled),
|
|
373
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button:hover:not(:disabled) {
|
|
374
|
+
background: var(--theme-hover);
|
|
375
|
+
color: var(--theme-fg);
|
|
376
|
+
}
|
|
377
|
+
.thread-ui-shell .thread-graph-theme-mode-button.is-selected,
|
|
378
|
+
.thread-ui-shell .thread-graph-settings-tab-button.is-active,
|
|
379
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button.is-selected,
|
|
380
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button.is-active {
|
|
381
|
+
background: var(--theme-accent-solid);
|
|
382
|
+
color: var(--theme-accent-solid-fg);
|
|
383
|
+
box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
|
|
384
|
+
}
|
|
385
|
+
.thread-ui-shell .thread-graph-theme-mode-button:disabled,
|
|
386
|
+
.thread-ui-shell .thread-graph-settings-tab-button:disabled,
|
|
387
|
+
.thread-graph-settings-dialog .thread-graph-theme-mode-button:disabled,
|
|
388
|
+
.thread-graph-settings-dialog .thread-graph-settings-tab-button:disabled {
|
|
389
|
+
cursor: not-allowed;
|
|
390
|
+
opacity: 0.55;
|
|
391
|
+
}
|
|
392
|
+
.thread-graph-settings-dialog .thread-graph-settings-body {
|
|
393
|
+
max-height: min(62vh, 42rem);
|
|
394
|
+
color: var(--theme-fg);
|
|
395
|
+
}
|
|
396
|
+
.thread-graph-settings-dialog .thread-graph-settings-global-content {
|
|
397
|
+
color: var(--theme-fg);
|
|
398
|
+
}
|
|
399
|
+
.thread-graph-settings-dialog .thread-graph-settings-body dt,
|
|
400
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-500,
|
|
401
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-500,
|
|
402
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-400,
|
|
403
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-400 {
|
|
404
|
+
color: var(--theme-fg-muted) !important;
|
|
405
|
+
}
|
|
406
|
+
.thread-graph-settings-dialog .thread-graph-settings-body dd,
|
|
407
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-100,
|
|
408
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-200,
|
|
409
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-stone-300,
|
|
410
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-100,
|
|
411
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-200,
|
|
412
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .text-slate-300 {
|
|
413
|
+
color: var(--theme-fg) !important;
|
|
414
|
+
}
|
|
415
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-stone-950,
|
|
416
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-stone-900,
|
|
417
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-slate-950,
|
|
418
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .bg-slate-900 {
|
|
419
|
+
background: var(--theme-surface-strong) !important;
|
|
420
|
+
}
|
|
421
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-stone-800,
|
|
422
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-stone-700,
|
|
423
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-slate-800,
|
|
424
|
+
.thread-graph-settings-dialog .thread-graph-settings-body .border-slate-700 {
|
|
425
|
+
border-color: var(--theme-border) !important;
|
|
426
|
+
}
|
|
427
|
+
.thread-graph-create-thread-input {
|
|
428
|
+
border-color: var(--theme-border);
|
|
429
|
+
background: var(--theme-surface);
|
|
430
|
+
color: var(--theme-fg);
|
|
431
|
+
}
|
|
432
|
+
.thread-graph-create-thread-input::placeholder {
|
|
433
|
+
color: var(--theme-fg-muted);
|
|
434
|
+
}
|
|
435
|
+
.thread-graph-create-thread-input:focus {
|
|
436
|
+
border-color: var(--theme-border-contrast);
|
|
437
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-border-contrast) 18%, transparent);
|
|
438
|
+
}
|
|
439
|
+
.thread-graph-create-thread-submit {
|
|
440
|
+
background: var(--theme-accent-solid);
|
|
441
|
+
color: var(--theme-accent-solid-fg);
|
|
442
|
+
}
|
|
443
|
+
.thread-graph-create-thread-submit:hover:not(:disabled) {
|
|
444
|
+
background: var(--theme-accent-solid-hover);
|
|
445
|
+
}
|
|
446
|
+
.thread-ui-shell .ui-action-danger {
|
|
447
|
+
border: 1px solid color-mix(in oklch, rgb(244 63 94) 48%, var(--theme-border));
|
|
448
|
+
background: color-mix(in oklch, rgb(244 63 94) 18%, var(--theme-panel));
|
|
449
|
+
color: color-mix(in oklch, rgb(254 226 226) 86%, var(--theme-fg));
|
|
450
|
+
}
|
|
451
|
+
.thread-ui-shell .ui-action-danger:hover {
|
|
452
|
+
background: color-mix(in oklch, rgb(244 63 94) 26%, var(--theme-panel));
|
|
453
|
+
color: rgb(254 226 226);
|
|
454
|
+
}
|
|
455
|
+
.thread-ui-shell .thread-mobile-segment {
|
|
456
|
+
background: var(--theme-surface-strong);
|
|
457
|
+
color: var(--theme-fg-soft);
|
|
458
|
+
}
|
|
459
|
+
.thread-ui-shell .thread-mobile-segment:hover {
|
|
460
|
+
background: var(--theme-hover);
|
|
461
|
+
color: var(--theme-fg);
|
|
462
|
+
}
|
|
463
|
+
.thread-ui-shell .thread-mobile-segment.is-active {
|
|
464
|
+
background: var(--theme-accent-solid);
|
|
465
|
+
color: var(--theme-accent-solid-fg);
|
|
466
|
+
}
|
|
467
|
+
.thread-ui-shell .thread-sidebar-card {
|
|
468
|
+
border-color: transparent;
|
|
469
|
+
background: var(--theme-surface-strong);
|
|
470
|
+
color: var(--theme-fg-soft);
|
|
471
|
+
}
|
|
472
|
+
.thread-ui-shell .thread-graph-room-card {
|
|
473
|
+
border-color: rgb(226 232 240 / 0.9);
|
|
474
|
+
background: rgb(248 250 252);
|
|
475
|
+
color: rgb(51 65 85);
|
|
476
|
+
}
|
|
477
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card {
|
|
478
|
+
border-color: rgb(226 232 240 / 0.9);
|
|
479
|
+
background: rgb(248 250 252);
|
|
480
|
+
color: rgb(51 65 85);
|
|
481
|
+
}
|
|
482
|
+
.thread-ui-shell .thread-sidebar-card:hover {
|
|
483
|
+
border-color: var(--theme-border);
|
|
484
|
+
background: var(--theme-panel);
|
|
485
|
+
color: var(--theme-fg);
|
|
486
|
+
}
|
|
487
|
+
.thread-ui-shell .thread-graph-room-card:hover {
|
|
488
|
+
border-color: rgb(203 213 225);
|
|
489
|
+
background: rgb(255 255 255);
|
|
490
|
+
color: rgb(15 23 42);
|
|
491
|
+
}
|
|
492
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card:hover {
|
|
493
|
+
border-color: rgb(203 213 225);
|
|
494
|
+
background: rgb(255 255 255);
|
|
495
|
+
color: rgb(15 23 42);
|
|
496
|
+
}
|
|
497
|
+
.thread-ui-shell .thread-sidebar-card-active {
|
|
498
|
+
border-color: var(--theme-accent-solid);
|
|
499
|
+
background: var(--theme-accent-solid);
|
|
500
|
+
color: var(--theme-accent-solid-fg);
|
|
501
|
+
box-shadow: 0 12px 30px oklch(0.22 0.024 255 / 0.18);
|
|
502
|
+
}
|
|
503
|
+
.thread-ui-shell .thread-graph-room-card.is-active {
|
|
504
|
+
border-color: rgb(203 213 225);
|
|
505
|
+
background: rgb(241 245 249);
|
|
506
|
+
color: rgb(15 23 42);
|
|
507
|
+
box-shadow: 0 8px 22px rgb(15 23 42 / 0.06);
|
|
508
|
+
}
|
|
509
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card.is-active {
|
|
510
|
+
border-color: rgb(203 213 225);
|
|
511
|
+
background: rgb(241 245 249);
|
|
512
|
+
color: rgb(15 23 42);
|
|
513
|
+
box-shadow: 0 8px 22px rgb(15 23 42 / 0.06);
|
|
514
|
+
}
|
|
515
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card.is-active,
|
|
516
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card.is-active,
|
|
517
|
+
.thread-ui-shell.dark .thread-graph-room-card.is-active {
|
|
518
|
+
border-color: #3c4556;
|
|
519
|
+
background: #262c38;
|
|
520
|
+
color: rgb(241 245 249);
|
|
521
|
+
box-shadow: 0 10px 24px rgb(0 0 0 / 0.18);
|
|
522
|
+
}
|
|
523
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card,
|
|
524
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card,
|
|
525
|
+
.thread-ui-shell.dark .thread-graph-room-card {
|
|
526
|
+
border-color: transparent;
|
|
527
|
+
background: #1d222c;
|
|
528
|
+
color: rgb(203 213 225);
|
|
529
|
+
}
|
|
530
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card:hover,
|
|
531
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card:hover,
|
|
532
|
+
.thread-ui-shell.dark .thread-graph-room-card:hover {
|
|
533
|
+
border-color: #343b48;
|
|
534
|
+
background: #222733;
|
|
535
|
+
color: rgb(241 245 249);
|
|
536
|
+
}
|
|
537
|
+
.thread-ui-shell .thread-sidebar-card-icon {
|
|
538
|
+
background: var(--theme-panel);
|
|
539
|
+
color: var(--theme-fg-muted);
|
|
540
|
+
}
|
|
541
|
+
.thread-ui-shell .thread-graph-room-card-icon {
|
|
542
|
+
background: rgb(255 255 255);
|
|
543
|
+
color: rgb(100 116 139);
|
|
544
|
+
}
|
|
545
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card-icon {
|
|
546
|
+
background: rgb(255 255 255);
|
|
547
|
+
color: rgb(100 116 139);
|
|
548
|
+
}
|
|
549
|
+
.thread-ui-shell .thread-sidebar-card-icon.is-active {
|
|
550
|
+
background: color-mix(in oklch, var(--theme-accent-solid-fg) 16%, transparent);
|
|
551
|
+
color: var(--theme-accent-solid-fg);
|
|
552
|
+
}
|
|
553
|
+
.thread-ui-shell .thread-graph-room-card-icon.is-active {
|
|
554
|
+
background: rgb(226 232 240);
|
|
555
|
+
color: rgb(15 23 42);
|
|
556
|
+
}
|
|
557
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-room-card-icon.is-active {
|
|
558
|
+
background: rgb(226 232 240);
|
|
559
|
+
color: rgb(15 23 42);
|
|
560
|
+
}
|
|
561
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card-icon.is-active,
|
|
562
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card-icon.is-active,
|
|
563
|
+
.thread-ui-shell.dark .thread-graph-room-card-icon.is-active {
|
|
564
|
+
background: #12151c;
|
|
565
|
+
color: rgb(226 232 240);
|
|
566
|
+
}
|
|
567
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card-icon,
|
|
568
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card-icon,
|
|
569
|
+
.thread-ui-shell.dark .thread-graph-room-card-icon {
|
|
570
|
+
background: #12151c;
|
|
571
|
+
color: rgb(148 163 184);
|
|
572
|
+
}
|
|
573
|
+
.thread-ui-shell .thread-sidebar-card-active .thread-sidebar-card-title,
|
|
574
|
+
.thread-ui-shell .thread-sidebar-card-active p,
|
|
575
|
+
.thread-ui-shell .thread-sidebar-card-active span,
|
|
576
|
+
.thread-ui-shell .thread-sidebar-card-active button,
|
|
577
|
+
.thread-ui-shell .thread-graph-room-card.is-active .thread-graph-room-card-title,
|
|
578
|
+
.thread-ui-shell .thread-graph-room-card.is-active p,
|
|
579
|
+
.thread-ui-shell .thread-graph-room-card.is-active button {
|
|
580
|
+
color: inherit;
|
|
581
|
+
}
|
|
582
|
+
.thread-ui-shell .thread-card-quiet-button {
|
|
583
|
+
color: var(--theme-fg-muted);
|
|
584
|
+
}
|
|
585
|
+
.thread-ui-shell .thread-card-quiet-button:hover {
|
|
586
|
+
background: color-mix(in oklch, var(--theme-hover) 80%, transparent);
|
|
587
|
+
color: var(--theme-fg);
|
|
588
|
+
}
|
|
589
|
+
.thread-ui-shell .thread-card-session-copy-button {
|
|
590
|
+
opacity: 0;
|
|
591
|
+
}
|
|
592
|
+
.thread-ui-shell .thread-graph-room-card:hover .thread-card-session-copy-button,
|
|
593
|
+
.thread-ui-shell .thread-card-session-copy-button:focus-visible,
|
|
594
|
+
.thread-ui-shell .thread-card-session-copy-button:active {
|
|
595
|
+
opacity: 1;
|
|
596
|
+
}
|
|
597
|
+
.thread-ui-shell .thread-card-danger-button {
|
|
598
|
+
color: oklch(0.62 0.16 25);
|
|
599
|
+
}
|
|
600
|
+
.thread-ui-shell .thread-card-danger-button:hover {
|
|
601
|
+
background: rgb(254 226 226);
|
|
602
|
+
}
|
|
603
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-card-danger-button:hover,
|
|
604
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-card-danger-button:hover,
|
|
605
|
+
.thread-ui-shell.dark .thread-card-danger-button:hover {
|
|
606
|
+
background: rgb(127 29 29 / 0.32);
|
|
607
|
+
}
|
|
608
|
+
.thread-ui-shell .thread-new-thread-button,
|
|
609
|
+
.thread-ui-shell .thread-graph-new-room-button {
|
|
610
|
+
min-width: 0;
|
|
611
|
+
}
|
|
612
|
+
.thread-ui-shell .thread-graph-new-room-strip {
|
|
613
|
+
border-color: var(--theme-border);
|
|
614
|
+
}
|
|
615
|
+
.thread-ui-shell .thread-graph-new-room-button {
|
|
616
|
+
background: var(--theme-accent-solid);
|
|
617
|
+
color: var(--theme-accent-solid-fg);
|
|
618
|
+
transition: background-color 160ms ease, transform 160ms ease;
|
|
619
|
+
}
|
|
620
|
+
.thread-ui-shell .thread-graph-new-room-button:hover {
|
|
621
|
+
background: var(--theme-accent-solid-hover);
|
|
622
|
+
transform: translateY(-1px);
|
|
623
|
+
}
|
|
624
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-new-room-button,
|
|
625
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-new-room-button,
|
|
626
|
+
.thread-ui-shell.dark .thread-graph-new-room-button {
|
|
627
|
+
border: 1px solid #343b48;
|
|
628
|
+
background: #222733;
|
|
629
|
+
color: rgb(241 245 249);
|
|
630
|
+
}
|
|
631
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-new-room-button:hover,
|
|
632
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-new-room-button:hover,
|
|
633
|
+
.thread-ui-shell.dark .thread-graph-new-room-button:hover {
|
|
634
|
+
border-color: #465164;
|
|
635
|
+
background: #2b313d;
|
|
636
|
+
}
|
|
637
|
+
.thread-ui-shell .thread-detail-surface {
|
|
638
|
+
border-color: transparent;
|
|
639
|
+
background: var(--theme-surface);
|
|
640
|
+
box-shadow: none;
|
|
641
|
+
}
|
|
642
|
+
.thread-ui-shell .thread-graph-chat-panel {
|
|
643
|
+
background: var(--theme-surface);
|
|
644
|
+
color: var(--theme-fg);
|
|
645
|
+
}
|
|
646
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-chat-panel,
|
|
647
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-chat-panel,
|
|
648
|
+
.thread-ui-shell.dark .thread-graph-chat-panel {
|
|
649
|
+
background: var(--theme-surface);
|
|
650
|
+
color: var(--theme-fg);
|
|
651
|
+
}
|
|
652
|
+
.thread-ui-shell .thread-graph-scroll-container {
|
|
653
|
+
background: var(--theme-surface);
|
|
654
|
+
color: var(--theme-fg);
|
|
655
|
+
scrollbar-color: rgb(203 213 225) transparent;
|
|
656
|
+
}
|
|
657
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-scroll-container,
|
|
658
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-scroll-container,
|
|
659
|
+
.thread-ui-shell.dark .thread-graph-scroll-container {
|
|
660
|
+
background: var(--theme-surface);
|
|
661
|
+
color: var(--theme-fg);
|
|
662
|
+
scrollbar-color: #374151 transparent;
|
|
663
|
+
}
|
|
664
|
+
.thread-ui-shell .thread-graph-scroll-content {
|
|
665
|
+
min-height: 100%;
|
|
666
|
+
padding: 0.75rem 0 max(0rem, var(--thread-graph-chat-scroll-bottom-spacer, 0px));
|
|
667
|
+
}
|
|
668
|
+
.thread-ui-shell .thread-graph-message-list {
|
|
669
|
+
display: flex;
|
|
670
|
+
flex-direction: column;
|
|
671
|
+
gap: 1rem;
|
|
672
|
+
}
|
|
673
|
+
.thread-ui-shell .thread-graph-message-section {
|
|
674
|
+
border-top: 1px solid var(--theme-border);
|
|
675
|
+
}
|
|
676
|
+
.thread-ui-shell .thread-graph-history-control,
|
|
677
|
+
.thread-ui-shell .thread-graph-empty-state {
|
|
678
|
+
color: var(--theme-fg-muted);
|
|
679
|
+
}
|
|
680
|
+
.thread-ui-shell .thread-graph-history-button,
|
|
681
|
+
.thread-ui-shell .thread-graph-turn-index,
|
|
682
|
+
.thread-ui-shell .thread-graph-turn-collapse {
|
|
683
|
+
border-color: var(--theme-border);
|
|
684
|
+
background: var(--theme-panel);
|
|
685
|
+
color: var(--theme-fg-muted);
|
|
686
|
+
}
|
|
687
|
+
.thread-ui-shell .thread-graph-history-button:hover,
|
|
688
|
+
.thread-ui-shell .thread-graph-turn-collapse:hover {
|
|
689
|
+
background: var(--theme-hover);
|
|
690
|
+
color: var(--theme-fg);
|
|
691
|
+
}
|
|
692
|
+
.thread-ui-shell .thread-graph-turn {
|
|
693
|
+
border-radius: 0;
|
|
694
|
+
}
|
|
695
|
+
.thread-ui-shell .thread-graph-turn-header {
|
|
696
|
+
color: var(--theme-fg-muted);
|
|
697
|
+
}
|
|
698
|
+
.thread-ui-shell .thread-graph-turn-time {
|
|
699
|
+
color: var(--theme-fg-muted);
|
|
700
|
+
}
|
|
701
|
+
.thread-ui-shell :where(.text-stone-100, .text-stone-200, .text-stone-300) {
|
|
702
|
+
color: var(--theme-fg) !important;
|
|
703
|
+
}
|
|
704
|
+
.thread-ui-shell :where(.text-stone-400, .text-stone-500, .text-stone-600) {
|
|
705
|
+
color: var(--theme-fg-muted) !important;
|
|
706
|
+
}
|
|
707
|
+
.thread-ui-shell :where(.border-stone-600, .border-stone-700, .border-stone-700\\/90, .border-stone-800, .border-stone-800\\/80) {
|
|
708
|
+
border-color: var(--theme-border) !important;
|
|
709
|
+
}
|
|
710
|
+
.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) {
|
|
711
|
+
background: var(--theme-surface-strong) !important;
|
|
712
|
+
}
|
|
713
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-sky-100, .text-sky-50),
|
|
714
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-sky-100, .text-sky-50) {
|
|
715
|
+
color: rgb(3 105 161);
|
|
716
|
+
}
|
|
717
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-emerald-100, .text-emerald-50),
|
|
718
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-emerald-100, .text-emerald-50) {
|
|
719
|
+
color: rgb(21 128 61);
|
|
720
|
+
}
|
|
721
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-rose-100, .text-rose-50),
|
|
722
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-rose-100, .text-rose-50) {
|
|
723
|
+
color: rgb(190 24 93);
|
|
724
|
+
}
|
|
725
|
+
.thread-ui-shell[data-theme-effective=light] :where(.text-amber-100, .text-amber-50, .text-amber-200),
|
|
726
|
+
:root[data-theme-effective=light] .thread-ui-shell :where(.text-amber-100, .text-amber-50, .text-amber-200) {
|
|
727
|
+
color: rgb(120 53 15);
|
|
728
|
+
}
|
|
729
|
+
.thread-ui-shell[data-theme-effective=light] .text-fuchsia-100,
|
|
730
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-fuchsia-100 {
|
|
731
|
+
color: rgb(162 28 175);
|
|
732
|
+
}
|
|
733
|
+
.thread-ui-shell[data-theme-effective=light] .text-violet-100,
|
|
734
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-violet-100 {
|
|
735
|
+
color: rgb(109 40 217);
|
|
736
|
+
}
|
|
737
|
+
.thread-ui-shell[data-theme-effective=light] .text-lime-100,
|
|
738
|
+
:root[data-theme-effective=light] .thread-ui-shell .text-lime-100 {
|
|
739
|
+
color: rgb(77 124 15);
|
|
740
|
+
}
|
|
741
|
+
.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),
|
|
742
|
+
: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) {
|
|
743
|
+
filter: saturate(0.72) brightness(0.97);
|
|
744
|
+
}
|
|
745
|
+
.thread-ui-shell .thread-token-popover {
|
|
746
|
+
border-color: var(--theme-border);
|
|
747
|
+
background: var(--theme-panel);
|
|
748
|
+
color: var(--theme-fg);
|
|
749
|
+
}
|
|
750
|
+
.thread-ui-shell .thread-token-popover-row {
|
|
751
|
+
border-color: var(--theme-border);
|
|
752
|
+
background: var(--theme-surface);
|
|
753
|
+
}
|
|
754
|
+
.thread-ui-shell .thread-token-popover-text {
|
|
755
|
+
color: var(--theme-fg-soft);
|
|
756
|
+
}
|
|
757
|
+
.thread-ui-shell .thread-token-popover-strong {
|
|
758
|
+
color: var(--theme-fg);
|
|
759
|
+
}
|
|
760
|
+
.thread-ui-shell .token-badge-in {
|
|
761
|
+
border-color: rgb(22 101 52 / 0.32);
|
|
762
|
+
background: rgb(220 252 231 / 0.72);
|
|
763
|
+
color: rgb(20 83 45);
|
|
764
|
+
}
|
|
765
|
+
.thread-ui-shell .token-badge-cache {
|
|
766
|
+
border-color: rgb(3 105 161 / 0.32);
|
|
767
|
+
background: rgb(224 242 254 / 0.76);
|
|
768
|
+
color: rgb(7 89 133);
|
|
769
|
+
}
|
|
770
|
+
.thread-ui-shell .token-badge-out {
|
|
771
|
+
border-color: rgb(109 40 217 / 0.28);
|
|
772
|
+
background: rgb(237 233 254 / 0.76);
|
|
773
|
+
color: rgb(91 33 182);
|
|
774
|
+
}
|
|
775
|
+
.thread-ui-shell .token-badge-reason {
|
|
776
|
+
border-color: rgb(146 64 14 / 0.28);
|
|
777
|
+
background: rgb(254 243 199 / 0.72);
|
|
778
|
+
color: rgb(120 53 15);
|
|
779
|
+
}
|
|
780
|
+
.thread-ui-shell .token-badge-total {
|
|
781
|
+
border-color: rgb(77 124 15 / 0.3);
|
|
782
|
+
background: rgb(236 252 203 / 0.72);
|
|
783
|
+
color: rgb(63 98 18);
|
|
784
|
+
}
|
|
785
|
+
.thread-ui-shell .token-badge-empty {
|
|
786
|
+
border-color: var(--theme-border-strong);
|
|
787
|
+
background: var(--theme-surface);
|
|
788
|
+
color: var(--theme-fg-soft);
|
|
789
|
+
}
|
|
790
|
+
.thread-ui-shell .thread-token-badge-value {
|
|
791
|
+
color: currentColor;
|
|
792
|
+
}
|
|
793
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-token-popover,
|
|
794
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-token-popover,
|
|
795
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-token-popover,
|
|
796
|
+
.thread-ui-shell.dark .thread-token-popover {
|
|
797
|
+
border-color: #303642;
|
|
798
|
+
background: #171a22;
|
|
799
|
+
}
|
|
800
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-token-popover-row,
|
|
801
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-token-popover-row,
|
|
802
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-token-popover-row,
|
|
803
|
+
.thread-ui-shell.dark .thread-token-popover-row {
|
|
804
|
+
border-color: #303642;
|
|
805
|
+
background: #1d222c;
|
|
806
|
+
}
|
|
807
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-in,
|
|
808
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-cache,
|
|
809
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-out,
|
|
810
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-reason,
|
|
811
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-total,
|
|
812
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-in,
|
|
813
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-cache,
|
|
814
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-out,
|
|
815
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-reason,
|
|
816
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-total,
|
|
817
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-in,
|
|
818
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-cache,
|
|
819
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-out,
|
|
820
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-reason,
|
|
821
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-total,
|
|
822
|
+
.thread-ui-shell.dark .token-badge-in,
|
|
823
|
+
.thread-ui-shell.dark .token-badge-cache,
|
|
824
|
+
.thread-ui-shell.dark .token-badge-out,
|
|
825
|
+
.thread-ui-shell.dark .token-badge-reason,
|
|
826
|
+
.thread-ui-shell.dark .token-badge-total {
|
|
827
|
+
background-color: color-mix(in oklch, currentColor 12%, transparent);
|
|
828
|
+
}
|
|
829
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-in,
|
|
830
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-in,
|
|
831
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-in,
|
|
832
|
+
.thread-ui-shell.dark .token-badge-in {
|
|
833
|
+
color: rgb(134 239 172);
|
|
834
|
+
}
|
|
835
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-cache,
|
|
836
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-cache,
|
|
837
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-cache,
|
|
838
|
+
.thread-ui-shell.dark .token-badge-cache {
|
|
839
|
+
color: rgb(125 211 252);
|
|
840
|
+
}
|
|
841
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-out,
|
|
842
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-out,
|
|
843
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-out,
|
|
844
|
+
.thread-ui-shell.dark .token-badge-out {
|
|
845
|
+
color: rgb(196 181 253);
|
|
846
|
+
}
|
|
847
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-reason,
|
|
848
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-reason,
|
|
849
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-reason,
|
|
850
|
+
.thread-ui-shell.dark .token-badge-reason {
|
|
851
|
+
color: rgb(252 211 77);
|
|
852
|
+
}
|
|
853
|
+
.thread-ui-shell[data-theme-effective=dark] .token-badge-total,
|
|
854
|
+
:root[data-theme-effective=dark] .thread-ui-shell .token-badge-total,
|
|
855
|
+
.thread-ui-shell.thread-ui-theme-dark .token-badge-total,
|
|
856
|
+
.thread-ui-shell.dark .token-badge-total {
|
|
857
|
+
color: rgb(190 242 100);
|
|
858
|
+
}
|
|
859
|
+
.thread-ui-shell .thread-graph-event,
|
|
860
|
+
.thread-ui-shell .thread-graph-event-card,
|
|
861
|
+
.thread-ui-shell .thread-graph-history-group,
|
|
862
|
+
.thread-ui-shell .thread-graph-history-group-card {
|
|
863
|
+
border-color: var(--theme-border);
|
|
864
|
+
background: var(--theme-panel);
|
|
865
|
+
color: var(--theme-fg);
|
|
866
|
+
}
|
|
867
|
+
.thread-ui-shell .thread-graph-event-card,
|
|
868
|
+
.thread-ui-shell .thread-graph-history-group-card {
|
|
869
|
+
background: var(--theme-surface);
|
|
870
|
+
}
|
|
871
|
+
.thread-ui-shell .thread-graph-event-line,
|
|
872
|
+
.thread-ui-shell .thread-graph-history-group-toggle {
|
|
873
|
+
color: var(--theme-fg);
|
|
874
|
+
}
|
|
875
|
+
.thread-ui-shell .thread-graph-history-group-list {
|
|
876
|
+
border-color: var(--theme-border);
|
|
877
|
+
}
|
|
878
|
+
.thread-ui-shell .thread-workspace-panel {
|
|
879
|
+
background: var(--theme-panel);
|
|
880
|
+
}
|
|
881
|
+
.thread-ui-shell .thread-workspace-card {
|
|
882
|
+
background: var(--theme-surface);
|
|
883
|
+
}
|
|
884
|
+
.thread-ui-shell .thread-workspace-collapse-tab,
|
|
885
|
+
.thread-ui-shell .thread-workspace-small-toggle,
|
|
886
|
+
.thread-ui-shell .thread-workspace-expand-fab,
|
|
887
|
+
.thread-ui-shell .thread-graph-panel-expand-fab {
|
|
888
|
+
align-items: center;
|
|
889
|
+
justify-content: center;
|
|
890
|
+
width: 2rem;
|
|
891
|
+
height: 2rem;
|
|
892
|
+
border: 1px solid var(--theme-border);
|
|
893
|
+
border-radius: 999px;
|
|
894
|
+
background: color-mix(in oklch, var(--theme-panel) 92%, transparent);
|
|
895
|
+
color: var(--theme-fg-soft);
|
|
896
|
+
box-shadow: 0 10px 26px color-mix(in oklch, var(--theme-bg) 62%, transparent);
|
|
897
|
+
transition:
|
|
898
|
+
background-color 160ms ease,
|
|
899
|
+
border-color 160ms ease,
|
|
900
|
+
color 160ms ease,
|
|
901
|
+
transform 160ms ease,
|
|
902
|
+
box-shadow 160ms ease;
|
|
903
|
+
}
|
|
904
|
+
.thread-ui-shell .thread-workspace-collapse-tab:hover,
|
|
905
|
+
.thread-ui-shell .thread-workspace-small-toggle:hover,
|
|
906
|
+
.thread-ui-shell .thread-workspace-expand-fab:hover,
|
|
907
|
+
.thread-ui-shell .thread-graph-panel-expand-fab:hover {
|
|
908
|
+
border-color: var(--theme-border-strong);
|
|
909
|
+
background: var(--theme-hover);
|
|
910
|
+
color: var(--theme-fg);
|
|
911
|
+
box-shadow: 0 14px 30px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
912
|
+
}
|
|
913
|
+
.thread-ui-shell .thread-workspace-collapse-tab {
|
|
914
|
+
position: absolute;
|
|
915
|
+
left: -1rem;
|
|
916
|
+
top: 50%;
|
|
917
|
+
z-index: 30;
|
|
918
|
+
transform: translateY(-50%);
|
|
919
|
+
}
|
|
920
|
+
.thread-ui-shell .thread-workspace-collapse-tab:hover {
|
|
921
|
+
transform: translateY(-50%) translateX(-1px);
|
|
922
|
+
}
|
|
923
|
+
.thread-ui-shell .thread-workspace-expand-fab {
|
|
924
|
+
position: absolute;
|
|
925
|
+
right: 0.75rem;
|
|
926
|
+
top: 50%;
|
|
927
|
+
z-index: 30;
|
|
928
|
+
transform: translateY(-50%);
|
|
929
|
+
}
|
|
930
|
+
.thread-ui-shell .thread-workspace-expand-fab:hover {
|
|
931
|
+
transform: translateY(-50%) translateX(-1px);
|
|
932
|
+
}
|
|
933
|
+
.thread-ui-shell .thread-chat-usage-footer {
|
|
934
|
+
background: var(--theme-surface);
|
|
935
|
+
color: rgb(148 163 184);
|
|
936
|
+
}
|
|
937
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-chat-usage-footer,
|
|
938
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-chat-usage-footer,
|
|
939
|
+
.thread-ui-shell.dark .thread-chat-usage-footer {
|
|
940
|
+
background: var(--theme-surface);
|
|
941
|
+
color: rgb(100 116 139);
|
|
942
|
+
}
|
|
943
|
+
.thread-ui-shell .thread-graph-composer-host {
|
|
944
|
+
border-top: 1px solid rgb(226 232 240);
|
|
945
|
+
background: var(--theme-surface);
|
|
946
|
+
padding: 0.5rem 0.75rem calc(env(safe-area-inset-bottom) + 0.5rem);
|
|
947
|
+
}
|
|
948
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-host,
|
|
949
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-host,
|
|
950
|
+
.thread-ui-shell.dark .thread-graph-composer-host {
|
|
951
|
+
border-top-color: #2a2f3a;
|
|
952
|
+
background: var(--theme-surface);
|
|
953
|
+
}
|
|
954
|
+
.thread-ui-shell .thread-graph-composer-host > .thread-composer-layer,
|
|
955
|
+
.thread-ui-shell .thread-graph-composer-host > .thread-graph-composer-layer {
|
|
956
|
+
width: 100%;
|
|
957
|
+
}
|
|
958
|
+
.thread-ui-shell .thread-split-chat-pane,
|
|
959
|
+
.thread-ui-shell .thread-split-workspace-pane {
|
|
960
|
+
width: 100%;
|
|
961
|
+
min-height: 0;
|
|
962
|
+
}
|
|
963
|
+
.thread-ui-shell .thread-split-chat-pane {
|
|
964
|
+
min-width: 0;
|
|
965
|
+
}
|
|
966
|
+
.thread-ui-shell .thread-split-region,
|
|
967
|
+
.thread-ui-shell .thread-split-container {
|
|
968
|
+
height: 100%;
|
|
969
|
+
min-height: 0;
|
|
970
|
+
overflow: hidden;
|
|
971
|
+
}
|
|
972
|
+
.thread-ui-shell .thread-graph-shell-desktop-split {
|
|
973
|
+
display: none !important;
|
|
974
|
+
}
|
|
975
|
+
.thread-ui-shell .thread-graph-shell-mobile-split {
|
|
976
|
+
display: block !important;
|
|
977
|
+
}
|
|
978
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split {
|
|
979
|
+
display: flex !important;
|
|
980
|
+
}
|
|
981
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-mobile-split {
|
|
982
|
+
display: none !important;
|
|
983
|
+
}
|
|
984
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
985
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-workspace-pane,
|
|
986
|
+
.thread-ui-shell .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
987
|
+
.thread-ui-shell .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
988
|
+
min-width: 0;
|
|
989
|
+
height: 100%;
|
|
990
|
+
}
|
|
991
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
992
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
993
|
+
flex: 1 1 0;
|
|
994
|
+
min-width: 0;
|
|
995
|
+
width: auto;
|
|
996
|
+
}
|
|
997
|
+
.thread-ui-shell[data-thread-layout=desktop] {
|
|
998
|
+
padding: 0.5rem;
|
|
999
|
+
}
|
|
1000
|
+
.thread-ui-shell[data-thread-layout=desktop].thread-ui-viewport-constrained {
|
|
1001
|
+
height: 100svh;
|
|
1002
|
+
max-height: 100svh;
|
|
1003
|
+
}
|
|
1004
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-frame {
|
|
1005
|
+
display: grid;
|
|
1006
|
+
grid-template-columns: 264px minmax(0, 1fr);
|
|
1007
|
+
gap: 0.5rem;
|
|
1008
|
+
height: 100%;
|
|
1009
|
+
min-height: 0;
|
|
1010
|
+
}
|
|
1011
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-only-flex {
|
|
1012
|
+
display: flex !important;
|
|
1013
|
+
}
|
|
1014
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-only-inline-flex {
|
|
1015
|
+
display: inline-flex !important;
|
|
1016
|
+
}
|
|
1017
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-block,
|
|
1018
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-grid,
|
|
1019
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-only-inline-flex {
|
|
1020
|
+
display: none !important;
|
|
1021
|
+
}
|
|
1022
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-chat-hidden,
|
|
1023
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-workspace-hidden {
|
|
1024
|
+
display: block !important;
|
|
1025
|
+
}
|
|
1026
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-desktop-collapsed-hidden {
|
|
1027
|
+
display: none;
|
|
1028
|
+
}
|
|
1029
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-frame.is-rail-collapsed {
|
|
1030
|
+
grid-template-columns: 56px minmax(0, 1fr);
|
|
1031
|
+
}
|
|
1032
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-rooms-rail {
|
|
1033
|
+
position: static;
|
|
1034
|
+
z-index: auto;
|
|
1035
|
+
width: auto;
|
|
1036
|
+
min-width: 0;
|
|
1037
|
+
height: 100%;
|
|
1038
|
+
transform: none;
|
|
1039
|
+
translate: 0 0;
|
|
1040
|
+
pointer-events: auto;
|
|
1041
|
+
border: 1px solid var(--theme-border);
|
|
1042
|
+
border-radius: 12px;
|
|
1043
|
+
box-shadow: var(--theme-shadow);
|
|
1044
|
+
}
|
|
1045
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-rooms-rail-header {
|
|
1046
|
+
height: 4rem;
|
|
1047
|
+
align-items: center;
|
|
1048
|
+
padding-bottom: 0;
|
|
1049
|
+
}
|
|
1050
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-shell-card {
|
|
1051
|
+
border: 1px solid var(--theme-border);
|
|
1052
|
+
border-radius: 12px;
|
|
1053
|
+
}
|
|
1054
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-topbar-row {
|
|
1055
|
+
min-height: 4rem;
|
|
1056
|
+
padding-left: 1.25rem;
|
|
1057
|
+
padding-right: 1.25rem;
|
|
1058
|
+
}
|
|
1059
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-mobile-view-switch {
|
|
1060
|
+
display: none !important;
|
|
1061
|
+
}
|
|
1062
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-region {
|
|
1063
|
+
padding: 0.5rem;
|
|
1064
|
+
}
|
|
1065
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-container.has-workspace {
|
|
1066
|
+
display: flex;
|
|
1067
|
+
align-items: stretch;
|
|
1068
|
+
min-width: 0;
|
|
1069
|
+
min-height: 0;
|
|
1070
|
+
}
|
|
1071
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-chat-pane {
|
|
1072
|
+
flex: 0 0 var(--thread-chat-percent, 54%);
|
|
1073
|
+
min-width: min(31rem, 100%);
|
|
1074
|
+
width: auto;
|
|
1075
|
+
height: 100%;
|
|
1076
|
+
display: block;
|
|
1077
|
+
}
|
|
1078
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-split-workspace-pane {
|
|
1079
|
+
flex: 0 0 var(--thread-workspace-percent, 46%);
|
|
1080
|
+
min-width: 19rem;
|
|
1081
|
+
width: auto;
|
|
1082
|
+
height: 100%;
|
|
1083
|
+
display: block;
|
|
1084
|
+
}
|
|
1085
|
+
.thread-ui-shell[data-thread-layout=desktop] .thread-resize-handle {
|
|
1086
|
+
display: flex !important;
|
|
1087
|
+
}
|
|
1088
|
+
@media (min-width: 640px) {
|
|
1089
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) {
|
|
1090
|
+
padding: 0.5rem;
|
|
1091
|
+
}
|
|
1092
|
+
.thread-ui-shell:not([data-thread-layout=mobile]).thread-ui-viewport-constrained {
|
|
1093
|
+
height: 100svh;
|
|
1094
|
+
max-height: 100svh;
|
|
1095
|
+
}
|
|
1096
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-frame {
|
|
1097
|
+
display: grid;
|
|
1098
|
+
grid-template-columns: 264px minmax(0, 1fr);
|
|
1099
|
+
gap: 0.5rem;
|
|
1100
|
+
height: 100%;
|
|
1101
|
+
min-height: 0;
|
|
1102
|
+
}
|
|
1103
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-only-flex {
|
|
1104
|
+
display: flex !important;
|
|
1105
|
+
}
|
|
1106
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-only-inline-flex {
|
|
1107
|
+
display: inline-flex !important;
|
|
1108
|
+
}
|
|
1109
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-block,
|
|
1110
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-grid,
|
|
1111
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-only-inline-flex {
|
|
1112
|
+
display: none !important;
|
|
1113
|
+
}
|
|
1114
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-chat-hidden,
|
|
1115
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-workspace-hidden {
|
|
1116
|
+
display: block !important;
|
|
1117
|
+
}
|
|
1118
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-desktop-collapsed-hidden {
|
|
1119
|
+
display: none;
|
|
1120
|
+
}
|
|
1121
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-frame.is-rail-collapsed {
|
|
1122
|
+
grid-template-columns: 56px minmax(0, 1fr);
|
|
1123
|
+
}
|
|
1124
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-rooms-rail {
|
|
1125
|
+
position: static;
|
|
1126
|
+
z-index: auto;
|
|
1127
|
+
width: auto;
|
|
1128
|
+
min-width: 0;
|
|
1129
|
+
height: 100%;
|
|
1130
|
+
transform: none;
|
|
1131
|
+
translate: 0 0;
|
|
1132
|
+
pointer-events: auto;
|
|
1133
|
+
border: 1px solid var(--theme-border);
|
|
1134
|
+
border-radius: 12px;
|
|
1135
|
+
box-shadow: var(--theme-shadow);
|
|
1136
|
+
}
|
|
1137
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-rooms-rail-header {
|
|
1138
|
+
height: 4rem;
|
|
1139
|
+
align-items: center;
|
|
1140
|
+
padding-bottom: 0;
|
|
1141
|
+
}
|
|
1142
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-shell-card {
|
|
1143
|
+
border: 1px solid var(--theme-border);
|
|
1144
|
+
border-radius: 12px;
|
|
1145
|
+
}
|
|
1146
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-topbar-row {
|
|
1147
|
+
min-height: 4rem;
|
|
1148
|
+
padding-left: 1.25rem;
|
|
1149
|
+
padding-right: 1.25rem;
|
|
1150
|
+
}
|
|
1151
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-mobile-view-switch {
|
|
1152
|
+
display: none !important;
|
|
1153
|
+
}
|
|
1154
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-region {
|
|
1155
|
+
padding: 0.5rem;
|
|
1156
|
+
}
|
|
1157
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-container.has-workspace {
|
|
1158
|
+
display: flex;
|
|
1159
|
+
align-items: stretch;
|
|
1160
|
+
min-width: 0;
|
|
1161
|
+
min-height: 0;
|
|
1162
|
+
}
|
|
1163
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-chat-pane {
|
|
1164
|
+
flex: 0 0 var(--thread-chat-percent, 54%);
|
|
1165
|
+
min-width: min(31rem, 100%);
|
|
1166
|
+
width: auto;
|
|
1167
|
+
height: 100%;
|
|
1168
|
+
display: block;
|
|
1169
|
+
}
|
|
1170
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-split-workspace-pane {
|
|
1171
|
+
flex: 0 0 var(--thread-workspace-percent, 46%);
|
|
1172
|
+
min-width: 19rem;
|
|
1173
|
+
width: auto;
|
|
1174
|
+
height: 100%;
|
|
1175
|
+
display: block;
|
|
1176
|
+
}
|
|
1177
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-resize-handle {
|
|
1178
|
+
display: flex !important;
|
|
1179
|
+
}
|
|
1180
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split {
|
|
1181
|
+
display: flex !important;
|
|
1182
|
+
}
|
|
1183
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-mobile-split {
|
|
1184
|
+
display: none !important;
|
|
1185
|
+
}
|
|
1186
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-chat-pane,
|
|
1187
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
1188
|
+
flex: 1 1 0;
|
|
1189
|
+
min-width: 0;
|
|
1190
|
+
width: auto;
|
|
1191
|
+
}
|
|
1192
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-chat-pane {
|
|
1193
|
+
min-width: 0;
|
|
1194
|
+
}
|
|
1195
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-shell-desktop-split .thread-split-workspace-pane {
|
|
1196
|
+
min-width: 0;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
.thread-ui-shell .thread-resize-handle span {
|
|
1200
|
+
background: var(--theme-border);
|
|
1201
|
+
}
|
|
1202
|
+
.thread-ui-shell .thread-resize-handle:hover span,
|
|
1203
|
+
.thread-ui-shell .thread-resize-handle:focus-visible span {
|
|
1204
|
+
background: var(--theme-border-strong);
|
|
1205
|
+
box-shadow: 0 0 0 3px color-mix(in oklch, var(--theme-accent-border) 24%, transparent);
|
|
1206
|
+
}
|
|
1207
|
+
.thread-ui-shell .thread-graph-right-tabs {
|
|
1208
|
+
border-color: var(--theme-border);
|
|
1209
|
+
background: var(--theme-surface);
|
|
1210
|
+
}
|
|
1211
|
+
.thread-ui-shell .thread-graph-right-tab-secondary {
|
|
1212
|
+
border-color: var(--theme-border);
|
|
1213
|
+
}
|
|
1214
|
+
.thread-ui-shell .thread-workspace-tab,
|
|
1215
|
+
.thread-ui-shell .thread-graph-right-tab {
|
|
1216
|
+
color: var(--theme-fg-muted);
|
|
1217
|
+
}
|
|
1218
|
+
.thread-ui-shell .thread-workspace-tab:hover,
|
|
1219
|
+
.thread-ui-shell .thread-graph-right-tab:hover {
|
|
1220
|
+
background: var(--theme-hover);
|
|
1221
|
+
color: var(--theme-fg);
|
|
1222
|
+
}
|
|
1223
|
+
.thread-ui-shell .thread-workspace-tab.is-active,
|
|
1224
|
+
.thread-ui-shell .thread-graph-right-tab.is-active {
|
|
1225
|
+
background: var(--theme-surface-strong);
|
|
1226
|
+
color: var(--theme-fg);
|
|
1227
|
+
}
|
|
1228
|
+
.thread-ui-shell .thread-graph-visualization-panel {
|
|
1229
|
+
background: var(--theme-surface);
|
|
1230
|
+
color: var(--theme-fg);
|
|
1231
|
+
}
|
|
1232
|
+
.thread-ui-shell .thread-graph-flow {
|
|
1233
|
+
overflow: hidden;
|
|
1234
|
+
border: 1px solid var(--theme-border);
|
|
1235
|
+
border-radius: 12px;
|
|
1236
|
+
background: var(--theme-surface);
|
|
1237
|
+
}
|
|
1238
|
+
.thread-ui-shell .thread-graph-flow-node {
|
|
1239
|
+
position: relative;
|
|
1240
|
+
min-width: 8rem;
|
|
1241
|
+
max-width: 12rem;
|
|
1242
|
+
border: 1px solid var(--theme-border-strong);
|
|
1243
|
+
border-radius: 8px;
|
|
1244
|
+
background: var(--theme-panel);
|
|
1245
|
+
padding: 0.85rem 1rem;
|
|
1246
|
+
color: var(--theme-fg);
|
|
1247
|
+
text-align: center;
|
|
1248
|
+
box-shadow: var(--theme-shadow);
|
|
1249
|
+
}
|
|
1250
|
+
.thread-ui-shell .thread-graph-flow .react-flow {
|
|
1251
|
+
background: var(--theme-surface);
|
|
1252
|
+
color: var(--theme-fg);
|
|
1253
|
+
}
|
|
1254
|
+
.thread-ui-shell .thread-graph-flow .react-flow__edge-path {
|
|
1255
|
+
stroke: var(--theme-border-contrast);
|
|
1256
|
+
}
|
|
1257
|
+
.thread-ui-shell .thread-graph-flow .react-flow__background {
|
|
1258
|
+
background: var(--theme-surface);
|
|
1259
|
+
}
|
|
1260
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls {
|
|
1261
|
+
overflow: hidden;
|
|
1262
|
+
border: 1px solid var(--theme-border);
|
|
1263
|
+
border-radius: 8px;
|
|
1264
|
+
box-shadow: var(--theme-shadow);
|
|
1265
|
+
}
|
|
1266
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button {
|
|
1267
|
+
border-bottom-color: var(--theme-border);
|
|
1268
|
+
background: var(--theme-panel);
|
|
1269
|
+
color: var(--theme-fg-soft);
|
|
1270
|
+
}
|
|
1271
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button:hover {
|
|
1272
|
+
background: var(--theme-hover);
|
|
1273
|
+
color: var(--theme-fg);
|
|
1274
|
+
}
|
|
1275
|
+
.thread-ui-shell .thread-graph-flow .react-flow__controls-button svg {
|
|
1276
|
+
fill: currentColor;
|
|
1277
|
+
}
|
|
1278
|
+
.thread-ui-shell .thread-guide-section {
|
|
1279
|
+
color: var(--theme-fg);
|
|
1280
|
+
}
|
|
1281
|
+
.thread-ui-shell .thread-guide-icon,
|
|
1282
|
+
.thread-ui-shell .thread-guide-tag {
|
|
1283
|
+
background: var(--theme-surface-strong);
|
|
1284
|
+
color: var(--theme-fg-muted);
|
|
1285
|
+
}
|
|
1286
|
+
.thread-ui-shell .thread-graph-workspace-mobile-tabs,
|
|
1287
|
+
.thread-ui-shell .thread-graph-workspace-mobile-explorer {
|
|
1288
|
+
border-color: var(--theme-border);
|
|
1289
|
+
background: var(--theme-surface);
|
|
1290
|
+
}
|
|
1291
|
+
.thread-ui-shell .thread-graph-workspace-mobile-stack,
|
|
1292
|
+
.thread-ui-shell .thread-graph-workspace-mobile-viewer {
|
|
1293
|
+
background: var(--theme-surface);
|
|
1294
|
+
color: var(--theme-fg);
|
|
1295
|
+
}
|
|
1296
|
+
.thread-ui-shell .thread-graph-workspace-resizable {
|
|
1297
|
+
height: 100%;
|
|
1298
|
+
min-width: 0;
|
|
1299
|
+
}
|
|
1300
|
+
.thread-ui-shell .thread-graph-workspace-explorer-pane {
|
|
1301
|
+
min-width: 0;
|
|
1302
|
+
}
|
|
1303
|
+
.thread-ui-shell .thread-graph-workspace-viewer-pane {
|
|
1304
|
+
min-width: 0;
|
|
1305
|
+
}
|
|
1306
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle::after {
|
|
1307
|
+
background: var(--theme-border);
|
|
1308
|
+
}
|
|
1309
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle:hover::after,
|
|
1310
|
+
.thread-ui-shell .thread-graph-workspace-resize-handle:focus-visible::after {
|
|
1311
|
+
background: var(--theme-border-contrast);
|
|
1312
|
+
}
|
|
1313
|
+
.thread-ui-shell .thread-graph-explorer,
|
|
1314
|
+
.thread-ui-shell .thread-graph-viewer {
|
|
1315
|
+
border-color: var(--theme-border);
|
|
1316
|
+
background: var(--theme-surface);
|
|
1317
|
+
color: var(--theme-fg);
|
|
1318
|
+
}
|
|
1319
|
+
.thread-ui-shell .thread-graph-explorer-header,
|
|
1320
|
+
.thread-ui-shell .thread-graph-viewer-header {
|
|
1321
|
+
border-color: var(--theme-border);
|
|
1322
|
+
background: var(--theme-surface);
|
|
1323
|
+
color: var(--theme-fg);
|
|
1324
|
+
}
|
|
1325
|
+
.thread-ui-shell .thread-graph-explorer h2,
|
|
1326
|
+
.thread-ui-shell .thread-graph-viewer h2 {
|
|
1327
|
+
color: var(--theme-fg);
|
|
1328
|
+
}
|
|
1329
|
+
.thread-ui-shell .thread-graph-explorer-icon-button,
|
|
1330
|
+
.thread-ui-shell .thread-graph-explorer-collapse-button,
|
|
1331
|
+
.thread-ui-shell .thread-graph-viewer-header button {
|
|
1332
|
+
border-color: var(--theme-border);
|
|
1333
|
+
background: var(--theme-surface-strong);
|
|
1334
|
+
color: var(--theme-fg-soft);
|
|
1335
|
+
}
|
|
1336
|
+
.thread-ui-shell .thread-graph-explorer-icon-button:hover,
|
|
1337
|
+
.thread-ui-shell .thread-graph-explorer-collapse-button:hover,
|
|
1338
|
+
.thread-ui-shell .thread-graph-viewer-header button:hover {
|
|
1339
|
+
border-color: var(--theme-border-strong);
|
|
1340
|
+
background: var(--theme-hover);
|
|
1341
|
+
color: var(--theme-fg);
|
|
1342
|
+
}
|
|
1343
|
+
.thread-ui-shell .thread-graph-panel-expand-fab {
|
|
1344
|
+
position: absolute;
|
|
1345
|
+
top: 50%;
|
|
1346
|
+
z-index: 30;
|
|
1347
|
+
display: inline-flex;
|
|
1348
|
+
transform: translateY(-50%);
|
|
1349
|
+
}
|
|
1350
|
+
.thread-ui-shell .thread-graph-panel-expand-fab.left-3 {
|
|
1351
|
+
left: 0.75rem;
|
|
1352
|
+
}
|
|
1353
|
+
.thread-ui-shell .thread-graph-panel-expand-fab.right-3 {
|
|
1354
|
+
right: 0.75rem;
|
|
1355
|
+
}
|
|
1356
|
+
.thread-ui-shell .thread-graph-panel-expand-fab:hover {
|
|
1357
|
+
transform: translateY(-50%) scale(1.04);
|
|
1358
|
+
}
|
|
1359
|
+
.thread-ui-shell .thread-graph-workspace-label,
|
|
1360
|
+
.thread-ui-shell .thread-graph-workspace-loading,
|
|
1361
|
+
.thread-ui-shell .thread-graph-workspace-empty,
|
|
1362
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1363
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1364
|
+
color: var(--theme-fg-muted);
|
|
1365
|
+
}
|
|
1366
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1367
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1368
|
+
border-color: var(--theme-border);
|
|
1369
|
+
}
|
|
1370
|
+
.thread-ui-shell .thread-graph-file-preview-footer,
|
|
1371
|
+
.thread-ui-shell .thread-graph-file-preview-frame {
|
|
1372
|
+
background: var(--theme-bg);
|
|
1373
|
+
}
|
|
1374
|
+
.thread-ui-shell .thread-graph-workspace-empty {
|
|
1375
|
+
border-color: var(--theme-border);
|
|
1376
|
+
background: var(--theme-surface-strong);
|
|
1377
|
+
}
|
|
1378
|
+
.thread-ui-shell .thread-graph-explorer button,
|
|
1379
|
+
.thread-ui-shell .thread-graph-viewer button {
|
|
1380
|
+
color: inherit;
|
|
1381
|
+
}
|
|
1382
|
+
.thread-ui-shell .thread-graph-tree-row {
|
|
1383
|
+
color: var(--theme-fg-soft);
|
|
1384
|
+
}
|
|
1385
|
+
.thread-ui-shell .thread-graph-tree-row:hover {
|
|
1386
|
+
background: var(--theme-hover);
|
|
1387
|
+
color: var(--theme-fg);
|
|
1388
|
+
}
|
|
1389
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected {
|
|
1390
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 13%, var(--theme-panel));
|
|
1391
|
+
color: var(--theme-fg);
|
|
1392
|
+
box-shadow: inset 3px 0 0 color-mix(in oklch, var(--theme-accent-solid) 72%, transparent);
|
|
1393
|
+
}
|
|
1394
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tree-row.is-selected,
|
|
1395
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tree-row.is-selected,
|
|
1396
|
+
.thread-ui-shell.dark .thread-graph-tree-row.is-selected {
|
|
1397
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 18%, var(--theme-panel));
|
|
1398
|
+
color: var(--theme-fg);
|
|
1399
|
+
box-shadow: inset 3px 0 0 color-mix(in oklch, var(--theme-accent-solid) 72%, transparent);
|
|
1400
|
+
}
|
|
1401
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected svg {
|
|
1402
|
+
color: currentColor;
|
|
1403
|
+
}
|
|
1404
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected .thread-graph-tree-action,
|
|
1405
|
+
.thread-ui-shell .thread-graph-tree-action.is-selected {
|
|
1406
|
+
color: var(--theme-fg-muted);
|
|
1407
|
+
}
|
|
1408
|
+
.thread-ui-shell .thread-graph-tree-row.is-selected .thread-graph-tree-action:hover,
|
|
1409
|
+
.thread-ui-shell .thread-graph-tree-action.is-selected:hover {
|
|
1410
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 12%, transparent);
|
|
1411
|
+
color: var(--theme-fg);
|
|
1412
|
+
}
|
|
1413
|
+
.thread-ui-shell .thread-graph-tree-action {
|
|
1414
|
+
color: var(--theme-fg-muted);
|
|
1415
|
+
}
|
|
1416
|
+
.thread-ui-shell .thread-graph-tree-action:hover {
|
|
1417
|
+
background: var(--theme-surface-strong);
|
|
1418
|
+
color: var(--theme-fg);
|
|
1419
|
+
}
|
|
1420
|
+
.thread-ui-shell .thread-graph-molecule-preview {
|
|
1421
|
+
background: var(--theme-surface);
|
|
1422
|
+
}
|
|
1423
|
+
.thread-ui-shell .thread-graph-molecule-viewer {
|
|
1424
|
+
background: var(--theme-surface);
|
|
1425
|
+
color: var(--theme-fg);
|
|
1426
|
+
}
|
|
1427
|
+
.thread-ui-shell .thread-graph-molecule-header,
|
|
1428
|
+
.thread-ui-shell .thread-graph-molecule-controls {
|
|
1429
|
+
border-color: var(--theme-border);
|
|
1430
|
+
background: var(--theme-surface);
|
|
1431
|
+
color: var(--theme-fg);
|
|
1432
|
+
}
|
|
1433
|
+
.thread-ui-shell .thread-graph-molecule-body {
|
|
1434
|
+
display: flex;
|
|
1435
|
+
min-height: 0;
|
|
1436
|
+
flex: 1;
|
|
1437
|
+
flex-direction: column;
|
|
1438
|
+
overflow: hidden;
|
|
1439
|
+
}
|
|
1440
|
+
.thread-ui-shell .thread-graph-molecule-header h2 {
|
|
1441
|
+
color: var(--theme-fg);
|
|
1442
|
+
}
|
|
1443
|
+
.thread-ui-shell .thread-graph-molecule-header p,
|
|
1444
|
+
.thread-ui-shell .thread-graph-molecule-header span,
|
|
1445
|
+
.thread-ui-shell .thread-graph-molecule-trajectory {
|
|
1446
|
+
color: var(--theme-fg-muted);
|
|
1447
|
+
}
|
|
1448
|
+
.thread-ui-shell .thread-graph-molecule-controls {
|
|
1449
|
+
border-top: 1px solid var(--theme-border);
|
|
1450
|
+
display: flex;
|
|
1451
|
+
flex-direction: column;
|
|
1452
|
+
gap: 0.75rem;
|
|
1453
|
+
max-height: min(42%, 18rem);
|
|
1454
|
+
overflow: auto;
|
|
1455
|
+
padding: 0.75rem;
|
|
1456
|
+
}
|
|
1457
|
+
.thread-ui-shell .thread-graph-molecule-control-row {
|
|
1458
|
+
display: flex;
|
|
1459
|
+
align-items: flex-start;
|
|
1460
|
+
justify-content: space-between;
|
|
1461
|
+
gap: 0.75rem;
|
|
1462
|
+
}
|
|
1463
|
+
.thread-ui-shell .thread-graph-molecule-control-title {
|
|
1464
|
+
color: var(--theme-fg);
|
|
1465
|
+
font-size: 0.875rem;
|
|
1466
|
+
font-weight: 600;
|
|
1467
|
+
line-height: 1.25rem;
|
|
1468
|
+
}
|
|
1469
|
+
.thread-ui-shell .thread-graph-molecule-control-subtitle {
|
|
1470
|
+
margin-top: 0.125rem;
|
|
1471
|
+
color: var(--theme-fg-muted);
|
|
1472
|
+
font-size: 0.6875rem;
|
|
1473
|
+
line-height: 1rem;
|
|
1474
|
+
}
|
|
1475
|
+
.thread-ui-shell .thread-graph-molecule-button-group {
|
|
1476
|
+
display: inline-flex;
|
|
1477
|
+
align-items: center;
|
|
1478
|
+
gap: 0.125rem;
|
|
1479
|
+
border: 1px solid var(--theme-border);
|
|
1480
|
+
border-radius: 0.5rem;
|
|
1481
|
+
background: var(--theme-surface);
|
|
1482
|
+
padding: 0.125rem;
|
|
1483
|
+
}
|
|
1484
|
+
.thread-ui-shell .thread-graph-molecule-button {
|
|
1485
|
+
display: inline-flex;
|
|
1486
|
+
min-width: 1.75rem;
|
|
1487
|
+
height: 1.75rem;
|
|
1488
|
+
align-items: center;
|
|
1489
|
+
justify-content: center;
|
|
1490
|
+
border: 1px solid transparent;
|
|
1491
|
+
border-radius: 0.375rem;
|
|
1492
|
+
background: transparent;
|
|
1493
|
+
color: var(--theme-fg-soft);
|
|
1494
|
+
transition:
|
|
1495
|
+
background-color 140ms ease,
|
|
1496
|
+
border-color 140ms ease,
|
|
1497
|
+
color 140ms ease,
|
|
1498
|
+
opacity 140ms ease;
|
|
1499
|
+
}
|
|
1500
|
+
.thread-ui-shell .thread-graph-molecule-button:hover:not(:disabled) {
|
|
1501
|
+
border-color: var(--theme-border);
|
|
1502
|
+
background: var(--theme-hover);
|
|
1503
|
+
color: var(--theme-fg);
|
|
1504
|
+
}
|
|
1505
|
+
.thread-ui-shell .thread-graph-molecule-button:disabled {
|
|
1506
|
+
cursor: not-allowed;
|
|
1507
|
+
color: var(--theme-fg-subtle);
|
|
1508
|
+
opacity: 0.45;
|
|
1509
|
+
}
|
|
1510
|
+
.thread-ui-shell .thread-graph-molecule-button-divider {
|
|
1511
|
+
width: 1px;
|
|
1512
|
+
align-self: stretch;
|
|
1513
|
+
margin-inline: 0.25rem;
|
|
1514
|
+
background: var(--theme-border);
|
|
1515
|
+
}
|
|
1516
|
+
.thread-ui-shell .thread-graph-molecule-stage {
|
|
1517
|
+
background: var(--theme-bg);
|
|
1518
|
+
}
|
|
1519
|
+
.thread-ui-shell .thread-graph-molecule-error {
|
|
1520
|
+
background: color-mix(in oklch, #ef4444 12%, var(--theme-surface));
|
|
1521
|
+
color: var(--theme-danger);
|
|
1522
|
+
}
|
|
1523
|
+
.thread-ui-shell .thread-graph-molecule-empty {
|
|
1524
|
+
color: var(--theme-fg-muted);
|
|
1525
|
+
}
|
|
1526
|
+
.thread-ui-shell .thread-graph-molecule-tooltip {
|
|
1527
|
+
border-color: var(--theme-border);
|
|
1528
|
+
background: color-mix(in oklch, var(--theme-surface) 96%, transparent);
|
|
1529
|
+
color: var(--theme-fg);
|
|
1530
|
+
box-shadow: 0 10px 28px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
1531
|
+
}
|
|
1532
|
+
.thread-ui-shell .thread-graph-molecule-tooltip div,
|
|
1533
|
+
.thread-ui-shell .thread-graph-molecule-tooltip span {
|
|
1534
|
+
color: inherit;
|
|
1535
|
+
}
|
|
1536
|
+
.thread-ui-shell .thread-graph-molecule-trajectory input {
|
|
1537
|
+
accent-color: var(--theme-accent-solid);
|
|
1538
|
+
}
|
|
1539
|
+
.thread-ui-shell .thread-graph-molecule-live-button {
|
|
1540
|
+
display: inline-flex;
|
|
1541
|
+
align-items: center;
|
|
1542
|
+
gap: 0.25rem;
|
|
1543
|
+
border: 1px solid var(--theme-border);
|
|
1544
|
+
border-radius: 0.375rem;
|
|
1545
|
+
background: var(--theme-surface);
|
|
1546
|
+
padding: 0.125rem 0.5rem;
|
|
1547
|
+
color: var(--theme-fg-muted);
|
|
1548
|
+
transition: background-color 140ms ease, color 140ms ease;
|
|
1549
|
+
}
|
|
1550
|
+
.thread-ui-shell .thread-graph-molecule-live-button:hover {
|
|
1551
|
+
background: var(--theme-hover);
|
|
1552
|
+
color: var(--theme-fg);
|
|
1553
|
+
}
|
|
1554
|
+
.thread-ui-shell .thread-graph-molecule-camera {
|
|
1555
|
+
margin-top: 0.75rem;
|
|
1556
|
+
border: 1px solid var(--theme-border);
|
|
1557
|
+
border-radius: 0.5rem;
|
|
1558
|
+
padding: 0.5rem;
|
|
1559
|
+
color: var(--theme-fg-muted);
|
|
1560
|
+
font-size: 0.625rem;
|
|
1561
|
+
}
|
|
1562
|
+
.thread-ui-shell .thread-graph-molecule-camera-divider {
|
|
1563
|
+
width: 100%;
|
|
1564
|
+
height: 1px;
|
|
1565
|
+
margin-block: 0.5rem;
|
|
1566
|
+
background: var(--theme-border);
|
|
1567
|
+
}
|
|
1568
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin {
|
|
1569
|
+
height: 100%;
|
|
1570
|
+
min-height: 0;
|
|
1571
|
+
border: 0;
|
|
1572
|
+
border-radius: 0;
|
|
1573
|
+
background: var(--theme-surface);
|
|
1574
|
+
color: var(--theme-fg);
|
|
1575
|
+
}
|
|
1576
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header {
|
|
1577
|
+
min-height: 60px;
|
|
1578
|
+
border-color: var(--theme-border);
|
|
1579
|
+
background: var(--theme-surface);
|
|
1580
|
+
padding: 0.75rem 1.25rem;
|
|
1581
|
+
}
|
|
1582
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header h2 {
|
|
1583
|
+
color: var(--theme-fg);
|
|
1584
|
+
font-size: 0.875rem;
|
|
1585
|
+
font-weight: 650;
|
|
1586
|
+
}
|
|
1587
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header p,
|
|
1588
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__header span {
|
|
1589
|
+
color: var(--theme-fg-muted);
|
|
1590
|
+
}
|
|
1591
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar {
|
|
1592
|
+
border-color: var(--theme-border);
|
|
1593
|
+
background: var(--theme-surface);
|
|
1594
|
+
padding: 0.5rem 0.625rem;
|
|
1595
|
+
}
|
|
1596
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button,
|
|
1597
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button {
|
|
1598
|
+
border-color: var(--theme-border);
|
|
1599
|
+
background: var(--theme-surface-strong);
|
|
1600
|
+
color: var(--theme-fg-soft);
|
|
1601
|
+
}
|
|
1602
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button:hover,
|
|
1603
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button:hover {
|
|
1604
|
+
border-color: var(--theme-border-strong);
|
|
1605
|
+
background: var(--theme-hover);
|
|
1606
|
+
color: var(--theme-fg);
|
|
1607
|
+
}
|
|
1608
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar button:disabled,
|
|
1609
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button:disabled {
|
|
1610
|
+
color: var(--theme-fg-subtle);
|
|
1611
|
+
}
|
|
1612
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__toolbar-divider {
|
|
1613
|
+
background: var(--theme-border);
|
|
1614
|
+
}
|
|
1615
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__stage {
|
|
1616
|
+
min-height: 0;
|
|
1617
|
+
background: var(--theme-bg);
|
|
1618
|
+
}
|
|
1619
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__error {
|
|
1620
|
+
background: color-mix(in oklch, #ef4444 12%, var(--theme-surface));
|
|
1621
|
+
color: var(--theme-danger);
|
|
1622
|
+
}
|
|
1623
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__empty {
|
|
1624
|
+
color: var(--theme-fg-muted);
|
|
1625
|
+
}
|
|
1626
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__tooltip {
|
|
1627
|
+
border-color: var(--theme-border);
|
|
1628
|
+
background: color-mix(in oklch, var(--theme-surface) 96%, transparent);
|
|
1629
|
+
color: var(--theme-fg);
|
|
1630
|
+
box-shadow: 0 10px 28px color-mix(in oklch, var(--theme-bg) 72%, transparent);
|
|
1631
|
+
}
|
|
1632
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__tooltip span {
|
|
1633
|
+
color: var(--theme-fg-soft);
|
|
1634
|
+
}
|
|
1635
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline,
|
|
1636
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__status {
|
|
1637
|
+
border-color: var(--theme-border);
|
|
1638
|
+
background: var(--theme-surface);
|
|
1639
|
+
color: var(--theme-fg-muted);
|
|
1640
|
+
}
|
|
1641
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline input {
|
|
1642
|
+
accent-color: var(--theme-accent-solid);
|
|
1643
|
+
}
|
|
1644
|
+
.thread-ui-shell .thread-graph-molecule-preview .xyz-viewer-plugin__timeline button.is-live {
|
|
1645
|
+
color: var(--theme-danger);
|
|
1646
|
+
}
|
|
1647
|
+
.thread-ui-shell .thread-graph-file-preview-header,
|
|
1648
|
+
.thread-ui-shell .thread-graph-file-preview-footer {
|
|
1649
|
+
border-color: var(--theme-border);
|
|
1650
|
+
background: var(--theme-surface);
|
|
1651
|
+
color: var(--theme-fg-muted);
|
|
1652
|
+
}
|
|
1653
|
+
.thread-ui-shell .thread-graph-load-more-button {
|
|
1654
|
+
border: 1px solid var(--theme-border);
|
|
1655
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 8%, var(--theme-panel));
|
|
1656
|
+
color: var(--theme-fg-soft);
|
|
1657
|
+
transition:
|
|
1658
|
+
background-color 140ms ease,
|
|
1659
|
+
border-color 140ms ease,
|
|
1660
|
+
color 140ms ease;
|
|
1661
|
+
}
|
|
1662
|
+
.thread-ui-shell .thread-graph-load-more-button:hover:not(:disabled) {
|
|
1663
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 28%, var(--theme-border));
|
|
1664
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 14%, var(--theme-panel));
|
|
1665
|
+
color: var(--theme-fg);
|
|
1666
|
+
}
|
|
1667
|
+
.thread-ui-shell .thread-graph-code-preview {
|
|
1668
|
+
background: var(--theme-bg);
|
|
1669
|
+
color: var(--theme-fg);
|
|
1670
|
+
}
|
|
1671
|
+
.thread-ui-shell .thread-graph-code-preview pre,
|
|
1672
|
+
.thread-ui-shell .thread-graph-code-preview code {
|
|
1673
|
+
font-family:
|
|
1674
|
+
ui-monospace,
|
|
1675
|
+
SFMono-Regular,
|
|
1676
|
+
Menlo,
|
|
1677
|
+
Monaco,
|
|
1678
|
+
Consolas,
|
|
1679
|
+
"Liberation Mono",
|
|
1680
|
+
monospace !important;
|
|
1681
|
+
font-size: 0.78rem;
|
|
1682
|
+
line-height: 1.55;
|
|
1683
|
+
}
|
|
1684
|
+
.thread-ui-shell .thread-graph-plain-code-preview {
|
|
1685
|
+
min-height: 100%;
|
|
1686
|
+
margin: 0;
|
|
1687
|
+
padding: 1rem;
|
|
1688
|
+
background: transparent;
|
|
1689
|
+
color: var(--theme-fg);
|
|
1690
|
+
white-space: pre;
|
|
1691
|
+
}
|
|
1692
|
+
.thread-ui-shell .thread-tool-call {
|
|
1693
|
+
background: var(--theme-panel);
|
|
1694
|
+
color: var(--theme-fg);
|
|
1695
|
+
overflow: hidden;
|
|
1696
|
+
}
|
|
1697
|
+
.thread-ui-shell .thread-tool-call:hover {
|
|
1698
|
+
border-color: var(--theme-border-strong);
|
|
1699
|
+
}
|
|
1700
|
+
.thread-ui-shell .thread-graph-tool-call {
|
|
1701
|
+
font-family:
|
|
1702
|
+
Inter,
|
|
1703
|
+
ui-sans-serif,
|
|
1704
|
+
system-ui,
|
|
1705
|
+
-apple-system,
|
|
1706
|
+
BlinkMacSystemFont,
|
|
1707
|
+
"Segoe UI",
|
|
1708
|
+
sans-serif;
|
|
1709
|
+
}
|
|
1710
|
+
.thread-ui-shell .thread-graph-tool-call,
|
|
1711
|
+
.thread-ui-shell .thread-graph-tool-accordion,
|
|
1712
|
+
.thread-ui-shell .thread-graph-tool-trigger,
|
|
1713
|
+
.thread-ui-shell .thread-graph-tool-content,
|
|
1714
|
+
.thread-ui-shell .thread-graph-tool-json,
|
|
1715
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1716
|
+
color: var(--theme-fg);
|
|
1717
|
+
}
|
|
1718
|
+
.thread-ui-shell .thread-graph-tool-accordion {
|
|
1719
|
+
overflow: hidden;
|
|
1720
|
+
border: 1px solid var(--theme-border);
|
|
1721
|
+
border-radius: 0.5rem;
|
|
1722
|
+
background: var(--theme-panel);
|
|
1723
|
+
box-shadow: 0 1px 2px color-mix(in oklch, var(--theme-bg) 65%, transparent);
|
|
1724
|
+
}
|
|
1725
|
+
.thread-ui-shell .thread-graph-tool-trigger {
|
|
1726
|
+
display: flex;
|
|
1727
|
+
width: 100%;
|
|
1728
|
+
min-width: 0;
|
|
1729
|
+
align-items: center;
|
|
1730
|
+
justify-content: space-between;
|
|
1731
|
+
gap: 0.75rem;
|
|
1732
|
+
border: 0;
|
|
1733
|
+
background: var(--theme-panel);
|
|
1734
|
+
text-align: left;
|
|
1735
|
+
transition: background 160ms ease, color 160ms ease;
|
|
1736
|
+
}
|
|
1737
|
+
.thread-ui-shell .thread-graph-tool-trigger:hover {
|
|
1738
|
+
background: var(--theme-hover);
|
|
1739
|
+
}
|
|
1740
|
+
.thread-ui-shell .thread-graph-tool-trigger svg {
|
|
1741
|
+
color: var(--theme-fg-muted);
|
|
1742
|
+
}
|
|
1743
|
+
.thread-ui-shell .thread-graph-tool-trigger > svg {
|
|
1744
|
+
margin-left: auto;
|
|
1745
|
+
}
|
|
1746
|
+
.thread-ui-shell .thread-graph-tool-badge {
|
|
1747
|
+
display: inline-flex;
|
|
1748
|
+
min-height: 1.35rem;
|
|
1749
|
+
shrink: 0;
|
|
1750
|
+
align-items: center;
|
|
1751
|
+
gap: 0.25rem;
|
|
1752
|
+
border: 1px solid transparent;
|
|
1753
|
+
border-radius: 999px;
|
|
1754
|
+
padding: 0.1rem 0.5rem;
|
|
1755
|
+
font-size: 0.75rem;
|
|
1756
|
+
font-weight: 400;
|
|
1757
|
+
line-height: 1rem;
|
|
1758
|
+
}
|
|
1759
|
+
.thread-ui-shell .thread-graph-tool-badge.is-completed {
|
|
1760
|
+
background: oklch(0.94 0.052 155);
|
|
1761
|
+
color: oklch(0.43 0.095 155);
|
|
1762
|
+
}
|
|
1763
|
+
.thread-ui-shell .thread-graph-tool-badge.is-failed {
|
|
1764
|
+
background: oklch(0.94 0.04 25);
|
|
1765
|
+
color: oklch(0.48 0.125 24);
|
|
1766
|
+
}
|
|
1767
|
+
.thread-ui-shell .thread-graph-tool-badge.is-pending {
|
|
1768
|
+
background: oklch(0.94 0.03 235);
|
|
1769
|
+
color: oklch(0.43 0.09 242);
|
|
1770
|
+
}
|
|
1771
|
+
.thread-ui-shell .thread-graph-tool-badge.is-neutral {
|
|
1772
|
+
background: var(--theme-muted);
|
|
1773
|
+
color: var(--theme-fg-muted);
|
|
1774
|
+
}
|
|
1775
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-completed,
|
|
1776
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-completed,
|
|
1777
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-completed {
|
|
1778
|
+
background: oklch(0.31 0.05 155);
|
|
1779
|
+
color: oklch(0.8 0.115 155);
|
|
1780
|
+
}
|
|
1781
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-failed,
|
|
1782
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-failed,
|
|
1783
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-failed {
|
|
1784
|
+
background: oklch(0.31 0.052 25);
|
|
1785
|
+
color: oklch(0.78 0.12 25);
|
|
1786
|
+
}
|
|
1787
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-pending,
|
|
1788
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-pending,
|
|
1789
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-pending {
|
|
1790
|
+
background: oklch(0.3 0.042 235);
|
|
1791
|
+
color: oklch(0.77 0.1 235);
|
|
1792
|
+
}
|
|
1793
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-badge.is-neutral,
|
|
1794
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-badge.is-neutral,
|
|
1795
|
+
.thread-ui-shell.dark .thread-graph-tool-badge.is-neutral {
|
|
1796
|
+
background: #222733;
|
|
1797
|
+
color: rgb(148 163 184);
|
|
1798
|
+
}
|
|
1799
|
+
.thread-ui-shell .thread-graph-tool-content {
|
|
1800
|
+
display: grid;
|
|
1801
|
+
gap: 0.75rem;
|
|
1802
|
+
border-top: 0;
|
|
1803
|
+
background: var(--theme-panel);
|
|
1804
|
+
}
|
|
1805
|
+
.thread-ui-shell .thread-graph-tool-content h4 {
|
|
1806
|
+
margin: 0.25rem 0 0.5rem;
|
|
1807
|
+
color: var(--theme-fg-muted);
|
|
1808
|
+
font-size: 0.625rem;
|
|
1809
|
+
font-weight: 700;
|
|
1810
|
+
letter-spacing: 0.08em;
|
|
1811
|
+
line-height: 1rem;
|
|
1812
|
+
text-transform: uppercase;
|
|
1813
|
+
}
|
|
1814
|
+
.thread-ui-shell .thread-graph-tool-json,
|
|
1815
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1816
|
+
overflow-x: auto;
|
|
1817
|
+
border: 1px solid var(--theme-border);
|
|
1818
|
+
border-radius: 0.375rem;
|
|
1819
|
+
background: var(--theme-surface-strong);
|
|
1820
|
+
padding: 0.75rem;
|
|
1821
|
+
font-family:
|
|
1822
|
+
ui-monospace,
|
|
1823
|
+
SFMono-Regular,
|
|
1824
|
+
Menlo,
|
|
1825
|
+
Monaco,
|
|
1826
|
+
Consolas,
|
|
1827
|
+
"Liberation Mono",
|
|
1828
|
+
monospace;
|
|
1829
|
+
font-size: 0.78rem;
|
|
1830
|
+
line-height: 1.55;
|
|
1831
|
+
white-space: pre-wrap;
|
|
1832
|
+
}
|
|
1833
|
+
.thread-ui-shell .thread-graph-tool-json > div {
|
|
1834
|
+
padding-left: 1rem;
|
|
1835
|
+
}
|
|
1836
|
+
.thread-ui-shell .thread-graph-tool-output {
|
|
1837
|
+
margin-top: 0.5rem;
|
|
1838
|
+
}
|
|
1839
|
+
.thread-ui-shell .thread-graph-tool-key {
|
|
1840
|
+
color: oklch(0.58 0.18 18);
|
|
1841
|
+
}
|
|
1842
|
+
.thread-ui-shell .thread-graph-tool-string {
|
|
1843
|
+
color: oklch(0.52 0.12 155);
|
|
1844
|
+
}
|
|
1845
|
+
.thread-ui-shell .thread-graph-tool-number {
|
|
1846
|
+
color: oklch(0.55 0.13 235);
|
|
1847
|
+
}
|
|
1848
|
+
.thread-ui-shell .thread-graph-tool-boolean {
|
|
1849
|
+
color: oklch(0.56 0.13 302);
|
|
1850
|
+
}
|
|
1851
|
+
.thread-ui-shell .thread-graph-tool-null,
|
|
1852
|
+
.thread-ui-shell .thread-graph-tool-punctuation,
|
|
1853
|
+
.thread-ui-shell .thread-graph-tool-object {
|
|
1854
|
+
color: var(--theme-fg-muted);
|
|
1855
|
+
}
|
|
1856
|
+
.thread-ui-shell .thread-graph-history-tool {
|
|
1857
|
+
width: 100%;
|
|
1858
|
+
min-width: 0;
|
|
1859
|
+
border: 0;
|
|
1860
|
+
background: transparent !important;
|
|
1861
|
+
color: var(--theme-fg);
|
|
1862
|
+
}
|
|
1863
|
+
.thread-ui-shell .thread-graph-history-tool-accordion {
|
|
1864
|
+
background: var(--theme-panel);
|
|
1865
|
+
}
|
|
1866
|
+
.thread-ui-shell .thread-graph-history-tool-trigger {
|
|
1867
|
+
min-height: 2.75rem;
|
|
1868
|
+
}
|
|
1869
|
+
.thread-ui-shell .thread-graph-history-tool-trigger > div:first-child {
|
|
1870
|
+
min-width: 0;
|
|
1871
|
+
}
|
|
1872
|
+
.thread-ui-shell .thread-graph-history-tool-icon {
|
|
1873
|
+
display: inline-flex;
|
|
1874
|
+
align-items: center;
|
|
1875
|
+
justify-content: center;
|
|
1876
|
+
color: var(--theme-fg-muted);
|
|
1877
|
+
}
|
|
1878
|
+
.thread-ui-shell .thread-graph-history-tool.is-command .thread-graph-history-tool-icon {
|
|
1879
|
+
color: oklch(0.63 0.12 75);
|
|
1880
|
+
}
|
|
1881
|
+
.thread-ui-shell .thread-graph-history-tool.is-tool .thread-graph-history-tool-icon {
|
|
1882
|
+
color: oklch(0.61 0.12 315);
|
|
1883
|
+
}
|
|
1884
|
+
.thread-ui-shell .thread-graph-history-tool.is-agent .thread-graph-history-tool-icon {
|
|
1885
|
+
color: oklch(0.58 0.11 170);
|
|
1886
|
+
}
|
|
1887
|
+
.thread-ui-shell .thread-graph-history-tool.is-skill .thread-graph-history-tool-icon {
|
|
1888
|
+
color: oklch(0.58 0.12 285);
|
|
1889
|
+
}
|
|
1890
|
+
.thread-ui-shell .thread-graph-history-tool.is-search .thread-graph-history-tool-icon {
|
|
1891
|
+
color: oklch(0.58 0.12 235);
|
|
1892
|
+
}
|
|
1893
|
+
.thread-ui-shell .thread-graph-history-tool.is-file-read .thread-graph-history-tool-icon {
|
|
1894
|
+
color: oklch(0.58 0.1 205);
|
|
1895
|
+
}
|
|
1896
|
+
.thread-ui-shell .thread-graph-history-tool-summary {
|
|
1897
|
+
display: flex;
|
|
1898
|
+
min-width: 0;
|
|
1899
|
+
align-items: center;
|
|
1900
|
+
gap: 0.5rem;
|
|
1901
|
+
overflow: hidden;
|
|
1902
|
+
border: 1px solid var(--theme-border);
|
|
1903
|
+
border-radius: 0.375rem;
|
|
1904
|
+
background: var(--theme-surface-strong);
|
|
1905
|
+
padding: 0.65rem 0.75rem;
|
|
1906
|
+
color: var(--theme-fg-soft);
|
|
1907
|
+
font-size: 0.875rem;
|
|
1908
|
+
line-height: 1.5;
|
|
1909
|
+
}
|
|
1910
|
+
.thread-ui-shell .thread-graph-history-tool-summary > span:first-child {
|
|
1911
|
+
min-width: 0;
|
|
1912
|
+
overflow: hidden;
|
|
1913
|
+
text-overflow: ellipsis;
|
|
1914
|
+
white-space: nowrap;
|
|
1915
|
+
}
|
|
1916
|
+
.thread-ui-shell .thread-graph-history-tool-ellipsis {
|
|
1917
|
+
flex: 0 0 auto;
|
|
1918
|
+
color: var(--theme-fg-muted);
|
|
1919
|
+
font-size: 0.75rem;
|
|
1920
|
+
letter-spacing: 0.16em;
|
|
1921
|
+
}
|
|
1922
|
+
.thread-ui-shell .thread-graph-history-tool-open {
|
|
1923
|
+
border-color: var(--theme-border);
|
|
1924
|
+
background: var(--theme-surface);
|
|
1925
|
+
color: var(--theme-fg-soft);
|
|
1926
|
+
}
|
|
1927
|
+
.thread-ui-shell .thread-graph-history-tool-open:hover {
|
|
1928
|
+
background: var(--theme-hover);
|
|
1929
|
+
color: var(--theme-fg);
|
|
1930
|
+
}
|
|
1931
|
+
.thread-ui-shell .thread-graph-history-event {
|
|
1932
|
+
display: flex;
|
|
1933
|
+
min-width: 0;
|
|
1934
|
+
width: 100%;
|
|
1935
|
+
align-items: flex-start;
|
|
1936
|
+
gap: 0.625rem;
|
|
1937
|
+
border: 0;
|
|
1938
|
+
background: transparent !important;
|
|
1939
|
+
color: var(--theme-fg);
|
|
1940
|
+
}
|
|
1941
|
+
.thread-ui-shell .thread-graph-history-event-icon {
|
|
1942
|
+
display: inline-flex;
|
|
1943
|
+
height: 1.75rem;
|
|
1944
|
+
width: 1.75rem;
|
|
1945
|
+
flex: 0 0 auto;
|
|
1946
|
+
align-items: center;
|
|
1947
|
+
justify-content: center;
|
|
1948
|
+
border: 1px solid var(--theme-border);
|
|
1949
|
+
border-radius: 999px;
|
|
1950
|
+
background: var(--theme-panel);
|
|
1951
|
+
color: var(--theme-fg-muted);
|
|
1952
|
+
}
|
|
1953
|
+
.thread-ui-shell .thread-graph-history-event-card {
|
|
1954
|
+
min-width: 0;
|
|
1955
|
+
flex: 1 1 auto;
|
|
1956
|
+
overflow: hidden;
|
|
1957
|
+
border: 1px solid var(--theme-border);
|
|
1958
|
+
border-radius: 0.5rem;
|
|
1959
|
+
background: var(--theme-panel);
|
|
1960
|
+
color: var(--theme-fg);
|
|
1961
|
+
box-shadow: 0 1px 2px color-mix(in oklch, var(--theme-bg) 65%, transparent);
|
|
1962
|
+
}
|
|
1963
|
+
.thread-ui-shell .thread-graph-history-event-header {
|
|
1964
|
+
display: flex;
|
|
1965
|
+
min-width: 0;
|
|
1966
|
+
align-items: center;
|
|
1967
|
+
justify-content: space-between;
|
|
1968
|
+
gap: 0.75rem;
|
|
1969
|
+
padding: 0.75rem 1rem;
|
|
1970
|
+
}
|
|
1971
|
+
.thread-ui-shell .thread-graph-history-event-heading {
|
|
1972
|
+
flex: 1 1 auto;
|
|
1973
|
+
min-width: 0;
|
|
1974
|
+
}
|
|
1975
|
+
.thread-ui-shell .thread-graph-history-event-title {
|
|
1976
|
+
flex: 0 0 auto;
|
|
1977
|
+
max-width: min(14rem, 36%);
|
|
1978
|
+
}
|
|
1979
|
+
.thread-ui-shell .thread-graph-history-event-actions {
|
|
1980
|
+
display: inline-flex;
|
|
1981
|
+
flex: 0 0 auto;
|
|
1982
|
+
align-items: center;
|
|
1983
|
+
gap: 0.5rem;
|
|
1984
|
+
}
|
|
1985
|
+
.thread-ui-shell .thread-graph-history-event-body {
|
|
1986
|
+
display: grid;
|
|
1987
|
+
gap: 0.625rem;
|
|
1988
|
+
border-top: 1px solid var(--theme-border);
|
|
1989
|
+
padding: 0.75rem 1rem 1rem;
|
|
1990
|
+
color: var(--theme-fg-soft);
|
|
1991
|
+
}
|
|
1992
|
+
.thread-ui-shell .thread-graph-history-event-line {
|
|
1993
|
+
display: flex;
|
|
1994
|
+
min-width: 0;
|
|
1995
|
+
align-items: center;
|
|
1996
|
+
gap: 0.5rem;
|
|
1997
|
+
color: var(--theme-fg);
|
|
1998
|
+
}
|
|
1999
|
+
.thread-ui-shell .thread-graph-history-event-primary {
|
|
2000
|
+
min-width: 0;
|
|
2001
|
+
color: var(--theme-fg);
|
|
2002
|
+
font-size: 0.875rem;
|
|
2003
|
+
font-weight: 500;
|
|
2004
|
+
line-height: 1.5;
|
|
2005
|
+
}
|
|
2006
|
+
.thread-ui-shell .thread-graph-history-event-secondary {
|
|
2007
|
+
min-width: 0;
|
|
2008
|
+
color: var(--theme-fg-muted);
|
|
2009
|
+
font-size: 0.75rem;
|
|
2010
|
+
line-height: 1.35;
|
|
2011
|
+
}
|
|
2012
|
+
.thread-ui-shell .thread-graph-history-event-summary {
|
|
2013
|
+
display: block;
|
|
2014
|
+
width: 100%;
|
|
2015
|
+
min-width: 0;
|
|
2016
|
+
overflow: hidden;
|
|
2017
|
+
border: 1px solid var(--theme-border);
|
|
2018
|
+
border-radius: 0.375rem;
|
|
2019
|
+
background: var(--theme-surface-strong);
|
|
2020
|
+
padding: 0.65rem 0.75rem;
|
|
2021
|
+
color: var(--theme-fg-soft);
|
|
2022
|
+
font-size: 0.875rem;
|
|
2023
|
+
line-height: 1.5;
|
|
2024
|
+
text-align: left;
|
|
2025
|
+
}
|
|
2026
|
+
.thread-ui-shell .thread-graph-history-event-summary.is-clickable {
|
|
2027
|
+
transition: background 160ms ease, color 160ms ease;
|
|
2028
|
+
}
|
|
2029
|
+
.thread-ui-shell .thread-graph-history-event-summary.is-clickable:hover {
|
|
2030
|
+
background: var(--theme-hover);
|
|
2031
|
+
color: var(--theme-fg);
|
|
2032
|
+
}
|
|
2033
|
+
.thread-ui-shell .thread-graph-history-event-prose {
|
|
2034
|
+
color: var(--theme-fg-soft);
|
|
2035
|
+
}
|
|
2036
|
+
.thread-ui-shell .thread-graph-history-event-pre {
|
|
2037
|
+
overflow-x: auto;
|
|
2038
|
+
border: 1px solid var(--theme-border);
|
|
2039
|
+
border-radius: 0.375rem;
|
|
2040
|
+
background: var(--theme-surface-strong);
|
|
2041
|
+
padding: 0.75rem;
|
|
2042
|
+
color: var(--theme-fg-soft);
|
|
2043
|
+
font-size: 0.8125rem;
|
|
2044
|
+
line-height: 1.55;
|
|
2045
|
+
white-space: pre-wrap;
|
|
2046
|
+
}
|
|
2047
|
+
.thread-ui-shell .thread-graph-history-event-action,
|
|
2048
|
+
.thread-ui-shell .thread-graph-history-event-pill {
|
|
2049
|
+
display: inline-flex;
|
|
2050
|
+
align-items: center;
|
|
2051
|
+
gap: 0.375rem;
|
|
2052
|
+
border: 1px solid var(--theme-border);
|
|
2053
|
+
border-radius: 999px;
|
|
2054
|
+
background: var(--theme-surface);
|
|
2055
|
+
padding: 0.25rem 0.55rem;
|
|
2056
|
+
color: var(--theme-fg-muted);
|
|
2057
|
+
font-size: 0.6875rem;
|
|
2058
|
+
font-weight: 500;
|
|
2059
|
+
line-height: 1rem;
|
|
2060
|
+
transition: background 160ms ease, color 160ms ease;
|
|
2061
|
+
}
|
|
2062
|
+
.thread-ui-shell .thread-graph-history-event-action:hover {
|
|
2063
|
+
background: var(--theme-hover);
|
|
2064
|
+
color: var(--theme-fg);
|
|
2065
|
+
}
|
|
2066
|
+
.thread-ui-shell .thread-graph-history-event-path {
|
|
2067
|
+
display: block;
|
|
2068
|
+
max-width: 100%;
|
|
2069
|
+
overflow: hidden;
|
|
2070
|
+
text-overflow: ellipsis;
|
|
2071
|
+
white-space: nowrap;
|
|
2072
|
+
color: var(--theme-fg-muted);
|
|
2073
|
+
font-size: 0.75rem;
|
|
2074
|
+
line-height: 1.4;
|
|
2075
|
+
text-align: left;
|
|
2076
|
+
}
|
|
2077
|
+
.thread-ui-shell .thread-graph-history-event-path:hover {
|
|
2078
|
+
color: var(--theme-fg);
|
|
2079
|
+
}
|
|
2080
|
+
.thread-ui-shell .thread-graph-history-event-image {
|
|
2081
|
+
max-height: 24rem;
|
|
2082
|
+
width: 100%;
|
|
2083
|
+
object-fit: contain;
|
|
2084
|
+
border: 1px solid var(--theme-border);
|
|
2085
|
+
border-radius: 0.5rem;
|
|
2086
|
+
background: var(--theme-surface-strong);
|
|
2087
|
+
}
|
|
2088
|
+
.thread-ui-shell .thread-graph-history-event.is-plan .thread-graph-history-event-icon {
|
|
2089
|
+
color: oklch(0.58 0.12 235);
|
|
2090
|
+
}
|
|
2091
|
+
.thread-ui-shell .thread-graph-history-event.is-context .thread-graph-history-event-icon {
|
|
2092
|
+
color: oklch(0.58 0.11 170);
|
|
2093
|
+
}
|
|
2094
|
+
.thread-ui-shell .thread-graph-history-event.is-image .thread-graph-history-event-icon,
|
|
2095
|
+
.thread-ui-shell .thread-graph-history-event.is-artifact .thread-graph-history-event-icon {
|
|
2096
|
+
color: oklch(0.58 0.12 285);
|
|
2097
|
+
}
|
|
2098
|
+
.thread-ui-shell .thread-graph-history-event.is-file-change .thread-graph-history-event-icon {
|
|
2099
|
+
color: oklch(0.62 0.12 145);
|
|
2100
|
+
}
|
|
2101
|
+
.thread-ui-shell .thread-graph-history-event.is-hook .thread-graph-history-event-icon {
|
|
2102
|
+
color: oklch(0.61 0.12 315);
|
|
2103
|
+
}
|
|
2104
|
+
@media (max-width: 639px) {
|
|
2105
|
+
.thread-ui-shell .thread-graph-history-event {
|
|
2106
|
+
gap: 0.5rem;
|
|
2107
|
+
}
|
|
2108
|
+
.thread-ui-shell .thread-graph-history-event-icon {
|
|
2109
|
+
height: 1.5rem;
|
|
2110
|
+
width: 1.5rem;
|
|
2111
|
+
}
|
|
2112
|
+
.thread-ui-shell .thread-graph-history-event-header,
|
|
2113
|
+
.thread-ui-shell .thread-graph-history-event-body {
|
|
2114
|
+
padding-left: 0.75rem;
|
|
2115
|
+
padding-right: 0.75rem;
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
.thread-ui-shell .thread-graph-history-detail-row {
|
|
2119
|
+
border-color: var(--theme-border);
|
|
2120
|
+
background: var(--theme-surface);
|
|
2121
|
+
color: var(--theme-fg);
|
|
2122
|
+
}
|
|
2123
|
+
.thread-ui-shell .thread-graph-history-detail-row:hover {
|
|
2124
|
+
background: var(--theme-hover);
|
|
2125
|
+
color: var(--theme-fg);
|
|
2126
|
+
}
|
|
2127
|
+
.thread-ui-shell .thread-graph-history-detail-text {
|
|
2128
|
+
color: var(--theme-fg);
|
|
2129
|
+
}
|
|
2130
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-card {
|
|
2131
|
+
border-radius: 0.4375rem;
|
|
2132
|
+
}
|
|
2133
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-header {
|
|
2134
|
+
min-height: 2.75rem;
|
|
2135
|
+
padding-block: 0.5rem;
|
|
2136
|
+
}
|
|
2137
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-heading {
|
|
2138
|
+
flex: 1 1 auto;
|
|
2139
|
+
min-width: 0;
|
|
2140
|
+
gap: 0.375rem;
|
|
2141
|
+
}
|
|
2142
|
+
.thread-ui-shell .thread-graph-event-file-change .thread-graph-history-event-title {
|
|
2143
|
+
max-width: none;
|
|
2144
|
+
font-size: 0.8125rem;
|
|
2145
|
+
}
|
|
2146
|
+
.thread-ui-shell .thread-graph-file-change-inline,
|
|
2147
|
+
.thread-ui-shell .thread-graph-file-change-inline-button {
|
|
2148
|
+
min-width: 0;
|
|
2149
|
+
}
|
|
2150
|
+
.thread-ui-shell .thread-graph-file-change-inline {
|
|
2151
|
+
max-width: 100%;
|
|
2152
|
+
gap: 0.375rem;
|
|
2153
|
+
}
|
|
2154
|
+
.thread-ui-shell .thread-graph-file-change-inline-button {
|
|
2155
|
+
display: block;
|
|
2156
|
+
flex: 1 1 auto;
|
|
2157
|
+
color: inherit;
|
|
2158
|
+
}
|
|
2159
|
+
.thread-ui-shell .thread-graph-file-change-inline-button:hover .thread-graph-history-detail-text {
|
|
2160
|
+
color: var(--theme-fg);
|
|
2161
|
+
text-decoration: underline;
|
|
2162
|
+
text-decoration-thickness: 1px;
|
|
2163
|
+
text-underline-offset: 2px;
|
|
2164
|
+
}
|
|
2165
|
+
.thread-ui-shell .thread-graph-history-detail-meta {
|
|
2166
|
+
color: var(--theme-fg-muted);
|
|
2167
|
+
}
|
|
2168
|
+
.thread-ui-shell .thread-graph-history-delta-badge {
|
|
2169
|
+
display: inline-flex;
|
|
2170
|
+
align-items: center;
|
|
2171
|
+
justify-content: center;
|
|
2172
|
+
border: 1px solid transparent;
|
|
2173
|
+
border-radius: 999px;
|
|
2174
|
+
padding: 0.125rem 0.375rem;
|
|
2175
|
+
font-size: 0.6875rem;
|
|
2176
|
+
font-weight: 500;
|
|
2177
|
+
line-height: 1rem;
|
|
2178
|
+
}
|
|
2179
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-add {
|
|
2180
|
+
border-color: rgb(52 211 153 / 0.28);
|
|
2181
|
+
background: rgb(52 211 153 / 0.1);
|
|
2182
|
+
color: rgb(167 243 208);
|
|
2183
|
+
}
|
|
2184
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-remove {
|
|
2185
|
+
border-color: rgb(251 113 133 / 0.3);
|
|
2186
|
+
background: rgb(251 113 133 / 0.1);
|
|
2187
|
+
color: rgb(254 205 211);
|
|
2188
|
+
}
|
|
2189
|
+
.thread-ui-shell .thread-graph-history-delta-badge.is-neutral {
|
|
2190
|
+
border-color: var(--theme-border);
|
|
2191
|
+
background: var(--theme-muted);
|
|
2192
|
+
color: var(--theme-fg-soft);
|
|
2193
|
+
}
|
|
2194
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-history-delta-badge.is-add {
|
|
2195
|
+
border-color: rgb(16 185 129 / 0.25);
|
|
2196
|
+
background: rgb(16 185 129 / 0.1);
|
|
2197
|
+
color: rgb(4 120 87);
|
|
2198
|
+
}
|
|
2199
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-history-delta-badge.is-remove {
|
|
2200
|
+
border-color: rgb(244 63 94 / 0.25);
|
|
2201
|
+
background: rgb(244 63 94 / 0.1);
|
|
2202
|
+
color: rgb(190 18 60);
|
|
2203
|
+
}
|
|
2204
|
+
@media (max-width: 639px) {
|
|
2205
|
+
.thread-ui-shell .thread-graph-history-tool-trigger {
|
|
2206
|
+
padding-left: 0.75rem;
|
|
2207
|
+
padding-right: 0.75rem;
|
|
2208
|
+
}
|
|
2209
|
+
.thread-ui-shell .thread-graph-history-tool-trigger .thread-graph-tool-badge {
|
|
2210
|
+
max-width: 7.5rem;
|
|
2211
|
+
}
|
|
2212
|
+
.thread-ui-shell .thread-graph-history-tool-content {
|
|
2213
|
+
padding-left: 0.75rem;
|
|
2214
|
+
padding-right: 0.75rem;
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
.thread-ui-shell .xyz-viewer-plugin {
|
|
2218
|
+
border-color: var(--theme-border);
|
|
2219
|
+
border-radius: 0;
|
|
2220
|
+
background: var(--theme-surface);
|
|
2221
|
+
color: var(--theme-fg);
|
|
2222
|
+
}
|
|
2223
|
+
.thread-ui-shell .xyz-viewer-plugin__header,
|
|
2224
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar,
|
|
2225
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline,
|
|
2226
|
+
.thread-ui-shell .xyz-viewer-plugin__status {
|
|
2227
|
+
border-color: var(--theme-border);
|
|
2228
|
+
background: var(--theme-surface);
|
|
2229
|
+
color: var(--theme-fg-muted);
|
|
2230
|
+
}
|
|
2231
|
+
.thread-ui-shell .xyz-viewer-plugin__header h2 {
|
|
2232
|
+
color: var(--theme-fg);
|
|
2233
|
+
}
|
|
2234
|
+
.thread-ui-shell .xyz-viewer-plugin__header p,
|
|
2235
|
+
.thread-ui-shell .xyz-viewer-plugin__header span,
|
|
2236
|
+
.thread-ui-shell .xyz-viewer-plugin__tooltip span {
|
|
2237
|
+
color: var(--theme-fg-muted);
|
|
2238
|
+
}
|
|
2239
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar button,
|
|
2240
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline button {
|
|
2241
|
+
border-color: var(--theme-border);
|
|
2242
|
+
background: var(--theme-surface-strong);
|
|
2243
|
+
color: var(--theme-fg-soft);
|
|
2244
|
+
}
|
|
2245
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar button:hover,
|
|
2246
|
+
.thread-ui-shell .xyz-viewer-plugin__timeline button:hover {
|
|
2247
|
+
background: var(--theme-hover);
|
|
2248
|
+
color: var(--theme-fg);
|
|
2249
|
+
}
|
|
2250
|
+
.thread-ui-shell .xyz-viewer-plugin__toolbar-divider {
|
|
2251
|
+
background: var(--theme-border);
|
|
2252
|
+
}
|
|
2253
|
+
.thread-ui-shell .xyz-viewer-plugin__stage {
|
|
2254
|
+
background: var(--theme-bg);
|
|
2255
|
+
}
|
|
2256
|
+
.thread-ui-shell .xyz-viewer-plugin__tooltip {
|
|
2257
|
+
border-color: var(--theme-border);
|
|
2258
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent);
|
|
2259
|
+
box-shadow: var(--theme-shadow);
|
|
2260
|
+
color: var(--theme-fg);
|
|
2261
|
+
}
|
|
2262
|
+
.thread-ui-shell .xyz-viewer-plugin__empty {
|
|
2263
|
+
color: var(--theme-fg-muted);
|
|
2264
|
+
}
|
|
2265
|
+
.thread-ui-shell .xyz-viewer-plugin__error {
|
|
2266
|
+
background: color-mix(in oklch, oklch(0.62 0.16 25) 14%, var(--theme-panel));
|
|
2267
|
+
color: oklch(0.78 0.12 25);
|
|
2268
|
+
}
|
|
2269
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-key,
|
|
2270
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-key,
|
|
2271
|
+
.thread-ui-shell.dark .thread-graph-tool-key {
|
|
2272
|
+
color: oklch(0.78 0.12 18);
|
|
2273
|
+
}
|
|
2274
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-string,
|
|
2275
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-string,
|
|
2276
|
+
.thread-ui-shell.dark .thread-graph-tool-string {
|
|
2277
|
+
color: oklch(0.79 0.11 155);
|
|
2278
|
+
}
|
|
2279
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-number,
|
|
2280
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-number,
|
|
2281
|
+
.thread-ui-shell.dark .thread-graph-tool-number {
|
|
2282
|
+
color: oklch(0.77 0.1 235);
|
|
2283
|
+
}
|
|
2284
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-tool-boolean,
|
|
2285
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-tool-boolean,
|
|
2286
|
+
.thread-ui-shell.dark .thread-graph-tool-boolean {
|
|
2287
|
+
color: oklch(0.79 0.1 302);
|
|
2288
|
+
}
|
|
2289
|
+
.thread-ui-shell .thread-timeline-surface,
|
|
2290
|
+
.thread-ui-shell .thread-scroll-container {
|
|
2291
|
+
background: var(--theme-surface);
|
|
2292
|
+
color: var(--theme-fg);
|
|
2293
|
+
scrollbar-color: var(--theme-border-strong) transparent;
|
|
2294
|
+
}
|
|
2295
|
+
.thread-ui-shell .thread-scroll-container > div > .divide-y {
|
|
2296
|
+
border-color: var(--theme-border);
|
|
2297
|
+
}
|
|
2298
|
+
.thread-ui-shell .timeline-item-frame {
|
|
2299
|
+
border-color: var(--theme-border);
|
|
2300
|
+
background: var(--theme-panel);
|
|
2301
|
+
color: var(--theme-fg);
|
|
2302
|
+
box-shadow: none;
|
|
2303
|
+
}
|
|
2304
|
+
.thread-ui-shell .timeline-agent {
|
|
2305
|
+
border-color: transparent;
|
|
2306
|
+
background: transparent;
|
|
2307
|
+
box-shadow: none;
|
|
2308
|
+
}
|
|
2309
|
+
.thread-ui-shell .timeline-user {
|
|
2310
|
+
border-color: transparent;
|
|
2311
|
+
background: oklch(0.94 0.025 214);
|
|
2312
|
+
color: oklch(0.24 0.027 255);
|
|
2313
|
+
}
|
|
2314
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user,
|
|
2315
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user,
|
|
2316
|
+
.thread-ui-shell.dark .timeline-user {
|
|
2317
|
+
background: oklch(0.29 0.034 224);
|
|
2318
|
+
color: var(--theme-fg);
|
|
2319
|
+
}
|
|
2320
|
+
.thread-ui-shell .timeline-command,
|
|
2321
|
+
.thread-ui-shell .timeline-agent-tool,
|
|
2322
|
+
.thread-ui-shell .timeline-skill-tool,
|
|
2323
|
+
.thread-ui-shell .timeline-action,
|
|
2324
|
+
.thread-ui-shell .timeline-file-change,
|
|
2325
|
+
.thread-ui-shell .timeline-file-read,
|
|
2326
|
+
.thread-ui-shell .timeline-search,
|
|
2327
|
+
.thread-ui-shell .timeline-plan,
|
|
2328
|
+
.thread-ui-shell .timeline-reasoning,
|
|
2329
|
+
.thread-ui-shell .timeline-other,
|
|
2330
|
+
.thread-ui-shell .timeline-special-warning,
|
|
2331
|
+
.thread-ui-shell .timeline-special-info,
|
|
2332
|
+
.thread-ui-shell .timeline-special-file-read,
|
|
2333
|
+
.thread-ui-shell .timeline-special-success,
|
|
2334
|
+
.thread-ui-shell .timeline-mobile-dense-event,
|
|
2335
|
+
.thread-ui-shell .timeline-batch-inner,
|
|
2336
|
+
.thread-ui-shell .timeline-item-inner {
|
|
2337
|
+
border-color: var(--theme-border);
|
|
2338
|
+
background: var(--theme-panel);
|
|
2339
|
+
color: var(--theme-fg);
|
|
2340
|
+
}
|
|
2341
|
+
.thread-ui-shell .timeline-special-warning,
|
|
2342
|
+
.thread-ui-shell .timeline-special-info,
|
|
2343
|
+
.thread-ui-shell .timeline-special-file-read,
|
|
2344
|
+
.thread-ui-shell .timeline-special-success {
|
|
2345
|
+
box-shadow: none;
|
|
2346
|
+
}
|
|
2347
|
+
.thread-ui-shell .timeline-mobile-dense-command,
|
|
2348
|
+
.thread-ui-shell .timeline-mobile-dense-search,
|
|
2349
|
+
.thread-ui-shell .timeline-mobile-dense-file-read,
|
|
2350
|
+
.thread-ui-shell .timeline-mobile-dense-file {
|
|
2351
|
+
background: var(--theme-panel);
|
|
2352
|
+
}
|
|
2353
|
+
.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) {
|
|
2354
|
+
border-color: var(--theme-border) !important;
|
|
2355
|
+
}
|
|
2356
|
+
.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) {
|
|
2357
|
+
background: var(--theme-surface-strong) !important;
|
|
2358
|
+
}
|
|
2359
|
+
.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) {
|
|
2360
|
+
color: var(--theme-fg) !important;
|
|
2361
|
+
}
|
|
2362
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-stone-400, .text-stone-500) {
|
|
2363
|
+
color: var(--theme-fg-muted) !important;
|
|
2364
|
+
}
|
|
2365
|
+
.thread-ui-shell .timeline-kind-agent,
|
|
2366
|
+
.thread-ui-shell .timeline-kind-user,
|
|
2367
|
+
.thread-ui-shell .timeline-kind-command,
|
|
2368
|
+
.thread-ui-shell .timeline-kind-search,
|
|
2369
|
+
.thread-ui-shell .timeline-kind-file-read,
|
|
2370
|
+
.thread-ui-shell .timeline-kind-reasoning,
|
|
2371
|
+
.thread-ui-shell .timeline-kind-agent-tool,
|
|
2372
|
+
.thread-ui-shell .timeline-kind-skill-tool,
|
|
2373
|
+
.thread-ui-shell .timeline-kind-action,
|
|
2374
|
+
.thread-ui-shell .timeline-kind-plan,
|
|
2375
|
+
.thread-ui-shell .timeline-kind-file {
|
|
2376
|
+
border-left-width: 1px;
|
|
2377
|
+
}
|
|
2378
|
+
.thread-ui-shell .timeline-primary-text,
|
|
2379
|
+
.thread-ui-shell .timeline-message-content,
|
|
2380
|
+
.thread-ui-shell .timeline-mobile-bubble-content,
|
|
2381
|
+
.thread-ui-shell .thread-message-prose,
|
|
2382
|
+
.thread-ui-shell .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2383
|
+
color: var(--theme-fg);
|
|
2384
|
+
}
|
|
2385
|
+
.thread-ui-shell .timeline-user .thread-message-prose,
|
|
2386
|
+
.thread-ui-shell .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2387
|
+
color: oklch(0.24 0.027 255);
|
|
2388
|
+
}
|
|
2389
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user .thread-message-prose,
|
|
2390
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user .thread-message-prose,
|
|
2391
|
+
.thread-ui-shell.dark .timeline-user .thread-message-prose,
|
|
2392
|
+
.thread-ui-shell.thread-ui-theme-dark .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2393
|
+
.thread-ui-shell[data-theme-effective=dark] .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2394
|
+
.thread-ui-shell.dark .timeline-user .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2395
|
+
color: var(--theme-fg);
|
|
2396
|
+
}
|
|
2397
|
+
.thread-ui-shell .timeline-agent .thread-message-prose,
|
|
2398
|
+
.thread-ui-shell .timeline-agent .thread-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2399
|
+
color: var(--theme-fg);
|
|
2400
|
+
}
|
|
2401
|
+
.thread-ui-shell .thread-graph-message {
|
|
2402
|
+
width: 100%;
|
|
2403
|
+
min-width: 0;
|
|
2404
|
+
}
|
|
2405
|
+
.thread-ui-shell .thread-graph-message-bubble {
|
|
2406
|
+
color: var(--theme-fg);
|
|
2407
|
+
}
|
|
2408
|
+
.thread-ui-shell .thread-graph-message-bubble.is-user {
|
|
2409
|
+
width: 100%;
|
|
2410
|
+
max-width: 100%;
|
|
2411
|
+
border-radius: 0.75rem;
|
|
2412
|
+
background: #eef5f9;
|
|
2413
|
+
padding: 0.5rem 0.75rem;
|
|
2414
|
+
color: rgb(15 23 42);
|
|
2415
|
+
}
|
|
2416
|
+
.thread-ui-shell .thread-graph-message-bubble.is-assistant {
|
|
2417
|
+
width: 100%;
|
|
2418
|
+
border: 0;
|
|
2419
|
+
background: transparent;
|
|
2420
|
+
padding: 0;
|
|
2421
|
+
box-shadow: none;
|
|
2422
|
+
}
|
|
2423
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-bubble.is-user,
|
|
2424
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-bubble.is-user,
|
|
2425
|
+
.thread-ui-shell.dark .thread-graph-message-bubble.is-user {
|
|
2426
|
+
background: #212b35;
|
|
2427
|
+
color: rgb(241 245 249);
|
|
2428
|
+
}
|
|
2429
|
+
.thread-ui-shell .thread-graph-message-content.is-user,
|
|
2430
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-message-prose,
|
|
2431
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2432
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2433
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2434
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-message-prose :where(p, li, span, div, strong, em, code),
|
|
2435
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2436
|
+
.thread-ui-shell .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code) {
|
|
2437
|
+
color: rgb(51 65 85);
|
|
2438
|
+
}
|
|
2439
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user,
|
|
2440
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user,
|
|
2441
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user,
|
|
2442
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-message-prose,
|
|
2443
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-message-prose,
|
|
2444
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-message-prose,
|
|
2445
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2446
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2447
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-message-prose,
|
|
2448
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2449
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2450
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-markdown,
|
|
2451
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2452
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2453
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-plain-text,
|
|
2454
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-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-message-prose :where(p, li, span, div, strong, em, code),
|
|
2456
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-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-message-prose :where(p, li, span, div, strong, em, code),
|
|
2458
|
+
.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),
|
|
2459
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-message-prose :where(p, li, span, div, strong, em, code),
|
|
2460
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code),
|
|
2461
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code),
|
|
2462
|
+
.thread-ui-shell.dark .thread-graph-message-content.is-user .thread-graph-markdown :where(p, li, span, div, strong, em, code) {
|
|
2463
|
+
color: rgb(226 232 240);
|
|
2464
|
+
}
|
|
2465
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant,
|
|
2466
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-message-prose,
|
|
2467
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-markdown,
|
|
2468
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-plain-text,
|
|
2469
|
+
.thread-ui-shell .thread-graph-message-content.is-assistant .thread-graph-message-prose :where(p, li, span, div, strong, em, code) {
|
|
2470
|
+
color: var(--theme-fg);
|
|
2471
|
+
}
|
|
2472
|
+
.thread-ui-shell .thread-graph-message-prose,
|
|
2473
|
+
.thread-ui-shell .thread-graph-markdown,
|
|
2474
|
+
.thread-ui-shell .thread-graph-plain-text {
|
|
2475
|
+
color: inherit;
|
|
2476
|
+
}
|
|
2477
|
+
.thread-ui-shell .thread-graph-markdown {
|
|
2478
|
+
max-width: none;
|
|
2479
|
+
font-size: 0.875rem;
|
|
2480
|
+
line-height: 1.7;
|
|
2481
|
+
}
|
|
2482
|
+
.thread-ui-shell .thread-graph-message-markdown {
|
|
2483
|
+
color: inherit;
|
|
2484
|
+
word-break: break-word;
|
|
2485
|
+
}
|
|
2486
|
+
.thread-ui-shell .thread-graph-show-more {
|
|
2487
|
+
min-height: 1.25rem;
|
|
2488
|
+
border-color: var(--theme-border);
|
|
2489
|
+
background: color-mix(in oklch, var(--theme-panel) 72%, transparent);
|
|
2490
|
+
color: var(--theme-fg-muted);
|
|
2491
|
+
}
|
|
2492
|
+
.thread-ui-shell .thread-graph-show-more:hover,
|
|
2493
|
+
.thread-ui-shell .thread-graph-show-more:focus-visible {
|
|
2494
|
+
background: var(--theme-hover);
|
|
2495
|
+
color: var(--theme-fg);
|
|
2496
|
+
}
|
|
2497
|
+
.thread-ui-shell .thread-graph-markdown :where(p, ul, ol, pre, blockquote, table, hr) {
|
|
2498
|
+
margin-bottom: 0.75rem;
|
|
2499
|
+
}
|
|
2500
|
+
.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) {
|
|
2501
|
+
margin-bottom: 0;
|
|
2502
|
+
}
|
|
2503
|
+
.thread-ui-shell .thread-graph-markdown :where(a) {
|
|
2504
|
+
color: rgb(3 105 161);
|
|
2505
|
+
text-decoration: underline;
|
|
2506
|
+
text-underline-offset: 2px;
|
|
2507
|
+
}
|
|
2508
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-markdown :where(a),
|
|
2509
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-markdown :where(a),
|
|
2510
|
+
.thread-ui-shell.dark .thread-graph-markdown :where(a) {
|
|
2511
|
+
color: rgb(125 211 252);
|
|
2512
|
+
}
|
|
2513
|
+
.thread-ui-shell .thread-graph-markdown :where(blockquote) {
|
|
2514
|
+
border-left: 3px solid var(--theme-border-strong);
|
|
2515
|
+
padding-left: 0.85rem;
|
|
2516
|
+
color: var(--theme-fg-soft);
|
|
2517
|
+
}
|
|
2518
|
+
.thread-ui-shell .thread-graph-markdown :where(ul, ol) {
|
|
2519
|
+
padding-left: 1.25rem;
|
|
2520
|
+
}
|
|
2521
|
+
.thread-ui-shell .thread-graph-markdown :where(li) {
|
|
2522
|
+
margin-top: 0.25rem;
|
|
2523
|
+
}
|
|
2524
|
+
.thread-ui-shell .thread-graph-markdown :where(table) {
|
|
2525
|
+
display: block;
|
|
2526
|
+
width: 100%;
|
|
2527
|
+
overflow-x: auto;
|
|
2528
|
+
border-collapse: collapse;
|
|
2529
|
+
}
|
|
2530
|
+
.thread-ui-shell .thread-graph-markdown :where(th, td) {
|
|
2531
|
+
border: 1px solid var(--theme-border);
|
|
2532
|
+
padding: 0.4rem 0.55rem;
|
|
2533
|
+
text-align: left;
|
|
2534
|
+
}
|
|
2535
|
+
.thread-ui-shell .thread-graph-markdown :where(th) {
|
|
2536
|
+
background: var(--theme-surface-strong);
|
|
2537
|
+
color: var(--theme-fg);
|
|
2538
|
+
}
|
|
2539
|
+
.thread-ui-shell .thread-graph-code-block {
|
|
2540
|
+
border-color: rgb(226 232 240);
|
|
2541
|
+
background: rgb(248 250 252);
|
|
2542
|
+
color: rgb(31 41 55);
|
|
2543
|
+
}
|
|
2544
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-block,
|
|
2545
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-block,
|
|
2546
|
+
.thread-ui-shell.dark .thread-graph-code-block {
|
|
2547
|
+
border-color: #303642;
|
|
2548
|
+
background: #11141a;
|
|
2549
|
+
color: rgb(241 245 249);
|
|
2550
|
+
}
|
|
2551
|
+
.thread-ui-shell .thread-graph-code-block pre,
|
|
2552
|
+
.thread-ui-shell .thread-graph-code-block code {
|
|
2553
|
+
margin: 0;
|
|
2554
|
+
background: transparent;
|
|
2555
|
+
color: inherit;
|
|
2556
|
+
}
|
|
2557
|
+
.thread-ui-shell .thread-graph-code-copy {
|
|
2558
|
+
background: rgb(255 255 255 / 0.72);
|
|
2559
|
+
color: rgb(51 65 85);
|
|
2560
|
+
box-shadow: 0 4px 12px rgb(15 23 42 / 0.08);
|
|
2561
|
+
}
|
|
2562
|
+
.thread-ui-shell .thread-graph-code-copy:hover {
|
|
2563
|
+
background: rgb(255 255 255);
|
|
2564
|
+
color: rgb(15 23 42);
|
|
2565
|
+
}
|
|
2566
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-copy,
|
|
2567
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-copy,
|
|
2568
|
+
.thread-ui-shell.dark .thread-graph-code-copy {
|
|
2569
|
+
background: rgb(34 39 51 / 0.82);
|
|
2570
|
+
color: rgb(226 232 240);
|
|
2571
|
+
}
|
|
2572
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-code-copy:hover,
|
|
2573
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-code-copy:hover,
|
|
2574
|
+
.thread-ui-shell.dark .thread-graph-code-copy:hover {
|
|
2575
|
+
background: #2b313d;
|
|
2576
|
+
color: rgb(248 250 252);
|
|
2577
|
+
}
|
|
2578
|
+
.thread-ui-shell .thread-graph-inline-code {
|
|
2579
|
+
background: rgb(241 245 249);
|
|
2580
|
+
color: rgb(31 41 55);
|
|
2581
|
+
}
|
|
2582
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-inline-code,
|
|
2583
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-inline-code,
|
|
2584
|
+
.thread-ui-shell.dark .thread-graph-inline-code {
|
|
2585
|
+
background: #222733;
|
|
2586
|
+
color: rgb(241 245 249);
|
|
2587
|
+
}
|
|
2588
|
+
.thread-ui-shell .thread-graph-message-sender {
|
|
2589
|
+
background: oklch(0.96 0.025 155);
|
|
2590
|
+
color: oklch(0.42 0.11 155);
|
|
2591
|
+
}
|
|
2592
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-message-sender,
|
|
2593
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-message-sender,
|
|
2594
|
+
.thread-ui-shell.dark .thread-graph-message-sender {
|
|
2595
|
+
background: rgb(52 211 153 / 0.1);
|
|
2596
|
+
color: rgb(110 231 183);
|
|
2597
|
+
}
|
|
2598
|
+
.thread-ui-shell .thread-graph-message-copy {
|
|
2599
|
+
border-color: var(--theme-border);
|
|
2600
|
+
background: var(--theme-panel);
|
|
2601
|
+
color: var(--theme-fg-muted);
|
|
2602
|
+
}
|
|
2603
|
+
.thread-ui-shell .thread-graph-message-copy:hover {
|
|
2604
|
+
background: var(--theme-hover);
|
|
2605
|
+
color: var(--theme-fg);
|
|
2606
|
+
}
|
|
2607
|
+
.thread-ui-shell .thread-graph-message-header-actions {
|
|
2608
|
+
color: var(--theme-fg-muted);
|
|
2609
|
+
}
|
|
2610
|
+
.thread-ui-shell .thread-graph-message-time {
|
|
2611
|
+
color: var(--theme-fg-muted);
|
|
2612
|
+
white-space: nowrap;
|
|
2613
|
+
}
|
|
2614
|
+
.thread-ui-shell .thread-graph-message-status {
|
|
2615
|
+
box-shadow: none;
|
|
2616
|
+
}
|
|
2617
|
+
.thread-ui-shell .thread-graph-message-status-icon {
|
|
2618
|
+
align-items: center;
|
|
2619
|
+
justify-content: center;
|
|
2620
|
+
}
|
|
2621
|
+
@media (max-width: 639px) {
|
|
2622
|
+
.thread-ui-shell .thread-graph-message-header {
|
|
2623
|
+
margin-bottom: 0.375rem;
|
|
2624
|
+
flex-wrap: nowrap;
|
|
2625
|
+
}
|
|
2626
|
+
.thread-ui-shell .thread-graph-message-sender {
|
|
2627
|
+
padding: 0.1875rem 0.5rem;
|
|
2628
|
+
font-size: 0.6875rem;
|
|
2629
|
+
line-height: 1rem;
|
|
2630
|
+
}
|
|
2631
|
+
.thread-ui-shell .thread-graph-message-header-actions {
|
|
2632
|
+
gap: 0.25rem;
|
|
2633
|
+
}
|
|
2634
|
+
.thread-ui-shell .thread-graph-message-copy {
|
|
2635
|
+
height: 1.55rem;
|
|
2636
|
+
width: 1.55rem;
|
|
2637
|
+
border-radius: 0.45rem;
|
|
2638
|
+
}
|
|
2639
|
+
.thread-ui-shell .thread-graph-message-time {
|
|
2640
|
+
font-size: 0.625rem;
|
|
2641
|
+
}
|
|
2642
|
+
.thread-ui-shell :where(.thread-graph-message-status, .thread-graph-tool-badge) .thread-graph-status-label {
|
|
2643
|
+
position: absolute;
|
|
2644
|
+
width: 1px;
|
|
2645
|
+
height: 1px;
|
|
2646
|
+
padding: 0;
|
|
2647
|
+
margin: -1px;
|
|
2648
|
+
overflow: hidden;
|
|
2649
|
+
clip: rect(0, 0, 0, 0);
|
|
2650
|
+
white-space: nowrap;
|
|
2651
|
+
border: 0;
|
|
2652
|
+
}
|
|
2653
|
+
.thread-ui-shell :where(.thread-graph-message-status, .thread-graph-tool-badge) {
|
|
2654
|
+
min-width: 1.45rem;
|
|
2655
|
+
justify-content: center;
|
|
2656
|
+
padding-left: 0.25rem !important;
|
|
2657
|
+
padding-right: 0.25rem !important;
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
@media (min-width: 640px) {
|
|
2661
|
+
.thread-ui-shell .thread-graph-message-bubble.is-user {
|
|
2662
|
+
padding: 0.375rem 1rem;
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
.thread-ui-shell .timeline-soft-text,
|
|
2666
|
+
.thread-ui-shell .thread-message-prose :where(blockquote) {
|
|
2667
|
+
color: var(--theme-fg-soft);
|
|
2668
|
+
}
|
|
2669
|
+
.thread-ui-shell .timeline-meta-text,
|
|
2670
|
+
.thread-ui-shell .thread-message-prose :where(figcaption) {
|
|
2671
|
+
color: var(--theme-fg-muted);
|
|
2672
|
+
}
|
|
2673
|
+
.thread-ui-shell .timeline-overlay-badge,
|
|
2674
|
+
.thread-ui-shell .ui-status-neutral,
|
|
2675
|
+
.thread-ui-shell .ui-status-info,
|
|
2676
|
+
.thread-ui-shell .ui-status-warning,
|
|
2677
|
+
.thread-ui-shell .ui-status-success,
|
|
2678
|
+
.thread-ui-shell .ui-status-danger {
|
|
2679
|
+
border-color: transparent;
|
|
2680
|
+
box-shadow: none;
|
|
2681
|
+
}
|
|
2682
|
+
.thread-ui-shell .timeline-command-status-complete,
|
|
2683
|
+
.thread-ui-shell .timeline-command-status-pending,
|
|
2684
|
+
.thread-ui-shell .timeline-delta-badge,
|
|
2685
|
+
.thread-ui-shell .timeline-live-plan-step {
|
|
2686
|
+
border-color: var(--theme-border);
|
|
2687
|
+
background: var(--theme-muted);
|
|
2688
|
+
color: var(--theme-fg-soft);
|
|
2689
|
+
}
|
|
2690
|
+
.thread-ui-shell .ui-status-neutral {
|
|
2691
|
+
background: var(--theme-muted);
|
|
2692
|
+
color: var(--theme-fg-soft);
|
|
2693
|
+
}
|
|
2694
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-neutral,
|
|
2695
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-neutral,
|
|
2696
|
+
.thread-ui-shell.dark .ui-status-neutral {
|
|
2697
|
+
border-color: #303642;
|
|
2698
|
+
background: #151923;
|
|
2699
|
+
color: rgb(203 213 225);
|
|
2700
|
+
}
|
|
2701
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-room-card.is-active .ui-status-neutral,
|
|
2702
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-room-card.is-active .ui-status-neutral,
|
|
2703
|
+
.thread-ui-shell.dark .thread-graph-room-card.is-active .ui-status-neutral {
|
|
2704
|
+
border-color: #424b5e;
|
|
2705
|
+
background: #1a1f2a;
|
|
2706
|
+
color: rgb(203 213 225);
|
|
2707
|
+
}
|
|
2708
|
+
.thread-ui-shell .ui-status-info {
|
|
2709
|
+
background: oklch(0.94 0.03 235);
|
|
2710
|
+
color: oklch(0.43 0.09 242);
|
|
2711
|
+
}
|
|
2712
|
+
.thread-ui-shell .ui-status-warning {
|
|
2713
|
+
background: oklch(0.94 0.048 84);
|
|
2714
|
+
color: oklch(0.46 0.08 75);
|
|
2715
|
+
}
|
|
2716
|
+
.thread-ui-shell .ui-status-success {
|
|
2717
|
+
background: oklch(0.94 0.052 155);
|
|
2718
|
+
color: oklch(0.43 0.095 155);
|
|
2719
|
+
}
|
|
2720
|
+
.thread-ui-shell .ui-status-danger {
|
|
2721
|
+
background: oklch(0.94 0.04 25);
|
|
2722
|
+
color: oklch(0.48 0.125 24);
|
|
2723
|
+
}
|
|
2724
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-info,
|
|
2725
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-info,
|
|
2726
|
+
.thread-ui-shell.dark .ui-status-info {
|
|
2727
|
+
background: oklch(0.3 0.042 235);
|
|
2728
|
+
color: oklch(0.77 0.1 235);
|
|
2729
|
+
}
|
|
2730
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-warning,
|
|
2731
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-warning,
|
|
2732
|
+
.thread-ui-shell.dark .ui-status-warning {
|
|
2733
|
+
background: oklch(0.31 0.045 75);
|
|
2734
|
+
color: oklch(0.83 0.11 80);
|
|
2735
|
+
}
|
|
2736
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-success,
|
|
2737
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-success,
|
|
2738
|
+
.thread-ui-shell.dark .ui-status-success {
|
|
2739
|
+
background: oklch(0.31 0.05 155);
|
|
2740
|
+
color: oklch(0.8 0.115 155);
|
|
2741
|
+
}
|
|
2742
|
+
.thread-ui-shell.thread-ui-theme-dark .ui-status-danger,
|
|
2743
|
+
.thread-ui-shell[data-theme-effective=dark] .ui-status-danger,
|
|
2744
|
+
.thread-ui-shell.dark .ui-status-danger {
|
|
2745
|
+
background: oklch(0.31 0.052 25);
|
|
2746
|
+
color: oklch(0.78 0.12 25);
|
|
2747
|
+
}
|
|
2748
|
+
.thread-ui-shell .thread-message-icon-user,
|
|
2749
|
+
.thread-ui-shell .thread-message-icon-agent {
|
|
2750
|
+
border-color: transparent;
|
|
2751
|
+
background: var(--theme-muted);
|
|
2752
|
+
color: var(--theme-fg-muted);
|
|
2753
|
+
}
|
|
2754
|
+
.thread-ui-shell .thread-graph-thinking-trigger {
|
|
2755
|
+
display: inline-flex;
|
|
2756
|
+
align-items: center;
|
|
2757
|
+
color: rgb(148 163 184);
|
|
2758
|
+
}
|
|
2759
|
+
.thread-ui-shell .thread-graph-thinking-trigger:hover,
|
|
2760
|
+
.thread-ui-shell .thread-graph-thinking-trigger[data-state=open] {
|
|
2761
|
+
color: rgb(125 211 252);
|
|
2762
|
+
}
|
|
2763
|
+
.thread-ui-shell .thread-graph-thinking-label {
|
|
2764
|
+
min-width: 0;
|
|
2765
|
+
}
|
|
2766
|
+
.thread-ui-shell .thread-graph-thinking-body {
|
|
2767
|
+
border-color: rgb(42 47 58);
|
|
2768
|
+
background: #1b1f29;
|
|
2769
|
+
color: rgb(203 213 225);
|
|
2770
|
+
}
|
|
2771
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger {
|
|
2772
|
+
color: rgb(100 116 139);
|
|
2773
|
+
}
|
|
2774
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger:hover,
|
|
2775
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-trigger[data-state=open] {
|
|
2776
|
+
color: rgb(3 105 161);
|
|
2777
|
+
}
|
|
2778
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-thinking-body {
|
|
2779
|
+
border-color: rgb(226 232 240);
|
|
2780
|
+
background: rgb(248 250 252);
|
|
2781
|
+
color: rgb(51 65 85);
|
|
2782
|
+
}
|
|
2783
|
+
.thread-ui-shell .timeline-corner-copy-visual {
|
|
2784
|
+
border-color: var(--theme-border);
|
|
2785
|
+
background: color-mix(in oklch, var(--theme-panel) 88%, transparent);
|
|
2786
|
+
color: var(--theme-fg-muted);
|
|
2787
|
+
}
|
|
2788
|
+
.thread-ui-shell .thread-composer-form {
|
|
2789
|
+
border-color: var(--theme-border);
|
|
2790
|
+
background: var(--theme-surface);
|
|
2791
|
+
}
|
|
2792
|
+
.thread-ui-shell .thread-composer-toolbar,
|
|
2793
|
+
.thread-ui-shell .thread-composer-input,
|
|
2794
|
+
.thread-ui-shell .thread-composer-menu {
|
|
2795
|
+
border-color: var(--theme-border);
|
|
2796
|
+
background: var(--theme-panel);
|
|
2797
|
+
color: var(--theme-fg);
|
|
2798
|
+
}
|
|
2799
|
+
.thread-ui-shell .thread-composer-toolbar {
|
|
2800
|
+
border-radius: 0;
|
|
2801
|
+
border: 0;
|
|
2802
|
+
background: transparent;
|
|
2803
|
+
box-shadow: none;
|
|
2804
|
+
order: 2;
|
|
2805
|
+
min-height: 2.75rem;
|
|
2806
|
+
padding: 0.25rem 0.75rem 0.65rem;
|
|
2807
|
+
flex-wrap: wrap;
|
|
2808
|
+
align-items: center;
|
|
2809
|
+
}
|
|
2810
|
+
.thread-ui-shell .thread-composer-prompt-region {
|
|
2811
|
+
order: 1;
|
|
2812
|
+
}
|
|
2813
|
+
.thread-ui-shell .thread-composer-input {
|
|
2814
|
+
position: relative;
|
|
2815
|
+
min-height: 5.25rem !important;
|
|
2816
|
+
max-height: 12rem !important;
|
|
2817
|
+
border: 0;
|
|
2818
|
+
border-radius: 0;
|
|
2819
|
+
background: transparent !important;
|
|
2820
|
+
box-shadow: none;
|
|
2821
|
+
overflow: visible;
|
|
2822
|
+
padding-top: 0.7rem;
|
|
2823
|
+
padding-bottom: 0.45rem;
|
|
2824
|
+
}
|
|
2825
|
+
.thread-ui-shell .thread-composer-input:focus-within {
|
|
2826
|
+
border-color: transparent;
|
|
2827
|
+
box-shadow: none;
|
|
2828
|
+
}
|
|
2829
|
+
.thread-ui-shell .thread-composer-input [contenteditable],
|
|
2830
|
+
.thread-ui-shell .thread-composer-input textarea {
|
|
2831
|
+
display: block;
|
|
2832
|
+
width: 100%;
|
|
2833
|
+
min-width: 0;
|
|
2834
|
+
background: transparent !important;
|
|
2835
|
+
color: var(--theme-fg);
|
|
2836
|
+
font-size: 1rem;
|
|
2837
|
+
line-height: 1.55;
|
|
2838
|
+
}
|
|
2839
|
+
.thread-ui-shell .thread-composer-input [contenteditable] {
|
|
2840
|
+
min-height: 4.15rem !important;
|
|
2841
|
+
max-height: 9.5rem !important;
|
|
2842
|
+
overflow-y: auto;
|
|
2843
|
+
}
|
|
2844
|
+
.thread-ui-shell .thread-composer-input textarea {
|
|
2845
|
+
min-height: 4.15rem !important;
|
|
2846
|
+
max-height: 9.5rem !important;
|
|
2847
|
+
overflow-y: auto;
|
|
2848
|
+
resize: none;
|
|
2849
|
+
}
|
|
2850
|
+
.thread-ui-shell .thread-composer-shell {
|
|
2851
|
+
border: 1px solid var(--theme-border);
|
|
2852
|
+
background: #fbfcfd;
|
|
2853
|
+
box-shadow: 0 4px 18px oklch(0.22 0.024 255 / 0.04);
|
|
2854
|
+
}
|
|
2855
|
+
.thread-ui-shell .thread-composer-send-button {
|
|
2856
|
+
flex: 0 0 auto;
|
|
2857
|
+
}
|
|
2858
|
+
.thread-ui-shell .thread-goal-compose-card {
|
|
2859
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 18%, var(--theme-border));
|
|
2860
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 7%, var(--theme-panel));
|
|
2861
|
+
color: var(--theme-fg-soft);
|
|
2862
|
+
box-shadow: 0 8px 18px rgb(15 23 42 / 0.05);
|
|
2863
|
+
}
|
|
2864
|
+
.thread-ui-shell .thread-goal-compose-label {
|
|
2865
|
+
color: color-mix(in oklch, var(--theme-accent-solid) 68%, var(--theme-fg));
|
|
2866
|
+
}
|
|
2867
|
+
.thread-ui-shell .thread-goal-compose-field {
|
|
2868
|
+
color: var(--theme-fg-soft);
|
|
2869
|
+
}
|
|
2870
|
+
.thread-ui-shell .thread-goal-compose-input {
|
|
2871
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 20%, var(--theme-border));
|
|
2872
|
+
background: var(--theme-panel);
|
|
2873
|
+
color: var(--theme-fg);
|
|
2874
|
+
}
|
|
2875
|
+
.thread-ui-shell .thread-goal-compose-input::placeholder {
|
|
2876
|
+
color: var(--theme-fg-muted);
|
|
2877
|
+
}
|
|
2878
|
+
.thread-ui-shell .thread-goal-compose-input:focus {
|
|
2879
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 48%, var(--theme-border));
|
|
2880
|
+
}
|
|
2881
|
+
.thread-ui-shell .thread-goal-compose-cancel {
|
|
2882
|
+
border-color: var(--theme-border);
|
|
2883
|
+
background: var(--theme-surface-strong);
|
|
2884
|
+
color: var(--theme-fg-soft);
|
|
2885
|
+
}
|
|
2886
|
+
.thread-ui-shell .thread-goal-compose-cancel:hover {
|
|
2887
|
+
background: var(--theme-hover);
|
|
2888
|
+
color: var(--theme-fg);
|
|
2889
|
+
}
|
|
2890
|
+
.thread-ui-shell .thread-goal-compose-error {
|
|
2891
|
+
color: rgb(190 18 60);
|
|
2892
|
+
}
|
|
2893
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-card,
|
|
2894
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-card,
|
|
2895
|
+
.thread-ui-shell.dark .thread-goal-compose-card {
|
|
2896
|
+
border-color: rgb(125 211 252 / 0.25);
|
|
2897
|
+
background: rgb(125 211 252 / 0.07);
|
|
2898
|
+
color: rgb(226 232 240);
|
|
2899
|
+
box-shadow: 0 8px 18px rgb(0 0 0 / 0.18);
|
|
2900
|
+
}
|
|
2901
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-label,
|
|
2902
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-label,
|
|
2903
|
+
.thread-ui-shell.dark .thread-goal-compose-label {
|
|
2904
|
+
color: rgb(224 242 254 / 0.9);
|
|
2905
|
+
}
|
|
2906
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-field,
|
|
2907
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-field,
|
|
2908
|
+
.thread-ui-shell.dark .thread-goal-compose-field {
|
|
2909
|
+
color: rgb(203 213 225);
|
|
2910
|
+
}
|
|
2911
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-input,
|
|
2912
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-input,
|
|
2913
|
+
.thread-ui-shell.dark .thread-goal-compose-input {
|
|
2914
|
+
border-color: rgb(125 211 252 / 0.25);
|
|
2915
|
+
background: rgb(2 6 23 / 0.46);
|
|
2916
|
+
color: rgb(241 245 249);
|
|
2917
|
+
}
|
|
2918
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-cancel,
|
|
2919
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-cancel,
|
|
2920
|
+
.thread-ui-shell.dark .thread-goal-compose-cancel {
|
|
2921
|
+
border-color: #343b48;
|
|
2922
|
+
background: #1d222c;
|
|
2923
|
+
color: rgb(203 213 225);
|
|
2924
|
+
}
|
|
2925
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-cancel:hover,
|
|
2926
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-cancel:hover,
|
|
2927
|
+
.thread-ui-shell.dark .thread-goal-compose-cancel:hover {
|
|
2928
|
+
background: #222733;
|
|
2929
|
+
color: rgb(241 245 249);
|
|
2930
|
+
}
|
|
2931
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-goal-compose-error,
|
|
2932
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-goal-compose-error,
|
|
2933
|
+
.thread-ui-shell.dark .thread-goal-compose-error {
|
|
2934
|
+
color: rgb(254 205 211);
|
|
2935
|
+
}
|
|
2936
|
+
@media (min-width: 640px) {
|
|
2937
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-shell {
|
|
2938
|
+
border-radius: 16px;
|
|
2939
|
+
}
|
|
2940
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input {
|
|
2941
|
+
min-height: 5.75rem !important;
|
|
2942
|
+
max-height: 12.5rem !important;
|
|
2943
|
+
padding-top: 0.9rem;
|
|
2944
|
+
}
|
|
2945
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input [contenteditable],
|
|
2946
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-input textarea {
|
|
2947
|
+
min-height: 4.5rem !important;
|
|
2948
|
+
max-height: 10rem !important;
|
|
2949
|
+
font-size: 0.875rem;
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-composer-form {
|
|
2953
|
+
padding: 0.5rem 1rem 0.75rem;
|
|
2954
|
+
}
|
|
2955
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-shell,
|
|
2956
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-shell,
|
|
2957
|
+
.thread-ui-shell.dark .thread-composer-shell {
|
|
2958
|
+
border-color: #303642;
|
|
2959
|
+
background: #181b23;
|
|
2960
|
+
box-shadow: 0 8px 24px oklch(0 0 0 / 0.22);
|
|
2961
|
+
}
|
|
2962
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-toolbar,
|
|
2963
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-toolbar,
|
|
2964
|
+
.thread-ui-shell.dark .thread-composer-toolbar,
|
|
2965
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input,
|
|
2966
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input,
|
|
2967
|
+
.thread-ui-shell.dark .thread-composer-input {
|
|
2968
|
+
border-color: #303642 !important;
|
|
2969
|
+
background: transparent !important;
|
|
2970
|
+
color: rgb(241 245 249) !important;
|
|
2971
|
+
box-shadow: none !important;
|
|
2972
|
+
}
|
|
2973
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input [contenteditable],
|
|
2974
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input [contenteditable],
|
|
2975
|
+
.thread-ui-shell.dark .thread-composer-input [contenteditable],
|
|
2976
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input textarea,
|
|
2977
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input textarea,
|
|
2978
|
+
.thread-ui-shell.dark .thread-composer-input textarea {
|
|
2979
|
+
background: transparent !important;
|
|
2980
|
+
color: rgb(241 245 249) !important;
|
|
2981
|
+
}
|
|
2982
|
+
.thread-ui-shell .thread-graph-composer-form {
|
|
2983
|
+
border-color: var(--theme-border);
|
|
2984
|
+
background: var(--theme-surface);
|
|
2985
|
+
}
|
|
2986
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-form,
|
|
2987
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-form,
|
|
2988
|
+
.thread-ui-shell.dark .thread-graph-composer-form {
|
|
2989
|
+
border-color: var(--theme-border);
|
|
2990
|
+
background: var(--theme-surface);
|
|
2991
|
+
}
|
|
2992
|
+
.thread-ui-shell .thread-graph-composer-shell {
|
|
2993
|
+
border: 1px solid var(--theme-border);
|
|
2994
|
+
background: var(--theme-panel);
|
|
2995
|
+
box-shadow: 0 4px 18px oklch(0.22 0.024 255 / 0.04);
|
|
2996
|
+
overflow: visible !important;
|
|
2997
|
+
}
|
|
2998
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-shell,
|
|
2999
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-shell,
|
|
3000
|
+
.thread-ui-shell.dark .thread-graph-composer-shell {
|
|
3001
|
+
border-color: var(--theme-border-strong);
|
|
3002
|
+
background: var(--theme-panel);
|
|
3003
|
+
box-shadow: 0 8px 24px oklch(0 0 0 / 0.22);
|
|
3004
|
+
}
|
|
3005
|
+
.thread-ui-shell .thread-graph-composer-input-group {
|
|
3006
|
+
order: 1;
|
|
3007
|
+
display: flex;
|
|
3008
|
+
flex-direction: column;
|
|
3009
|
+
align-items: stretch;
|
|
3010
|
+
height: auto;
|
|
3011
|
+
min-height: 0;
|
|
3012
|
+
color: rgb(30 41 59);
|
|
3013
|
+
overflow: visible !important;
|
|
3014
|
+
}
|
|
3015
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input-group,
|
|
3016
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input-group,
|
|
3017
|
+
.thread-ui-shell.dark .thread-graph-composer-input-group {
|
|
3018
|
+
color: rgb(241 245 249);
|
|
3019
|
+
}
|
|
3020
|
+
.thread-ui-shell .thread-graph-composer-prompt-region {
|
|
3021
|
+
order: 1;
|
|
3022
|
+
}
|
|
3023
|
+
.thread-ui-shell .thread-graph-composer-input {
|
|
3024
|
+
position: relative;
|
|
3025
|
+
border: 0;
|
|
3026
|
+
background: transparent;
|
|
3027
|
+
color: rgb(30 41 59);
|
|
3028
|
+
box-shadow: none;
|
|
3029
|
+
overflow-y: auto;
|
|
3030
|
+
}
|
|
3031
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input,
|
|
3032
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input,
|
|
3033
|
+
.thread-ui-shell.dark .thread-graph-composer-input {
|
|
3034
|
+
color: rgb(241 245 249);
|
|
3035
|
+
}
|
|
3036
|
+
.thread-ui-shell .thread-graph-composer-input [contenteditable] {
|
|
3037
|
+
display: block;
|
|
3038
|
+
width: 100%;
|
|
3039
|
+
min-width: 0;
|
|
3040
|
+
overflow-y: auto;
|
|
3041
|
+
background: transparent;
|
|
3042
|
+
color: inherit;
|
|
3043
|
+
}
|
|
3044
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-chip,
|
|
3045
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-chip {
|
|
3046
|
+
box-sizing: border-box;
|
|
3047
|
+
flex: 0 0 auto;
|
|
3048
|
+
width: max-content !important;
|
|
3049
|
+
max-width: min(100%, 7.25rem) !important;
|
|
3050
|
+
vertical-align: middle;
|
|
3051
|
+
}
|
|
3052
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-chip-photo,
|
|
3053
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-chip-photo {
|
|
3054
|
+
display: inline-flex !important;
|
|
3055
|
+
flex-direction: column;
|
|
3056
|
+
align-items: flex-start;
|
|
3057
|
+
gap: 0.25rem;
|
|
3058
|
+
padding: 0.35rem !important;
|
|
3059
|
+
}
|
|
3060
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-thumb,
|
|
3061
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-thumb {
|
|
3062
|
+
display: block;
|
|
3063
|
+
width: 5.75rem !important;
|
|
3064
|
+
height: 3.75rem !important;
|
|
3065
|
+
max-width: 100%;
|
|
3066
|
+
border-radius: 0.6rem !important;
|
|
3067
|
+
object-fit: cover;
|
|
3068
|
+
}
|
|
3069
|
+
.thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3070
|
+
.thread-ui-shell .thread-composer-input .thread-composer-attachment-caption {
|
|
3071
|
+
display: block !important;
|
|
3072
|
+
width: 100%;
|
|
3073
|
+
max-width: 5.75rem !important;
|
|
3074
|
+
margin-left: 0 !important;
|
|
3075
|
+
overflow: hidden;
|
|
3076
|
+
color: rgb(3 105 161);
|
|
3077
|
+
text-overflow: ellipsis;
|
|
3078
|
+
white-space: nowrap;
|
|
3079
|
+
}
|
|
3080
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3081
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3082
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3083
|
+
.thread-ui-shell.dark .thread-graph-composer-input .thread-composer-attachment-caption,
|
|
3084
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-input .thread-composer-attachment-caption,
|
|
3085
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-input .thread-composer-attachment-caption,
|
|
3086
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-composer-input .thread-composer-attachment-caption,
|
|
3087
|
+
.thread-ui-shell.dark .thread-composer-input .thread-composer-attachment-caption {
|
|
3088
|
+
color: rgb(125 211 252);
|
|
3089
|
+
}
|
|
3090
|
+
.thread-ui-shell .thread-graph-composer-toolbar {
|
|
3091
|
+
order: 2;
|
|
3092
|
+
width: 100%;
|
|
3093
|
+
min-height: 2.75rem;
|
|
3094
|
+
flex-wrap: wrap;
|
|
3095
|
+
justify-content: flex-start;
|
|
3096
|
+
gap: 0.5rem;
|
|
3097
|
+
border: 0;
|
|
3098
|
+
background: transparent;
|
|
3099
|
+
padding: 0 0.5rem 0.5rem;
|
|
3100
|
+
color: rgb(100 116 139);
|
|
3101
|
+
box-shadow: none;
|
|
3102
|
+
overflow: visible !important;
|
|
3103
|
+
}
|
|
3104
|
+
@media (min-width: 640px) {
|
|
3105
|
+
.thread-ui-shell:not([data-thread-layout=mobile]) .thread-graph-composer-toolbar {
|
|
3106
|
+
flex-wrap: nowrap;
|
|
3107
|
+
padding: 0 0.75rem 0.75rem;
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-toolbar,
|
|
3111
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-toolbar,
|
|
3112
|
+
.thread-ui-shell.dark .thread-graph-composer-toolbar {
|
|
3113
|
+
color: rgb(148 163 184);
|
|
3114
|
+
}
|
|
3115
|
+
.thread-ui-shell .thread-graph-composer-send-button {
|
|
3116
|
+
flex: 0 0 auto;
|
|
3117
|
+
}
|
|
3118
|
+
.thread-ui-shell .thread-graph-composer-stop-button {
|
|
3119
|
+
border-color: rgb(244 63 94 / 0.28) !important;
|
|
3120
|
+
box-shadow: 0 8px 18px rgb(15 23 42 / 0.14);
|
|
3121
|
+
}
|
|
3122
|
+
.thread-ui-shell .thread-graph-composer-prompt-region .thread-graph-composer-stop-button {
|
|
3123
|
+
position: absolute;
|
|
3124
|
+
}
|
|
3125
|
+
@media (max-width: 639px) {
|
|
3126
|
+
.thread-ui-shell .thread-graph-composer-form {
|
|
3127
|
+
padding: 0.35rem 0.55rem calc(env(safe-area-inset-bottom) + 0.35rem) !important;
|
|
3128
|
+
}
|
|
3129
|
+
.thread-ui-shell .thread-graph-composer-shell {
|
|
3130
|
+
border-radius: 14px !important;
|
|
3131
|
+
}
|
|
3132
|
+
.thread-ui-shell .thread-graph-composer-input {
|
|
3133
|
+
min-height: 3.65rem !important;
|
|
3134
|
+
max-height: 7.5rem !important;
|
|
3135
|
+
padding: 0.65rem 0.75rem 0.2rem !important;
|
|
3136
|
+
}
|
|
3137
|
+
.thread-ui-shell .thread-graph-composer-input [contenteditable] {
|
|
3138
|
+
min-height: 3rem !important;
|
|
3139
|
+
padding-right: 2.5rem;
|
|
3140
|
+
}
|
|
3141
|
+
.thread-ui-shell .thread-graph-composer-toolbar {
|
|
3142
|
+
min-height: 2.35rem;
|
|
3143
|
+
gap: 0.3rem;
|
|
3144
|
+
padding: 0 0.45rem 0.45rem;
|
|
3145
|
+
}
|
|
3146
|
+
.thread-ui-shell .thread-graph-composer-toolbar > .flex {
|
|
3147
|
+
min-width: 0;
|
|
3148
|
+
gap: 0.3rem;
|
|
3149
|
+
}
|
|
3150
|
+
.thread-ui-shell .thread-graph-composer-icon-button,
|
|
3151
|
+
.thread-ui-shell .thread-graph-composer-send-button {
|
|
3152
|
+
width: 1.95rem !important;
|
|
3153
|
+
height: 1.95rem !important;
|
|
3154
|
+
}
|
|
3155
|
+
.thread-ui-shell .thread-graph-composer-inline-toggle {
|
|
3156
|
+
height: 1.95rem;
|
|
3157
|
+
max-width: 6.75rem !important;
|
|
3158
|
+
padding-left: 0.5rem !important;
|
|
3159
|
+
padding-right: 0.5rem !important;
|
|
3160
|
+
font-size: 0.6875rem;
|
|
3161
|
+
}
|
|
3162
|
+
.thread-ui-shell .thread-graph-composer-stop-button {
|
|
3163
|
+
top: 0.45rem !important;
|
|
3164
|
+
right: 0.45rem !important;
|
|
3165
|
+
width: 1.8rem !important;
|
|
3166
|
+
height: 1.8rem !important;
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
.thread-ui-shell .thread-composer-icon-button,
|
|
3170
|
+
.thread-ui-shell .thread-composer-inline-toggle,
|
|
3171
|
+
.thread-ui-shell .thread-composer-chip-button,
|
|
3172
|
+
.thread-ui-shell .thread-composer-menu-item,
|
|
3173
|
+
.thread-ui-shell .thread-composer-panel-button,
|
|
3174
|
+
.thread-ui-shell .thread-graph-composer-icon-button,
|
|
3175
|
+
.thread-ui-shell .thread-graph-composer-inline-toggle,
|
|
3176
|
+
.thread-ui-shell .thread-graph-composer-chip-button,
|
|
3177
|
+
.thread-ui-shell .thread-graph-composer-menu-item,
|
|
3178
|
+
.thread-ui-shell .thread-graph-composer-panel-button {
|
|
3179
|
+
border-color: var(--theme-border) !important;
|
|
3180
|
+
background: transparent !important;
|
|
3181
|
+
color: var(--theme-fg-soft) !important;
|
|
3182
|
+
}
|
|
3183
|
+
.thread-ui-shell .thread-composer-icon-button:hover,
|
|
3184
|
+
.thread-ui-shell .thread-composer-inline-toggle:hover,
|
|
3185
|
+
.thread-ui-shell .thread-composer-chip-button:hover,
|
|
3186
|
+
.thread-ui-shell .thread-composer-menu-item:hover,
|
|
3187
|
+
.thread-ui-shell .thread-composer-panel-button:hover,
|
|
3188
|
+
.thread-ui-shell .thread-graph-composer-icon-button:hover,
|
|
3189
|
+
.thread-ui-shell .thread-graph-composer-inline-toggle:hover,
|
|
3190
|
+
.thread-ui-shell .thread-graph-composer-chip-button:hover,
|
|
3191
|
+
.thread-ui-shell .thread-graph-composer-menu-item:hover,
|
|
3192
|
+
.thread-ui-shell .thread-graph-composer-panel-button:hover {
|
|
3193
|
+
background: var(--theme-hover) !important;
|
|
3194
|
+
color: var(--theme-fg) !important;
|
|
3195
|
+
}
|
|
3196
|
+
.thread-ui-shell .thread-composer-icon-button,
|
|
3197
|
+
.thread-ui-shell .thread-graph-composer-icon-button {
|
|
3198
|
+
background: var(--theme-muted) !important;
|
|
3199
|
+
}
|
|
3200
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-icon-button,
|
|
3201
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-icon-button,
|
|
3202
|
+
.thread-ui-shell.dark .thread-composer-icon-button,
|
|
3203
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-icon-button,
|
|
3204
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-icon-button,
|
|
3205
|
+
.thread-ui-shell.dark .thread-graph-composer-icon-button {
|
|
3206
|
+
border-color: #303642 !important;
|
|
3207
|
+
background: #222733 !important;
|
|
3208
|
+
color: rgb(203 213 225) !important;
|
|
3209
|
+
}
|
|
3210
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-icon-button:hover,
|
|
3211
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-icon-button:hover,
|
|
3212
|
+
.thread-ui-shell.dark .thread-composer-icon-button:hover,
|
|
3213
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-icon-button:hover,
|
|
3214
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-icon-button:hover,
|
|
3215
|
+
.thread-ui-shell.dark .thread-graph-composer-icon-button:hover {
|
|
3216
|
+
background: #2b313d !important;
|
|
3217
|
+
color: rgb(241 245 249) !important;
|
|
3218
|
+
}
|
|
3219
|
+
.thread-ui-shell .thread-composer-menu,
|
|
3220
|
+
.thread-ui-shell .thread-graph-composer-menu {
|
|
3221
|
+
border-radius: 12px;
|
|
3222
|
+
border-color: var(--theme-border) !important;
|
|
3223
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent) !important;
|
|
3224
|
+
color: var(--theme-fg) !important;
|
|
3225
|
+
box-shadow: 0 16px 38px oklch(0.22 0.024 255 / 0.16);
|
|
3226
|
+
z-index: 80;
|
|
3227
|
+
}
|
|
3228
|
+
.thread-ui-shell [data-composer-menu-surface=true] {
|
|
3229
|
+
border-color: var(--theme-border) !important;
|
|
3230
|
+
background: color-mix(in oklch, var(--theme-panel) 96%, transparent) !important;
|
|
3231
|
+
color: var(--theme-fg) !important;
|
|
3232
|
+
box-shadow: 0 16px 38px oklch(0.22 0.024 255 / 0.16) !important;
|
|
3233
|
+
}
|
|
3234
|
+
.thread-ui-shell .thread-graph-composer-menu {
|
|
3235
|
+
max-height: min(27rem, calc(100svh - 8rem));
|
|
3236
|
+
overflow: auto !important;
|
|
3237
|
+
}
|
|
3238
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select) {
|
|
3239
|
+
border-color: var(--theme-border) !important;
|
|
3240
|
+
background: var(--theme-panel) !important;
|
|
3241
|
+
color: var(--theme-fg) !important;
|
|
3242
|
+
}
|
|
3243
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea)::placeholder {
|
|
3244
|
+
color: var(--theme-fg-muted) !important;
|
|
3245
|
+
}
|
|
3246
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select):focus {
|
|
3247
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 38%, var(--theme-border)) !important;
|
|
3248
|
+
}
|
|
3249
|
+
.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) {
|
|
3250
|
+
border-color: color-mix(in oklch, var(--theme-accent-solid) 24%, var(--theme-border)) !important;
|
|
3251
|
+
}
|
|
3252
|
+
.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) {
|
|
3253
|
+
background: color-mix(in oklch, var(--theme-accent-solid) 8%, var(--theme-panel)) !important;
|
|
3254
|
+
}
|
|
3255
|
+
.thread-ui-shell :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(.text-rose-100\\/90, .text-rose-200) {
|
|
3256
|
+
color: rgb(190 18 60) !important;
|
|
3257
|
+
}
|
|
3258
|
+
.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) {
|
|
3259
|
+
color: rgb(146 64 14) !important;
|
|
3260
|
+
}
|
|
3261
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-menu,
|
|
3262
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-menu,
|
|
3263
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-composer-menu,
|
|
3264
|
+
.thread-ui-shell.dark .thread-composer-menu,
|
|
3265
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-menu,
|
|
3266
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-menu,
|
|
3267
|
+
:root[data-theme-effective=dark] .thread-ui-shell .thread-graph-composer-menu,
|
|
3268
|
+
.thread-ui-shell.dark .thread-graph-composer-menu,
|
|
3269
|
+
.thread-ui-shell.thread-ui-theme-dark [data-composer-menu-surface=true],
|
|
3270
|
+
.thread-ui-shell[data-theme-effective=dark] [data-composer-menu-surface=true],
|
|
3271
|
+
:root[data-theme-effective=dark] .thread-ui-shell [data-composer-menu-surface=true],
|
|
3272
|
+
.thread-ui-shell.dark [data-composer-menu-surface=true] {
|
|
3273
|
+
border-color: #303642 !important;
|
|
3274
|
+
background: rgb(23 26 34 / 0.96) !important;
|
|
3275
|
+
color: rgb(241 245 249) !important;
|
|
3276
|
+
box-shadow: 0 18px 48px rgb(0 0 0 / 0.28) !important;
|
|
3277
|
+
}
|
|
3278
|
+
.thread-ui-shell.thread-ui-theme-dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select),
|
|
3279
|
+
.thread-ui-shell[data-theme-effective=dark] :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select),
|
|
3280
|
+
: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),
|
|
3281
|
+
.thread-ui-shell.dark :where(.thread-composer-menu, .thread-graph-composer-menu, [data-composer-menu-surface=true]) :where(input, textarea, select) {
|
|
3282
|
+
border-color: #303642 !important;
|
|
3283
|
+
background: #11141a !important;
|
|
3284
|
+
color: rgb(241 245 249) !important;
|
|
3285
|
+
}
|
|
3286
|
+
.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),
|
|
3287
|
+
.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),
|
|
3288
|
+
: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),
|
|
3289
|
+
.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) {
|
|
3290
|
+
color: rgb(254 205 211) !important;
|
|
3291
|
+
}
|
|
3292
|
+
.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),
|
|
3293
|
+
.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),
|
|
3294
|
+
: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),
|
|
3295
|
+
.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) {
|
|
3296
|
+
color: rgb(253 230 138) !important;
|
|
3297
|
+
}
|
|
3298
|
+
.thread-ui-shell .thread-composer-plan-toggle-active,
|
|
3299
|
+
.thread-ui-shell .thread-graph-composer-plan-toggle-active {
|
|
3300
|
+
background: var(--theme-accent-soft);
|
|
3301
|
+
color: var(--theme-accent-strong);
|
|
3302
|
+
}
|
|
3303
|
+
.thread-ui-shell .thread-jump-latest-badge {
|
|
3304
|
+
border-color: var(--theme-border);
|
|
3305
|
+
background: var(--theme-panel);
|
|
3306
|
+
color: var(--theme-fg-muted);
|
|
3307
|
+
}
|
|
3308
|
+
.thread-ui-shell .ui-action-primary {
|
|
3309
|
+
background: var(--theme-accent-solid);
|
|
3310
|
+
color: var(--theme-accent-solid-fg);
|
|
3311
|
+
}
|
|
3312
|
+
.thread-ui-shell .ui-action-primary:hover {
|
|
3313
|
+
background: var(--theme-accent-solid-hover);
|
|
3314
|
+
}
|
|
3315
|
+
.thread-ui-shell .ui-action-info {
|
|
3316
|
+
background: oklch(0.46 0.1 235);
|
|
3317
|
+
color: oklch(0.98 0.005 235);
|
|
3318
|
+
}
|
|
3319
|
+
.thread-ui-shell .ui-action-danger {
|
|
3320
|
+
background: oklch(0.56 0.16 25);
|
|
3321
|
+
color: oklch(0.98 0.005 25);
|
|
3322
|
+
}
|
|
3323
|
+
.thread-ui-shell .thread-composer-send-button.ui-action-danger,
|
|
3324
|
+
.thread-ui-shell .thread-graph-composer-send-button.ui-action-danger {
|
|
3325
|
+
border: 1px solid var(--theme-border) !important;
|
|
3326
|
+
background: var(--theme-muted) !important;
|
|
3327
|
+
color: var(--theme-fg-soft) !important;
|
|
3328
|
+
}
|
|
3329
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-composer-send-button.ui-action-danger,
|
|
3330
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-composer-send-button.ui-action-danger,
|
|
3331
|
+
.thread-ui-shell.dark .thread-composer-send-button.ui-action-danger,
|
|
3332
|
+
.thread-ui-shell.thread-ui-theme-dark .thread-graph-composer-send-button.ui-action-danger,
|
|
3333
|
+
.thread-ui-shell[data-theme-effective=dark] .thread-graph-composer-send-button.ui-action-danger,
|
|
3334
|
+
.thread-ui-shell.dark .thread-graph-composer-send-button.ui-action-danger {
|
|
3335
|
+
border-color: #303642 !important;
|
|
3336
|
+
background: #222733 !important;
|
|
3337
|
+
color: rgb(241 245 249) !important;
|
|
3338
|
+
}
|
|
3339
|
+
.thread-ui-shell .thread-composer-send-button.ui-action-danger:hover,
|
|
3340
|
+
.thread-ui-shell .thread-graph-composer-send-button.ui-action-danger:hover {
|
|
3341
|
+
background: var(--theme-hover) !important;
|
|
3342
|
+
color: var(--theme-fg) !important;
|
|
3343
|
+
}
|
|
3344
|
+
.thread-ui-shell .thread-empty-surface,
|
|
3345
|
+
.thread-ui-shell .timeline-pending-card,
|
|
3346
|
+
.thread-ui-shell .timeline-note-card,
|
|
3347
|
+
.thread-ui-shell .timeline-activity-card,
|
|
3348
|
+
.thread-ui-shell .timeline-live-plan-card,
|
|
3349
|
+
.thread-ui-shell .timeline-question-section,
|
|
3350
|
+
.thread-ui-shell .timeline-live-plan-step,
|
|
3351
|
+
.thread-ui-shell .timeline-detail-row {
|
|
3352
|
+
border-color: var(--theme-border);
|
|
3353
|
+
background: var(--theme-panel);
|
|
3354
|
+
color: var(--theme-fg);
|
|
3355
|
+
}
|
|
3356
|
+
.thread-ui-shell .prose,
|
|
3357
|
+
.thread-ui-shell .prose :where(p, li, strong, code, pre, blockquote) {
|
|
3358
|
+
color: inherit;
|
|
3359
|
+
}
|
|
3360
|
+
.thread-ui-shell .prose img {
|
|
3361
|
+
max-width: min(28rem, 100%);
|
|
3362
|
+
height: auto;
|
|
3363
|
+
border-radius: 10px;
|
|
3364
|
+
border: 1px solid var(--theme-border);
|
|
3365
|
+
box-shadow: 0 12px 35px oklch(0.22 0.024 255 / 0.14);
|
|
3366
|
+
margin-top: 0.75rem;
|
|
3367
|
+
margin-bottom: 0.75rem;
|
|
3368
|
+
}
|
|
3369
|
+
.thread-ui-shell .thread-graph-plan-card {
|
|
3370
|
+
border-color: rgb(42 47 58);
|
|
3371
|
+
background: #1b1f29;
|
|
3372
|
+
color: rgb(241 245 249);
|
|
3373
|
+
box-shadow: none;
|
|
3374
|
+
}
|
|
3375
|
+
.thread-ui-shell .thread-graph-plan-step {
|
|
3376
|
+
border-color: rgb(48 54 66);
|
|
3377
|
+
background: #181b23;
|
|
3378
|
+
color: rgb(241 245 249);
|
|
3379
|
+
}
|
|
3380
|
+
.thread-ui-shell .thread-graph-plan-explanation {
|
|
3381
|
+
color: rgb(148 163 184);
|
|
3382
|
+
}
|
|
3383
|
+
.thread-ui-shell .thread-graph-plan-badge {
|
|
3384
|
+
border-color: transparent;
|
|
3385
|
+
background: rgb(56 189 248 / 0.12);
|
|
3386
|
+
color: rgb(186 230 253);
|
|
3387
|
+
box-shadow: none;
|
|
3388
|
+
text-transform: uppercase;
|
|
3389
|
+
letter-spacing: 0.16em;
|
|
3390
|
+
}
|
|
3391
|
+
.thread-ui-shell .thread-graph-plan-status {
|
|
3392
|
+
height: 1.75rem;
|
|
3393
|
+
min-width: 1.75rem;
|
|
3394
|
+
padding: 0;
|
|
3395
|
+
border-color: transparent;
|
|
3396
|
+
box-shadow: none;
|
|
3397
|
+
}
|
|
3398
|
+
.thread-ui-shell .thread-graph-plan-status.is-completed {
|
|
3399
|
+
background: rgb(52 211 153 / 0.14);
|
|
3400
|
+
color: rgb(167 243 208);
|
|
3401
|
+
}
|
|
3402
|
+
.thread-ui-shell .thread-graph-plan-status.is-running {
|
|
3403
|
+
background: rgb(56 189 248 / 0.14);
|
|
3404
|
+
color: rgb(186 230 253);
|
|
3405
|
+
}
|
|
3406
|
+
.thread-ui-shell .thread-graph-plan-status.is-pending,
|
|
3407
|
+
.thread-ui-shell .thread-graph-plan-status.is-unknown {
|
|
3408
|
+
background: #2b313d;
|
|
3409
|
+
color: rgb(203 213 225);
|
|
3410
|
+
}
|
|
3411
|
+
.thread-ui-shell .thread-graph-plan-status.is-failed {
|
|
3412
|
+
background: rgb(251 113 133 / 0.14);
|
|
3413
|
+
color: rgb(254 205 211);
|
|
3414
|
+
}
|
|
3415
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-card {
|
|
3416
|
+
border-color: rgb(226 232 240);
|
|
3417
|
+
background: rgb(248 250 252);
|
|
3418
|
+
color: rgb(15 23 42);
|
|
3419
|
+
}
|
|
3420
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step {
|
|
3421
|
+
border-color: rgb(226 232 240);
|
|
3422
|
+
background: rgb(255 255 255);
|
|
3423
|
+
color: rgb(15 23 42);
|
|
3424
|
+
}
|
|
3425
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-explanation {
|
|
3426
|
+
color: rgb(100 116 139);
|
|
3427
|
+
}
|
|
3428
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-badge {
|
|
3429
|
+
background: rgb(14 165 233 / 0.1);
|
|
3430
|
+
color: rgb(3 105 161);
|
|
3431
|
+
}
|
|
3432
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-completed {
|
|
3433
|
+
background: rgb(16 185 129 / 0.12);
|
|
3434
|
+
color: rgb(4 120 87);
|
|
3435
|
+
}
|
|
3436
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-running {
|
|
3437
|
+
background: rgb(14 165 233 / 0.12);
|
|
3438
|
+
color: rgb(3 105 161);
|
|
3439
|
+
}
|
|
3440
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-pending,
|
|
3441
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-unknown {
|
|
3442
|
+
background: rgb(226 232 240);
|
|
3443
|
+
color: rgb(71 85 105);
|
|
3444
|
+
}
|
|
3445
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-status.is-failed {
|
|
3446
|
+
background: rgb(244 63 94 / 0.12);
|
|
3447
|
+
color: rgb(190 18 60);
|
|
3448
|
+
}
|
|
3449
|
+
.thread-ui-shell .thread-graph-event {
|
|
3450
|
+
background: transparent !important;
|
|
3451
|
+
color: var(--theme-fg) !important;
|
|
3452
|
+
}
|
|
3453
|
+
.thread-ui-shell .thread-graph-event-card {
|
|
3454
|
+
background: var(--theme-surface) !important;
|
|
3455
|
+
color: var(--theme-fg) !important;
|
|
3456
|
+
}
|
|
3457
|
+
.thread-ui-shell .thread-graph-plan-card,
|
|
3458
|
+
.thread-ui-shell .thread-graph-plan-step,
|
|
3459
|
+
.thread-ui-shell .thread-graph-plan-step-text {
|
|
3460
|
+
color: rgb(241 245 249) !important;
|
|
3461
|
+
}
|
|
3462
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-card,
|
|
3463
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step,
|
|
3464
|
+
.thread-ui-shell[data-theme-effective=light] .thread-graph-plan-step-text {
|
|
3465
|
+
color: rgb(15 23 42) !important;
|
|
3466
|
+
}
|
|
3467
|
+
.thread-export-dialog-root {
|
|
3468
|
+
--export-bg: rgb(248 250 252);
|
|
3469
|
+
--export-panel: rgb(255 255 255);
|
|
3470
|
+
--export-surface: rgb(241 245 249);
|
|
3471
|
+
--export-surface-strong: rgb(226 232 240);
|
|
3472
|
+
--export-border: rgb(203 213 225);
|
|
3473
|
+
--export-fg: rgb(15 23 42);
|
|
3474
|
+
--export-fg-soft: rgb(51 65 85);
|
|
3475
|
+
--export-fg-muted: rgb(100 116 139);
|
|
3476
|
+
--export-accent: rgb(217 119 6);
|
|
3477
|
+
--export-accent-bg: rgb(254 243 199);
|
|
3478
|
+
--export-accent-border: rgb(251 191 36);
|
|
3479
|
+
--export-shadow: rgb(15 23 42 / 0.16);
|
|
3480
|
+
color: var(--export-fg);
|
|
3481
|
+
}
|
|
3482
|
+
.thread-export-dialog-root.thread-ui-theme-dark,
|
|
3483
|
+
.thread-export-dialog-root[data-theme-effective=dark] {
|
|
3484
|
+
--export-bg: #12151c;
|
|
3485
|
+
--export-panel: #181d25;
|
|
3486
|
+
--export-surface: #1d222c;
|
|
3487
|
+
--export-surface-strong: #262c38;
|
|
3488
|
+
--export-border: #343b48;
|
|
3489
|
+
--export-fg: rgb(241 245 249);
|
|
3490
|
+
--export-fg-soft: rgb(203 213 225);
|
|
3491
|
+
--export-fg-muted: rgb(148 163 184);
|
|
3492
|
+
--export-accent: rgb(245 158 11);
|
|
3493
|
+
--export-accent-bg: rgb(245 158 11 / 0.16);
|
|
3494
|
+
--export-accent-border: rgb(245 158 11 / 0.34);
|
|
3495
|
+
--export-shadow: rgb(0 0 0 / 0.36);
|
|
3496
|
+
}
|
|
3497
|
+
.thread-export-dialog-backdrop {
|
|
3498
|
+
background: color-mix(in oklch, var(--export-bg) 68%, transparent);
|
|
3499
|
+
}
|
|
3500
|
+
.thread-export-dialog-root.thread-ui-theme-dark .thread-export-dialog-backdrop,
|
|
3501
|
+
.thread-export-dialog-root[data-theme-effective=dark] .thread-export-dialog-backdrop {
|
|
3502
|
+
background: rgb(2 6 23 / 0.74);
|
|
3503
|
+
}
|
|
3504
|
+
.thread-export-dialog-panel {
|
|
3505
|
+
border-color: var(--export-border);
|
|
3506
|
+
background: var(--export-panel);
|
|
3507
|
+
box-shadow: 0 26px 80px var(--export-shadow);
|
|
3508
|
+
}
|
|
3509
|
+
.thread-export-dialog-header,
|
|
3510
|
+
.thread-export-dialog-footer,
|
|
3511
|
+
.thread-export-dialog-box-header {
|
|
3512
|
+
border-color: var(--export-border);
|
|
3513
|
+
}
|
|
3514
|
+
.thread-export-dialog-title,
|
|
3515
|
+
.thread-export-dialog-strong,
|
|
3516
|
+
.thread-export-dialog-body-text {
|
|
3517
|
+
color: var(--export-fg);
|
|
3518
|
+
}
|
|
3519
|
+
.thread-export-dialog-subtitle,
|
|
3520
|
+
.thread-export-dialog-status-pill {
|
|
3521
|
+
color: var(--export-fg-muted);
|
|
3522
|
+
}
|
|
3523
|
+
.thread-export-dialog-icon-button,
|
|
3524
|
+
.thread-export-dialog-secondary-button,
|
|
3525
|
+
.thread-export-dialog-segment,
|
|
3526
|
+
.thread-export-dialog-box,
|
|
3527
|
+
.thread-export-dialog-status-pill {
|
|
3528
|
+
border-color: var(--export-border);
|
|
3529
|
+
background: var(--export-surface);
|
|
3530
|
+
}
|
|
3531
|
+
.thread-export-dialog-segment,
|
|
3532
|
+
.thread-export-dialog-box {
|
|
3533
|
+
background: color-mix(in oklch, var(--export-surface) 72%, var(--export-panel));
|
|
3534
|
+
}
|
|
3535
|
+
.thread-export-dialog-icon-button,
|
|
3536
|
+
.thread-export-dialog-secondary-button {
|
|
3537
|
+
color: var(--export-fg-soft);
|
|
3538
|
+
}
|
|
3539
|
+
.thread-export-dialog-icon-button:hover:not(:disabled),
|
|
3540
|
+
.thread-export-dialog-secondary-button:hover:not(:disabled),
|
|
3541
|
+
.thread-export-dialog-turn-row:hover {
|
|
3542
|
+
background: var(--export-surface-strong);
|
|
3543
|
+
color: var(--export-fg);
|
|
3544
|
+
}
|
|
3545
|
+
.thread-export-dialog-muted-action {
|
|
3546
|
+
color: var(--export-fg-muted);
|
|
3547
|
+
}
|
|
3548
|
+
.thread-export-dialog-muted-action:hover {
|
|
3549
|
+
color: var(--export-fg);
|
|
3550
|
+
}
|
|
3551
|
+
.thread-export-dialog-root .ui-status-warning {
|
|
3552
|
+
border: 1px solid var(--export-accent-border);
|
|
3553
|
+
background: var(--export-accent-bg);
|
|
3554
|
+
color: color-mix(in oklch, var(--export-accent) 72%, var(--export-fg));
|
|
3555
|
+
}
|
|
3556
|
+
.thread-export-dialog-checkbox {
|
|
3557
|
+
accent-color: var(--export-accent);
|
|
3558
|
+
}
|
|
3559
|
+
.thread-export-dialog-turn-row {
|
|
3560
|
+
color: var(--export-fg-soft);
|
|
3561
|
+
}
|
|
3562
|
+
`);function xt(...t){return _h(Cl(t))}var Tu=Fr("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?fl:"button";return e.jsx(s,{"data-slot":"button",className:xt(Tu({variant:a,size:n,className:r})),...o})}function Eu({className:t,...r}){return e.jsx("div",{"data-slot":"input-group",role:"group",className:xt("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 zu=Fr("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 Lu({className:t,align:r="inline-start",...n}){return e.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":r,className:xt(zu({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 Ru=Fr("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 Ht({className:t,type:r="button",variant:n="ghost",size:a="xs",...o}){return e.jsx(Ar,{type:r,"data-size":a,variant:n,className:xt(Ru({size:a}),t),...o})}function Iu({className:t,...r}){return e.jsx("span",{className:xt("flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4",t),...r})}var Pu=180,ln=[{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:""}],aa=`node -e "process.stdin.resume(); process.stdin.on('end', () => console.error('hook ran'))"`;function po(t){return t.replace(/\u00a0/g," ")}function Mu(t){if(!t)return"";const r=document.createElement("div");return r.innerHTML=t,r.textContent??""}function $u(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 en(t){return`${t.prompt}${t.attachments.map(r=>`${r.clientId}${r.kind}${r.placeholder}${r.originalName}`).join("")}`}function fo(t){if(!t)return"Auto";switch(t){case"xhigh":return"xhigh";default:return t}}function Au(){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 Du(){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 Bu(){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 Fu(t){switch(t){case"bearerToken":return"Token";case"oAuth":return"OAuth";case"notLoggedIn":return"Login";case"unsupported":return"Public";default:return"Unknown"}}function Gu(t){switch(t){case"repo":return"Repo";case"system":return"System";case"admin":return"Admin";case"user":default:return"User"}}function Ou(t){var r;return((r=ln.find(n=>n.value===t))==null?void 0:r.label)??t}function Hu(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 Vu(t){switch(t){case"managed":return"Managed";case"modified":return"Modified";case"trusted":return"Trusted";case"untrusted":return"Review"}}function Uu(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 Wu(t){return t.source==="user"?"global":t.source==="project"?"project":null}function go(t){const r=Wu(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 qu(t){switch(t){case"active":return"Active";case"paused":return"Paused";case"budgetLimited":return"Budget";case"complete":return"Complete";default:return t}}function Ku(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 Xu(t){if(!t)return"";const r=t/1e3;return Number.isInteger(r)?String(r):String(Number(r.toFixed(1)))}function Na(t){return t.replace(/\r\n/g,`
|
|
3563
|
+
`)}function Zu(t){const r=t.trim();return/^[A-Za-z0-9_-]+$/.test(r)?r:null}function Yu(t){const n=Na(t).split(`
|
|
3564
|
+
`).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 Ju(t,r){return`[mcp_servers.${t}]
|
|
3565
|
+
url = ${JSON.stringify(r.trim())}
|
|
3566
|
+
`}function xo(t,r,n){var f,m;const a=Na(t),o=`${Na(n).trim()}
|
|
3567
|
+
`,s=a.split(`
|
|
3568
|
+
`),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(`
|
|
3569
|
+
`).trimEnd(),v=s.slice(h).join(`
|
|
3570
|
+
`).trim();return[x,o.trimEnd(),v].filter(Boolean).join(`
|
|
3571
|
+
|
|
3572
|
+
`).replace(/\n{3,}/g,`
|
|
3573
|
+
|
|
3574
|
+
`).concat(`
|
|
3575
|
+
`)}const p=a.trimEnd();return p?`${p}
|
|
3576
|
+
|
|
3577
|
+
${o}`:o}function ii(t){return typeof t!="number"||Number.isNaN(t)?0:Math.max(0,Math.min(100,Math.round(t)))}function sa(t){const r=t/1e3;return Number.isInteger(r)?`${r}k`:`${Number(r.toFixed(1))}k`}function Qu(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,`${sa(n)} used / ${sa(a)}`,`${sa(o)} left`,`${ii(r.remainingPercent)}% context left`].join(" · ")}function em({contextUsage:t}){const r=(t==null?void 0:t.availability)??"unavailable",n=ii(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 bo(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 vo(t){return t.replace(/[\r\n[\]]+/g," ").replace(/\s+/g," ").trim()||"attachment"}function oa(t){return t.type.startsWith("image/")?"photo":"file"}function Ca(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 ko(t,r){return Ca(t,r).length>0}function nr(t){return t instanceof HTMLElement&&t.dataset.segmentType==="attachment"&&t.dataset.placeholder?t.dataset.placeholder:t.textContent??""}function tm(t){const r=t.replace(/[\\/]+$/,"").trim();return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function wo(t){const r=t.placeholder.match(/^\[(?:PHOTO|FILE)\s+(.+)\]$/);return r!=null&&r[1]?r[1]:tm(t.originalName)}function rm(){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 nm(){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 la(){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 Sa({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:P,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:F={status:"idle",data:null,error:null},onDraftChange:ie,onSubmit:q,onInterrupt:_,onCompact:Y,onOpenSkills:ye,onOpenMcp:ue,onOpenHooks:Le,onCreateHook:X,onUpdateHook:$,onTrustHook:G,onUntrustHook:M,onOpenGoal:A,onUpdateGoal:O,onOpenForkTurns:N,onForkLatest:E,onForkTurn:V,onReadProviderConfig:D,onWriteProviderConfig:re,onToggleFollow:ne,onUpdateSettings:Ne,onToggleView:ee,onShellCopy:me,onShellControl:pe,canInterrupt:Te=!1}){var Ls,Rs,Is,Ps,Ms,$s,_s,As,Ds,Bs,Fs,Gs,Os;const[Oe,J]=i.useState({prompt:"",attachments:[]}),[U,te]=i.useState(()=>({prompt:z??"",attachments:P??[]})),[ae,Q]=i.useState(null),[we,Ae]=i.useState("root"),[He,$e]=i.useState("list"),[Ue,Qe]=i.useState("list"),[W,oe]=i.useState("project"),be=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)&&!!D&&!!re,hookTrust:(m==null?void 0:m.management.hookTrust)??!1,planMode:(m==null?void 0:m.controls.planMode)??!1}),[m,b,D,re]),fe=i.useMemo(()=>(x??[]).filter(u=>{switch(u.action){case"fast":return be.fast;case"compact":return be.compact;case"goal":return be.goal;case"fork":return be.fork;case"skills":return be.skills;case"mcp":return be.mcp;case"hooks":return be.hooks;default:return!1}}),[be,x]),he=i.useMemo(()=>{const u=new Map;for(const S of v??[])u.set(S.eventName,S.command);return u},[v]),Re=i.useMemo(()=>u=>he.get(u)??he.get("preToolUse")??aa,[he]),De=i.useMemo(()=>new Set([aa,...he.values()]),[he]),[Ie,ct]=i.useState("preToolUse"),[st,Ke]=i.useState("Bash"),[ot,gt]=i.useState(aa),[Ct,bt]=i.useState("30"),[mt,ut]=i.useState("Running hook"),[wt,vt]=i.useState(null),[L,B]=i.useState(!1),[de,xe]=i.useState(null),[et,lt]=i.useState(null),[yt,it]=i.useState(""),[rt,Lt]=i.useState(""),[jt,Kt]=i.useState(""),[jr,Xt]=i.useState(null),[ve,je]=i.useState(!1),[pt,We]=i.useState(null),[Bt,kt]=i.useState(null),[Zt,j]=i.useState(null),[se,Pe]=i.useState(!1),[Be,ze]=i.useState(!1),[Ze,Ye]=i.useState(""),[Ce,Xe]=i.useState(!1),[Ft,Rt]=i.useState(null),[It,In]=i.useState(null),Ri=i.useRef(null),Gt=i.useRef(null),Ya=i.useRef(null),Ja=i.useRef(null),cr=i.useRef(null),Wr=i.useRef([]),St=i.useRef(null),Nr=i.useRef(new Map),Qa=i.useRef(""),es=i.useRef(0),Pt=i.useRef(null),hr=i.useRef(U),Pn=i.useRef(en(U)),Mn=i.useRef(Pn.current),Me=t==="shell",Ii=w||Me,ts=!!(Me&&(C!=null&&C.isMobileShell)),$n=(C==null?void 0:C.promptLabel)??null,[qr,rs]=i.useState({}),[ns,Cr]=i.useState(!1),[_n,Pi]=i.useState(0),Et=!Me&&z!==void 0&&P!==void 0&&typeof ie=="function",Mi=Et?en({prompt:z??"",attachments:P??[]}):"",An=i.useRef(Mi),tt=Et?U.prompt:Oe.prompt,Yt=Et?U.attachments:Oe.attachments,Dn=It??h;i.useEffect(()=>()=>{Bn(hr.current),Pt.current!==null&&window.clearTimeout(Pt.current)},[Et,ie]),i.useEffect(()=>{if(!Et){An.current="";return}const u={prompt:z??"",attachments:P??[]},S=en(u);S!==An.current&&(An.current=S,Pn.current=S,Mn.current=S,hr.current=u,Pt.current!==null&&(window.clearTimeout(Pt.current),Pt.current=null),te(u))},[P,z,Et]),i.useEffect(()=>{In(null)},[h]),i.useEffect(()=>{ae!=="slash"&&(Ae("root"),$e("list"),We(null),kt(null),Qe("list"),xe(null),lt(null))},[ae]),i.useEffect(()=>{we!=="mcp"&&($e("list"),We(null),kt(null))},[we]),i.useEffect(()=>{we!=="forkTurns"&&Pe(!1)},[we]),i.useEffect(()=>{we!=="hooks"&&(Qe("list"),xe(null),lt(null))},[we]),i.useEffect(()=>{const u=ln.find(S=>S.value===Ie);Ke(S=>{const H=S.trim(),ge=new Set(ln.map(ke=>ke.matcherHint).filter(Boolean));return H&&!ge.has(H)?S:(u==null?void 0:u.matcherHint)??""}),gt(S=>De.has(S.trim())?Re(Ie):S)},[Re,De,Ie,he]),i.useEffect(()=>{if(!Zt)return;const u=window.setTimeout(()=>{j(S=>S===Zt?null:S)},1400);return()=>{window.clearTimeout(u)}},[Zt]);function Bn(u){if(!Et||!ie)return;const S=en(u);S!==Mn.current&&(Mn.current=S,Pn.current=S,ie(()=>({prompt:u.prompt,attachments:u.attachments})))}function as(u,S){if(Et){if(Pt.current!==null&&(window.clearTimeout(Pt.current),Pt.current=null),S==="immediate"){Bn(u);return}Pt.current=window.setTimeout(()=>{Pt.current=null,Bn(hr.current)},Pu)}}function ss(u=hr.current){as(u,"immediate")}function Jt(u,S="immediate"){if(Et){const H=u(hr.current);hr.current=H,te(H),as(H,S);return}J(H=>u(H))}function $i(u){Jt(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){Rt("Goal objective cannot be empty.");return}const S=Ze.trim(),H=Ku(S);if(S.length>0&&(H===null||!Number.isInteger(H)||H<=0)){Rt("Token budget must be a positive number in thousands.");return}if(!O){Rt("/goal is unavailable in this view.");return}Xe(!0),Rt(null);try{await O({objective:u,status:"active",tokenBudget:H}),Ye(""),ze(!1),Jt(()=>({prompt:"",attachments:[]}))}catch(ge){Rt(ge instanceof Error?ge.message:"Unable to set goal.")}finally{Xe(!1)}}function Fi(){var u;Q(null),Ae("root"),ze(!0),Ye(Xu((u=Z.data)==null?void 0:u.tokenBudget)),Rt(null),A==null||A(),requestAnimationFrame(()=>{var S;(S=Gt.current)==null||S.focus()})}function os(){ze(!1),Rt(null)}const Fn=i.useMemo(()=>p.find(u=>u.model===l)??null,[l,p]),ls=Qu(l,f),Gn=(Fn==null?void 0:Fn.supportedReasoningEfforts)??[],is=i.useMemo(()=>_u(tt,Yt),[Yt,tt]),On=i.useMemo(()=>Object.entries(qr).sort(([u],[S])=>u.localeCompare(S)).map(([u,S])=>`${u}:${S}`).join("|"),[qr]);async function Hn(){if(!be.hostConfigFiles||!D)throw new Error("Provider config editing is unavailable for this thread.");const u=await D();return Xt(u.path),u}async function ds(u){if(!be.hostConfigFiles||!re)throw new Error("Provider config editing is unavailable for this thread.");const S=await re(u);return Xt(S.path),S}function Gi(u){switch(u.action){case"fast":return c?"On":"Off";case"compact":return o?"Busy":"Run";case"goal":return Be?"Composing":Z.data?qu(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"&&(Be||((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":Xr({fastMode:!c});break;case"compact":Q(null),Y==null||Y();break;case"goal":Be?(os(),Q(null)):Fi();break;case"fork":Ae("fork");break;case"skills":Ae("skills"),ye==null||ye();break;case"mcp":Ae("mcp"),ue==null||ue();break;case"hooks":Ae("hooks"),Le==null||Le();break}}function Ui(){vt(null),oe("project"),ct("preToolUse"),Ke("Bash"),gt(Re("preToolUse")),bt("30"),ut("Running hook")}function Wi(u){const S=go(u);if(!S){xe("Only command hooks in global or project hooks.json can be edited here.");return}vt(S),oe(S.scope),ct(S.eventName),Ke(S.matcher??""),gt(S.command),bt(S.timeoutSec?String(S.timeoutSec):""),ut(S.statusMessage??""),xe(null),lt(null),Qe("edit")}async function qi(){const u=Zu(yt),S=rt.trim();if(!u){We("MCP name must use only letters, numbers, underscore, or hyphen.");return}if(!/^https?:\/\//i.test(S)){We("HTTP MCP URL must start with http:// or https://");return}je(!0),We(null),kt(null);try{const H=await Hn(),ge=xo(H.content,u,Ju(u,S));await ds(ge),kt("MCP entry written to provider config. Restart the backend if it does not appear immediately."),$e("list"),it(""),Lt(""),ue==null||ue()}catch(H){We(H instanceof Error?H.message:"Unable to update provider config.")}finally{je(!1)}}async function Ki(){je(!0),We(null),kt(null);try{await Hn(),jt.trim()||Kt(`[mcp_servers.example_stdio]
|
|
3578
|
+
command = "npx"
|
|
3579
|
+
args = ["-y", "your-mcp-server"]
|
|
3580
|
+
`),$e("stdio")}catch(u){We(u instanceof Error?u.message:"Unable to load provider config.")}finally{je(!1)}}async function Xi(){const u=Yu(jt);if(!u){We("The raw MCP block must start with a header like [mcp_servers.name].");return}je(!0),We(null),kt(null);try{const S=await Hn(),H=xo(S.content,u,jt);await ds(H),kt("MCP entry written to provider config. Restart the backend if it does not appear immediately."),$e("list"),ue==null||ue()}catch(S){We(S instanceof Error?S.message:"Unable to update provider config.")}finally{je(!1)}}async function Zi(){if(Ue==="edit"&&!$){xe("Hook editing is unavailable in this view.");return}if(Ue!=="edit"&&!X){xe("Hook editing is unavailable in this view.");return}if(Ue==="edit"&&!wt){xe("Select a hook to edit first.");return}const u=ot.trim();if(!u){xe("Hook command cannot be empty.");return}const S=Ct.trim(),H=S?Number(S):null;if(S&&(H===null||!Number.isInteger(H)||H<=0)){xe("Timeout must be a positive number of seconds.");return}B(!0),xe(null),lt(null);try{const ge={scope:W,eventName:Ie,matcher:st.trim()||null,command:u,timeoutSec:H,statusMessage:mt.trim()||null};Ue==="edit"?await($==null?void 0:$({...ge,target:wt})):await(X==null?void 0:X(ge)),lt(`${W==="project"?"Project":"Global"} hook ${Ue==="edit"?"updated":"written"} in hooks.json and trusted.`),Qe("list"),vt(null)}catch(ge){xe(ge instanceof Error?ge.message:"Unable to write hooks.json.")}finally{B(!1)}}async function Yi(u){if(!G||!u.currentHash){xe("Hook trust is unavailable in this view.");return}B(!0),xe(null),lt(null);try{await G({key:u.key,currentHash:u.currentHash}),lt("Hook trusted.")}catch(S){xe(S instanceof Error?S.message:"Unable to trust hook.")}finally{B(!1)}}async function Ji(u){if(!M){xe("Hook trust is unavailable in this view.");return}B(!0),xe(null),lt(null);try{await M({key:u.key}),lt("Hook untrusted.")}catch(S){xe(S instanceof Error?S.message:"Unable to untrust hook.")}finally{B(!1)}}i.useEffect(()=>{if(Me){rs({});return}const u={},S=new Set;for(const H of Yt){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));rs(u)},[Yt,Me]),i.useEffect(()=>{const u=Nr.current;return()=>{for(const S of u.values())URL.revokeObjectURL(S);u.clear()}},[]);function Qt(){const u=Gt.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:cs(u,H.startContainer,H.startOffset),end:cs(u,H.endContainer,H.endOffset)}}function cs(u,S,H){var Ve;let ge=null,ke=H;if(S===u){const Ge=Array.from(u.childNodes);let Je=0;for(let ft=0;ft<Math.min(H,Ge.length);ft+=1){const qe=Ge[ft];qe&&(Je+=nr(qe).length)}return Je}if(S.nodeType===Node.TEXT_NODE)ge=S;else{const Ge=Array.from(u.childNodes).find(Je=>Je.contains(S));if(!Ge)return Kr().length;if(ge=Ge,Ge instanceof HTMLElement&&Ge.dataset.segmentType==="attachment"){const Je=document.createRange();Je.selectNodeContents(Ge);const ft=nr(Ge).length;try{Je.setEnd(S,H);const qe=Je.toString().length,_t=((Ve=Ge.textContent)==null?void 0:Ve.length)??0;_t===0?ke=ft:ke=Math.round(Math.min(1,qe/_t)*ft)}catch{ke=ft}}else{const Je=document.createRange();Je.selectNodeContents(Ge);try{Je.setEnd(S,H),ke=Je.toString().length}catch{ke=nr(Ge).length}}}const Ee=Array.from(u.childNodes);let Se=0;for(const Ge of Ee){if(Ge===ge)return Ge.nodeType===Node.TEXT_NODE?Se+ke:Se+Math.min(ke,nr(Ge).length);Se+=nr(Ge).length}return Se}function hs(u,S){let H=Math.max(0,S);const ge=Array.from(u.childNodes);for(const[ke,Ee]of ge.entries()){const Ve=nr(Ee).length;if(Ee.nodeType===Node.TEXT_NODE){if(H<=Ve)return{node:Ee,offset:H};H-=Ve;continue}if(Ee instanceof HTMLElement&&Ee.dataset.segmentType==="attachment"){if(H===0)return{node:u,offset:ke};if(H<=Ve){const Ge=ge[ke+1];return H===Ve&&(Ge==null?void 0:Ge.nodeType)===Node.TEXT_NODE?{node:Ge,offset:0}:{node:u,offset:ke+1}}H-=Ve;continue}if(H<=Ve)return{node:u,offset:ke+1};H-=Ve}return{node:u,offset:u.childNodes.length}}const Vn=i.useCallback(u=>{const S=Gt.current;if(!S||!u)return;const H=hs(S,u.start),ge=hs(S,u.end),ke=document.createRange();ke.setStart(H.node,H.offset),ke.setEnd(ge.node,ge.offset);const Ee=window.getSelection();Ee==null||Ee.removeAllRanges(),Ee==null||Ee.addRange(ke)},[]);function Qi(u){const S=Wr.current;if(S.length===0)return!1;const H=S.at(-1);if(!H)return!1;const ge=Array.from(u.childNodes).find(Ve=>Ve instanceof HTMLElement&&Ve.dataset.segmentType==="attachment"&&Ve.dataset.clientId===H);if(!(ge instanceof HTMLElement))return!1;const ke=document.createRange(),Ee=ge.nextSibling;(Ee==null?void 0:Ee.nodeType)===Node.TEXT_NODE?ke.setStart(Ee,0):ke.setStartAfter(ge),ke.collapse(!0);const Se=window.getSelection();return Se==null||Se.removeAllRanges(),Se==null||Se.addRange(ke),!0}const Kr=i.useCallback(()=>{const u=Gt.current;if(!u)return tt;let S="";for(const H of Array.from(u.childNodes))S+=nr(H);return po(S)},[tt]);function us(u,S,H){const ge=u==="photo"?"PHOTO":"FILE";let ke=0;for(;;){const Ee=ke===0?S:`${S} (${ke+1})`,Se=`[${ge} ${Ee}]`;if(!H.has(Se))return Se;ke+=1}}function ms(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`attachment-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function ps(u,S,H){const ge=S.start>0?u[S.start-1]:"",ke=S.end<u.length?u[S.end]:"",Ee=!!(ge&&!/\s/.test(ge)),Se=!ke||!/\s/.test(ke);return`${Ee?" ":""}${H.join(" ")}${Se?" ":""}`}function fs(u,S){if(!u||u.length===0)return;const H=Array.from(u),ge=new Set(Yt.map(qe=>qe.placeholder)),ke=H.map(qe=>{const _t=bo(qe,S),Sr=us(S,vo(_t),ge);return ge.add(Sr),{clientId:ms(),kind:S,originalName:_t,placeholder:Sr,file:qe}}),Ee=Qt()??St.current,Se=Ee?{start:Ee.start,end:Ee.end}:{start:tt.length,end:tt.length},Ve=ps(tt,Se,ke.map(qe=>qe.placeholder)),Ge=`${tt.slice(0,Se.start)}${Ve}${tt.slice(Se.end)}`;Jt(qe=>({prompt:Ge,attachments:[...qe.attachments,...ke]}));const Je=Ve.endsWith(" ")?1:0,ft=Se.start+Ve.length-Je;cr.current={start:ft,end:ft},St.current={start:ft,end:ft},Wr.current=ke.map(qe=>qe.clientId),Q(null)}function gs(u){if(u.length===0)return;const S={photo:u.filter(qe=>oa(qe)==="photo"),file:u.filter(qe=>oa(qe)==="file")},H=[...S.photo,...S.file],ge=new Set(Yt.map(qe=>qe.placeholder)),ke=H.map(qe=>{const _t=oa(qe),Sr=bo(qe,_t),Hs=us(_t,vo(Sr),ge);return ge.add(Hs),{clientId:ms(),kind:_t,originalName:Sr,placeholder:Hs,file:qe}}),Ee=Qt()??St.current,Se=Ee?{start:Ee.start,end:Ee.end}:{start:tt.length,end:tt.length},Ve=ps(tt,Se,ke.map(qe=>qe.placeholder)),Ge=`${tt.slice(0,Se.start)}${Ve}${tt.slice(Se.end)}`;Jt(qe=>({prompt:Ge,attachments:[...qe.attachments,...ke]}));const Je=Ve.endsWith(" ")?1:0,ft=Se.start+Ve.length-Je;cr.current={start:ft,end:ft},St.current={start:ft,end:ft},Wr.current=ke.map(qe=>qe.clientId),Q(null)}function xs(u){if(!u)return;const S=Qt()??St.current,H=(S==null?void 0:S.start)??tt.length,ge=(S==null?void 0:S.end)??H,ke=po(u),Ee=`${tt.slice(0,H)}${ke}${tt.slice(ge)}`;Jt(Ve=>({prompt:Ee,attachments:Ve.attachments}));const Se=H+ke.length;cr.current={start:Se,end:Se},St.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=Gt.current;if(!u||Me)return;const S=cr.current,H=Kr()!==tt||Qa.current!==On||es.current!==_n;if(H){const ge=document.createDocumentFragment();for(const ke of is){if(ke.type==="text"){ge.append(document.createTextNode(ke.text===" "?" ":ke.text));continue}const Ee=ke.attachment,Se=document.createElement("span");if(Se.dataset.segmentType="attachment",Se.dataset.clientId=Ee.clientId,Se.dataset.placeholder=Ee.placeholder,Se.contentEditable="false",Se.className="thread-composer-attachment-chip mx-[0.12rem] inline-flex max-w-full align-baseline",Ee.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 Ve=qr[Ee.clientId];if(Ve){const Je=document.createElement("img");Je.src=Ve,Je.alt=Ee.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 Ge=document.createElement("span");Ge.className="thread-composer-attachment-caption ml-2 inline-flex max-w-[8rem] items-center text-[10px] font-medium tracking-[0.08em] text-sky-50",Ge.textContent=wo(Ee),Se.append(Ge)}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 Ve=document.createElement("span");Ve.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]",Ve.textContent="FILE";const Ge=document.createElement("span");Ge.className="inline-flex max-w-[10rem] truncate",Ge.textContent=wo(Ee),Se.append(Ve,Ge)}ge.append(Se)}u.replaceChildren(ge),Qa.current=On,es.current=_n}S!==null?(u.focus(),Qi(u)||Vn(S),St.current=S):document.activeElement===u&&H&&Vn(St.current),cr.current=null,Wr.current=[]},[qr,_n,Me,On,tt,is,Vn,Kr]);function Tt(){var u;(u=Gt.current)==null||u.blur(),document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur()}async function ed(){var u;if(Tt(),Q(null),!!((u=navigator.clipboard)!=null&&u.readText))try{const S=await navigator.clipboard.readText();xs(S)}catch{return}}async function bs(){if(Et&&ss(),Be&&!Me){await Bi();return}if(!Me&&!tt.trim())return;const u=Me?tt:tt.trim(),S=Me?[]:Yt.filter(ge=>u.includes(ge.placeholder));await q(S.length>0?{prompt:u,attachments:S}:{prompt:u})!==!1&&Jt(()=>({prompt:"",attachments:[]}))}async function td(u){u.preventDefault(),await bs()}function rd(){const u=Kr(),S=Qt();St.current=S;const H=Gt.current;(H?$u(H):!1)&&(cr.current=S,Pi(ke=>ke+1)),Jt(ke=>({prompt:u,attachments:ke.attachments.filter(Ee=>u.includes(Ee.placeholder))}),"deferred")}function nd(u){var H,ge,ke,Ee;const S=Ca((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"))??"",Ve=((Ee=u.clipboardData)==null?void 0:Ee.getData("text/html"))??"",Ge=Se||Mu(Ve);if(!Ge&&!Ve)return;u.preventDefault(),xs(Ge);return}u.preventDefault(),gs(S)}function ad(u){var S,H;ko((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;ko((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=Ca((H=u.dataTransfer)==null?void 0:H.items,(ge=u.dataTransfer)==null?void 0:ge.files);S.length!==0&&(u.preventDefault(),Cr(!1),gs(S))}function vs(u){u.key==="Enter"&&(!u.metaKey&&!u.ctrlKey||(u.preventDefault(),!(n||T)&&bs()))}async function Xr(u){const S=It;u.collaborationMode&&In(u.collaborationMode);try{await(Ne==null?void 0:Ne(u)),Q(null)}catch(H){throw u.collaborationMode&&In(S),H}}const ks=Be?"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..."),Zr=Me?"Send Ctrl-C":"Stop Current Turn",ws=Be?Ce?"Setting...":"Set goal":!g&&n?"Connecting...":g&&n&&!Me?"Sending...":"Send",ys=g?Be?"ui-action-info":"ui-action-primary":"ui-action-danger",js=a,Ns=js||Gn.length===0,id=c?"Fast mode is on. Turn it off from the slash toolbox to edit reasoning.":Gn.length===0?"The selected model does not expose adjustable reasoning effort.":"Select reasoning effort",Cs=Me?"thread-composer-layer thread-shell-composer-layer":"thread-graph-composer-layer",dd=ae?`${Cs} relative z-[80] shrink-0`:`${Cs} relative z-20 shrink-0`,Un=Me?"thread-composer-form":"thread-graph-composer-form",Ss=Me?"thread-composer-form-floating":"thread-graph-composer-form-floating",cd=Me?r||ts?`${Un} ${Ss} 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`:`${Un} 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`:`${Un} ${r?Ss:""} 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",Ts=Me?"thread-composer-input":"thread-graph-composer-input",Wn=Me?"thread-composer-icon-button":"thread-graph-composer-icon-button",Es=Me?"thread-composer-menu":"thread-graph-composer-menu",ur=Me?"thread-composer-menu-item":"thread-graph-composer-menu-item",qn=Me?"thread-composer-inline-toggle":"thread-graph-composer-inline-toggle",Kn=Me?"thread-composer-panel-button":"thread-graph-composer-panel-button",er=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",zs=Me?"thread-composer-prompt-region":"thread-graph-composer-prompt-region",fd=`${Ts} min-h-[5.25rem] w-full px-4 pr-14 pt-3 outline-none transition sm:min-h-[5.75rem] ${ns?"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=`${Ts} 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 ${ns?"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:Ya,type:"file",accept:"image/*",multiple:!0,tabIndex:-1,className:"sr-only",onChange:u=>{fs(u.target.files,"photo"),u.target.value=""}}),e.jsx("input",{ref:Ja,type:"file",multiple:!0,tabIndex:-1,className:"sr-only",onChange:u=>{fs(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:()=>ne==null?void 0:ne(),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(Eu,{className:gd,children:[Me?null:e.jsxs("div",{"data-slot":"input-group-control",className:`${zs} 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 truncate text-slate-500 sm:left-4 sm:top-4 dark:text-slate-400 ${Te?"right-12":"right-3 sm:right-4"}`,children:ks}),e.jsx("div",{ref:Gt,role:"textbox","aria-label":"Prompt","aria-multiline":"true",contentEditable:!T,suppressContentEditableWarning:!0,onInput:()=>rd(),onPaste:nd,onKeyDown:vs,onKeyUp:()=>{St.current=Qt()},onMouseUp:()=>{St.current=Qt()},onBlur:()=>{St.current=Qt(),Cr(!1),Et&&ss()},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] ${Te?"pr-12":""} ${T?"cursor-not-allowed text-slate-500":""}`})]}),Te?e.jsx(Ht,{type:"button",variant:"ghost",size:"icon-xs","aria-label":Zr,title:Zr,onClick:u=>{u.preventDefault(),_==null||_()},className:"thread-graph-composer-stop-button ui-action-danger absolute right-2 top-2 z-30 h-8 w-8 rounded-full text-sm font-medium",children:e.jsx("span",{"aria-hidden":"true",className:"block h-2.5 w-2.5 rounded-[2px] bg-current"})}):null]}),e.jsxs(Lu,{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(Ht,{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:`${Wn} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:e.jsx(Bu,{})}),ae==="slash"&&e.jsx("div",{"data-composer-menu-surface":"true",className:`${Es} 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:we==="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:we==="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(),Ae("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]}):we==="forkTurns"?e.jsxs("div",{className:"p-2",children:[F.status==="loading"&&!F.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,F.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:F.error}):null,(Ls=F.data)!=null&&Ls.length?e.jsx("div",{className:"space-y-2",children:F.data.map(u=>e.jsx("button",{type:"button",disabled:se,onClick:()=>void Di(u.turnId),className:`${Kn} 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,F.status!=="loading"&&!F.error&&(((Rs=F.data)==null?void 0:Rs.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]}):we==="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,(Is=I.data)!=null&&Is.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:Gu(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 ${Zt===u.name?"border-emerald-400/45 bg-emerald-400/12 text-emerald-100":`${er} 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(la,{}),"$",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,(Ps=I.data)!=null&&Ps.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&&(((Ms=I.data)==null?void 0:Ms.skills.length)??0)===0&&((($s=I.data)==null?void 0:$s.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]}):we==="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>"})]}),Ue==="list"&&be.hostConfigFiles?e.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),Ui(),Qe("add"),xe(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,de?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:de}):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,Ue==="add"||Ue==="edit"?e.jsxs("div",{className:"space-y-2 rounded-xl border border-stone-800 bg-stone-950/70 px-3 py-3",children:[Ue==="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"," ",Uu((wt==null?void 0:wt.eventName)??Ie)," ","in"," ",(wt==null?void 0:wt.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:W,onChange:u=>oe(u.target.value),disabled:Ue==="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:Ie,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:ln.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:st,onChange:u=>Ke(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:ot,onChange:u=>gt(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:Ct,onChange:u=>bt(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:mt,onChange:u=>ut(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"),vt(null)},className:`${er} 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…":Ue==="edit"?"Update Hook":"Write Hook"})]})]}):null,Ue==="list"&&((As=K.data)!=null&&As.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,Ue==="list"&&((Ds=K.data)!=null&&Ds.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,Ue==="list"&&((Bs=K.data)!=null&&Bs.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:[Ou(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:[go(u)?e.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),Wi(u)},className:`${er} 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,be.hookTrust&&u.trustStatus==="trusted"&&!u.isManaged?e.jsx("button",{type:"button",disabled:L,onClick:S=>{S.stopPropagation(),Ji(u)},className:`${er} 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&&be.hookTrust?e.jsx("button",{type:"button",disabled:L||!u.currentHash,onClick:S=>{S.stopPropagation(),Yi(u)},className:`${er} 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:Vu(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:Hu(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,Ue==="list"&&K.status!=="loading"&&!K.error&&(((Fs=K.data)==null?void 0:Fs.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:jr??"<provider config>"})]}),He==="list"&&be.mcpConfigEditing?e.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),$e("add"),We(null),kt(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,pt?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:pt}):null,Bt?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:Bt}):null,He==="add"?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",onClick:u=>{u.stopPropagation(),$e("http"),We(null),kt(null)},className:`${Kn} 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:`${Kn} 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,He==="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:yt,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:rt,onChange:u=>Lt(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:()=>$e("add"),className:`${er} 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:ve,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:ve?"Saving…":"Write HTTP MCP"})]})]}):null,He==="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:jt,onChange:u=>Kt(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:()=>$e("add"),className:`${er} 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:ve,className:"ui-status-info rounded-full px-3 py-1.5 text-xs transition disabled:cursor-not-allowed disabled:opacity-60",children:ve?"Saving…":"Write raw block"})]})]}):null,He==="list"&&((Gs=R.data)!=null&&Gs.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:Fu(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,He==="list"&&R.status!=="loading"&&!R.error&&(((Os=R.data)==null?void 0:Os.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(Ht,{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:`${Wn} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:e.jsx(Du,{})}),ae==="attachments"&&e.jsx("div",{"data-composer-menu-surface":"true",className:`${Es} 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;Tt(),(u=Ya.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;Tt(),(u=Ja.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(Ht,{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:`${Wn} h-9 w-9 rounded-full sm:h-8 sm:w-8`,children:Me?e.jsx(rm,{}):e.jsx(Au,{})})]}),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(Ht,{type:"button",variant:"ghost",size:"xs","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":ae==="model","aria-label":l??"Select model",disabled:js||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. ${ls}`:ls,className:`${qn} 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(em,{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 Xr({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(Ht,{type:"button",variant:"ghost",size:"xs","data-composer-menu-trigger":"true","aria-haspopup":"menu","aria-expanded":ae==="effort",disabled:Ns,onClick:()=>Q(u=>u==="effort"?null:"effort"),title:id,className:`${qn} rounded-full px-2 disabled:cursor-not-allowed disabled:text-stone-700 ${Ns?"text-stone-500":"text-stone-300 hover:text-stone-100"}`,children:fo(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:Gn.map(u=>e.jsx("button",{type:"button",onClick:()=>void Xr({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:fo(u.reasoningEffort)})},u.reasoningEffort))})})]}),be.planMode&&e.jsx(Ht,{type:"button",variant:"ghost",size:"xs","aria-pressed":Dn==="plan",disabled:a,onClick:()=>void Xr({collaborationMode:Dn==="plan"?"default":"plan"}),className:`${qn} rounded-full px-2.5 ${Dn==="plan"?md:"text-stone-500"} disabled:cursor-not-allowed disabled:opacity-60`,children:"Plan"}),e.jsx(Ht,{type:"submit",variant:"default",size:"icon-xs","aria-label":Be?"Set goal":"Send Prompt",title:ws,disabled:Ce||(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 ${ys}`,children: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&&$n&&e.jsx(Iu,{className:"min-w-0 max-w-[12rem] truncate rounded-full px-1.5 py-1 text-stone-400",title:$n,children:$n}),ts&&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:()=>{Tt(),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(nm,{})}),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(la,{}),e.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Paste"})]})}),e.jsx("button",{type:"button",onClick:()=>{Tt(),Q(null),me==null||me()},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(la,{}),e.jsx("span",{className:"text-[10px] font-medium tracking-[0.12em]",children:"Copy"})]})}),e.jsx("button",{type:"button",disabled:n,onClick:()=>{Tt(),Q(null),q({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:()=>{Tt(),Q(null),pe==null||pe("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:()=>{Tt(),Q(null),pe==null||pe("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:()=>{Tt(),Q(null),pe==null||pe("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:()=>{Tt(),Q(null),pe==null||pe("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:()=>{Tt(),Q(null),pe==null||pe("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:()=>{Tt(),Q(null),pe==null||pe("down")},className:"disabled:cursor-not-allowed disabled:opacity-45",children:e.jsx(ar,{label:"DOWN"})})]})})]})]})]})]}),Be&&!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"})]}),Ft?e.jsx("span",{className:"thread-goal-compose-error min-w-0 flex-1",children:Ft}):null,e.jsx("button",{type:"button",onClick:os,className:"thread-goal-compose-cancel rounded-full border px-2.5 py-1 text-[11px] transition",children:"Cancel"})]}),Me?e.jsxs("div",{className:`${zs} relative`,children:[e.jsx("textarea",{"aria-label":"Prompt",disabled:!1,value:tt,onChange:u=>$i(u.target.value),onKeyDown:vs,rows:2,placeholder:ks,className:`${fd} resize-y pb-10`}),e.jsx("button",{type:"button","aria-label":Zr,title:Zr,onClick:()=>void(_==null?void 0:_()),disabled:!Te,className:`absolute right-2.5 top-2.5 inline-flex h-8 w-8 items-center justify-center rounded-full border transition ${Te?"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:Ce||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 ${ys}`,children:ws})]}):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 am=i.createContext(null);function sm(){return i.useContext(am)}function Tn(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 om(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 lm(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 di(t){switch(t){case"sending":return"Sending";case"completed":return"Completed";case"interrupted":return"Interrupted";case"failed":return"Failed";case"inProgress":return"Running"}}function im({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 vn.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 dm({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 cm({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 hm({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 um({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 mm({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 pm({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 fm({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 ci(...t){return t.filter(Boolean).join(" ")}function hi({className:t,...r}){return e.jsx(si,{"data-slot":"resizable-panel-group",className:ci("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...r})}function fn({...t}){return e.jsx(Gl,{"data-slot":"resizable-panel",...t})}function ui({withHandle:t,className:r,...n}){return e.jsx(oi,{"data-slot":"resizable-handle",className:ci("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(Hd,{className:"size-2.5"})}):null})}function yo({...t}){return e.jsx(Cc,{"data-slot":"dialog",...t})}function jo({...t}){return e.jsx(Sc,{"data-slot":"dialog-trigger",...t})}function gm({...t}){return e.jsx(Rc,{"data-slot":"dialog-portal",...t})}function xm({className:t,...r}){return e.jsx(Ic,{"data-slot":"dialog-overlay",className:xt("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 No({children:t,className:r,showCloseButton:n=!0,...a}){return e.jsxs(gm,{"data-slot":"dialog-portal",children:[e.jsx(xm,{}),e.jsxs(Tc,{"data-slot":"dialog-content",className:xt("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(Ec,{"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(wl,{}),e.jsx("span",{className:"sr-only",children:"Close"})]}):null]})]})}function Co({className:t,...r}){return e.jsx("div",{"data-slot":"dialog-header",className:xt("flex flex-col gap-2 text-center sm:text-left",t),...r})}function So({className:t,...r}){return e.jsx(zc,{"data-slot":"dialog-title",className:xt("text-lg font-semibold leading-none",t),...r})}function To({className:t,...r}){return e.jsx(Lc,{"data-slot":"dialog-description",className:xt("text-sm text-muted-foreground",t),...r})}var bm=[{value:"system",label:"Follow system",icon:wc},{value:"dark",label:"Dark",icon:yc},{value:"light",label:"Light",icon:jc}];function vm({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 P=t.providerSessionId;if(P)try{await navigator.clipboard.writeText(P),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(vl,{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:P=>{P.stopPropagation(),P.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:P=>{P.stopPropagation(),P.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 ${lm(t.status)}`,children:om(t.status)}),e.jsx("time",{className:"shrink-0 text-[11px] text-[var(--theme-fg-muted)]",dateTime:t.lastTurnStartedAt??t.updatedAt,children:Tn(t.lastTurnStartedAt??t.updatedAt)})]})]}),h&&c&&!f?e.jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),P.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:P=>{P.preventDefault(),T()},title:f?t.title:void 0,className:y,children:C}):e.jsx("div",{role:"link",tabIndex:0,onClick:T,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T())},title:f?t.title:void 0,className:y,children:C})}function km({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(vm,{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 wm({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:P={},appMenuButton:I,appNavigationMenu:R,workspaceReturnHref:K,onWorkspaceReturn:Z,getThreadHref:F,onOpenThread:ie,getNewThreadHref:q,newThreadHref:_,newThreadLabel:Y="New Chat",onNewThread:ye,onNewThreadTitle:ue,renderThreadLink:Le,onCloseAppNavigation:X,onRenameThread:$,onDeleteThread:G,workspaceContent:M,workspaceTitle:A="Workspace",workspaceActions:O,children:N}){const E=sm(),[V,D]=i.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1),re=d??(E==null?void 0:E.themeMode)??"system",ne=l??(E==null?void 0:E.effectiveTheme)??(re==="system"?V?"dark":"light":re),[Ne,ee]=i.useState(!1),[me,pe]=i.useState(!1),[Te,Oe]=i.useState(!1),[J,U]=i.useState(()=>typeof window<"u"?window.matchMedia("(max-width: 639px)").matches:s==="mobile"),[te,ae]=i.useState("chat"),[Q,we]=i.useState(null),[Ae,He]=i.useState(""),[$e,Ue]=i.useState(null),[Qe,W]=i.useState(!1),[oe,be]=i.useState(""),[fe,he]=i.useState(!1),[Re,De]=i.useState(!1),[Ie,ct]=i.useState("session");i.useEffect(()=>{if(typeof window>"u")return;const ve=window.matchMedia("(max-width: 639px)"),je=()=>{U(ve.matches)};return je(),ve.addEventListener("change",je),()=>{ve.removeEventListener("change",je)}},[]),i.useEffect(()=>{if(typeof window>"u")return;const ve=window.matchMedia("(prefers-color-scheme: dark)"),je=()=>{D(ve.matches)};return je(),ve.addEventListener("change",je),()=>{ve.removeEventListener("change",je)}},[]);const st=i.useMemo(()=>[...b?t.filter(je=>je.workspaceId===b):t].sort((je,pt)=>{if(je.id===x)return-1;if(pt.id===x)return 1;const We=Date.parse(je.lastTurnStartedAt??je.updatedAt);return Date.parse(pt.lastTurnStartedAt??pt.updatedAt)-We}),[x,b,t]),Ke=_??(q==null?void 0:q(b)),ot=k??b??"all",gt=g??v??x??"default_session",Ct=w??(r!=null&&r.state?`runtime ${r.state}`:"waiting for agent usage"),bt=c??(E==null?void 0:E.setThemeMode),mt=!!bt,ut=()=>{ee(!1),X==null||X()};async function wt(ve){if(!$)return;const je=Ae.trim();if(je){Ue(ve);try{await $(ve,je),we(null),He("")}finally{Ue(null)}}}function vt(ve){we(ve.id),He(ve.title)}function L(){we(null),He("")}function B(ve){ie==null||ie(ve),ut()}function de(ve){if(!Ke||!ve.trim())return Ke;try{const je=new URL(Ke,window.location.origin);return je.searchParams.set("title",ve.trim()),`${je.pathname}${je.search}${je.hash}`}catch{const je=Ke.includes("?")?"&":"?";return`${Ke}${je}title=${encodeURIComponent(ve.trim())}`}}async function xe(){const ve=oe.trim();he(!0);try{if(ve&&ue){await ue(ve),be(""),W(!1),ut();return}if(Ke){window.location.assign(de(ve)??Ke);return}await(ye==null?void 0:ye()),be(""),W(!1),ut()}finally{he(!1)}}function et(ve,je=!1){const pt=je?e.jsxs(e.Fragment,{children:[e.jsx(wa,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:Y})]}):e.jsxs(e.Fragment,{children:[e.jsx(wa,{className:"h-4 w-4"}),e.jsx("span",{children:Y})]});return e.jsxs(yo,{open:Qe,onOpenChange:We=>{fe||W(We)},children:[e.jsx(jo,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":je?Y:void 0,title:Y,className:ve,children:pt})}),e.jsxs(No,{"data-testid":"create-thread-dialog","data-theme-effective":ne,"data-theme-mode":re,className:"thread-graph-create-thread-dialog thread-graph-dialog",children:[e.jsxs(Co,{children:[e.jsx(So,{children:"Create New Chat"}),e.jsx(To,{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:We=>be(We.target.value),onKeyDown:We=>{We.key==="Enter"&&(We.preventDefault(),xe())},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 xe(),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&&!mt)return null;const ve=!!(C||y),je=!!z,pt=Ie==="global"&&je||!ve&&je?"global":"session";return e.jsxs(yo,{children:[e.jsx(jo,{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(kc,{className:"h-4 w-4"})})}),e.jsxs(No,{"data-testid":"settings-dialog","data-theme-effective":ne,"data-theme-mode":re,className:"thread-graph-settings-dialog thread-graph-dialog",children:[e.jsxs(Co,{children:[e.jsx(So,{children:"Settings"}),e.jsx(To,{children:"Manage this session and host-wide preferences."})]}),mt?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: ",ne]})]}),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:bm.map(We=>{const Bt=We.icon,kt=re===We.value;return e.jsxs("button",{type:"button","data-testid":`theme-mode-${We.value}`,"aria-pressed":kt,disabled:!mt,onClick:()=>bt==null?void 0:bt(We.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 ${kt?"is-selected":""}`,children:[e.jsx(Bt,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"truncate",children:We.label})]},We.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":pt==="session",onClick:()=>ct("session"),className:`thread-graph-settings-tab-button rounded-md px-3 py-2 text-sm font-medium transition ${pt==="session"?"is-active":""}`,children:"Session"}),e.jsx("button",{type:"button","aria-pressed":pt==="global",disabled:!je,onClick:()=>ct("global"),className:`thread-graph-settings-tab-button rounded-md px-3 py-2 text-sm font-medium transition ${pt==="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:pt==="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,ve?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 yt(ve=!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)] ${ve?"justify-center":""}`,children:[e.jsx(Nc,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:ve?"sr-only":"",children:"Rooms"}),!ve&&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&&st.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,st.length>0?e.jsx(km,{threads:st,currentThreadId:x,currentWorkspaceId:b,workspaceLabels:P,onOpenThread:B,collapsed:ve,...$?{onBeginRenameThread:vt}:{},showDeleteButton:!!G,...F?{getThreadHref:F}:{},...Le?{renderThreadLink:Le}:{},...G?{onDeleteThread:G}:{}}):null]})]})})}function it(){return M?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:()=>Oe(!0),className:"thread-workspace-collapse-tab thread-desktop-only-inline-flex",title:"Collapse workspace","aria-label":"Collapse workspace",children:e.jsx(cn,{className:"h-4 w-4"})}),O?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:O})}):null,e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:M})]}):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:A}),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:[O,e.jsx("button",{type:"button",onClick:()=>Oe(!0),className:"thread-workspace-small-toggle thread-desktop-only-inline-flex",title:"Collapse workspace","aria-label":"Collapse workspace",children:e.jsx(cn,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:M??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 rt=!!M,Lt=s==="mobile"||s==="responsive"&&J,jt=Lt,Kt=jt&&!Ne,Xt=!!(K||Z)?e.jsx("a",{href:K??"#",onClick:ve=>{Z&&(ve.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(vc,{className:"h-4 w-4"})}):null;return e.jsxs(e.Fragment,{children:[e.jsx(dm,{effectiveTheme:ne,layoutMode:s,themeMode:re,viewportConstrained:o,children:e.jsxs(cm,{roomsRailCollapsed:me,children:[e.jsx(hm,{open:Ne,onClose:()=>ee(!1)}),e.jsxs(um,{collapsed:me,mobileOpen:Ne,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 ${me?"sm:w-full sm:justify-center sm:px-2":""}`,children:e.jsxs("div",{className:`flex w-full items-center gap-3 ${me?"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:()=>pe(ve=>!ve),className:"thread-icon-button thread-desktop-only-flex h-9 w-9 shrink-0 items-center justify-center rounded-full",title:me?"Expand rooms":"Collapse rooms","aria-label":me?"Expand rooms":"Collapse rooms",children:me?e.jsx(fc,{className:"h-4 w-4"}):e.jsx(gc,{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)] ${me?"thread-desktop-collapsed-hidden":""}`,children:(k??"R").charAt(0).toUpperCase()}),e.jsxs("div",{className:`min-w-0 ${me?"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 ${me?"thread-desktop-collapsed-hidden":""}`,children:[lt(),Xt,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(wl,{className:"h-4 w-4"})})]})]})}),e.jsx("div",{className:`thread-graph-new-room-strip flex shrink-0 items-center border-b ${me?"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 ${me?"h-9 w-9 p-0":"h-11 w-full gap-2 px-3 text-sm sm:h-9"}`,me)}),e.jsx("div",{className:`flex min-h-0 flex-1 flex-col ${me?"w-full px-2 py-2":"px-3 py-3"}`,children:yt(me)})]}),e.jsxs(mm,{children:[e.jsxs(pm,{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:[Kt?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:[jt?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:()=>{De(ve=>!ve)},"aria-expanded":Re,"aria-haspopup":"dialog",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:"Session and usage",children:[e.jsx("span",{className:"shrink-0",children:"Room"}),e.jsx("span",{className:"truncate font-mono",children:ot})]}),Re?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 ve;ot&&((ve=navigator.clipboard)==null||ve.writeText(ot))},className:"thread-topbar-meta-row flex min-w-0 max-w-full items-center gap-2 text-left text-xs leading-5",title:"Copy room ID",children:[e.jsx("span",{className:"w-12 shrink-0",children:"Room"}),e.jsx("span",{className:"truncate font-mono",children:ot})]}),e.jsxs("button",{type:"button",onClick:()=>{var ve;gt&&((ve=navigator.clipboard)==null||ve.writeText(gt))},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:gt})]}),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:Ct})]})]}):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,jt?m:null,jt&&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]})]})}),jt&&rt?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 ${te==="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 ${te==="workspace"?"is-active":""}`,children:"Workspace"})]}):null]}),e.jsx(fm,{children:rt&&!Te?Lt?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 ${te==="chat"?"block":"thread-mobile-chat-hidden"}`,children:N}),e.jsx("div",{className:`h-full min-h-0 overflow-hidden ${te==="workspace"?"block":"thread-mobile-workspace-hidden"}`,children:it()})]}):e.jsxs(hi,{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(fn,{defaultSize:47,minSize:30,maxSize:75,className:"thread-split-chat-pane min-w-0 overflow-hidden",children:N}),e.jsx(ui,{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(fn,{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:[rt&&Te?e.jsx("button",{type:"button",onClick:()=>Oe(!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(im,{open:Q!==null,title:"Rename Thread",label:"Thread Title",value:Ae,busy:$e!==null,onChange:He,onCancel:L,onSubmit:()=>Q?wt(Q):void 0})]})}function ym({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?vn.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 jm({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 Nm(t){return!t||typeof t!="object"?!1:Array.isArray(t.content)}function Cm(t){return t.trim().toLowerCase()==="extxyz"?"xyz":t.trim().toLowerCase()}function Sm({artifact:t,expanded:r,onToggleExpanded:n}){const a=Nm(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(li,{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 Tm({code:t,isIncomplete:r,language:n}){const[a,o]=i.useState(!0),[s,l]=i.useState(!1),d=Cm(n),c=i.useMemo(()=>({content:[t.endsWith(`
|
|
3581
|
+
`)?t:`${t}
|
|
3582
|
+
`],format:d,name:`${d.toUpperCase()} structure`,uuid:`inline:${d}:${t.length}`}),[t,d]);return r||!Cu(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(li,{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:pu,threadPanels:[{id:"terminal",kind:"terminal",label:"Terminal"}]},{manifest:hu,renderArtifact:t=>e.jsx(Sm,{...t}),inlineCodeRenderers:[{languages:["xyz","extxyz","cif","pdb"],render:t=>e.jsx(Tm,{...t})}]}];function Ta(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=Ta(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 qa=i.createContext(Wa());function Ka(){return i.useContext(qa)??Wa()}var Em=[/^(?: {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],zm=/^(?:\|?[^|\n]+\|[^|\n]+(?:\|[^|\n]+)*\|?\s*\n\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)+\|?\s*$)/m,Lm=/!?\[[^\]\n]+\]\([^)]+\)/,Rm=/`[^`\n]+`/,Im=/(?:\*\*[^*\n]+\*\*|__[^_\n]+__)/,Pm=/(^|[^\w])(?:\*[^*\n]+\*|_[^_\n]+_)(?=[^\w]|$)/,Mm=/~~[^~\n]+~~/;function $m(t){const r=t.trim();return r?Em.some(n=>n.test(r))||zm.test(r)?!0:/[`[\]*_~!]/.test(r)?Lm.test(r)||Rm.test(r)||Im.test(r)||Pm.test(r)||Mm.test(r):!1:!1}function Xa(...t){return t.filter(Boolean).join(" ")}function Gr({...t}){return e.jsx(Rd,{"data-slot":"accordion",...t})}function Or({className:t,...r}){return e.jsx(Id,{"data-slot":"accordion-item",className:Xa("border-b last:border-b-0",t),...r})}function Hr({className:t,children:r,...n}){return e.jsx(Pd,{className:"flex",children:e.jsxs(Md,{"data-slot":"accordion-trigger",className:Xa("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(pl,{className:"pointer-events-none size-4 shrink-0 translate-y-0.5 text-[var(--theme-fg-muted)] transition-transform duration-200"})]})})}function Vr({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:Xa("pb-4 pt-0",t),children:r})})}function mi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Eo(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 zo({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(wn,{className:"h-3.5 w-3.5"}),label:"Completed"};case"failed":return{className:"is-failed",icon:e.jsx(Br,{className:"h-3.5 w-3.5"}),label:"Failed"};default:return{className:"is-pending",icon:e.jsx(kn,{className:"h-3.5 w-3.5 animate-spin"}),label:"Running"}}},[n]),l=i.useMemo(()=>Eo(o),[o]),d=i.useMemo(()=>Eo(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(Gr,{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(Or,{value:"item-1",className:"border-0",children:[e.jsx(Hr,{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(Da,{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}`,title:s.label,"aria-label":`Status: ${s.label}`,children:[s.icon,e.jsx("span",{className:"thread-graph-status-label",children:s.label})]})]})}),e.jsxs(Vr,{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 Lo=null;function Am(){return Lo??(Lo=Promise.all([at(()=>import("./core-DIQen2lE.js"),__vite__mapDeps([0,1,2])),at(()=>import("./engine-javascript-DBd1bXLz.js"),[]),at(()=>import("./ayu-light-BA47KaF1.js"),[]),at(()=>import("./ayu-dark-DYE7WIF3.js"),[]),at(()=>import("./javascript-wDzz0qaB.js"),[]),at(()=>import("./typescript-BPQ3VLAy.js"),[]),at(()=>import("./tsx-COt5Ahok.js"),[]),at(()=>import("./jsx-g9-lgVsj.js"),[]),at(()=>import("./python-B6aJPvgy.js"),[]),at(()=>import("./json-Cp-IABpG.js"),[]),at(()=>import("./shellscript-CEILq0vU.js").then(t=>t.b),[]),at(()=>import("./shellscript-CEILq0vU.js").then(t=>t.s),[]),at(()=>import("./yaml-Buea-lGh.js"),[]),at(()=>import("./toml-vGWfd6FD.js"),[]),at(()=>import("./markdown-Cvjx9yec.js"),[]),at(()=>import("./html-pp8916En.js"),__vite__mapDeps([3,4,5])),at(()=>import("./css-CLj8gQPS.js"),[]),at(()=>import("./sql-CRqJ_cUM.js"),[]),at(()=>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]}))),Lo}function En(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ea(t){if(!t)return{};if(En(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 za(){return{finalResult:null,stdout:"",stderr:""}}function Dm(t){return typeof t=="string"?{result:t}:t}function fi(t){const r=En(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 Ro(t){if(!t)return"pending";if(!En(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 Bm(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=Dm(c.result),f=r.get(h)??za();return En(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=Ea(c.args);if(typeof h=="string"&&r.has(h)){const m=fi(r.get(h)??za());return`\`\`\`tool-merged
|
|
3583
|
+
${JSON.stringify({call:{tool:p,args:f,call_id:h},result:m},null,2)}
|
|
3584
|
+
\`\`\``}return l}catch{return l}}),resultMap:r}}function Io(t){return t.replace(/background-color:[^;"]+;?/g,"background-color: transparent;").replace(/background:[^;"]+;?/g,"background: transparent;")}function Po(t){return Array.isArray(t)?t.map(r=>String(r)).join(""):String(t??"")}function Fm(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 Gm({children:t,...r}){return Om(t)?e.jsx(e.Fragment,{children:t}):e.jsx("pre",{...r,children:t})}function Om(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 Hm=i.memo(function({className:r="thread-graph-markdown",content:n}){const a=i.useRef(null),o=Ka(),[s,l]=i.useState(null),[d,c]=i.useState({}),[h,p]=i.useState(!1),{processedContent:f,resultMap:m}=i.useMemo(()=>Bm(n),[n]);i.useEffect(()=>{let b=!0;return Am().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=Po(b).replace(/\n$/,""),{startLine:P,endLine:I}=Fm(w),R=g===!1||!!k||z.includes(`
|
|
3585
|
+
`)||P!==I;if(C==="tool-merged"){let F={call:{tool:"Unknown",args:{},call_id:void 0},result:null};try{F=JSON.parse(z)}catch{F={call:{tool:"Error",args:{raw:z}},result:{status:"failed"}}}const ie=typeof F.call.tool=="string"?F.call.tool:"Unknown",q=typeof F.call.call_id=="string"?F.call.call_id:void 0;return e.jsx(zo,{callId:q,toolName:ie,status:Ro(F.result),parameters:Ea(F.call.args),result:F.result})}if(C==="tool-call"){let F={tool:"Unknown",args:{},call_id:void 0};try{F=JSON.parse(z)}catch{F={tool:"Error",args:{raw:z}}}const ie=typeof F.call_id=="string"?F.call_id:void 0,q=ie&&m.has(ie)?fi(m.get(ie)??za()):void 0;return e.jsx(zo,{callId:ie,toolName:typeof F.tool=="string"?F.tool:"Unknown",status:q?Ro(q):"pending",parameters:Ea(F.args),result:q})}if(C==="tool-result")return null;if(["xyz","extxyz","cif","pdb"].includes(C)){const F=o.renderInlineCode({code:z,isIncomplete:!1,language:C});if(i.isValidElement(F))return F}if(R){const ie=(((Z=s==null?void 0:s.getLoadedLanguages)==null?void 0:Z.call(s))??[]).includes(C)?C:"text",q=h?"ayu-dark":"ayu-light",_=`${C||"text"}:${z.length}:${z.slice(0,32)}`;let Y="";if(s)try{Y=Io(s.codeToHtml(z,{lang:ie,theme:q}))}catch{Y=Io(s.codeToHtml(z,{lang:"text",theme:q}))}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(_,z),variant:"ghost",size:"sm",className:"thread-graph-code-copy absolute right-2 top-2 z-10 rounded-md p-1.5",title:d[_]==="copied"?"Copied":d[_]==="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=Po(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(Fc,{remarkPlugins:[Oc,Hc],rehypePlugins:[Gc],components:{code:v,pre:Gm},children:f})})}),Mo=4e3,Vm=/\b(?:https?:\/\/|www\.)[^\s<>"'`]+/gi,Um=/[),.;:!?]+$/;function Wm(t){return t.startsWith("www.")?`https://${t}`:t}function $o(t){const r=t.replace(/[\\/]+$/,"").trim();return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function qm(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(Vm)){const s=o[0],l=o.index??0,d=((a=s.match(Um))==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:Wm(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=$m(r),x=!a&&r.length>Mo,v=x&&!p?`${r.slice(0,Mo).trimEnd()}
|
|
3586
|
+
|
|
3587
|
+
...`: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(Hm,{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]})}),Km=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}:{}})}),Xm=i.memo(function({threadId:r,text:n,getImageAssetUrl:a}){const o=i.useMemo(()=>qm(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=$o(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=$o(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 zn({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 Zm=Fr("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 Ln({asChild:t=!1,className:r,variant:n,...a}){const o=t?fl:"span";return e.jsx(o,{"data-slot":"badge",className:xt(Zm({variant:n,className:r})),...a})}function Rn(t){if(!t)return!1;const r=t.trim().toLowerCase();return r==="running"||r==="in_progress"||r==="in progress"||r==="pending"}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.2 8h3.6"}),e.jsx("path",{d:"M6.2 10h1.7"})]})}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.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 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("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 ep(){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 tp(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=tp(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 rp(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 La({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 np(t){var n;const r=t.replace(/\r\n/g,`
|
|
3588
|
+
`).split(`
|
|
3589
|
+
`);for(;r.length>1&&((n=r.at(-1))==null?void 0:n.trim())==="";)r.pop();return r}function $t(t){const r=np(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(wn,{className:"h-3.5 w-3.5"}),label:"Completed"}:r==="failed"||r==="failure"||r==="error"||r==="errored"?{className:"is-failed",icon:e.jsx(Br,{className:"h-3.5 w-3.5"}),label:"Failed"}:Rn(t)?{className:"is-pending",icon:e.jsx(kn,{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 ap(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 sp(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 ${sp(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(Ln,{variant:"outline",className:`thread-graph-tool-badge ${c.className} rounded-full px-2 py-0.5 text-xs font-normal`,title:c.label,"aria-label":`Status: ${c.label}`,children:[c.icon,e.jsx("span",{className:"thread-graph-status-label",children: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(Rn(s.status)?"item-1":void 0);return e.jsx("div",{className:`thread-graph-event thread-graph-history-tool ${ap(h)} ${n??""}`,children:e.jsx(Gr,{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(Or,{value:"item-1",className:"border-0",children:[e.jsx(Hr,{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(Ln,{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`,title:p.label,"aria-label":`Status: ${p.label}`,children:[p.icon,e.jsx("span",{className:"thread-graph-status-label",children:p.label})]})]})}),e.jsxs(Vr,{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 op=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}:{}})})})}),lp=i.memo(function({item:r}){const n=Rn(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(La,{tone:"emerald"}):null]}),o?e.jsx("p",{className:"thread-graph-history-event-secondary",title:o,children:o}):null]})}),ip=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})})})}),dp=i.memo(function({item:r,onOpen:n}){const a=$t(r.previewText??r.text);return e.jsx(yr,{actionLabel:"Open full command",actionTitle:"Command Output",className:"thread-graph-event-command",icon:e.jsx(ml,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Command Output"),preview:a,title:"command",tone:"command"})}),cp=i.memo(function({item:r,onOpen:n}){const a=$t(r.text);return e.jsx(yr,{actionLabel:"Open full tool call",actionTitle:"Tool Call Details",className:"thread-graph-event-tool",icon:e.jsx(Da,{className:"h-4 w-4"}),item:r,onOpen:()=>n(r,"Tool Call Details"),preview:a,title:"tool_call",tone:"tool"})}),hp=i.memo(function({item:r,onOpen:n}){const a=$t(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"})}),up=i.memo(function({item:r,onOpen:n}){const a=$t(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"})}),mp=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=$t(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"})}),pp=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=$t(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"})}),fp=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]})}),gp=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=rp(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"})}),xp=i.memo(function({item:r,onSelect:n}){const a=Ka(),[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(Vs,{className:"h-3.5 w-3.5"}),"Inspect"]}):null]}),className:"thread-graph-event-artifact",icon:e.jsx(Vs,{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]})})}),bp=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(`
|
|
3590
|
+
`).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=$t(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]})})}),vp=i.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.filter(d=>Rn(d.status)).length,l=r.length===1?"1 command":`${r.length} commands`;return e.jsx(zn,{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(Qm,{}),onToggleExpanded:a,runningIndicator:s>0?e.jsx(La,{}):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(La,{})}):null]}),toggleAriaLabel:`${n?"Collapse":"Expand"} ${r.length} command entries`,children:r.map((d,c)=>{const h=$t(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)})})}),kp=i.memo(function({items:r,expanded:n,onToggleExpanded:a,onOpen:o}){const s=r.length===1?"1 search":`${r.length} searches`;return e.jsx(zn,{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(ep,{}),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=$t(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)})})}),wp=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(zn,{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(Jm,{}),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=$t(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)})})}),yp=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(zn,{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(Ym,{}),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 jp(){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"),a=r.includes("failed")||r.includes("error"),o=r.includes("accepted")||r.includes("complete"),s=n?"ui-status-warning":a?"ui-status-danger":o?"ui-status-success":"ui-status-neutral",l=n?e.jsx(kn,{className:"h-3.5 w-3.5 animate-spin"}):a?e.jsx(Br,{className:"h-3.5 w-3.5"}):o?e.jsx(wn,{className:"h-3.5 w-3.5"}):e.jsx(Od,{className:"h-3.5 w-3.5"});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 ${s}`,title:t,"aria-label":`Status: ${t}`,children:[e.jsx("span",{className:"thread-graph-message-status-icon inline-flex shrink-0",children:n?e.jsx(jp,{}):l}),e.jsx("span",{className:"thread-graph-status-label",children:t})]})}function Np({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 min-w-0 items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",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-1.5 sm:gap-2",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 ia(t){if(!t)return!1;const r=t.toLowerCase();return r.includes("running")||r.includes("inprogress")||r.includes("in_progress")}function Cp({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(`
|
|
3591
|
+
|
|
3592
|
+
`),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(Gr,{type:"single",collapsible:!0,className:"thread-graph-thinking-accordion w-full border-none",onValueChange:y=>m(!!y),...f?{value:"thoughts"}:{},children:e.jsxs(Or,{value:"thoughts",className:"border-b-0",children:[e.jsx(Hr,{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=>ia(y.status))?"animate-pulse":""}`}),e.jsx("span",{children:v.some(y=>ia(y.status))?"Thinking...":"Thought Process"}),v.some(y=>ia(y.status))?e.jsx(Cp,{tone:"sky"}):null]})}),e.jsx(Vr,{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(Np,{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(Km,{text:n.text,scrollRootRef:a,streaming:o,...c?{onBeforeResize:c}:{}}):e.jsx(Xm,{threadId:r,text:n.text,getImageAssetUrl:s==null?void 0:s.getImageAssetUrl})})});function Sp(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 Tp({status:t}){const r=Sp(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(Ln,{"aria-label":n,title:n.replace("Plan step status: ",""),className:a,children:r==="completed"?e.jsx(wn,{className:"h-3.5 w-3.5"}):r==="in_progress"?e.jsx(kn,{className:"h-3.5 w-3.5 animate-spin"}):r==="pending"?e.jsx(Vd,{className:"h-3.5 w-3.5"}):r==="failed"?e.jsx(Br,{className:"h-3.5 w-3.5"}):e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.14em]",children:"?"})})}function Ep({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(Ln,{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(Tp,{status:r.status})]},`${t.turnId}-${n}`))})]})}function zp({footer:t,history:r,liveHookPrompt:n,liveOutput:a,livePlan:o}){return e.jsxs(e.Fragment,{children:[r,o?e.jsx(Ep,{livePlan:o}):null,n??a??null,t]})}function Lp({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 Ao=10,Rp=10,Ra=80;function Ip(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 Do(t){return t.replace(/"/g,'"').replace(/'/g,"'").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function Ia(t){const r=t.trim().match(/^<hook_prompt(?:\s+hook_run_id="([^"]+)")?>([\s\S]*)<\/hook_prompt>$/);if(!r)return null;const n=r[1]?Do(r[1]):null,a=Do(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 Pp(t){return t==="userMessage"||t==="agentMessage"}function Mp(t){return t==="commandExecution"||t==="webSearch"||t==="fileRead"||t==="fileChange"||t==="image"||t==="contextCompaction"}function $p(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&&Mp(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=>$p(c.kind))?s:{...s,status:"Awaiting response"}:(o=!0,s))}function Vt(t){return typeof t.sequence=="number"&&Number.isFinite(t.sequence)}function tn(t){return Vt(t)?t.sequence:Number.POSITIVE_INFINITY}function Bo(t){var h;const r=[];let n=0;for(;n<t.length&&((h=t[n])==null?void 0:h.kind)==="userMessage"&&!Vt(t[n]);)r.push(t[n]),n+=1;const a=t.slice(n);if(!a.some(Vt))return t;const o=a.map(p=>tn(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(Vt(p)){l.push({item:p,index:d,order:tn(p)}),d+=1;continue}const f=d;for(;d<a.length&&!Vt(a[d]);)d+=1;const m=a.slice(f,d),x=[...a.slice(0,f)].reverse().find(Vt),v=a.slice(d).find(Vt),b=x?tn(x):null,k=v?tn(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 Ap(t,r){if(!r||r.length===0)return Bo(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(Vt)||(a.push(...o),!a.some(s=>typeof s.sequence=="number"&&Number.isFinite(s.sequence)))?a:Bo(a)}function Dp(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 gn(t){return t==="inProgress"||t==="sending"}function Er(t,r=Ra){return t.scrollHeight-t.scrollTop-t.clientHeight<=r}function Bp(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 Fp(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 Gp({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 Fo(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 Op(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 Hp(t,r,n){if(!t||!gn(n))return t;const a=t.plan.findIndex(d=>Fo(d.status)==="in_progress");if(a<0)return t;const o=t.plan.findIndex((d,c)=>c>a&&Fo(d.status)==="pending");if(o<0||!r.some(d=>Op(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 Go({status:t}){const r=di(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(Gp,{tone:"emerald"})})}function Oo({turn:t,variant:r="header"}){const n=di(t.status),a=Qp(t),o=Xp(t),s=wi(t),l=gn(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(Go,{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:Tn(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(Go,{status:t.status}),e.jsx("span",{className:"timeline-meta-text min-w-0 truncate",children:a})]})}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 2.75v8"}),e.jsx("path",{d:"m4.75 7.5 3.25 3.25L11.25 7.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.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 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:"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 qp(){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 rn(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 Kp(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 nn(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:rn(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(Vp,{})}:null,a>0?{id:"cache",label:"Cached input",tokenCompactValue:rn(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(Wp,{})}:null,s>0?{id:"out",label:"Output",tokenCompactValue:rn(s),tokenRawValue:s,usdCompactValue:t.priceEstimate?Ir(nn(t.priceEstimate.outputUsd,Math.max(r.outputTokens,0),s)??0):"--",usdRawValue:nn((p=t.priceEstimate)==null?void 0:p.outputUsd,Math.max(r.outputTokens,0),s),className:"token-badge-out",icon:e.jsx(Up,{})}:null,o>0?{id:"reason",label:"Reasoning",tokenCompactValue:rn(o),tokenRawValue:o,usdCompactValue:t.priceEstimate?Ir(nn(t.priceEstimate.outputUsd,Math.max(r.outputTokens,0),o)??0):"--",usdRawValue:nn((f=t.priceEstimate)==null?void 0:f.outputUsd,Math.max(r.outputTokens,0),o),className:"token-badge-reason",icon:e.jsx(qp,{})}:null].filter(m=>m!==null)}function Xp(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?Kp(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 da="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 Zp({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),P=Math.min(Math.max(y,C),z);c(Math.round(P-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:`${da} 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:`${da} ${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:`${da} 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 Yp(t){return t.map(n=>{const a=n.createdAt;return typeof a=="string"&&a.trim()?a:null}).filter(n=>!!n).sort()[0]??null}function Jp(t,r){return{id:t,startedAt:Yp(r),status:"inProgress",error:null,model:null,reasoningEffort:null,reasoningEffortAvailable:null,tokenUsage:null,priceEstimate:null,items:[]}}function Qp(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 Za=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(Pp(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(xp,{item:n,...c?{onSelect:(k,g)=>c({item:k,artifact:g})}:{}});if(n.kind==="commandExecution")return e.jsx(dp,{item:n,onOpen:s});if(n.kind==="toolCall")return e.jsx(cp,{item:n,onOpen:l});if(n.kind==="agentToolCall")return e.jsx(hp,{item:n,onOpen:l});if(n.kind==="skillToolCall")return e.jsx(up,{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(mp,{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(pp,{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(fp,{threadId:r,item:n,onOpen:o,getImageAssetUrl:p==null?void 0:p.getImageAssetUrl});if(n.kind==="plan")return e.jsx(op,{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(gp,{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(lp,{item:n}):n.kind==="hook"?e.jsx(bp,{item:n}):e.jsx(ip,{item:n})});function an({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(P=>P!==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 sn({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:Tn(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 ca=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||gn(a.status)||y||T,z=C&&!gn(a.status)?{...a,status:"inProgress"}:a,P=i.useMemo(()=>Ap(a.items,d),[d,a.items]),I=i.useMemo(()=>Hp(l,P,a.status),[l,P,a.status]),R=i.useMemo(()=>Dp(c,P),[c,P]),K=i.useMemo(()=>_p(P,C),[C,P]),Z=i.useMemo(()=>Fp(K),[K]),F=Tn(a.startedAt),ie=Ua(a.startedAt),q=i.useMemo(()=>Ia(R),[R]),[_,Y]=i.useState({}),ye=i.useCallback(M=>{Y(A=>({...A,[M]:!A[M]}))},[]),ue=e.jsx(ef,{entries:Z,expandedGroups:_,onToggleGroupedItem:ye,threadId:r,scrollRootRef:g,onOpenExpandedText:f,onOpenCommandDetail:m,onOpenToolCallDetail:x,onOpenDeferredHistoryItemDetail:v,...k?{onBeforeMessageResize:k}:{},timeLabel:F,timeTitle:ie,...b?{onSelectArtifact:b}:{},...n?{adapter:n}:{}}),Le=q?e.jsx(Za,{threadId:r,item:q,scrollRootRef:g,onOpenExpandedText:f,onOpenCommandDetail:m,onOpenToolCallDetail:x,onOpenDeferredHistoryItemDetail:v,timeLabel:F,timeTitle:ie,...b?{onSelectArtifact:b}:{},...n?{adapter:n}:{}}):null,X=!q&&R?e.jsx(Mr,{item:{id:"live-agent-message",kind:"agentMessage",text:R},scrollRootRef:g,timeLabel:F,timeTitle:ie,streaming:!0,...k?{onBeforeMessageResize:k}:{}}):null,$=C?e.jsx(Oo,{turn:z,variant:"footer"}):null,G=e.jsx(zp,{footer:$,history:ue,liveHookPrompt:Le,liveOutput:X,livePlan:I});return e.jsx(Lp,{absoluteIndex:o,body:G,collapsed:s,error:a.error,headerStatus:e.jsx(Oo,{turn:a}),isActive:C,onToggleCollapse:()=>p(a.id),refCallback:w,startedAt:a.startedAt,timeLabel:F,timeTitle:ie,tokenSummary:e.jsx(Zp,{turn:a})})});function ef({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(jm,{entries:t,expandedGroups:r,onToggleGroupedItem:n,renderCommandGroup:(v,b,k)=>e.jsx(vp,{items:v.items,expanded:b,onToggleExpanded:k,onOpen:l},v.key),renderFileChangeGroup:(v,b,k)=>e.jsx(yp,{items:v.items,expanded:b,onToggleExpanded:k,onOpen:s},v.key),renderSearchGroup:(v,b,k)=>e.jsx(kp,{items:v.items,expanded:b,onToggleExpanded:k,onOpen:s},v.key),renderFileReadGroup:(v,b,k)=>e.jsx(wp,{items:v.items,expanded:b,onToggleExpanded:k,onOpen:s},v.key),renderItem:v=>e.jsx(Za,{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 tf({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:P,onOpenThread:I,onSelectArtifact:R,onSelectHistoryItemDetail:K,adapter:Z}){var pt,We,Bt,kt,Zt;const F=i.useRef(null),ie=i.useRef(null),q=i.useRef(m),_=i.useRef(null),Y=i.useRef(x),ye=i.useRef(0),ue=i.useRef(0),Le=i.useRef(null),X=i.useRef(null),$=i.useRef(!0),G=i.useRef(!0),M=i.useRef(!1),A=i.useRef(!1),O=i.useRef(!1),N=i.useRef(0),E=i.useRef(new Map),[V,D]=i.useState(Ao),[re,ne]=i.useState(0),[Ne,ee]=i.useState(null),[me,pe]=i.useState({}),[Te,Oe]=i.useState(!0),J=(Z==null?void 0:Z.onLoadHistoryItemDetail)??P,U=Z==null?void 0:Z.onOpenLinkedThread,te=Ip([r,a,l,C,f,d,c,z,T,y,w,x]),ae=typeof g=="function"||n!==void 0,Q=i.useCallback(j=>{pe(se=>({...se,[j]:!se[j]}))},[]),we=i.useCallback((j,se)=>{ee({title:j,text:se})},[]),Ae=i.useCallback((j,se)=>{if(K){K({item:j,detail:se});return}ee({title:se.title,text:se.text})},[K]),He=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){Ae(j,{id:j.id,kind:j.kind,title:se,text:Pe});return}const Be=E.current.get(j.id);if(Be){Ae(j,Be);return}const ze=N.current+1;N.current=ze,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!==ze)return;Ae(j,Ye)}catch(Ye){if(N.current!==ze)return;const Ce=Ye instanceof Error?Ye.message:"Unable to load full command output.";Ae(j,{id:j.id,kind:j.kind,title:se,text:Ce})}},[Ae,J,K]),$e=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){Ae(j,{id:j.id,kind:j.kind,title:se,text:Pe});return}const Be=E.current.get(j.id);if(Be){Ae(j,Be);return}const ze=N.current+1;N.current=ze,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!==ze)return;Ae(j,Ye)}catch(Ye){if(N.current!==ze)return;const Ce=Ye instanceof Error?Ye.message:"Unable to load full tool call details.";Ae(j,{id:j.id,kind:j.kind,title:se,text:Ce})}},[Ae,J,K]),Ue=i.useCallback(async(j,se,Pe,Be,ze)=>{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:Be});try{const Ce=await J(j.id);if(E.current.set(j.id,Ce),N.current!==Ye)return;ee({title:Ce.title,text:Ce.text})}catch(Ce){if(N.current!==Ye)return;ee({title:se,text:Ce instanceof Error?Ce.message:ze})}},[J]),Qe=i.useCallback(()=>{const j=F.current,se=Le.current;if(!j)return;const Pe=se?Bp(j,se):Er(j);$.current=Pe,Oe(Be=>Be===Pe?Be:Pe)},[]),W=i.useCallback(()=>{const j=F.current;if(j){A.current=!0;const se=j.scrollTop,Pe=ue.current,Be=se-Pe;ue.current=se,Er(j,1)?(M.current=!1,G.current=!0):Be<-1?(M.current=!0,G.current=!1):Be>1&&(G.current=!M.current&&Er(j,Ra))}Qe()},[Qe]),oe=i.useCallback(()=>{const j=F.current;j&&(j.scrollTop=j.scrollHeight,ue.current=j.scrollTop,ye.current=j.scrollHeight,$.current=!0,Oe(se=>se||!0),M.current=!1,G.current=!0)},[]),be=i.useCallback(()=>{const j=F.current;j&&(ue.current=j.scrollTop,ye.current=j.scrollHeight,G.current=!1,M.current=!0)},[]);i.useLayoutEffect(()=>{const j=window.requestAnimationFrame(()=>{oe()});return()=>{window.cancelAnimationFrame(j)}},[t,oe]),i.useEffect(()=>{O.current=!1,A.current=!1},[t]),i.useEffect(()=>{D(j=>j>=r.length-1?r.length:Math.max(j,Ao))},[r.length]),i.useEffect(()=>{const j=F.current;j&&(ye.current=j.scrollHeight,ue.current=j.scrollTop,Er(j,1)?(M.current=!1,G.current=!0):(M.current||!Er(j,Ra))&&(G.current=!1)),Qe()},[x,T,w,f,c,d,a.length,Qe,r.length,V]),i.useEffect(()=>{const j=m!==q.current,se=_.current!==te;if(_.current=te,!(j||se&&G.current&&!M.current))return;const Be=window.requestAnimationFrame(()=>{oe()});return m!==q.current&&(q.current=m),()=>{window.cancelAnimationFrame(Be)}},[te,Te,oe,m]),i.useEffect(()=>{const j=F.current,se=ie.current;if(!j||!se||typeof ResizeObserver>"u")return;ye.current=j.scrollHeight;const Pe=new ResizeObserver(()=>{const Be=j.scrollHeight,ze=ye.current;if(ye.current=Be,Be<=ze)return;const Ze=ze>0&&ze-j.scrollTop-j.clientHeight<=1;M.current||!(G.current||Ze||$.current)||window.requestAnimationFrame(()=>{oe()})});return Pe.observe(se),()=>{Pe.disconnect()}},[oe]),i.useEffect(()=>{if(!G.current||M.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(Te)},[Te,b]);const fe=n??r.length,he=ae?0:Math.max(0,r.length-V),Re=ae?Math.max(0,fe-r.length):0,De=ae?r:r.slice(he),Ie=Re+he,ct=fe+1,st=ae?0:r.length-De.length,Ke=ae?Math.max(0,fe-r.length):0,ot=ae?Ke+st:st,gt=!ae&&ot>0&&re>=2,Ct=ae&&Ke>0&&st===0&&typeof g=="function";i.useEffect(()=>{const j=F.current,se=X.current;if(!j||!se||!Ct||k||O.current||typeof IntersectionObserver>"u")return;const Pe=new IntersectionObserver(Be=>{!A.current||k||O.current||!Be.some(ze=>ze.isIntersecting)||(O.current=!0,g==null||g())},{root:j,threshold:.01});return Pe.observe(se),()=>{Pe.disconnect()}},[Ct,k,g]);const bt=s&&(!o||!De.some(j=>j.id===o)&&(z==null?void 0:z.id)!==o),mt=(z==null?void 0:z.id)??((pt=De.at(-1))==null?void 0:pt.id)??null,ut=bt&&mt!==null,wt=!!c&&(De.some(j=>j.id===c.turnId)||(z==null?void 0:z.id)===c.turnId),vt=c&&wt?c.turnId:c&&ut?mt:null,L=z&&vt===z.id?(c==null?void 0:c.items)??null:null,B=((c==null?void 0:c.items.length)??0)>0,de=c&&vt===null?c.items:null,xe=i.useMemo(()=>c&&vt===null&&c.items.length>0?Jp(c.turnId,c.items):null,[c,vt]),et=Math.max(1,fe+(z?1:0)),lt=!!f&&!!z&&z.status!=="failed"&&!L,yt=f&&De.length>0?o&&De.some(j=>j.id===o)?o:((We=De.findLast(j=>vi(j.status)))==null?void 0:We.id)??(ut?mt:null):null,it=!!yt,rt=new Set(De.map(j=>j.id)),Lt=T.reduce((j,se)=>{if(!se.turnId||!rt.has(se.turnId))return j;const Pe=j.get(se.turnId)??[];return Pe.push(se),j.set(se.turnId,Pe),j},new Map),jt=a.reduce((j,se)=>{if(!se.turnId||!rt.has(se.turnId))return j;const Pe=j.get(se.turnId)??[];return Pe.push(se),j.set(se.turnId,Pe),j},new Map),Kt=[...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)),jr=T.filter(j=>!j.turnId||!rt.has(j.turnId)),Xt=a.filter(j=>!j.turnId||!rt.has(j.turnId)),ve=i.useMemo(()=>{const j=[...De.map(ze=>({id:ze.id,startedAt:ze.startedAt??""})),...z?[{id:z.id,startedAt:z.startedAt??""}]:[]],se=new Map,Pe=[],Be=[...jr.map(ze=>({kind:"note",id:ze.id,createdAt:ze.createdAt??"",note:ze})),...Xt.map(ze=>({kind:"request",id:ze.id,createdAt:ze.createdAt,request:ze}))].sort((ze,Ze)=>ze.createdAt.localeCompare(Ze.createdAt));for(const ze of Be){const Ze=j.find(Ce=>ze.createdAt&&Ce.startedAt&&ze.createdAt.localeCompare(Ce.startedAt)<=0);if(!Ze){Pe.push(ze);continue}const Ye=se.get(Ze.id)??[];Ye.push(ze),se.set(Ze.id,Ye)}return{beforeTurnId:se,trailing:Pe}},[z,jr,Xt,De]),je=i.useMemo(()=>{const j=[...y].sort((Xe,Ft)=>Xe.createdAt.localeCompare(Ft.createdAt)),se=[...De.map(Xe=>({id:Xe.id,startedAt:Xe.startedAt??""})),...z?[{id:z.id,startedAt:z.startedAt??""}]:[]],Pe=[],Be=new Map,ze=new Map,Ze=[],Ce=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(It=>It.id===Xe.anchorTurnId)){const It=ze.get(Xe.anchorTurnId)??[];It.push(Xe),ze.set(Xe.anchorTurnId,It)}else Pe.push(Xe);continue}const Ft=se.find(It=>It.startedAt&&Xe.createdAt.localeCompare(It.startedAt)<=0);if(!Ft){!Ce||Xe.createdAt.localeCompare(Ce)<=0?Pe.push(Xe):Ze.push(Xe);continue}const Rt=Be.get(Ft.id)??[];Rt.push(Xe),Be.set(Ft.id,Rt)}return{leading:Pe,beforeTurnId:Be,afterTurnId:ze,trailing:Ze}},[y,z,De]);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:F,"data-testid":"chat-scroll-container",onScroll:W,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:ie,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:[ot>0&&e.jsx("button",{type:"button",onClick:()=>{if(ae&&st===0){g==null||g();return}D(j=>Math.min(r.length,j+Rp)),ne(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"}),gt&&e.jsx("button",{type:"button",onClick:()=>D(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 ",De.length," of ",fe," turns",ot>0?` · ${ot} earlier hidden${st>0&&Ke>0?` (${st} 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."}),(De.length>0||z||je.leading.length>0||je.trailing.length>0)&&e.jsxs("div",{className:"thread-graph-message-list",children:[je.leading.length>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:je.leading.map(j=>e.jsx(pr,{note:j,onOpenThread:I,onOpenLinkedThread:U},j.id))}):null,De.map((j,se)=>{var Pe,Be,ze,Ze,Ye;return e.jsxs("div",{children:[(((Pe=je.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:(je.beforeTurnId.get(j.id)??[]).map(Ce=>e.jsx(pr,{note:Ce,onOpenThread:I,onOpenLinkedThread:U},Ce.id))}):null,(((Be=ve.beforeTurnId.get(j.id))==null?void 0:Be.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(ve.beforeTurnId.get(j.id)??[]).map(Ce=>Ce.kind==="note"?e.jsx(sn,{note:Ce.note},Ce.id):e.jsx(an,{request:Ce.request,busy:h===Ce.request.id,onRespond:p??void 0},Ce.id))}):null,e.jsx(ca,{threadId:t,...Z?{adapter:Z}:{},turn:j,absoluteIndex:Ie+se+1,isCollapsed:me[j.id]??!1,livePlan:(d==null?void 0:d.turnId)===j.id?d:null,liveItems:vt===j.id?(c==null?void 0:c.items)??null:null,liveOutput:yt===j.id?f:"",forceActive:o===j.id||ut&&mt===j.id,onToggleCollapse:Q,onOpenExpandedText:we,onOpenCommandDetail:He,onOpenToolCallDetail:$e,onOpenDeferredHistoryItemDetail:Ue,onBeforeMessageResize:be,...R?{onSelectArtifact:R}:{},scrollRootRef:F,articleRef:void 0}),(((ze=je.afterTurnId.get(j.id))==null?void 0:ze.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(je.afterTurnId.get(j.id)??[]).map(Ce=>e.jsx(pr,{note:Ce,onOpenThread:I,onOpenLinkedThread:U},Ce.id))}):null,(Ze=Lt.get(j.id))!=null&&Ze.length||(Ye=jt.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:[...(Lt.get(j.id)??[]).map(Ce=>({kind:"note",id:Ce.id,createdAt:Ce.createdAt??"",note:Ce})),...(jt.get(j.id)??[]).map(Ce=>({kind:"request",id:Ce.id,createdAt:Ce.createdAt,request:Ce}))].sort((Ce,Xe)=>Ce.createdAt.localeCompare(Xe.createdAt)).map(Ce=>Ce.kind==="note"?e.jsx(sn,{note:Ce.note},Ce.id):e.jsx(an,{request:Ce.request,busy:h===Ce.request.id,onRespond:p??void 0},Ce.id))}):null]},j.id)}),z&&De.every(j=>j.id!==z.id)&&e.jsxs(e.Fragment,{children:[(((Bt=je.beforeTurnId.get(z.id))==null?void 0:Bt.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(je.beforeTurnId.get(z.id)??[]).map(j=>e.jsx(pr,{note:j,onOpenThread:I,onOpenLinkedThread:U},j.id))}):null,(((kt=ve.beforeTurnId.get(z.id))==null?void 0:kt.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(ve.beforeTurnId.get(z.id)??[]).map(j=>j.kind==="note"?e.jsx(sn,{note:j.note},j.id):e.jsx(an,{request:j.request,busy:h===j.request.id,onRespond:p??void 0},j.id))}):null,e.jsx(ca,{threadId:t,...Z?{adapter:Z}:{},turn:z,absoluteIndex:ct,isCollapsed:me[z.id]??!1,livePlan:null,liveItems:L,liveOutput:lt?f:"",forceActive:o===z.id||ut&&mt===z.id,onToggleCollapse:Q,onOpenExpandedText:we,onOpenCommandDetail:He,onOpenToolCallDetail:$e,onOpenDeferredHistoryItemDetail:Ue,onBeforeMessageResize:be,...R?{onSelectArtifact:R}:{},scrollRootRef:F}),(((Zt=je.afterTurnId.get(z.id))==null?void 0:Zt.length)??0)>0?e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:(je.afterTurnId.get(z.id)??[]).map(j=>e.jsx(pr,{note:j,onOpenThread:I,onOpenLinkedThread:U},j.id))}):null]})]}),Kt.length>0&&e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:Kt.map(j=>e.jsx(Mr,{threadId:t,item:{id:j.id,kind:"userMessage",text:j.prompt,status:j.status},scrollRootRef:F,onBeforeMessageResize:be,...Z?{adapter:Z}:{}},j.id))}),(ve.trailing.length>0||je.trailing.length>0)&&e.jsx("div",{className:"thread-graph-message-section space-y-3 px-3 py-4 sm:px-5",children:[...je.trailing.map(j=>({kind:"activity",id:j.id,createdAt:j.createdAt,note:j})),...ve.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(sn,{note:j.note},j.id):e.jsx(an,{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:F,onBeforeMessageResize:be})}),xe&&de&&de.length>0&&e.jsx(ca,{threadId:t,...Z?{adapter:Z}:{},turn:xe,absoluteIndex:et,isCollapsed:me[xe.id]??!1,livePlan:(d==null?void 0:d.turnId)===xe.id?d:null,liveItems:de,liveOutput:"",forceActive:!0,onToggleCollapse:Q,onOpenExpandedText:we,onOpenCommandDetail:He,onOpenToolCallDetail:$e,onOpenDeferredHistoryItemDetail:Ue,onBeforeMessageResize:be,...R?{onSelectArtifact:R}:{},scrollRootRef:F}),f&&!it&&!lt&&!B&&e.jsx("div",{className:"thread-graph-message-section px-3 py-2.5 sm:px-5",children:Ia(f)?e.jsx(Za,{threadId:t,item:Ia(f),scrollRootRef:F,onOpenExpandedText:we,onOpenCommandDetail:He,onOpenToolCallDetail:$e,onOpenDeferredHistoryItemDetail:Ue,onBeforeMessageResize:be,...R?{onSelectArtifact:R}:{},...Z?{adapter:Z}:{}}):e.jsx(Mr,{threadId:t,item:{id:"live-agent-message-fallback",kind:"agentMessage",text:f},scrollRootRef:F,streaming:!0,onBeforeMessageResize:be,...Z?{adapter:Z}:{}})}),e.jsx("div",{ref:Le,"aria-hidden":"true",className:"h-px w-full"})]})})}),e.jsx(ym,{open:Ne!==null,title:(Ne==null?void 0:Ne.title)??"Full text",text:(Ne==null?void 0:Ne.text)??"",onClose:()=>{N.current+=1,ee(null)}})]})}var yi=i.memo(tf);function Ho(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 ha(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 Vo(t,r,n,a,o){const s=r.replace(/\r\n/g,`
|
|
3593
|
+
`),l=s.split(`
|
|
3594
|
+
`);s.endsWith(`
|
|
3595
|
+
`)&&l.at(-1)===""&&l.pop();let c=l.join(`\r
|
|
3596
|
+
`);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 rf(t){return/^[a-z]$/i.test(t)?String.fromCharCode(t.toUpperCase().charCodeAt(0)-64):null}function Uo(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(`
|
|
3597
|
+
`).trimEnd():""}function Pa(t){return t.replace(/\r\n/g,`
|
|
3598
|
+
`)}function Wo(t){const r=Pa(t),n=r.split(`
|
|
3599
|
+
`);return r.endsWith(`
|
|
3600
|
+
`)&&n.at(-1)===""&&n.pop(),n}function nf(t){const r=t.trim();return r?/(?:[$%#>])\s*$/.test(r):!1}function af(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 sf(t,r,n){var c,h;const a=Wo(t),o=Wo(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=af(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())===""||nf(d.at(-1)??""));)d.pop();return d.join(`
|
|
3601
|
+
`).trimEnd()}function xn(t){if(!t)return"";const r=t.replace(/[\\/]+$/,"");return r?r.split(/[\\/]/).filter(Boolean).at(-1)??r:""}function Ma(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 ua(t){return Math.min(75,Math.max(25,t))}function of(){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 lf({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 qo(){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 ma({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 df(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 Ko=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),P=i.useRef(null),I=i.useRef(""),R=i.useRef(null),K=i.useRef(""),Z=i.useRef(null),F=i.useRef(null),ie=i.useRef({cursorX:void 0,cursorY:void 0,paneHeight:void 0}),q=i.useRef(!1),_=i.useRef(null),Y=i.useRef(o),ye=i.useRef(s),ue=i.useRef(()=>!1),Le=i.useRef(()=>null),X=i.useRef(()=>{}),$=i.useRef(null),[G,M]=i.useState(null),[A,O]=i.useState(!1),[N,E]=i.useState(null),[V,D]=i.useState(!1),[re,ne]=i.useState(null),[Ne,ee]=i.useState(null),[me,pe]=i.useState(!1),[Te,Oe]=i.useState(0),J=(n==null?void 0:n.status)??"not_created",U=!!(n&&!d&&n.status!=="exited"&&n.status!=="not_found"),te=i.useMemo(()=>Ma(xn(n==null?void 0:n.cwd),null),[n==null?void 0:n.cwd]),ae=Ne??te,Q=i.useCallback(W=>{g.current=W,E(W)},[]),we=i.useCallback(W=>{const oe=$.current;if(oe){$.current=null,oe.timer!==null&&window.clearTimeout(oe.timer);for(const be of oe.waiters)be(W)}},[]);i.useEffect(()=>{Y.current=o},[o]),i.useEffect(()=>{ye.current=s},[s]),i.useEffect(()=>{w.current=(n==null?void 0:n.id)??null},[n==null?void 0:n.id]);const Ae=i.useCallback(W=>{const oe=k.current,be=w.current,fe=g.current;return!oe||!be||!fe?!1:(oe.send({type:"shell.input",shellId:be,viewerId:fe,data:W}),!0)},[]);i.useEffect(()=>{ue.current=Ae},[Ae]);const He=i.useCallback(()=>{const W=k.current,oe=w.current,be=g.current;return!W||!oe||!be?!1:(W.send({type:"shell.clear",shellId:oe,viewerId:be}),!0)},[]),$e=i.useCallback(()=>{if(!o||!G)return!1;const W=G.getBoundingClientRect();return W.width>0&&W.height>0},[o,G]),Ue=i.useCallback(W=>{const oe=v.current,be=b.current;if(!oe||!be||!$e()||(be.fit(),oe.cols<=0||oe.rows<=0))return null;const fe={cols:oe.cols,rows:oe.rows};if((W==null?void 0:W.syncBackendSize)===!1)return fe;const he=F.current;return(he==null?void 0:he.cols)===fe.cols&&he.rows===fe.rows||(F.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},[$e]);i.useEffect(()=>{Le.current=Ue},[Ue]);const Qe=i.useCallback(W=>{const oe=v.current;!oe||!$e()||(Ue((W==null?void 0:W.syncBackendSize)===void 0?void 0:{syncBackendSize:W.syncBackendSize}),I.current&&!Uo(G)?Vo(oe,I.current,ie.current.cursorX,ie.current.cursorY,ie.current.paneHeight):oe.scrollToBottom(),W!=null&&W.focus&&!s&&oe.focus())},[s,$e,Ue,G]);return i.useEffect(()=>{X.current=()=>Qe()},[Qe]),i.useEffect(()=>{f({status:N?"attached":J,shellInputEnabled:!!(N&&n),isConnecting:V,isCommandRunning:me,promptLabel:ae,error:re,hasShell:!!n})},[re,V,me,f,ae,n,J,N]),i.useEffect(()=>{if(!G||v.current||q.current)return;let W=!1;return q.current=!0,(async()=>{const[{Terminal:oe},{FitAddon:be}]=await Promise.all([at(()=>import("./terminal-vendor-CLGgN91S.js").then(Re=>Re.x),__vite__mapDeps([6,2,7])),at(()=>import("./terminal-vendor-CLGgN91S.js").then(Re=>Re.a),__vite__mapDeps([6,2,7]))]);if(W||!G){q.current=!1;return}const fe=new oe({cursorBlink:!0,disableStdin:ye.current,fontFamily:"IBM Plex Mono, SFMono-Regular, Menlo, monospace",fontSize:13,lineHeight:1.25,scrollback:3e3,theme:Ho(l)}),he=new be;fe.loadAddon(he),fe.open(G),v.current=fe,b.current=he,Le.current(),fe.attachCustomKeyEventHandler(Re=>{if(ye.current||Re.type!=="keydown")return!0;if(Re.ctrlKey&&!Re.altKey&&!Re.metaKey&&!Re.shiftKey){const De=rf(Re.key);if(!De)return!0;if(ue.current(De))return Re.preventDefault(),!1}return!0}),O(!0),q.current=!1,Z.current=new ResizeObserver(()=>{X.current()}),Z.current.observe(G),_.current=fe.onData(Re=>{ye.current||ue.current(Re)})})(),()=>{var oe,be,fe;W=!0,q.current=!1,(oe=_.current)==null||oe.dispose(),_.current=null,(be=Z.current)==null||be.disconnect(),Z.current=null,O(!1),(fe=v.current)==null||fe.dispose(),v.current=null,b.current=null,F.current=null}},[l,G]),i.useEffect(()=>{var W;n||(Q(null),D(!1),we(!1),ne(null),ee(null),pe(!1),I.current="",K.current="",R.current=null,(W=v.current)==null||W.reset())},[Q,we,n]),i.useEffect(()=>{const W=v.current;W&&(W.options.theme=Ho(l))},[l]),i.useEffect(()=>{const W=v.current;W&&(W.options.disableStdin=s)},[s]),i.useEffect(()=>{if(!o||!A)return;const W=window.requestAnimationFrame(()=>{Qe({focus:a,syncBackendSize:!1}),!k.current&&(n!=null&&n.id)&&P.current!==n.id&&Oe(oe=>oe+1)});return()=>{window.cancelAnimationFrame(W)}},[a,o,Qe,n==null?void 0:n.id,A]),i.useEffect(()=>{const W=n==null?void 0:n.id;if(!W||!A||!Y.current||!U||P.current===W)return;const oe=v.current;if(!oe)return;const be=Le.current();if(!be){C.current===null&&(C.current=window.setTimeout(()=>{C.current=null,Oe(he=>he+1)},120));return}if(C.current!==null&&(window.clearTimeout(C.current),C.current=null),k.current&&w.current===W)return;T.current!==null&&(window.clearTimeout(T.current),T.current=null),w.current=W,oe.reset(),ne(null),Q(null),D(!0),z.current=!1;const fe=c.connectSocket({onConnected:()=>{var he;((he=k.current)==null?void 0:he.socket)===fe.socket&&(fe.send({type:"shell.attach",shellId:W,cols:be.cols,rows:be.rows}),y.current!==null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>{var Re,De,Ie;y.current=null,!(fe.socket&&((Re=k.current)==null?void 0:Re.socket)!==fe.socket)&&(g.current||(ne("Shell connection timed out. Reconnecting..."),D(!1),we(!1),(De=fe.close)==null||De.call(fe),(Ie=fe.socket)==null||Ie.close()))},4e3))},onShellEvent:he=>{var De;if(fe.socket&&((De=k.current)==null?void 0:De.socket)!==fe.socket||he.shellId!==W)return;if(he.type==="shell.connected"){y.current!==null&&(window.clearTimeout(y.current),y.current=null);const Ie=String(he.payload.viewerId??"");Q(Ie||null),D(!1),we(!!Ie),p(W,ct=>({...ct,status:"attached",attachedViewerId:Ie}),"attached");return}if(he.type==="shell.output"){const Ie=typeof he.payload.data=="string"?he.payload.data:"",ct=he.payload.replace===!0,st=typeof he.payload.cursorX=="number"?he.payload.cursorX:void 0,Ke=typeof he.payload.cursorY=="number"?he.payload.cursorY:void 0,ot=typeof he.payload.paneHeight=="number"?he.payload.paneHeight:void 0,gt=typeof he.payload.cwdBaseName=="string"?he.payload.cwdBaseName:null,Ct=typeof he.payload.envPrefix=="string"?he.payload.envPrefix:null,bt=Ma(gt??xn(n==null?void 0:n.cwd),Ct),mt=he.payload.isCommandRunning===!0;if(ie.current={cursorX:st,cursorY:Ke,paneHeight:ot},ee(bt),pe(mt),Ie)if(ct){const ut=Pa(Ie);I.current=ut,Vo(oe,Ie,st,Ke,ot),!mt&&R.current&&(K.current=sf(R.current.beforeSnapshot,ut,R.current.command),R.current=null)}else I.current=Pa(`${I.current}${Ie}`),oe.write(Ie);return}if(he.type==="shell.error"){ne(String(he.payload.message??"Shell connection failed.")),D(!1),we(!1),he.payload.code==="viewer_conflict"&&p(W,Ie=>({...Ie,status:"detached",attachedViewerId:null}),"detached");return}if(he.type==="shell.detached"){const Ie=String(he.payload.viewerId??""),ct=String(he.payload.reason??"");Ie&&Ie===g.current&&(Q(null),D(!1),we(!1),p(W,st=>({...st,status:"detached",attachedViewerId:null}),"detached"),ct==="replaced"?(z.current=!0,ne("This shell connection was taken over by another pane or device.")):ne(null),pe(!1),fe.socket.close());return}if(he.type==="shell.exited"){Q(null),pe(!1),D(!1),we(!1),z.current=!0;const Ie=he.payload.state==="exited"?"exited":"not_found";p(W,ct=>({...ct,status:Ie,attachedViewerId:null}),Ie),fe.socket.close();return}const Re=he.payload.state;Re&&(Re!=="attached"&&(Q(null),pe(!1),D(!1),we(!1)),p(W,Ie=>({...Ie,status:Re==="attached"||Re==="detached"?Re:Ie.status,attachedViewerId:Re==="attached"?Ie.attachedViewerId:null}),Re))}});return k.current=fe,fe.socket.addEventListener("close",()=>{var Re;if(((Re=k.current)==null?void 0:Re.socket)!==fe.socket)return;y.current!==null&&(window.clearTimeout(y.current),y.current=null),k.current=null;const he=!!g.current;Q(null),D(!1),we(!1),he&&p(W,De=>({...De,status:De.status==="attached"?"detached":De.status,attachedViewerId:null}),"detached"),!z.current&&P.current!==W&&(T.current=window.setTimeout(()=>{T.current=null,Oe(De=>De+1)},800))}),()=>{var Re;const he=g.current;z.current=!0,C.current!==null&&(window.clearTimeout(C.current),C.current=null),he&&fe.socket.readyState===WebSocket.OPEN&&fe.send({type:"shell.detach",shellId:W,viewerId:he}),Q(null),D(!1),we(!1),y.current!==null&&(window.clearTimeout(y.current),y.current=null),fe.socket.close(),((Re=k.current)==null?void 0:Re.socket)===fe.socket&&(k.current=null)}},[U,p,Te,Q,we,n==null?void 0:n.cwd,n==null?void 0:n.id,A]),i.useEffect(()=>()=>{T.current!==null&&window.clearTimeout(T.current),y.current!==null&&window.clearTimeout(y.current),C.current!==null&&window.clearTimeout(C.current),we(!1)},[we]),i.useImperativeHandle(x,()=>({disconnect(){const W=k.current,oe=w.current,be=g.current;P.current=oe,z.current=!0,W&&oe&&be&&W.send({type:"shell.detach",shellId:oe,viewerId:be}),Q(null),D(!1),we(!1),W==null||W.socket.close(),k.current=null,F.current=null,oe&&p(oe,fe=>({...fe,status:"detached",attachedViewerId:null}),"detached")},reconnect(){if(!w.current||!A||d)return Promise.resolve(!1);if(g.current)return Promise.resolve(!0);if($.current)return new Promise(oe=>{var be;(be=$.current)==null||be.waiters.push(oe)});const W=new Promise(oe=>{const be=window.setTimeout(()=>{D(!1),$.current=null,oe(!1)},4500);$.current={waiters:[oe],timer:be}});return P.current===w.current&&(P.current=null),z.current=!1,ne(null),D(!0),Oe(oe=>oe+1),W},sendInput(W){return Ae(W)},sendCommand(W){const oe={command:W,beforeSnapshot:I.current};if(R.current=oe,W.trim()==="clear"){const he=He();return!he&&R.current===oe&&(R.current=null),he}const be=W.endsWith(`
|
|
3602
|
+
`)?W:`${W}
|
|
3603
|
+
`,fe=Ae(be);return!fe&&R.current===oe&&(R.current=null),fe},sendControl(W){return W==="clear"?He():Ae(df(W))},async copyLastCommandOutput(){const W=K.current.trim()||Uo(G);if(!W)return m==null||m("failed","Nothing to copy"),!1;try{return await navigator.clipboard.writeText(W),m==null||m("done","Copied"),!0}catch{return m==null||m("failed","Copy failed"),!1}},focus(){var W;(W=v.current)==null||W.focus()},refreshLayout(W){Qe(W)}}),[m,p,Qe,He,Ae,Q,we,G,A,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:M,className:`h-full w-full px-2 py-2 sm:px-3 sm:py-3 ${s?"mobile-shell-selectable":""}`,onMouseDown:()=>{var W;h(),(W=v.current)==null||W.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"})]})}),cf=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),[P,I]=i.useState(null),[R,K]=i.useState("primary"),[Z,F]=i.useState(null),[ie,q]=i.useState(null),[_,Y]=i.useState("single"),[ye,ue]=i.useState(50),[Le,X]=i.useState(null),[$,G]=i.useState(""),[M,A]=i.useState(!1),[O,N]=i.useState(!1),[E,V]=i.useState(!1),[D,re]=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}}),[ne,Ne]=i.useState(null),ee=(g==null?void 0:g.state)??"not_created",me=i.useMemo(()=>(g==null?void 0:g.shells)??[],[g==null?void 0:g.shells]),pe=i.useMemo(()=>me.filter(L=>L.status!=="exited"&&L.status!=="not_found"),[me]),Te=i.useMemo(()=>pe.find(L=>L.id===Z)??null,[pe,Z]),Oe=i.useMemo(()=>pe.find(L=>L.id===ie)??null,[pe,ie]),J=R==="secondary"?Oe:Te,U=D[R],te=(g==null?void 0:g.workspacePathStatus)==="missing",ae=C||T||ee==="creating"||te,Q=R==="secondary"?m:f,we=U.shellInputEnabled?"Disconnect shell":J&&(J.status==="exited"||J.status==="not_found")?"Restart shell":J?"Connect shell":"Create shell",Ae=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":te?"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",He=(ne==null?void 0:ne.tone)==="done"?"shell-floating-feedback shell-floating-feedback-done":(ne==null?void 0:ne.tone)==="failed"?"shell-floating-feedback shell-floating-feedback-failed":"shell-floating-feedback",$e=i.useCallback((L,B)=>{Ne({tone:L,text:B}),x.current!==null&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>{Ne(null),x.current=null},1800)},[]),Ue=i.useCallback((L,B,de)=>{w(xe=>{var yt;if(!xe)return xe;const et=xe.shells.map(it=>it.id===L?B(it):it),lt=((yt=xe.shell)==null?void 0:yt.id)===L?B(xe.shell):et.find(it=>{var rt;return it.id===((rt=xe.shell)==null?void 0:rt.id)})??xe.shell;return{...xe,...de?{state:de}:{},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){ue(50);return}const B=typeof L=="number"?L:Number.parseFloat(String(L));ue(Number.isFinite(B)?ua(B):50)},[d,r]),i.useEffect(()=>{if(!g){F(null),q(null);return}const L=de=>de.status!=="exited"&&de.status!=="not_found",B=(g.activeShellId?g.shells.find(de=>de.id===g.activeShellId&&L(de)):null)??(g.shell&&L(g.shell)?g.shell:null)??g.shells.find(L)??null;F(de=>de&&g.shells.some(xe=>xe.id===de&&L(xe))?de:(B==null?void 0:B.id)??null),q(de=>{if(_!=="columns")return null;if(de&&g.shells.some(et=>et.id===de&&L(et)))return de;const xe=g.shells.find(et=>L(et)&&et.id!==(B==null?void 0:B.id));return(xe==null?void 0:xe.id)??null})},[g,_]),i.useEffect(()=>{_!=="columns"&&(K("primary"),q(null))},[_]),i.useEffect(()=>{if(_!=="columns"||ie||pe.length<2)return;const L=pe.find(B=>B.id!==(Te==null?void 0:Te.id))??null;L&&q(L.id)},[pe,Te==null?void 0:Te.id,ie,_]),i.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const L=window.matchMedia("(max-width: 767px), (hover: none) and (pointer: coarse)"),B=()=>{A(L.matches),L.matches||(V(!1),N(!1))};return B(),L.addEventListener("change",B),()=>{L.removeEventListener("change",B)}},[]),i.useEffect(()=>()=>{x.current!==null&&window.clearTimeout(x.current),b.current!==null&&window.cancelAnimationFrame(b.current)},[]);const W=i.useCallback((L,B)=>{re(de=>{const xe=de[L];return xe.status===B.status&&xe.shellInputEnabled===B.shellInputEnabled&&xe.isConnecting===B.isConnecting&&xe.isCommandRunning===B.isCommandRunning&&xe.promptLabel===B.promptLabel&&xe.error===B.error&&xe.hasShell===B.hasShell?de:{...de,[L]:B}})},[]),oe=i.useCallback(L=>W("primary",L),[W]),be=i.useCallback(L=>W("secondary",L),[W]),fe=i.useCallback(L=>{var de;if((de=L.label)!=null&&de.trim())return L.label.trim();const B=me.findIndex(xe=>xe.id===L.id);return`Shell ${B>=0?B+1:""}`.trim()},[me]),he=i.useCallback(L=>{var B;X(L.id),G(((B=L.label)==null?void 0:B.trim())||fe(L))},[fe]),Re=i.useCallback(()=>{X(null),G("")},[]),De=i.useCallback(async()=>{if(Le){z(!0);try{const L=$.trim(),B=await n.updateShell(Le,{label:L.length>0?L:null});w(de=>{var xe;return de&&{...de,state:de.activeShellId===B.id?B.status:de.state,shell:((xe=de.shell)==null?void 0:xe.id)===B.id?B:de.shell,shells:de.shells.map(et=>et.id===B.id?B:et)}}),X(null),G(""),I(null)}catch(L){I(L instanceof Error?L.message:"Unable to rename shell.")}finally{z(!1)}}},[$,Le,n]),Ie=i.useCallback((L,B)=>{if(L==="primary"){F(B),q(de=>de===B?null:de);return}q(B),F(de=>de===B?null:de)},[]),ct=i.useCallback(L=>{var B,de;if(L==="primary"){(B=f.current)==null||B.disconnect(),F(null),_==="columns"&&K("secondary");return}(de=m.current)==null||de.disconnect(),q(null),K("primary"),Y("single")},[_]),st=i.useCallback((L,B=R)=>{const de=_==="columns"?B:"primary";Ie(de,L.id),_!=="columns"&&q(null),K(de)},[R,Ie,_]),Ke=i.useCallback(async(L=R)=>{var B;if(!k.current){k.current=!0,z(!0);try{const de=await n.createShell(r);w(de);const xe=de.activeShellId??((B=de.shell)==null?void 0:B.id)??null;if(xe){const et=_==="columns"?L:"primary";Ie(et,xe),_!=="columns"&&q(null),K(et)}I(null)}catch(de){I(de instanceof Error?de.message:"Unable to create shell.")}finally{k.current=!1,z(!1)}}},[R,Ie,n,_,r]);i.useEffect(()=>{!a||!g||T||C||te||ee==="creating"||pe.length>0||Ke("primary")},[C,Ke,a,pe.length,T,g,ee,te]);const ot=i.useCallback(async(L=(J==null?void 0:J.id)??"")=>{if(L){z(!0);try{await n.terminateShell(L),F(B=>B===L?null:B),q(B=>B===L?null:B),await Qe(),I(null)}catch(B){I(B instanceof Error?B.message:"Unable to terminate shell.")}finally{z(!1)}}},[J==null?void 0:J.id,Qe,n]),gt=i.useCallback(async()=>{var L,B;if(!ae){if(U.shellInputEnabled){(L=Q.current)==null||L.disconnect();return}if(!J||J.status==="exited"||J.status==="not_found"){await Ke(R);return}await((B=Q.current)==null?void 0:B.reconnect())}},[R,Q,U.shellInputEnabled,J,ae,Ke]),Ct=i.useCallback(L=>{typeof window>"u"||c==null||c(r,ua(L))},[c,r]),bt=i.useCallback(()=>{var L,B;(L=f.current)==null||L.refreshLayout({syncBackendSize:!0}),(B=m.current)==null||B.refreshLayout({syncBackendSize:!0})},[]),mt=i.useCallback(L=>{var lt,yt;if(_!=="columns")return;const B=v.current;if(!B)return;L.preventDefault(),(yt=(lt=L.currentTarget).setPointerCapture)==null||yt.call(lt,L.pointerId);const de=it=>{const rt=B.getBoundingClientRect();if(rt.width<=0)return;const Lt=ua((it-rt.left)/rt.width*100);ue(Lt),b.current!==null&&window.cancelAnimationFrame(b.current),b.current=window.requestAnimationFrame(()=>{b.current=null,bt()})},xe=it=>{de(it.clientX)},et=it=>{de(it.clientX);const rt=B.getBoundingClientRect();rt.width>0&&Ct((it.clientX-rt.left)/rt.width*100),window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",et)};window.addEventListener("pointermove",xe),window.addEventListener("pointerup",et,{once:!0})},[Ct,bt,_]),ut=i.useCallback((L,B)=>{Ie(B,L.id),K(B)},[Ie]),wt=i.useCallback(async()=>{var B;return await((B=Q.current)==null?void 0:B.copyLastCommandOutput())?!0:($e("failed","Nothing to copy"),!1)},[Q,$e]);i.useEffect(()=>{h==null||h({status:U.status,connectionButtonDisabled:ae,connectionButtonLabel:we,shellInputEnabled:U.shellInputEnabled,isConnecting:U.isConnecting,isCommandRunning:U.isCommandRunning,promptLabel:U.promptLabel??(J?Ma(xn(J.cwd),null):null),isMobileShell:M,hasShell:!!J,busy:C,loading:T,error:U.error??P})},[U,J,C,ae,we,P,M,T,h]),i.useImperativeHandle(p,()=>({async toggleConnection(){await gt()},sendInput(L){var B;return((B=Q.current)==null?void 0:B.sendInput(L))??!1},sendCommand(L){var B;return((B=Q.current)==null?void 0:B.sendCommand(L))??!1},sendControl(L){var B;return((B=Q.current)==null?void 0:B.sendControl(L))??!1},async copyLastCommandOutput(){var L;return await((L=Q.current)==null?void 0:L.copyLastCommandOutput())??!1},async terminate(){await ot()},focus(){var L;(L=Q.current)==null||L.focus()},refreshLayout(L){var B,de;(B=f.current)==null||B.refreshLayout(L),_==="columns"&&((de=m.current)==null||de.refreshLayout(L))}}),[Q,gt,ot,_]);const vt=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:[Le===L.id?e.jsx("form",{className:"min-w-0 flex-1",onSubmit:B=>{B.preventDefault(),De()},children:e.jsx("input",{value:$,onChange:B=>G(B.currentTarget.value),onKeyDown:B=>{B.key==="Escape"&&(B.preventDefault(),Re())},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:()=>st(L),onDoubleClick:()=>he(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:[ha(L.status)," · ",xn(L.cwd)||L.cwd]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Le===L.id?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>void De(),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:Re,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:()=>he(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"}),_==="columns"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>ut(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:()=>ut(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 ot(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":we,title:`${we} (${ha(U.status)})`,disabled:ae,onClick:()=>void gt(),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 ${Ae}`,children:e.jsx(lf,{connected:U.shellInputEnabled})}),J&&e.jsx("button",{type:"button",disabled:C,onClick:()=>void ot(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"})]})]}),(P||T||te)&&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&&te&&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&&P&&e.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:P})]})]}),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:ha(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 ",pe.length]}),e.jsx("button",{type:"button","aria-expanded":O,"aria-label":O?"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"})]})]}),O&&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:[pe.length," live"]})]}),e.jsxs("div",{className:"max-h-52 space-y-1 overflow-y-auto",children:[pe.map(vt),pe.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||te,onClick:()=>void Ke(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"||te?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."}),!te&&e.jsx("button",{type:"button",disabled:C||T,onClick:()=>void Ke("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&&(P||T||te)&&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&&te&&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&&P&&e.jsx("p",{className:"text-amber-700 dark:text-amber-100",children:P})]}),e.jsxs("div",{ref:v,className:`relative grid h-full min-h-0 ${_==="columns"?"grid-cols-1 sm:grid-cols-[var(--shell-left)_0.35rem_var(--shell-right)]":"grid-cols-1"}`,style:_==="columns"?{"--shell-left":`${ye}fr`,"--shell-right":`${100-ye}fr`}:void 0,"data-shell-split-ratio":ye,children:[e.jsx(Ko,{ref:f,paneId:"primary",shell:Te,isActive:R==="primary",isVisible:a,isMobileShell:M,effectiveTheme:l,workspacePathMissing:te,shellAdapter:n,onActivate:()=>K("primary"),onShellUpdate:Ue,onRuntimeStateChange:oe,onFeedback:$e}),_==="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"}),_==="columns"&&e.jsx("button",{type:"button","aria-label":"Resize shell panes",title:"Resize shell panes",onPointerDown:mt,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"}),_==="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(Ko,{ref:m,paneId:"secondary",shell:Oe,isActive:R==="secondary",isVisible:a,isMobileShell:M,effectiveTheme:l,workspacePathMissing:te,shellAdapter:n,onActivate:()=>K("secondary"),onShellUpdate:Ue,onRuntimeStateChange:be,onFeedback:$e}),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&&M&&e.jsxs("div",{className:"pointer-events-none absolute bottom-3 right-3 z-20 flex flex-col items-end gap-2",children:[ne&&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 ${He}`,children:ne.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:()=>{$e("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(qo,{}),e.jsx("span",{className:"text-[11px] font-medium tracking-[0.12em]",children:"Paste"})]})}),e.jsx("button",{type:"button",onClick:()=>void wt(),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(qo,{}),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")?$e("done","Cleared"):$e("failed","Connect the shell first")},className:"disabled:opacity-45",children:e.jsx(ma,{label:"CLEAR",tone:"sky"})}),e.jsx("button",{type:"button",disabled:!U.shellInputEnabled||!U.isCommandRunning,onClick:()=>{var L;(L=Q.current)!=null&&L.sendInput("")?$e("done","Sent Ctrl-C"):$e("failed","Connect the shell first")},className:"disabled:opacity-45",children:e.jsx(ma,{label:"CTRL-C",tone:"rose"})}),["ctrl_d","esc","tab","up","down"].map(L=>e.jsx("button",{type:"button",disabled:!U.shellInputEnabled,onClick:()=>{var B;(B=Q.current)!=null&&B.sendControl(L)?$e("done",`Sent ${L.toUpperCase().replace("_","-")}`):$e("failed","Connect the shell first")},className:"disabled:opacity-45",children:e.jsx(ma,{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(of,{})})]})]}),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:[pe.length," live"]})]}),e.jsxs("div",{className:"min-h-0 flex-1 space-y-1 overflow-y-auto",children:[pe.map(vt),pe.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||te,onClick:()=>void Ke(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"]),hf=new Set(["png","jpg","jpeg","gif","webp","svg"]),uf=new Set(["pdf"]);function mf(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 pf(t){return t.trim().replace(/^\/+|\/+$/g,"").replace(/[^\w.-]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function Ur(t){var r;return((r=t.split(".").pop())==null?void 0:r.toLowerCase())||""}function ff(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 $a(t,r){return!t||!r?!1:t.path===r?!0:t.children.some(n=>$a(n,r))}function gf(t){if(!t)return null;const r=Ur(t.path);return ji.has(r)?{content:[t.content.endsWith(`
|
|
3604
|
+
`)?t.content:`${t.content}
|
|
3605
|
+
`],format:r==="extxyz"?"xyz":r,name:t.name,uuid:t.path}:null}function xf(t){const r=Ur(t);return r==="tsx"||r==="jsx"?"tsx":r==="yml"?"yaml":r||"text"}function bf(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 vf(t,r,n){const a=r.split("/").filter(Boolean),o=a.pop()??n.name;bf(t,a).children.push({...n,name:n.name||o,path:r})}function kf(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(kf);for(const r of t.children)Si(r);return t}function Xo(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=pf(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:ff(b),path:b,kind:"event",item:m,preview:k,detail:JSON.stringify(m,null,2),children:[]};if(x){d.children.push(w);return}vf(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 wf(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 Zo(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 yf({className:t,decorative:r=!0,orientation:n="horizontal",...a}){return e.jsx(mc,{"data-slot":"separator",decorative:r,orientation:n,className:xt("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 jf=Fr("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 Nf({className:t,orientation:r,...n}){return e.jsx("div",{role:"group","data-slot":"button-group","data-orientation":r,className:xt(jf({orientation:r}),t),...n})}function Cf({className:t,orientation:r="vertical",...n}){return e.jsx(yf,{"data-slot":"button-group-separator",orientation:r,className:xt("relative !m-0 self-stretch bg-input data-[orientation=vertical]:h-auto",t),...n})}function Sf({delayDuration:t=0,...r}){return e.jsx(pc,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function Tf({...t}){return e.jsx(Sf,{children:e.jsx(ic,{"data-slot":"tooltip",...t})})}function Ef({...t}){return e.jsx(dc,{"data-slot":"tooltip-trigger",...t})}function zf({children:t,className:r,sideOffset:n=0,...a}){return e.jsx(cc,{children:e.jsxs(hc,{"data-slot":"tooltip-content",sideOffset:n,className:xt("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(uc,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}function Lf(t){return(t==null?void 0:t.trim().replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""))||"molecule"}function Yo(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(Tf,{children:[e.jsx(Ef,{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(zf,{children:e.jsx("p",{children:n})})]})}function _a({children:t,className:r=""}){return e.jsx(Nf,{className:`thread-graph-molecule-button-group ${r}`,children:t})}function Rf({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(_a,{children:[e.jsx(dt,{label:"Distance",children:e.jsx(Qd,{className:"size-4"})}),e.jsx(dt,{label:"Connectivity",children:e.jsx(ec,{className:"size-4"})}),e.jsx(dt,{label:"Angle",children:e.jsx(tc,{className:"size-4"})}),e.jsx(dt,{label:"Dihedral",children:e.jsx(rc,{className:"size-4"})}),e.jsx(dt,{label:"Add dummy atoms",children:e.jsx(nc,{className:"size-4"})}),e.jsx(dt,{label:"Delete atoms",children:e.jsx(Br,{className:"size-4"})}),e.jsx(dt,{label:"Rotate",children:e.jsx(ac,{className:"size-4"})})]}),e.jsxs(_a,{children:[e.jsx(dt,{label:m?"Hide unit cell":"Show unit cell",disabled:!f,onClick:l,children:e.jsx(cl,{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(sc,{className:"size-4"})}),e.jsx(dt,{label:"Stage current selection",disabled:!x,onClick:s,children:e.jsx(Aa,{className:"size-4"})}),e.jsx(dt,{label:"Clear staged selections",disabled:!v,onClick:n,children:e.jsx(oc,{className:"size-4"})}),e.jsx(dt,{label:"Send staged selections",disabled:!v,onClick:o,children:e.jsx(lc,{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 If({currentIndex:t,exportContent:r,moleculeId:n,onScreenshot:a,viewerRef:o,xyzContent:s,xyzFormat:l}){const d=Lf(n);async function c(){s&&await navigator.clipboard.writeText(s)}function h(){s&&Yo(s,`${d}_step_${t+1}.${l||"xyz"}`)}function p(){r&&Yo(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(_a,{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(dn,{className:"size-3.5"})}),e.jsx(dt,{label:"Download full trajectory",onClick:p,disabled:!r,children:e.jsx(Aa,{className:"size-3.5"})}),e.jsx(dt,{label:"Copy screenshot",onClick:a,disabled:!o.current||!s,children:e.jsx(ol,{className:"size-3.5"})}),e.jsx(Cf,{className:"thread-graph-molecule-button-divider"}),e.jsx(dt,{label:"Zoom in",onClick:f,disabled:!o.current||!s,children:e.jsx(ll,{className:"size-3.5"})}),e.jsx(dt,{label:"Zoom out",onClick:m,disabled:!o.current||!s,children:e.jsx(il,{className:"size-3.5"})}),e.jsx(dt,{label:"Reset camera",onClick:x,disabled:!o.current||!s,children:e.jsx(dl,{className:"size-3.5"})})]})}var pa=null;async function Pf(){if(typeof window>"u")throw new Error("3Dmol is only available in a browser environment.");return window["3Dmol"]?window["3Dmol"]:(pa||(pa=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)})),pa)}function Mf({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(Xd,{"data-slot":"slider",...r!==void 0?{defaultValue:r}:{},...o!==void 0?{value:o}:{},min:a,max:n,className:xt("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(Zd,{"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(Yd,{"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(Jd,{"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 $f(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,`
|
|
3606
|
+
`).replace(/\r/g,`
|
|
3607
|
+
`).split(`
|
|
3608
|
+
`),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(`
|
|
3609
|
+
`)}
|
|
3610
|
+
`),a+=d}return n.length>0?n:[t]}function Jo(t,r){return r!=="xyz"?t:t.flatMap(n=>_f(n))}function Qo(t){return t.map(r=>`${r.replace(/\s+$/g,"")}
|
|
3611
|
+
`).join("")}function Af(t){if(!t)return{format:"xyz",frames:[],exportContent:""};if(typeof t=="string"){const o=Jo([t],"xyz");return{frames:o,format:"xyz",exportContent:Qo(o)}}const r=$f(t.format),n=t.content.filter(o=>o.trim().length>0);return{frames:Jo(n,r),format:r,exportContent:Qo(n)}}function Df({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([]),[P,I]=i.useState({}),[R,K]=i.useState(!1),[Z,F]=i.useState(!1),[ie,q]=i.useState(null),_=i.useMemo(()=>Af(o),[o]),Y=_.frames,ye=_.format,ue=Y[x]??null,Le=Y.length>0&&x===Y.length-1,X=r??"current",$=Object.values(P).reduce((N,E)=>N+E.length,0),G=Object.keys(P).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 D=document.createElement("canvas");if(!(D.getContext("webgl2")||D.getContext("webgl")||D.getContext("experimental-webgl"))){q("WebGL is unavailable in this browser environment. Unable to render 3D viewer.");return}}catch{q("WebGL is unavailable in this browser environment. Unable to render 3D viewer.");return}const V=()=>{var D,re;(D=d.current)==null||D.resize(),(re=d.current)==null||re.render()};return Pf().then(D=>{if(!(E||d.current))try{const re=D.createViewer(N,{});d.current=re,re.setBackgroundColor("#f8fafc",.8),window.addEventListener("resize",V),window.setTimeout(V,100)}catch(re){console.error("Failed to initialize 3Dmol viewer:",re),q("Failed to initialize 3D viewer. Please refresh or try another browser.")}}).catch(D=>{console.error("Failed to load 3Dmol viewer runtime:",D),q("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||!ue))try{N.removeAllModels(),N.removeAllShapes(),N.removeAllLabels();const E=N.addModel(ue,ye||"xyz");c.current=E,E.setStyle({},{stick:{radius:.2},sphere:{scale:.3}});const V=E.getCrystData(),D=!!(V&&typeof V=="object"&&Object.keys(V).length);K(D),F(D?p.current:!1),z([]),y({});const re=ue.split(`
|
|
3612
|
+
`).slice(2).map(ne=>ne.trim()).filter(Boolean).map(ne=>ne.split(/\s+/)[0]??"Atom");h.current||(N.zoomTo(),h.current=!0),E.setClickable({},!0,(ne,Ne,ee)=>{const me=ne.serial??ne.index;if(me===void 0)return;const pe=ne.atom||ne.elem||re[me]||"Atom";z(Te=>{const J=!!(ee!=null&&ee.shiftKey||ee!=null&&ee.metaKey||ee!=null&&ee.ctrlKey)?Te.includes(me)?Te.filter(U=>U!==me):[...Te,me]:Te.length===1&&Te[0]===me?[]:[me];return y(U=>{if(J.length===0)return{};const te={};return J.forEach(ae=>{te[ae]=U[ae]||re[ae]||pe}),te}),J})}),E.setHoverable({},!0,(ne,Ne,ee)=>{!ee||!ne||k({x:ee.clientX,y:ee.clientY,label:`${ne.atom||ne.elem||"Atom"} (${ne.serial??ne.index??"?"})`,coords:{x:ne.x.toFixed(2),y:ne.y.toFixed(2),z:ne.z.toFixed(2)}})},()=>k(null)),N.render()}catch(E){console.error("Failed to render molecule:",E),q("Unable to render this molecular structure.")}},[ue,ye]),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),F(!1)}N.render()}},[R,Z,ue,ye]),i.useEffect(()=>{const N=d.current,E=c.current;!N||!E||!ue||(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,ue]),i.useEffect(()=>{if(!ue)return;let N=0;const E=()=>{var D,re;const V=(re=(D=d.current)==null?void 0:D.getView)==null?void 0:re.call(D);if(Array.isArray(V)&&V.length>=8){const[ne,Ne,ee,me,pe,Te,Oe,J]=V;if(typeof ne=="number"&&typeof Ne=="number"&&typeof ee=="number"&&typeof me=="number"&&typeof pe=="number"&&typeof Te=="number"&&typeof Oe=="number"&&typeof J=="number"){const U=Math.sqrt(pe*pe+Te*Te+Oe*Oe),te=U>0?{x:pe/U,y:Te/U,z:Oe/U}:{x:0,y:0,z:0};m({position:{x:ne,y:Ne,z:ee,qx:pe,qy:Te,qz:Oe,qw:J},lookAt:te,zoom:me})}}N=window.requestAnimationFrame(E)};return N=window.requestAnimationFrame(E),()=>window.cancelAnimationFrame(N)},[ue]);const M=i.useCallback(async()=>{const N=d.current;if(!(N!=null&&N.pngURI))return;N.render();const E=N.pngURI();if(E){try{const D=await(await fetch(E)).blob(),re=new ClipboardItem({[D.type||"image/png"]:D});await navigator.clipboard.write([re])}catch{}n==null||n({moleculeId:r,image:E})}},[r,n]);function A(){R&&F(N=>{const E=!N;return p.current=E,E})}function O(){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:[ie?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:ie}):null,!ie&&!ue?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(If,{currentIndex:x,exportContent:_.exportContent,moleculeId:r,onScreenshot:()=>void M(),viewerRef:d,xyzContent:ue,xyzFormat:ye})]}),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(hl,{className:"h-3 w-3"}):e.jsx(ul,{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 ${Le?"animate-pulse bg-red-600":"bg-gray-300"}`}),"Live"]})]}),e.jsx(Mf,{value:[x],max:Y.length-1,step:1,onValueChange:N=>v(N[0]??0),"aria-label":"Trajectory frame"})]}):null,e.jsx(Rf,{cameraInfo:f,onClearSelection:()=>z([]),onClearStaged:()=>I({}),onSendSelection:()=>a==null?void 0:a({moleculeId:r,atoms:C}),onSendStaged:()=>{Object.entries(P).forEach(([N,E])=>{a==null||a({moleculeId:N==="current"?r:N,atoms:E})})},onStageSelection:O,onToggleUnitCell:A,selectedAtomLabels:T,selectedSerials:C,stagedAtoms:$,stagedMolecules:G,unitCellAvailable:R,unitCellVisible:Z})]})]})]})}function Bf(t){return t&&(t.node.path||t.node.name)||null}function Ff(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 fa=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 Gf({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=gf(l??null),x=(l==null?void 0:l.language)||xf((l==null?void 0:l.path)??""),v=l?Ur(l.path):"",b=Bf(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(cn,{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(Df,{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(fa,{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(fa,{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(fa,{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 Of({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 el=24e3,Hf="remote-codex:graphchat:workspace:expanded:",Vf="thread-graph-explorer h-full min-h-0 overflow-hidden rounded-[12px]",Uf="thread-graph-explorer-header flex h-[60px] shrink-0 items-center justify-between border-b px-4",Wf="text-[18px] font-semibold text-slate-900 dark:text-slate-100",ga="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",qf="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",Kf="thread-graph-workspace-label px-3 pb-1 pt-2 text-[11px] font-semibold tracking-normal text-slate-500 dark:text-slate-400",Xf="thread-graph-workspace-loading px-4 text-sm text-slate-400 dark:text-slate-500",Zf="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`${Hf}${t.workspaceId??"workspace"}:${t.threadId}`}function Yf(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 Jf(t,r){if(!(typeof window>"u"))try{window.localStorage.setItem(Ei(t),JSON.stringify([...r]))}catch{}}function tl(t,r){if(t.kind==="directory")return r?e.jsx(xl,{className:"h-4 w-4 text-slate-500 dark:text-slate-400"}):e.jsx(Wd,{className:"h-4 w-4 text-slate-500 dark:text-slate-400"});const n=Ur(t.name);return n==="zip"?e.jsx(qd,{className:"h-4 w-4 text-amber-600"}):t.kind==="file"&&["png","jpg","jpeg","gif","webp","svg"].includes(n)?e.jsx(bl,{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(kl,{className:"h-4 w-4 text-emerald-600"}):e.jsx(Kd,{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(pl,{className:"h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500"}):e.jsx(Ud,{className:"h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500"}),tl(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(dn,{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:[tl(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(dn,{className:"h-3.5 w-3.5"})}):null]})}function Qf({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(kl,{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 eg({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:`${Vf} flex flex-col`,children:[e.jsxs("div",{className:Uf,children:[e.jsx("div",{className:"min-w-0",children:e.jsx("h2",{className:Wf,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:qf,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:ga,title:r?"Upload file":"Upload is unavailable for this workspace","aria-label":"Upload file",children:e.jsx(gl,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:d,className:ga,title:"Refresh workspace","aria-label":"Refresh workspace",children:e.jsx(hn,{className:`h-4 w-4 ${o?"animate-spin":""}`})}),l?e.jsx("button",{type:"button",onClick:l,disabled:!t,className:ga,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(Qf,{liveNodes:x??[],onSelect:c,selectedNodeId:f}),e.jsx("div",{className:Kf,children:"Workspace"}),o?e.jsx("p",{className:Xf,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:Zf,children:"This workspace is empty. Agent tool runs execute inside the thread workspace, so files should appear here as the session works."}):null]})]})}function tg({activeView:t,detail:r,artifacts:n,plugins:a,status:o,workspaceAdapter:s}){const[l,d]=i.useState(null),c=i.useMemo(()=>s&&l?null:Xo(r,n),[t,l,n,r,o,s]),h=l??c??Xo(r,n),p=i.useMemo(()=>wf(h),[h]),f=i.useMemo(()=>{var U;return((U=h.children.find(te=>te.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",...Zo((m==null?void 0:m.path)??"")])),[g,w]=i.useState(null),[T,y]=i.useState(null),[C,z]=i.useState(!1),[P,I]=i.useState(!1),[R,K]=i.useState(!1),[Z,F]=i.useState(!1),[ie,q]=i.useState([]),[_,Y]=i.useState(null),[ye,ue]=i.useState(null),[Le,X]=i.useState(null),[$,G]=i.useState(0),[M,A]=i.useState(!1),O=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",...Yf(V),...Zo((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)"),te=()=>A(U.matches);return te(),typeof U.addEventListener=="function"?(U.addEventListener("change",te),()=>U.removeEventListener("change",te)):(U.addListener(te),()=>U.removeListener(te))},[]);async function D(U){if(s){z(!0),y(null);try{const te=Ni(await s.listTree(V));d(te);const ae=Ci(te);v(Q=>{const we=Q?p.get(Q):null;return U&&$a(te,U)?`workspace:${U}`:we!=null&&we.path&&$a(te,we.path)?`workspace:${we.path}`:(ae==null?void 0:ae.id)??Q}),G(Q=>Q+1)}catch(te){y(te instanceof Error?te.message:"Failed to load workspace"),d(null)}finally{z(!1)}}}i.useEffect(()=>{d(null),Y(null),ue(null),X(null),y(null),D()},[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,D((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),ue(null),X(null);return}const te=U;let ae=!1;async function Q(){var we;if(s){I(!0),y(null),Y(null),ue(null),X(null);try{const Ae=Ur(te),He=(we=s.getRawFileUrl)==null?void 0:we.call(s,{...V,path:te});if(He&&hf.has(Ae)){ae||ue(He);return}if(He&&uf.has(Ae)){ae||X(He);return}const $e=await s.readFile({...V,path:te,limit:el});ae||Y($e)}catch(Ae){ae||y(Ae instanceof Error?Ae.message:"Failed to read file")}finally{ae||I(!1)}}}return Q(),()=>{ae=!0}},[s,E==null?void 0:E.id,$]);async function re(){if(!(!s||!(_!=null&&_.truncated))){K(!0);try{const U=await s.readFile({...V,path:_.path,offset:_.nextOffset,limit:el});Y(te=>te&&{...te,content:te.content+U.content,truncated:U.truncated,nextOffset:U.nextOffset,size:U.size})}finally{K(!1)}}}async function ne(U){var ae;const te=(ae=U.target.files)==null?void 0:ae[0];if(U.target.value="",!(!(s!=null&&s.uploadFile)||!te)){z(!0),y(null);try{const Q=await s.uploadFile({...V,path:te.name,file:te}),we=Q.kind==="archive"?Q.paths[0]??null:Q.file.path;await D(we)}catch(Q){y(Q instanceof Error?Q.message:"Failed to upload file")}finally{z(!1)}}}function Ne(U){var te;(te=s==null?void 0:s.downloadNode)==null||te.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){q([]),F(!0);return}try{const U=await s.listGarbage(V);q(U.map(te=>`garbage/${te}`))}catch(U){q([]),y(U instanceof Error?U.message:"Failed to list garbage files")}finally{F(!0)}}}async function me(){if(s!=null&&s.emptyGarbage){F(!1),y(null);try{await s.emptyGarbage(V),await D((E==null?void 0:E.path)??null)}catch(U){y(U instanceof Error?U.message:"Failed to empty garbage")}}}const pe={...s!=null&&s.downloadNode?{onDownload:Ne}:{},...s!=null&&s.emptyGarbage?{onEmptyGarbage:ee}:{},...s?{onRefresh:()=>void D((E==null?void 0:E.path)??null)}:{},...s!=null&&s.uploadFile?{onUpload:()=>{var U;return(U=O.current)==null?void 0:U.click()}}:{}};function Te(U){U&&k(te=>{const ae=new Set(te);return ae.has(U)?ae.delete(U):ae.add(U),Jf(V,ae),ae})}const Oe=e.jsx(eg,{canEmptyGarbage:!!(s!=null&&s.emptyGarbage),canUpload:!!(s!=null&&s.uploadFile),...M?{}:{onCollapse:()=>w("explorer")},expandedPaths:b,loading:C,...pe,onSelect:U=>{v(U)},onToggle:Te,selectedNodeId:(E==null?void 0:E.id)??null,tree:h,liveNodes:f}),J=e.jsx(Gf,{error:T,imageUrl:ye,loadingMore:R,onLoadMore:re,...M?{}:{onCollapse:()=>w("viewer")},pdfUrl:Le,previewFile:_,previewLoading:P,plugins:a,selectedTarget:Ff(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(cn,{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:[Oe,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(Of,{files:ie,onCancel:()=>F(!1),onConfirm:()=>void me()}):null,M?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:Oe}),e.jsx("div",{className:"thread-graph-workspace-mobile-viewer min-h-0 flex-1 overflow-hidden",children:J})]}):e.jsxs(hi,{direction:"horizontal",className:"thread-graph-workspace-resizable",children:[e.jsx(fn,{defaultSize:33,minSize:20,children:e.jsx("div",{className:"thread-graph-workspace-explorer-pane h-full min-h-0 overflow-hidden",children:Oe})}),e.jsx(ui,{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(fn,{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:O,type:"file",className:"hidden",onChange:U=>void ne(U)})]})}function xa({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 rg({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(Or,{value:t,className:"thread-guide-section border-b border-[var(--theme-border)] last:border-b-0",children:[e.jsx(Hr,{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(rg,{children:n}),r]})}),e.jsx(Vr,{className:"space-y-3 pb-3",children:a})]})}function ng(){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(Gr,{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(xl,{className:"h-3 w-3"}),children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(gl,{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(wa,{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(hn,{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(xa,{children:".xyz .extxyz .cif"})," use the 3D molecule plugin."]}),e.jsxs(e.Fragment,{children:[e.jsx(xa,{children:".png .jpg .gif .svg .webp"})," use inline image preview."]}),e.jsxs(e.Fragment,{children:[e.jsx(xa,{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(bl,{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(ka,{className:"h-3 w-3"}),children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ka,{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(vl,{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 ag(t){if(t==null)return"—";if(typeof t=="string")return t.length>2e3?`${t.slice(0,2e3)}
|
|
3613
|
+
...(truncated)`:t;try{return JSON.stringify(t,null,2)}catch{return String(t)}}function rl({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:ag(r)})]})}function sg({event:t}){return e.jsxs(Or,{value:t.id,className:"thread-tool-call mb-2 overflow-hidden rounded-lg border border-[var(--theme-border)] last:mb-0",children:[e.jsxs(Hr,{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(Vr,{className:"px-3 pb-3",children:e.jsxs("div",{className:"space-y-2 px-3 pb-3 pt-1",children:[e.jsx(rl,{label:"Input",value:t.preview}),e.jsx(rl,{label:"Output",value:t.detail})]})})]})}function og({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(hn,{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(Gr,{type:"single",collapsible:!0,value:o??"",onValueChange:d=>s(d||null),className:"space-y-0",children:n.slice(-50).map(d=>e.jsx(sg,{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(hn,{className:"h-3 w-3"}),"Reload from workspace"]})]})}function nl(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 al(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=nl(t,r),a=nl(r,t),o=al(t,n),s=al(r,a);return{sx:n.x,sy:n.y,tx:a.x,ty:a.y,sourcePos:o,targetPos:s}}function lg(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,P=Math.sqrt(C*C+z*z)||1,R=(200-P)*.5,K=C/P*R,Z=z/P*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,P=w/y*z,I=T/y*z;k.vx+=P,k.vy+=I,g.vx-=P,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:yl.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 ig({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]=jl({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 dg({id:t,source:r,target:n,markerEnd:a,style:o}){const s=Ws(r),l=Ws(n);if(!s||!l)return null;const{sx:d,sy:c,tx:h,ty:p,sourcePos:f,targetPos:m}=Li(s,l),[x]=jl({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 cg({nodes:t}){const[r,n,a]=Pc([]),[o,s,l]=Mc([]),d=i.useMemo(()=>lg(t),[t]),c=i.useMemo(()=>({floating:dg}),[]),h=i.useMemo(()=>({styledNode:({data:f,isConnectable:m})=>e.jsxs("div",{className:"thread-graph-flow-node",children:[f.label,e.jsx(Us,{type:"target",position:sr.Top,isConnectable:m,style:{opacity:0,pointerEvents:"none"}}),e.jsx(Us,{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=>$c({...f,type:"floating",sourceHandle:null,targetHandle:null,markerEnd:{type:yl.Arrow}},m)),[s]);return e.jsx("div",{className:"thread-graph-flow h-full min-h-0",children:e.jsx(_c,{children:e.jsxs(Ac,{nodes:r,edges:o,onNodesChange:a,onEdgesChange:l,onConnect:p,fitView:!0,nodeTypes:h,edgeTypes:c,connectionLineComponent:ig,children:[e.jsx(Dc,{}),e.jsx(Bc,{gap:16})]})})})}var hg={workspace:!0,toolUsage:!0,guide:!0,threadGraph:!0,extensions:!0};function ug(t){return{...hg,...t}}function sl(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 mg(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 pg(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:bn(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:bn(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 bn(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 fg(t){switch(t.kind){case"userMessage":return"User";case"agentMessage":return"Agent";default:return bn(t.kind)}}function gg(t){return(t.previewText??t.text??t.detailText??t.kind).replace(/\s+/g," ").slice(0,96)}function xg(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:fg(c),description:gg(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 bg({detail:t,status:r,plugins:n,workspaceAdapter:a,metaContent:o,settingsContent:s,activeView:l="chat",features:d}){const c=i.useMemo(()=>ug(d),[d]),h=sl(c,d==null?void 0:d.defaultTab),[p,f]=i.useState(h),m=i.useMemo(()=>mf(t),[t]),x=i.useMemo(()=>pg(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(()=>xg(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:ka}),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:Da}),y},[c.extensions,c.threadGraph]);return i.useEffect(()=>{(!p||!mg(c,p))&&f(sl(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(tg,{activeView:l,detail:t,artifacts:m,plugins:n,status:r,workspaceAdapter:a??null}):null,p==="tools"?e.jsx(og,{formatToolKind:bn,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(cg,{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(ml,{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(ng,{}):null]})]}):null}var vg=i.memo(bg);function Ig({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?vn.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 kg(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 wg(t){switch(t){case"inProgress":return"running";case"completed":return"completed";case"interrupted":return"interrupted";case"failed":return"failed"}}function Pg({open:t,busy:r=!1,turnsState:n,onCancel:a,onLoadTurns:o,onExport:s}){var z,P,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,((P=n.data)==null?void 0:P.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 vn.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:kg(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:wg(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 ba(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 yg(t){return`in ${ba(t.input)} / out ${ba(t.output)} / cache ${ba(t.cache)}`}function jg(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 Ng({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),[P,I]=i.useState(!1),R=i.useRef(null),K=i.useRef(null);i.useMemo(()=>jg(t,o),[t,o]);const Z=d==null?void 0:d.onTailVisibilityChange,F=t.pendingRequests.length>0;i.useEffect(()=>{R.current=null,v(!0)},[t.thread.id]);const ie=i.useCallback($=>{v($),Z==null||Z($)},[Z]);i.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const $=window.matchMedia("(max-width: 639px)"),G=()=>k($.matches);return G(),$.addEventListener("change",G),()=>{$.removeEventListener("change",G)}},[]),i.useEffect(()=>{var G,M;if(typeof window>"u")return;const $=()=>{const A=window.visualViewport,O=A?Math.max(0,Math.round(window.innerHeight-A.height-A.offsetTop)):0,N=A?Math.max(0,Math.round(window.innerHeight-A.height)):O,E=Math.min(O,N),V=Math.max(0,Math.round(window.innerHeight*.52));z(Math.min(E,V))};return $(),(G=window.visualViewport)==null||G.addEventListener("resize",$),(M=window.visualViewport)==null||M.addEventListener("scroll",$),window.addEventListener("resize",$),()=>{var A,O;(A=window.visualViewport)==null||A.removeEventListener("resize",$),(O=window.visualViewport)==null||O.removeEventListener("scroll",$),window.removeEventListener("resize",$)}},[]),i.useLayoutEffect(()=>{const $=K.current;if(!$||!b){w(0);return}const G=()=>{w(Math.ceil($.getBoundingClientRect().height))};if(G(),typeof ResizeObserver>"u")return;const M=new ResizeObserver(G);return M.observe($),()=>{M.disconnect()}},[b,l,F]),i.useLayoutEffect(()=>{var A,O;const $=K.current;if(!$||!b){y(0);return}const G=()=>{const N=$.getBoundingClientRect();y(Math.max(0,Math.ceil(window.innerHeight-N.top)))};G(),window.addEventListener("resize",G),(A=window.visualViewport)==null||A.addEventListener("resize",G),(O=window.visualViewport)==null||O.addEventListener("scroll",G);let M=null;return typeof ResizeObserver<"u"&&(M=new ResizeObserver(G),M.observe($)),()=>{var N,E;window.removeEventListener("resize",G),(N=window.visualViewport)==null||N.removeEventListener("resize",G),(E=window.visualViewport)==null||E.removeEventListener("scroll",G),M==null||M.disconnect()}},[b,C,P,l,F]),i.useEffect(()=>{if(!b){I(!1);return}const $=M=>{var O;const A=M.target;A instanceof HTMLElement&&((O=K.current)!=null&&O.contains(A))&&I(!0)},G=M=>{var O;const A=M.relatedTarget;A instanceof HTMLElement&&((O=K.current)!=null&&O.contains(A))||I(!1)};return document.addEventListener("focusin",$),document.addEventListener("focusout",G),()=>{document.removeEventListener("focusin",$),document.removeEventListener("focusout",G)}},[b]);const q=i.useCallback($=>{K.current=$,m&&(m.current=$)},[m]),_=b&&P?Math.max(0,C-f):0,Y=Math.max(g,144),ye=Math.max(T,Y+_),ue=b?ye+12:0,Le=ue>0?{"--thread-graph-chat-scroll-bottom-spacer":`${ue}px`}:void 0,X=p&&b?{bottom:`${f+_}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:Le,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:ie}),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?yg(c):"waiting for agent usage"]})]}),l?p?e.jsx("div",{ref:q,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(Sa,{...l,activeView:"chat",edgeToEdgeMobile:!0,onSubmit:r.sendPrompt})}):e.jsx("div",{ref:q,className:"thread-graph-composer-host shrink-0",children:e.jsx(Sa,{...l,activeView:"chat",onSubmit:r.sendPrompt})}):null]})}function Cg(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 va(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 Sg(t){return!t||t.turns<=0?"waiting for agent usage":`in ${va(t.input)} / out ${va(t.output)} / cache ${va(t.cache)}`}function Mg({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,onNewThreadTitle:C,beforeTimelineContent:z,errorContent:P,workspaceMissingContent:I,dialogs:R,currentThreadId:K,currentWorkspaceId:Z,currentWorkspaceLabel:F,onCloseAppNavigation:ie,className:q="thread-detail-surface relative flex h-full min-h-0 flex-1 flex-col overflow-hidden",activeView:_="chat",liveOutput:Y="",timelineProps:ye,composerProps:ue,shellComposerProps:Le,useFloatingMobileComposer:X=!1,floatingMobileComposerBottomOffset:$=0,composerHostRef:G,shellPanelRef:M,shellEffectiveTheme:A="dark",shellThemeMode:O=A,onShellThemeModeChange:N,onShellStateChange:E,shellUnavailableContent:V,shellDisconnectedContent:D,timelineComponent:re=yi,shellPanelComponent:ne=cf,shellContent:Ne,loadingContent:ee,emptyContent:me}){const pe=Ka(),Te=s??pe??Wa(),Oe=i.useMemo(()=>({...l.getImageAssetUrl?{getImageAssetUrl:He=>{var $e;return(($e=l.getImageAssetUrl)==null?void 0:$e.call(l,He.path))??""}}:{},onOpenLinkedThread:l.openThread,...l.loadHistoryItemDetail?{onLoadHistoryItemDetail:l.loadHistoryItemDetail}:{}}),[l.getImageAssetUrl,l.loadHistoryItemDetail,l.openThread]),J=Te.getThreadPanels().some(He=>He.kind==="terminal"),U=i.useMemo(()=>r?Cg(r):null,[r]),te=i.useMemo(()=>Sg(U),[U]),ae=i.useMemo(()=>{var He;return r?r.turns.reduce(($e,Ue)=>$e+Ue.items.length,((He=r.liveItems)==null?void 0:He.items.length)??0):0},[r]),Q=g??(r?e.jsx(vg,{detail:r,status:o,plugins:Te,workspaceAdapter:l.workspace??null,metaContent:d,settingsContent:c,activeView:_,features:y}):null),we=n?ee??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:q,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&&(P??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"&&(I??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:_==="chat"?"flex min-h-0 flex-1 flex-col":"hidden",children:e.jsx(Ng,{detail:r,adapter:l,timelineAdapter:Oe,TimelineComponent:re,liveOutput:Y,threadUsageSummary:U,transcriptItemCount:ae,useFloatingMobileComposer:X,floatingMobileComposerBottomOffset:$,...z?{beforeTimelineContent:z}:{},...ue?{composerProps:ue}:{},...ye?{timelineProps:ye}:{},...G?{composerHostRef:G}:{}})}),e.jsxs("div",{className:_==="shell"?"flex min-h-0 flex-1 flex-col":"hidden",children:[Ne??(r.thread.isLoaded&&J&&l.shell?e.jsx(ne,{ref:M,threadId:r.thread.id,shellAdapter:l.shell,effectiveTheme:A,isVisible:_==="shell",showHeader:!1,showFloatingToolbox:!1,...E?{onStateChange:E}:{}}):r.thread.isLoaded&&!J?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:"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."})]})}):D??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."})]})})),_==="shell"&&Le&&!Ne?e.jsx(Sa,{...Le,activeView:"shell",onSubmit:l.sendPrompt}):null]}),R]}):me??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."}),Ae=e.jsx(wm,{threads:t,status:o,loading:n,error:n?null:a,viewportConstrained:!0,currentThreadId:K??(r==null?void 0:r.thread.id),currentThreadLabel:r==null?void 0:r.thread.title,currentWorkspaceId:Z??(r==null?void 0:r.thread.workspaceId),currentWorkspaceLabel:F??(r==null?void 0:r.workspace.label),sessionLabel:(r==null?void 0:r.thread.providerSessionId)??(r==null?void 0:r.thread.id),usageLabel:te,topbarActions:b,metaContent:d,settingsContent:c,globalSettingsContent:h,mobileHeaderAction:p,effectiveTheme:A,themeMode:O,appMenuButton:f,appNavigationMenu:m,workspaceReturnHref:x,...v?{onWorkspaceReturn:v}:{},showMobileAppMenu:!!f,showMobileThreadNavToggle:!0,showMobileNewThreadShortcut:!1,onOpenThread:l.openThread,workspaceContent:Q,workspaceTitle:w??"Workspace",workspaceActions:T,...C?{onNewThreadTitle:C}:{},...ie?{onCloseAppNavigation:ie}:{},...N?{onThemeModeChange:N}:{},...l.getThreadHref?{getThreadHref:l.getThreadHref}:{},...l.getNewThreadHref?{getNewThreadHref:l.getNewThreadHref}:{},...l.renameThread?{onRenameThread:l.renameThread}:{},...l.deleteThread?{onDeleteThread:l.deleteThread}:{},children:we});return s?e.jsx(qa.Provider,{value:Te,children:Ae}):Ae}function $g({adapter:t={},children:r}){const[n,a]=i.useState(()=>Ta(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(Ta(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(qa.Provider,{value:g,children:r})}export{Ig as C,Pg as E,ym as L,$g as P,Mg as T,cf as a,yi as b,wm as c,km as d,Ua as f,om as t,Ka as u};
|