remote-claude-code 0.1.0
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/README.md +193 -0
- package/README.zh-CN.md +193 -0
- package/cli/commands/logs.ts +68 -0
- package/cli/commands/setup.ts +43 -0
- package/cli/commands/start.ts +68 -0
- package/cli/commands/status.ts +41 -0
- package/cli/commands/stop.ts +14 -0
- package/cli/constants.ts +1 -0
- package/cli/index.ts +18 -0
- package/cli/utils/process-manager.ts +77 -0
- package/cli/utils/server.ts +45 -0
- package/dist/client/assets/abap-BdImnpbu.js +1 -0
- package/dist/client/assets/actionscript-3-CoDkCxhg.js +1 -0
- package/dist/client/assets/ada-bCR0ucgS.js +1 -0
- package/dist/client/assets/andromeeda-C4gqWexZ.js +1 -0
- package/dist/client/assets/angular-html-CU67Zn6k.js +1 -0
- package/dist/client/assets/angular-ts-BwZT4LLn.js +1 -0
- package/dist/client/assets/apache-Pmp26Uib.js +1 -0
- package/dist/client/assets/apex-D8_7TLub.js +1 -0
- package/dist/client/assets/apl-dKokRX4l.js +1 -0
- package/dist/client/assets/applescript-Co6uUVPk.js +1 -0
- package/dist/client/assets/ara-BRHolxvo.js +1 -0
- package/dist/client/assets/asciidoc-Ve4PFQV2.js +1 -0
- package/dist/client/assets/asm-D_Q5rh1f.js +1 -0
- package/dist/client/assets/astro-CbQHKStN.js +1 -0
- package/dist/client/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/dist/client/assets/awk-DMzUqQB5.js +1 -0
- package/dist/client/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/dist/client/assets/ayu-light-BA47KaF1.js +1 -0
- package/dist/client/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/dist/client/assets/ballerina-BFfxhgS-.js +1 -0
- package/dist/client/assets/bat-BkioyH1T.js +1 -0
- package/dist/client/assets/beancount-k_qm7-4y.js +1 -0
- package/dist/client/assets/berry-uYugtg8r.js +1 -0
- package/dist/client/assets/bibtex-CHM0blh-.js +1 -0
- package/dist/client/assets/bicep-Bmn6On1c.js +1 -0
- package/dist/client/assets/bird2-DPOp833l.js +1 -0
- package/dist/client/assets/blade-D4QpJJKB.js +1 -0
- package/dist/client/assets/bsl-BO_Y6i37.js +1 -0
- package/dist/client/assets/c-BIGW1oBm.js +1 -0
- package/dist/client/assets/c3-eo99z4R2.js +1 -0
- package/dist/client/assets/cadence-Bv_4Rxtq.js +1 -0
- package/dist/client/assets/cairo-KRGpt6FW.js +1 -0
- package/dist/client/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/dist/client/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/dist/client/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/dist/client/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/dist/client/assets/clarity-D53aC0YG.js +1 -0
- package/dist/client/assets/clojure-P80f7IUj.js +1 -0
- package/dist/client/assets/cmake-D1j8_8rp.js +1 -0
- package/dist/client/assets/cobol-nwyudZeR.js +1 -0
- package/dist/client/assets/code-highlighter-D_0rJlW2.js +153 -0
- package/dist/client/assets/codeowners-Bp6g37R7.js +1 -0
- package/dist/client/assets/codeql-DsOJ9woJ.js +1 -0
- package/dist/client/assets/coffee-Ch7k5sss.js +1 -0
- package/dist/client/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/dist/client/assets/coq-DkFqJrB1.js +1 -0
- package/dist/client/assets/cpp-CofmeUqb.js +1 -0
- package/dist/client/assets/crystal-tKQVLTB8.js +1 -0
- package/dist/client/assets/csharp-COcwbKMJ.js +1 -0
- package/dist/client/assets/css-DPfMkruS.js +1 -0
- package/dist/client/assets/csv-fuZLfV_i.js +1 -0
- package/dist/client/assets/cue-D82EKSYY.js +1 -0
- package/dist/client/assets/cypher-COkxafJQ.js +1 -0
- package/dist/client/assets/d-85-TOEBH.js +1 -0
- package/dist/client/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/client/assets/dart-CF10PKvl.js +1 -0
- package/dist/client/assets/dax-CEL-wOlO.js +1 -0
- package/dist/client/assets/desktop-BmXAJ9_W.js +1 -0
- package/dist/client/assets/diff-D97Zzqfu.js +1 -0
- package/dist/client/assets/docker-BcOcwvcX.js +1 -0
- package/dist/client/assets/dotenv-Da5cRb03.js +1 -0
- package/dist/client/assets/dracula-BzJJZx-M.js +1 -0
- package/dist/client/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/dist/client/assets/dream-maker-BtqSS_iP.js +1 -0
- package/dist/client/assets/edge-BkV0erSs.js +1 -0
- package/dist/client/assets/elixir-CDX3lj18.js +1 -0
- package/dist/client/assets/elm-DbKCFpqz.js +1 -0
- package/dist/client/assets/emacs-lisp-C9XAeP06.js +1 -0
- package/dist/client/assets/erb-B12qg9BL.js +1 -0
- package/dist/client/assets/erlang-DsQrWhSR.js +1 -0
- package/dist/client/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/dist/client/assets/everforest-light-C8M2exoo.js +1 -0
- package/dist/client/assets/fennel-BYunw83y.js +1 -0
- package/dist/client/assets/fish-BvzEVeQv.js +1 -0
- package/dist/client/assets/fluent-C4IJs8-o.js +1 -0
- package/dist/client/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/dist/client/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/dist/client/assets/fsharp-CXgrBDvD.js +1 -0
- package/dist/client/assets/gdresource-BOOCDP_w.js +1 -0
- package/dist/client/assets/gdscript-C5YyOfLZ.js +1 -0
- package/dist/client/assets/gdshader-DkwncUOv.js +1 -0
- package/dist/client/assets/genie-D0YGMca9.js +1 -0
- package/dist/client/assets/gherkin-DyxjwDmM.js +1 -0
- package/dist/client/assets/git-commit-F4YmCXRG.js +1 -0
- package/dist/client/assets/git-rebase-r7XF79zn.js +1 -0
- package/dist/client/assets/github-dark-DHJKELXO.js +1 -0
- package/dist/client/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/dist/client/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/dist/client/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/dist/client/assets/github-light-DAi9KRSo.js +1 -0
- package/dist/client/assets/github-light-default-D7oLnXFd.js +1 -0
- package/dist/client/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/dist/client/assets/gleam-BspZqrRM.js +1 -0
- package/dist/client/assets/glimmer-js-Rg0-pVw9.js +1 -0
- package/dist/client/assets/glimmer-ts-U6CK756n.js +1 -0
- package/dist/client/assets/glsl-DplSGwfg.js +1 -0
- package/dist/client/assets/gn-n2N0HUVH.js +1 -0
- package/dist/client/assets/gnuplot-DdkO51Og.js +1 -0
- package/dist/client/assets/go-CxLEBnE3.js +1 -0
- package/dist/client/assets/graphql-ChdNCCLP.js +1 -0
- package/dist/client/assets/groovy-gcz8RCvz.js +1 -0
- package/dist/client/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/dist/client/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/dist/client/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/dist/client/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/dist/client/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/dist/client/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/dist/client/assets/hack-CaT9iCJl.js +1 -0
- package/dist/client/assets/haml-B8DHNrY2.js +1 -0
- package/dist/client/assets/handlebars-BL8al0AC.js +1 -0
- package/dist/client/assets/haskell-Df6bDoY_.js +1 -0
- package/dist/client/assets/haxe-CzTSHFRz.js +1 -0
- package/dist/client/assets/hcl-BWvSN4gD.js +1 -0
- package/dist/client/assets/highlighted-body-TPN3WLV5-Bbf4VBqH.js +1 -0
- package/dist/client/assets/hjson-D5-asLiD.js +1 -0
- package/dist/client/assets/hlsl-D3lLCCz7.js +1 -0
- package/dist/client/assets/horizon-BUw7H-hv.js +1 -0
- package/dist/client/assets/horizon-bright-Cn-bp-IR.js +1 -0
- package/dist/client/assets/houston-DnULxvSX.js +1 -0
- package/dist/client/assets/html-GMplVEZG.js +1 -0
- package/dist/client/assets/html-derivative-BFtXZ54Q.js +1 -0
- package/dist/client/assets/http-jrhK8wxY.js +1 -0
- package/dist/client/assets/hurl-irOxFIW8.js +1 -0
- package/dist/client/assets/hxml-Bvhsp5Yf.js +1 -0
- package/dist/client/assets/hy-DFXneXwc.js +1 -0
- package/dist/client/assets/imba-DGztddWO.js +1 -0
- package/dist/client/assets/index-D7x3ypuO.css +32 -0
- package/dist/client/assets/index-DLfciZbe.js +477 -0
- package/dist/client/assets/ini-BEwlwnbL.js +1 -0
- package/dist/client/assets/java-CylS5w8V.js +1 -0
- package/dist/client/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/client/assets/jinja-4LBKfQ-Z.js +1 -0
- package/dist/client/assets/jison-wvAkD_A8.js +1 -0
- package/dist/client/assets/json-Cp-IABpG.js +1 -0
- package/dist/client/assets/json5-C9tS-k6U.js +1 -0
- package/dist/client/assets/jsonc-Des-eS-w.js +1 -0
- package/dist/client/assets/jsonl-DcaNXYhu.js +1 -0
- package/dist/client/assets/jsonnet-DFQXde-d.js +1 -0
- package/dist/client/assets/jssm-C2t-YnRu.js +1 -0
- package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
- package/dist/client/assets/julia-CxzCAyBv.js +1 -0
- package/dist/client/assets/just-Cw27pwNe.js +1 -0
- package/dist/client/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/dist/client/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/dist/client/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/dist/client/assets/kdl-DV7GczEv.js +1 -0
- package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
- package/dist/client/assets/kusto-DZf3V79B.js +1 -0
- package/dist/client/assets/laserwave-DUszq2jm.js +1 -0
- package/dist/client/assets/latex-CWtU0Tv5.js +1 -0
- package/dist/client/assets/lean-BZvkOJ9d.js +1 -0
- package/dist/client/assets/less-B1dDrJ26.js +1 -0
- package/dist/client/assets/light-plus-B7mTdjB0.js +1 -0
- package/dist/client/assets/liquid-DYVedYrR.js +1 -0
- package/dist/client/assets/llvm-DjAJT7YJ.js +1 -0
- package/dist/client/assets/log-2UxHyX5q.js +1 -0
- package/dist/client/assets/logo-BtOb2qkB.js +1 -0
- package/dist/client/assets/lua-BaeVxFsk.js +1 -0
- package/dist/client/assets/luau-C-HG3fhB.js +1 -0
- package/dist/client/assets/make-CHLpvVh8.js +1 -0
- package/dist/client/assets/markdown-Cvjx9yec.js +1 -0
- package/dist/client/assets/markdown-ksT5_TvX.js +146 -0
- package/dist/client/assets/marko-CnJfTvn9.js +1 -0
- package/dist/client/assets/material-theme-D5KoaKCx.js +1 -0
- package/dist/client/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/dist/client/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/dist/client/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/dist/client/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/dist/client/assets/matlab-D7o27uSR.js +1 -0
- package/dist/client/assets/mdc-BMNejdWA.js +1 -0
- package/dist/client/assets/mdx-Cmh6b_Ma.js +1 -0
- package/dist/client/assets/mermaid-mWjccvbQ.js +1 -0
- package/dist/client/assets/min-dark-CafNBF8u.js +1 -0
- package/dist/client/assets/min-light-CTRr51gU.js +1 -0
- package/dist/client/assets/mipsasm-CKIfxQSi.js +1 -0
- package/dist/client/assets/mojo-rZm6bMo-.js +1 -0
- package/dist/client/assets/monokai-D4h5O-jR.js +1 -0
- package/dist/client/assets/moonbit-_H4v1dQx.js +1 -0
- package/dist/client/assets/move-IF9eRakj.js +1 -0
- package/dist/client/assets/narrat-DRg8JJMk.js +1 -0
- package/dist/client/assets/nextflow-Zz6hmt5N.js +1 -0
- package/dist/client/assets/nextflow-groovy-BeH2EWoN.js +1 -0
- package/dist/client/assets/nginx-BpAMiNFr.js +1 -0
- package/dist/client/assets/night-owl-C39BiMTA.js +1 -0
- package/dist/client/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/dist/client/assets/nim-CVrawwO9.js +1 -0
- package/dist/client/assets/nix-CwoSXNpI.js +1 -0
- package/dist/client/assets/nord-Ddv68eIx.js +1 -0
- package/dist/client/assets/nushell-Cz2AlsmD.js +1 -0
- package/dist/client/assets/objective-c-DXmwc3jG.js +1 -0
- package/dist/client/assets/objective-cpp-CLxacb5B.js +1 -0
- package/dist/client/assets/ocaml-C0hk2d4L.js +1 -0
- package/dist/client/assets/odin-BBf5iR-q.js +1 -0
- package/dist/client/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/dist/client/assets/one-light-C3Wv6jpd.js +1 -0
- package/dist/client/assets/openscad-C4EeE6gA.js +1 -0
- package/dist/client/assets/pascal-D93ZcfNL.js +1 -0
- package/dist/client/assets/perl-C0TMdlhV.js +1 -0
- package/dist/client/assets/php-Dhbhpdrm.js +1 -0
- package/dist/client/assets/pkl-u5AG7uiY.js +1 -0
- package/dist/client/assets/plastic-3e1v2bzS.js +1 -0
- package/dist/client/assets/plsql-ChMvpjG-.js +1 -0
- package/dist/client/assets/po-BTJTHyun.js +1 -0
- package/dist/client/assets/poimandres-CS3Unz2-.js +1 -0
- package/dist/client/assets/polar-C0HS_06l.js +1 -0
- package/dist/client/assets/postcss-CXtECtnM.js +1 -0
- package/dist/client/assets/powerquery-CEu0bR-o.js +1 -0
- package/dist/client/assets/powershell-Dpen1YoG.js +1 -0
- package/dist/client/assets/prisma-Dd19v3D-.js +1 -0
- package/dist/client/assets/prolog-CbFg5uaA.js +1 -0
- package/dist/client/assets/proto-C7zT0LnQ.js +1 -0
- package/dist/client/assets/pug-CGlum2m_.js +1 -0
- package/dist/client/assets/puppet-BMWR74SV.js +1 -0
- package/dist/client/assets/purescript-CklMAg4u.js +1 -0
- package/dist/client/assets/python-B6aJPvgy.js +1 -0
- package/dist/client/assets/qml-3beO22l8.js +1 -0
- package/dist/client/assets/qmldir-C8lEn-DE.js +1 -0
- package/dist/client/assets/qss-IeuSbFQv.js +1 -0
- package/dist/client/assets/r-Dspwwk_N.js +1 -0
- package/dist/client/assets/racket-BqYA7rlc.js +1 -0
- package/dist/client/assets/raku-DXvB9xmW.js +1 -0
- package/dist/client/assets/razor-Uh8Bk_45.js +1 -0
- package/dist/client/assets/red-bN70gL4F.js +1 -0
- package/dist/client/assets/reg-C-SQnVFl.js +1 -0
- package/dist/client/assets/regexp-CDVJQ6XC.js +1 -0
- package/dist/client/assets/rel-C3B-1QV4.js +1 -0
- package/dist/client/assets/riscv-BM1_JUlF.js +1 -0
- package/dist/client/assets/ron-D8l8udqQ.js +1 -0
- package/dist/client/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/dist/client/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/dist/client/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/dist/client/assets/rosmsg-BJDFO7_C.js +1 -0
- package/dist/client/assets/rst-BrH8l1NY.js +1 -0
- package/dist/client/assets/ruby-Dw2BHqvy.js +1 -0
- package/dist/client/assets/rust-B1yitclQ.js +1 -0
- package/dist/client/assets/sas-cz2c8ADy.js +1 -0
- package/dist/client/assets/sass-Cj5Yp3dK.js +1 -0
- package/dist/client/assets/scala-C151Ov-r.js +1 -0
- package/dist/client/assets/scheme-C98Dy4si.js +1 -0
- package/dist/client/assets/scss-OYdSNvt2.js +1 -0
- package/dist/client/assets/sdbl-DVxCFoDh.js +1 -0
- package/dist/client/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/dist/client/assets/shellscript-Yzrsuije.js +1 -0
- package/dist/client/assets/shellsession-BADoaaVG.js +1 -0
- package/dist/client/assets/slack-dark-BthQWCQV.js +1 -0
- package/dist/client/assets/slack-ochin-DqwNpetd.js +1 -0
- package/dist/client/assets/smalltalk-BERRCDM3.js +1 -0
- package/dist/client/assets/snazzy-light-Bw305WKR.js +1 -0
- package/dist/client/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/dist/client/assets/solarized-light-L9t79GZl.js +1 -0
- package/dist/client/assets/solidity-rGO070M0.js +1 -0
- package/dist/client/assets/soy-Brmx7dQM.js +1 -0
- package/dist/client/assets/sparql-rVzFXLq3.js +1 -0
- package/dist/client/assets/splunk-BtCnVYZw.js +1 -0
- package/dist/client/assets/sql-BLtJtn59.js +1 -0
- package/dist/client/assets/ssh-config-_ykCGR6B.js +1 -0
- package/dist/client/assets/stata-BH5u7GGu.js +1 -0
- package/dist/client/assets/stylus-BEDo0Tqx.js +1 -0
- package/dist/client/assets/surrealql-Bq5Q-fJD.js +1 -0
- package/dist/client/assets/svelte-C_ipcX3V.js +1 -0
- package/dist/client/assets/swift-D82vCrfD.js +1 -0
- package/dist/client/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/dist/client/assets/system-verilog-CnnmHF94.js +1 -0
- package/dist/client/assets/systemd-4A_iFExJ.js +1 -0
- package/dist/client/assets/talonscript-CkByrt1z.js +1 -0
- package/dist/client/assets/tasl-QIJgUcNo.js +1 -0
- package/dist/client/assets/tcl-dwOrl1Do.js +1 -0
- package/dist/client/assets/templ-P3uqSqPl.js +1 -0
- package/dist/client/assets/terraform-BETggiCN.js +1 -0
- package/dist/client/assets/tex-idrVyKtj.js +1 -0
- package/dist/client/assets/tokyo-night-hegEt444.js +1 -0
- package/dist/client/assets/toml-vGWfd6FD.js +1 -0
- package/dist/client/assets/ts-tags-zn1MmPIZ.js +1 -0
- package/dist/client/assets/tsv-B_m7g4N7.js +1 -0
- package/dist/client/assets/tsx-COt5Ahok.js +1 -0
- package/dist/client/assets/turtle-BsS91CYL.js +1 -0
- package/dist/client/assets/twig-DNn4PbVi.js +1 -0
- package/dist/client/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/client/assets/typespec-BGHnOYBU.js +1 -0
- package/dist/client/assets/typst-DHCkPAjA.js +1 -0
- package/dist/client/assets/v-BcVCzyr7.js +1 -0
- package/dist/client/assets/vala-CsfeWuGM.js +1 -0
- package/dist/client/assets/vb-D17OF-Vu.js +1 -0
- package/dist/client/assets/verilog-BQ8w6xss.js +1 -0
- package/dist/client/assets/vesper-DU1UobuO.js +1 -0
- package/dist/client/assets/vhdl-CeAyd5Ju.js +1 -0
- package/dist/client/assets/viml-CJc9bBzg.js +1 -0
- package/dist/client/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/dist/client/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/dist/client/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/dist/client/assets/vue-DN_0RTcg.js +1 -0
- package/dist/client/assets/vue-html-AaS7Mt5G.js +1 -0
- package/dist/client/assets/vue-vine-CQOfvN7w.js +1 -0
- package/dist/client/assets/vyper-CDx5xZoG.js +1 -0
- package/dist/client/assets/wasm-CG6Dc4jp.js +1 -0
- package/dist/client/assets/wasm-MzD3tlZU.js +1 -0
- package/dist/client/assets/wenyan-BV7otONQ.js +1 -0
- package/dist/client/assets/wgsl-Dx-B1_4e.js +1 -0
- package/dist/client/assets/wikitext-BhOHFoWU.js +1 -0
- package/dist/client/assets/wit-5i3qLPDT.js +1 -0
- package/dist/client/assets/wolfram-lXgVvXCa.js +1 -0
- package/dist/client/assets/xml-sdJ4AIDG.js +1 -0
- package/dist/client/assets/xsl-CtQFsRM5.js +1 -0
- package/dist/client/assets/yaml-Buea-lGh.js +1 -0
- package/dist/client/assets/zenscript-DVFEvuxE.js +1 -0
- package/dist/client/assets/zig-VOosw3JB.js +1 -0
- package/dist/client/images/logo.png +0 -0
- package/dist/client/index.html +23 -0
- package/dist/client/manifest.webmanifest +1 -0
- package/dist/client/registerSW.js +1 -0
- package/dist/client/sw.js +1 -0
- package/dist/client/workbox-1ef09536.js +1 -0
- package/package.json +61 -0
- package/public/images/logo.png +0 -0
- package/server/auth-cookie.ts +25 -0
- package/server/auth.ts +92 -0
- package/server/claude.ts +759 -0
- package/server/db.ts +134 -0
- package/server/index.ts +177 -0
- package/server/preview.ts +93 -0
- package/server/projects.ts +401 -0
- package/server/tailscale.ts +87 -0
- package/server/terminal.ts +411 -0
- package/server/threads.ts +39 -0
- package/server/tunnel.ts +121 -0
- package/server/upload.ts +109 -0
- package/server/ws.ts +785 -0
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-highlighter-D_0rJlW2.js","assets/markdown-ksT5_TvX.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{e as Gy,g as YC,r as g,t as GC,i as Xy,j as _,k as em,l as js,m as Zy,n as XC,U as ZC,_ as QC,u as JC}from"./markdown-ksT5_TvX.js";import{A as e2}from"./code-highlighter-D_0rJlW2.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function s(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function n(a){if(a.ep)return;a.ep=!0;const c=s(a);fetch(a.href,c)}})();var Sd={exports:{}},ia={},xd={exports:{}},wd={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* scheduler.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Xv;function t2(){return Xv||(Xv=1,(function(e){function t(A,L){var z=A.length;A.push(L);e:for(;0<z;){var K=z-1>>>1,ee=A[K];if(0<a(ee,L))A[K]=L,A[z]=ee,z=K;else break e}}function s(A){return A.length===0?null:A[0]}function n(A){if(A.length===0)return null;var L=A[0],z=A.pop();if(z!==L){A[0]=z;e:for(var K=0,ee=A.length,he=ee>>>1;K<he;){var ne=2*(K+1)-1,ae=A[ne],ie=ne+1,me=A[ie];if(0>a(ae,z))ie<ee&&0>a(me,ae)?(A[K]=me,A[ie]=z,K=ie):(A[K]=ae,A[ne]=z,K=ne);else if(ie<ee&&0>a(me,z))A[K]=me,A[ie]=z,K=ie;else break e}}return L}function a(A,L){var z=A.sortIndex-L.sortIndex;return z!==0?z:A.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,h=u.now();e.unstable_now=function(){return u.now()-h}}var m=[],p=[],y=1,v=null,b=3,x=!1,w=!1,C=!1,E=!1,M=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function N(A){for(var L=s(p);L!==null;){if(L.callback===null)n(p);else if(L.startTime<=A)n(p),L.sortIndex=L.expirationTime,t(m,L);else break;L=s(p)}}function D(A){if(C=!1,N(A),!w)if(s(m)!==null)w=!0,j||(j=!0,G());else{var L=s(p);L!==null&&W(D,L.startTime-A)}}var j=!1,q=-1,te=5,re=-1;function oe(){return E?!0:!(e.unstable_now()-re<te)}function Z(){if(E=!1,j){var A=e.unstable_now();re=A;var L=!0;try{e:{w=!1,C&&(C=!1,R(q),q=-1),x=!0;var z=b;try{t:{for(N(A),v=s(m);v!==null&&!(v.expirationTime>A&&oe());){var K=v.callback;if(typeof K=="function"){v.callback=null,b=v.priorityLevel;var ee=K(v.expirationTime<=A);if(A=e.unstable_now(),typeof ee=="function"){v.callback=ee,N(A),L=!0;break t}v===s(m)&&n(m),N(A)}else n(m);v=s(m)}if(v!==null)L=!0;else{var he=s(p);he!==null&&W(D,he.startTime-A),L=!1}}break e}finally{v=null,b=z,x=!1}L=void 0}}finally{L?G():j=!1}}}var G;if(typeof T=="function")G=function(){T(Z)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,V=I.port2;I.port1.onmessage=Z,G=function(){V.postMessage(null)}}else G=function(){M(Z,0)};function W(A,L){q=M(function(){A(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(A){A.callback=null},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(A){switch(b){case 1:case 2:case 3:var L=3;break;default:L=b}var z=b;b=L;try{return A()}finally{b=z}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(A,L){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var z=b;b=A;try{return L()}finally{b=z}},e.unstable_scheduleCallback=function(A,L,z){var K=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?K+z:K):z=K,A){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=z+ee,A={id:y++,callback:L,priorityLevel:A,startTime:z,expirationTime:ee,sortIndex:-1},z>K?(A.sortIndex=z,t(p,A),s(m)===null&&A===s(p)&&(C?(R(q),q=-1):C=!0,W(D,z-K))):(A.sortIndex=ee,t(m,A),w||x||(w=!0,j||(j=!0,G()))),A},e.unstable_shouldYield=oe,e.unstable_wrapCallback=function(A){var L=b;return function(){var z=b;b=L;try{return A.apply(this,arguments)}finally{b=z}}}})(wd)),wd}var Zv;function i2(){return Zv||(Zv=1,xd.exports=t2()),xd.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-dom-client.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Qv;function r2(){if(Qv)return ia;Qv=1;var e=i2(),t=Gy(),s=YC();function n(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function c(i){var r=i,o=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(o=r.return),i=r.return;while(i)}return r.tag===3?o:null}function u(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function h(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function m(i){if(c(i)!==i)throw Error(n(188))}function p(i){var r=i.alternate;if(!r){if(r=c(i),r===null)throw Error(n(188));return r!==i?null:i}for(var o=i,l=r;;){var d=o.return;if(d===null)break;var f=d.alternate;if(f===null){if(l=d.return,l!==null){o=l;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===o)return m(d),i;if(f===l)return m(d),r;f=f.sibling}throw Error(n(188))}if(o.return!==l.return)o=d,l=f;else{for(var S=!1,k=d.child;k;){if(k===o){S=!0,o=d,l=f;break}if(k===l){S=!0,l=d,o=f;break}k=k.sibling}if(!S){for(k=f.child;k;){if(k===o){S=!0,o=f,l=d;break}if(k===l){S=!0,l=f,o=d;break}k=k.sibling}if(!S)throw Error(n(189))}}if(o.alternate!==l)throw Error(n(190))}if(o.tag!==3)throw Error(n(188));return o.stateNode.current===o?i:r}function y(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=y(i),r!==null)return r;i=i.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function G(i){return i===null||typeof i!="object"?null:(i=Z&&i[Z]||i["@@iterator"],typeof i=="function"?i:null)}var I=Symbol.for("react.client.reference");function V(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===I?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case M:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case j:return"SuspenseList";case re:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case T:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case N:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case q:return r=i.displayName||null,r!==null?r:V(i.type)||"Memo";case te:r=i._payload,i=i._init;try{return V(i(r))}catch{}}return null}var W=Array.isArray,A=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},K=[],ee=-1;function he(i){return{current:i}}function ne(i){0>ee||(i.current=K[ee],K[ee]=null,ee--)}function ae(i,r){ee++,K[ee]=i.current,i.current=r}var ie=he(null),me=he(null),ve=he(null),Ne=he(null);function Ue(i,r){switch(ae(ve,r),ae(me,i),ae(ie,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?yv(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=yv(r),i=bv(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}ne(ie),ae(ie,i)}function xe(){ne(ie),ne(me),ne(ve)}function ce(i){i.memoizedState!==null&&ae(Ne,i);var r=ie.current,o=bv(r,i.type);r!==o&&(ae(me,i),ae(ie,o))}function Te(i){me.current===i&&(ne(ie),ne(me)),Ne.current===i&&(ne(Ne),Qo._currentValue=z)}var Ge,be;function ze(i){if(Ge===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);Ge=r&&r[1]||"",be=-1<o.stack.indexOf(`
|
|
19
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
+
`+Ge+i+be}var Li=!1;function Ze(i,r){if(!i||Li)return"";Li=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch($){var F=$}Reflect.construct(i,[],Q)}else{try{Q.call()}catch($){F=$}i.call(Q.prototype)}}else{try{throw Error()}catch($){F=$}(Q=i())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch($){if($&&F&&typeof $.stack=="string")return[$.stack,F.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=l.DetermineComponentFrameRoot(),S=f[0],k=f[1];if(S&&k){var O=S.split(`
|
|
21
|
+
`),U=k.split(`
|
|
22
|
+
`);for(d=l=0;l<O.length&&!O[l].includes("DetermineComponentFrameRoot");)l++;for(;d<U.length&&!U[d].includes("DetermineComponentFrameRoot");)d++;if(l===O.length||d===U.length)for(l=O.length-1,d=U.length-1;1<=l&&0<=d&&O[l]!==U[d];)d--;for(;1<=l&&0<=d;l--,d--)if(O[l]!==U[d]){if(l!==1||d!==1)do if(l--,d--,0>d||O[l]!==U[d]){var Y=`
|
|
23
|
+
`+O[l].replace(" at new "," at ");return i.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",i.displayName)),Y}while(1<=l&&0<=d);break}}}finally{Li=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?ze(o):""}function zi(i,r){switch(i.tag){case 26:case 27:case 5:return ze(i.type);case 16:return ze("Lazy");case 13:return i.child!==r&&r!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return Ze(i.type,!1);case 11:return Ze(i.type.render,!1);case 1:return Ze(i.type,!0);case 31:return ze("Activity");default:return""}}function Wi(i){try{var r="",o=null;do r+=zi(i,o),o=i,i=i.return;while(i);return r}catch(l){return`
|
|
24
|
+
Error generating stack: `+l.message+`
|
|
25
|
+
`+l.stack}}var gi=Object.prototype.hasOwnProperty,zr=e.unstable_scheduleCallback,lo=e.unstable_cancelCallback,qi=e.unstable_shouldYield,au=e.unstable_requestPaint,Pt=e.unstable_now,Be=e.unstable_getCurrentPriorityLevel,vs=e.unstable_ImmediatePriority,sn=e.unstable_UserBlockingPriority,nn=e.unstable_NormalPriority,lu=e.unstable_LowPriority,Jm=e.unstable_IdlePriority,Tx=e.log,Ax=e.unstable_setDisableYieldValue,co=null,ii=null;function Br(i){if(typeof Tx=="function"&&Ax(i),ii&&typeof ii.setStrictMode=="function")try{ii.setStrictMode(co,i)}catch{}}var ri=Math.clz32?Math.clz32:Lx,Dx=Math.log,Ox=Math.LN2;function Lx(i){return i>>>=0,i===0?32:31-(Dx(i)/Ox|0)|0}var Pa=256,Ua=262144,Ia=4194304;function ys(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Fa(i,r,o){var l=i.pendingLanes;if(l===0)return 0;var d=0,f=i.suspendedLanes,S=i.pingedLanes;i=i.warmLanes;var k=l&134217727;return k!==0?(l=k&~f,l!==0?d=ys(l):(S&=k,S!==0?d=ys(S):o||(o=k&~i,o!==0&&(d=ys(o))))):(k=l&~f,k!==0?d=ys(k):S!==0?d=ys(S):o||(o=l&~i,o!==0&&(d=ys(o)))),d===0?0:r!==0&&r!==d&&(r&f)===0&&(f=d&-d,o=r&-r,f>=o||f===32&&(o&4194048)!==0)?r:d}function uo(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function zx(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ep(){var i=Ia;return Ia<<=1,(Ia&62914560)===0&&(Ia=4194304),i}function cu(i){for(var r=[],o=0;31>o;o++)r.push(i);return r}function ho(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Bx(i,r,o,l,d,f){var S=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var k=i.entanglements,O=i.expirationTimes,U=i.hiddenUpdates;for(o=S&~o;0<o;){var Y=31-ri(o),Q=1<<Y;k[Y]=0,O[Y]=-1;var F=U[Y];if(F!==null)for(U[Y]=null,Y=0;Y<F.length;Y++){var $=F[Y];$!==null&&($.lane&=-536870913)}o&=~Q}l!==0&&tp(i,l,0),f!==0&&d===0&&i.tag!==0&&(i.suspendedLanes|=f&~(S&~r))}function tp(i,r,o){i.pendingLanes|=r,i.suspendedLanes&=~r;var l=31-ri(r);i.entangledLanes|=r,i.entanglements[l]=i.entanglements[l]|1073741824|o&261930}function ip(i,r){var o=i.entangledLanes|=r;for(i=i.entanglements;o;){var l=31-ri(o),d=1<<l;d&r|i[l]&r&&(i[l]|=r),o&=~d}}function rp(i,r){var o=r&-r;return o=(o&42)!==0?1:uu(o),(o&(i.suspendedLanes|r))!==0?0:o}function uu(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function hu(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function sp(){var i=L.p;return i!==0?i:(i=window.event,i===void 0?32:Wv(i.type))}function np(i,r){var o=L.p;try{return L.p=i,r()}finally{L.p=o}}var jr=Math.random().toString(36).slice(2),Tt="__reactFiber$"+jr,Kt="__reactProps$"+jr,on="__reactContainer$"+jr,du="__reactEvents$"+jr,jx="__reactListeners$"+jr,Hx="__reactHandles$"+jr,op="__reactResources$"+jr,fo="__reactMarker$"+jr;function fu(i){delete i[Tt],delete i[Kt],delete i[du],delete i[jx],delete i[Hx]}function an(i){var r=i[Tt];if(r)return r;for(var o=i.parentNode;o;){if(r=o[on]||o[Tt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(i=Mv(i);i!==null;){if(o=i[Tt])return o;i=Mv(i)}return r}i=o,o=i.parentNode}return null}function ln(i){if(i=i[Tt]||i[on]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function mo(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(n(33))}function cn(i){var r=i[op];return r||(r=i[op]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function xt(i){i[fo]=!0}var ap=new Set,lp={};function bs(i,r){un(i,r),un(i+"Capture",r)}function un(i,r){for(lp[i]=r,i=0;i<r.length;i++)ap.add(r[i])}var Px=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),cp={},up={};function Ux(i){return gi.call(up,i)?!0:gi.call(cp,i)?!1:Px.test(i)?up[i]=!0:(cp[i]=!0,!1)}function Wa(i,r,o){if(Ux(r))if(o===null)i.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+o)}}function qa(i,r,o){if(o===null)i.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+o)}}function ar(i,r,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(r,o,""+l)}}function vi(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function hp(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ix(i,r,o){var l=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,f=l.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return d.call(this)},set:function(S){o=""+S,f.call(this,S)}}),Object.defineProperty(i,r,{enumerable:l.enumerable}),{getValue:function(){return o},setValue:function(S){o=""+S},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function mu(i){if(!i._valueTracker){var r=hp(i)?"checked":"value";i._valueTracker=Ix(i,r,""+i[r])}}function dp(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var o=r.getValue(),l="";return i&&(l=hp(i)?i.checked?"true":"false":i.value),i=l,i!==o?(r.setValue(i),!0):!1}function $a(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Fx=/[\n"\\]/g;function yi(i){return i.replace(Fx,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function pu(i,r,o,l,d,f,S,k){i.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?i.type=S:i.removeAttribute("type"),r!=null?S==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+vi(r)):i.value!==""+vi(r)&&(i.value=""+vi(r)):S!=="submit"&&S!=="reset"||i.removeAttribute("value"),r!=null?_u(i,S,vi(r)):o!=null?_u(i,S,vi(o)):l!=null&&i.removeAttribute("value"),d==null&&f!=null&&(i.defaultChecked=!!f),d!=null&&(i.checked=d&&typeof d!="function"&&typeof d!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?i.name=""+vi(k):i.removeAttribute("name")}function fp(i,r,o,l,d,f,S,k){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(i.type=f),r!=null||o!=null){if(!(f!=="submit"&&f!=="reset"||r!=null)){mu(i);return}o=o!=null?""+vi(o):"",r=r!=null?""+vi(r):o,k||r===i.value||(i.value=r),i.defaultValue=r}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=k?i.checked:!!l,i.defaultChecked=!!l,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.name=S),mu(i)}function _u(i,r,o){r==="number"&&$a(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function hn(i,r,o,l){if(i=i.options,r){r={};for(var d=0;d<o.length;d++)r["$"+o[d]]=!0;for(o=0;o<i.length;o++)d=r.hasOwnProperty("$"+i[o].value),i[o].selected!==d&&(i[o].selected=d),d&&l&&(i[o].defaultSelected=!0)}else{for(o=""+vi(o),r=null,d=0;d<i.length;d++){if(i[d].value===o){i[d].selected=!0,l&&(i[d].defaultSelected=!0);return}r!==null||i[d].disabled||(r=i[d])}r!==null&&(r.selected=!0)}}function mp(i,r,o){if(r!=null&&(r=""+vi(r),r!==i.value&&(i.value=r),o==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=o!=null?""+vi(o):""}function pp(i,r,o,l){if(r==null){if(l!=null){if(o!=null)throw Error(n(92));if(W(l)){if(1<l.length)throw Error(n(93));l=l[0]}o=l}o==null&&(o=""),r=o}o=vi(r),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l),mu(i)}function dn(i,r){if(r){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=r;return}}i.textContent=r}var Wx=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function _p(i,r,o){var l=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":l?i.setProperty(r,o):typeof o!="number"||o===0||Wx.has(r)?r==="float"?i.cssFloat=o:i[r]=(""+o).trim():i[r]=o+"px"}function gp(i,r,o){if(r!=null&&typeof r!="object")throw Error(n(62));if(i=i.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="");for(var d in r)l=r[d],r.hasOwnProperty(d)&&o[d]!==l&&_p(i,d,l)}else for(var f in r)r.hasOwnProperty(f)&&_p(i,f,r[f])}function gu(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var qx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),$x=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Va(i){return $x.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function lr(){}var vu=null;function yu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var fn=null,mn=null;function vp(i){var r=ln(i);if(r&&(i=r.stateNode)){var o=i[Kt]||null;e:switch(i=r.stateNode,r.type){case"input":if(pu(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+yi(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var l=o[r];if(l!==i&&l.form===i.form){var d=l[Kt]||null;if(!d)throw Error(n(90));pu(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(r=0;r<o.length;r++)l=o[r],l.form===i.form&&dp(l)}break e;case"textarea":mp(i,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&hn(i,!!o.multiple,r,!1)}}}var bu=!1;function yp(i,r,o){if(bu)return i(r,o);bu=!0;try{var l=i(r);return l}finally{if(bu=!1,(fn!==null||mn!==null)&&(Ol(),fn&&(r=fn,i=mn,mn=fn=null,vp(r),i)))for(r=0;r<i.length;r++)vp(i[r])}}function po(i,r){var o=i.stateNode;if(o===null)return null;var l=o[Kt]||null;if(l===null)return null;o=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(i=i.type,l=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!l;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(n(231,r,typeof o));return o}var cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Su=!1;if(cr)try{var _o={};Object.defineProperty(_o,"passive",{get:function(){Su=!0}}),window.addEventListener("test",_o,_o),window.removeEventListener("test",_o,_o)}catch{Su=!1}var Hr=null,xu=null,Ka=null;function bp(){if(Ka)return Ka;var i,r=xu,o=r.length,l,d="value"in Hr?Hr.value:Hr.textContent,f=d.length;for(i=0;i<o&&r[i]===d[i];i++);var S=o-i;for(l=1;l<=S&&r[o-l]===d[f-l];l++);return Ka=d.slice(i,1<l?1-l:void 0)}function Ya(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function Ga(){return!0}function Sp(){return!1}function Yt(i){function r(o,l,d,f,S){this._reactName=o,this._targetInst=d,this.type=l,this.nativeEvent=f,this.target=S,this.currentTarget=null;for(var k in i)i.hasOwnProperty(k)&&(o=i[k],this[k]=o?o(f):f[k]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Ga:Sp,this.isPropagationStopped=Sp,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ga)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ga)},persist:function(){},isPersistent:Ga}),r}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xa=Yt(Ss),go=v({},Ss,{view:0,detail:0}),Vx=Yt(go),wu,Cu,vo,Za=v({},go,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ku,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==vo&&(vo&&i.type==="mousemove"?(wu=i.screenX-vo.screenX,Cu=i.screenY-vo.screenY):Cu=wu=0,vo=i),wu)},movementY:function(i){return"movementY"in i?i.movementY:Cu}}),xp=Yt(Za),Kx=v({},Za,{dataTransfer:0}),Yx=Yt(Kx),Gx=v({},go,{relatedTarget:0}),Eu=Yt(Gx),Xx=v({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),Zx=Yt(Xx),Qx=v({},Ss,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Jx=Yt(Qx),ew=v({},Ss,{data:0}),wp=Yt(ew),tw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},rw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sw(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=rw[i])?!!r[i]:!1}function ku(){return sw}var nw=v({},go,{key:function(i){if(i.key){var r=tw[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=Ya(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?iw[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ku,charCode:function(i){return i.type==="keypress"?Ya(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ya(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),ow=Yt(nw),aw=v({},Za,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cp=Yt(aw),lw=v({},go,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ku}),cw=Yt(lw),uw=v({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),hw=Yt(uw),dw=v({},Za,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),fw=Yt(dw),mw=v({},Ss,{newState:0,oldState:0}),pw=Yt(mw),_w=[9,13,27,32],Mu=cr&&"CompositionEvent"in window,yo=null;cr&&"documentMode"in document&&(yo=document.documentMode);var gw=cr&&"TextEvent"in window&&!yo,Ep=cr&&(!Mu||yo&&8<yo&&11>=yo),kp=" ",Mp=!1;function Rp(i,r){switch(i){case"keyup":return _w.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Np(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var pn=!1;function vw(i,r){switch(i){case"compositionend":return Np(r);case"keypress":return r.which!==32?null:(Mp=!0,kp);case"textInput":return i=r.data,i===kp&&Mp?null:i;default:return null}}function yw(i,r){if(pn)return i==="compositionend"||!Mu&&Rp(i,r)?(i=bp(),Ka=xu=Hr=null,pn=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ep&&r.locale!=="ko"?null:r.data;default:return null}}var bw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Tp(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!bw[i.type]:r==="textarea"}function Ap(i,r,o,l){fn?mn?mn.push(l):mn=[l]:fn=l,r=Ul(r,"onChange"),0<r.length&&(o=new Xa("onChange","change",null,o,l),i.push({event:o,listeners:r}))}var bo=null,So=null;function Sw(i){fv(i,0)}function Qa(i){var r=mo(i);if(dp(r))return i}function Dp(i,r){if(i==="change")return r}var Op=!1;if(cr){var Ru;if(cr){var Nu="oninput"in document;if(!Nu){var Lp=document.createElement("div");Lp.setAttribute("oninput","return;"),Nu=typeof Lp.oninput=="function"}Ru=Nu}else Ru=!1;Op=Ru&&(!document.documentMode||9<document.documentMode)}function zp(){bo&&(bo.detachEvent("onpropertychange",Bp),So=bo=null)}function Bp(i){if(i.propertyName==="value"&&Qa(So)){var r=[];Ap(r,So,i,yu(i)),yp(Sw,r)}}function xw(i,r,o){i==="focusin"?(zp(),bo=r,So=o,bo.attachEvent("onpropertychange",Bp)):i==="focusout"&&zp()}function ww(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Qa(So)}function Cw(i,r){if(i==="click")return Qa(r)}function Ew(i,r){if(i==="input"||i==="change")return Qa(r)}function kw(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var si=typeof Object.is=="function"?Object.is:kw;function xo(i,r){if(si(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var o=Object.keys(i),l=Object.keys(r);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var d=o[l];if(!gi.call(r,d)||!si(i[d],r[d]))return!1}return!0}function jp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Hp(i,r){var o=jp(i);i=0;for(var l;o;){if(o.nodeType===3){if(l=i+o.textContent.length,i<=r&&l>=r)return{node:o,offset:r-i};i=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=jp(o)}}function Pp(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?Pp(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function Up(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=$a(i.document);r instanceof i.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)i=r.contentWindow;else break;r=$a(i.document)}return r}function Tu(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var Mw=cr&&"documentMode"in document&&11>=document.documentMode,_n=null,Au=null,wo=null,Du=!1;function Ip(i,r,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Du||_n==null||_n!==$a(l)||(l=_n,"selectionStart"in l&&Tu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),wo&&xo(wo,l)||(wo=l,l=Ul(Au,"onSelect"),0<l.length&&(r=new Xa("onSelect","select",null,r,o),i.push({event:r,listeners:l}),r.target=_n)))}function xs(i,r){var o={};return o[i.toLowerCase()]=r.toLowerCase(),o["Webkit"+i]="webkit"+r,o["Moz"+i]="moz"+r,o}var gn={animationend:xs("Animation","AnimationEnd"),animationiteration:xs("Animation","AnimationIteration"),animationstart:xs("Animation","AnimationStart"),transitionrun:xs("Transition","TransitionRun"),transitionstart:xs("Transition","TransitionStart"),transitioncancel:xs("Transition","TransitionCancel"),transitionend:xs("Transition","TransitionEnd")},Ou={},Fp={};cr&&(Fp=document.createElement("div").style,"AnimationEvent"in window||(delete gn.animationend.animation,delete gn.animationiteration.animation,delete gn.animationstart.animation),"TransitionEvent"in window||delete gn.transitionend.transition);function ws(i){if(Ou[i])return Ou[i];if(!gn[i])return i;var r=gn[i],o;for(o in r)if(r.hasOwnProperty(o)&&o in Fp)return Ou[i]=r[o];return i}var Wp=ws("animationend"),qp=ws("animationiteration"),$p=ws("animationstart"),Rw=ws("transitionrun"),Nw=ws("transitionstart"),Tw=ws("transitioncancel"),Vp=ws("transitionend"),Kp=new Map,Lu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Lu.push("scrollEnd");function Bi(i,r){Kp.set(i,r),bs(r,[i])}var Ja=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},bi=[],vn=0,zu=0;function el(){for(var i=vn,r=zu=vn=0;r<i;){var o=bi[r];bi[r++]=null;var l=bi[r];bi[r++]=null;var d=bi[r];bi[r++]=null;var f=bi[r];if(bi[r++]=null,l!==null&&d!==null){var S=l.pending;S===null?d.next=d:(d.next=S.next,S.next=d),l.pending=d}f!==0&&Yp(o,d,f)}}function tl(i,r,o,l){bi[vn++]=i,bi[vn++]=r,bi[vn++]=o,bi[vn++]=l,zu|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function Bu(i,r,o,l){return tl(i,r,o,l),il(i)}function Cs(i,r){return tl(i,null,null,r),il(i)}function Yp(i,r,o){i.lanes|=o;var l=i.alternate;l!==null&&(l.lanes|=o);for(var d=!1,f=i.return;f!==null;)f.childLanes|=o,l=f.alternate,l!==null&&(l.childLanes|=o),f.tag===22&&(i=f.stateNode,i===null||i._visibility&1||(d=!0)),i=f,f=f.return;return i.tag===3?(f=i.stateNode,d&&r!==null&&(d=31-ri(o),i=f.hiddenUpdates,l=i[d],l===null?i[d]=[r]:l.push(r),r.lane=o|536870912),f):null}function il(i){if(50<$o)throw $o=0,$h=null,Error(n(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var yn={};function Aw(i,r,o,l){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(i,r,o,l){return new Aw(i,r,o,l)}function ju(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ur(i,r){var o=i.alternate;return o===null?(o=ni(i.tag,r,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=r,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,r=i.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function Gp(i,r){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,r=o.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function rl(i,r,o,l,d,f){var S=0;if(l=i,typeof i=="function")ju(i)&&(S=1);else if(typeof i=="string")S=BC(i,o,ie.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case re:return i=ni(31,o,r,d),i.elementType=re,i.lanes=f,i;case C:return Es(o.children,d,f,r);case E:S=8,d|=24;break;case M:return i=ni(12,o,r,d|2),i.elementType=M,i.lanes=f,i;case D:return i=ni(13,o,r,d),i.elementType=D,i.lanes=f,i;case j:return i=ni(19,o,r,d),i.elementType=j,i.lanes=f,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:S=10;break e;case R:S=9;break e;case N:S=11;break e;case q:S=14;break e;case te:S=16,l=null;break e}S=29,o=Error(n(130,i===null?"null":typeof i,"")),l=null}return r=ni(S,o,r,d),r.elementType=i,r.type=l,r.lanes=f,r}function Es(i,r,o,l){return i=ni(7,i,l,r),i.lanes=o,i}function Hu(i,r,o){return i=ni(6,i,null,r),i.lanes=o,i}function Xp(i){var r=ni(18,null,null,0);return r.stateNode=i,r}function Pu(i,r,o){return r=ni(4,i.children!==null?i.children:[],i.key,r),r.lanes=o,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var Zp=new WeakMap;function Si(i,r){if(typeof i=="object"&&i!==null){var o=Zp.get(i);return o!==void 0?o:(r={value:i,source:r,stack:Wi(r)},Zp.set(i,r),r)}return{value:i,source:r,stack:Wi(r)}}var bn=[],Sn=0,sl=null,Co=0,xi=[],wi=0,Pr=null,$i=1,Vi="";function hr(i,r){bn[Sn++]=Co,bn[Sn++]=sl,sl=i,Co=r}function Qp(i,r,o){xi[wi++]=$i,xi[wi++]=Vi,xi[wi++]=Pr,Pr=i;var l=$i;i=Vi;var d=32-ri(l)-1;l&=~(1<<d),o+=1;var f=32-ri(r)+d;if(30<f){var S=d-d%5;f=(l&(1<<S)-1).toString(32),l>>=S,d-=S,$i=1<<32-ri(r)+d|o<<d|l,Vi=f+i}else $i=1<<f|o<<d|l,Vi=i}function Uu(i){i.return!==null&&(hr(i,1),Qp(i,1,0))}function Iu(i){for(;i===sl;)sl=bn[--Sn],bn[Sn]=null,Co=bn[--Sn],bn[Sn]=null;for(;i===Pr;)Pr=xi[--wi],xi[wi]=null,Vi=xi[--wi],xi[wi]=null,$i=xi[--wi],xi[wi]=null}function Jp(i,r){xi[wi++]=$i,xi[wi++]=Vi,xi[wi++]=Pr,$i=r.id,Vi=r.overflow,Pr=i}var At=null,Qe=null,Oe=!1,Ur=null,Ci=!1,Fu=Error(n(519));function Ir(i){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Eo(Si(r,i)),Fu}function e_(i){var r=i.stateNode,o=i.type,l=i.memoizedProps;switch(r[Tt]=i,r[Kt]=l,o){case"dialog":Re("cancel",r),Re("close",r);break;case"iframe":case"object":case"embed":Re("load",r);break;case"video":case"audio":for(o=0;o<Ko.length;o++)Re(Ko[o],r);break;case"source":Re("error",r);break;case"img":case"image":case"link":Re("error",r),Re("load",r);break;case"details":Re("toggle",r);break;case"input":Re("invalid",r),fp(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Re("invalid",r);break;case"textarea":Re("invalid",r),pp(r,l.value,l.defaultValue,l.children)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||l.suppressHydrationWarning===!0||gv(r.textContent,o)?(l.popover!=null&&(Re("beforetoggle",r),Re("toggle",r)),l.onScroll!=null&&Re("scroll",r),l.onScrollEnd!=null&&Re("scrollend",r),l.onClick!=null&&(r.onclick=lr),r=!0):r=!1,r||Ir(i,!0)}function t_(i){for(At=i.return;At;)switch(At.tag){case 5:case 31:case 13:Ci=!1;return;case 27:case 3:Ci=!0;return;default:At=At.return}}function xn(i){if(i!==At)return!1;if(!Oe)return t_(i),Oe=!0,!1;var r=i.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||od(i.type,i.memoizedProps)),o=!o),o&&Qe&&Ir(i),t_(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));Qe=kv(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));Qe=kv(i)}else r===27?(r=Qe,ts(i.type)?(i=hd,hd=null,Qe=i):Qe=r):Qe=At?ki(i.stateNode.nextSibling):null;return!0}function ks(){Qe=At=null,Oe=!1}function Wu(){var i=Ur;return i!==null&&(Qt===null?Qt=i:Qt.push.apply(Qt,i),Ur=null),i}function Eo(i){Ur===null?Ur=[i]:Ur.push(i)}var qu=he(null),Ms=null,dr=null;function Fr(i,r,o){ae(qu,r._currentValue),r._currentValue=o}function fr(i){i._currentValue=qu.current,ne(qu)}function $u(i,r,o){for(;i!==null;){var l=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),i===o)break;i=i.return}}function Vu(i,r,o,l){var d=i.child;for(d!==null&&(d.return=i);d!==null;){var f=d.dependencies;if(f!==null){var S=d.child;f=f.firstContext;e:for(;f!==null;){var k=f;f=d;for(var O=0;O<r.length;O++)if(k.context===r[O]){f.lanes|=o,k=f.alternate,k!==null&&(k.lanes|=o),$u(f.return,o,i),l||(S=null);break e}f=k.next}}else if(d.tag===18){if(S=d.return,S===null)throw Error(n(341));S.lanes|=o,f=S.alternate,f!==null&&(f.lanes|=o),$u(S,o,i),S=null}else S=d.child;if(S!==null)S.return=d;else for(S=d;S!==null;){if(S===i){S=null;break}if(d=S.sibling,d!==null){d.return=S.return,S=d;break}S=S.return}d=S}}function wn(i,r,o,l){i=null;for(var d=r,f=!1;d!==null;){if(!f){if((d.flags&524288)!==0)f=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var S=d.alternate;if(S===null)throw Error(n(387));if(S=S.memoizedProps,S!==null){var k=d.type;si(d.pendingProps.value,S.value)||(i!==null?i.push(k):i=[k])}}else if(d===Ne.current){if(S=d.alternate,S===null)throw Error(n(387));S.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(i!==null?i.push(Qo):i=[Qo])}d=d.return}i!==null&&Vu(r,i,o,l),r.flags|=262144}function nl(i){for(i=i.firstContext;i!==null;){if(!si(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Rs(i){Ms=i,dr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Dt(i){return i_(Ms,i)}function ol(i,r){return Ms===null&&Rs(i),i_(i,r)}function i_(i,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},dr===null){if(i===null)throw Error(n(308));dr=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else dr=dr.next=r;return o}var Dw=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(o,l){i.push(l)}};this.abort=function(){r.aborted=!0,i.forEach(function(o){return o()})}},Ow=e.unstable_scheduleCallback,Lw=e.unstable_NormalPriority,dt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ku(){return{controller:new Dw,data:new Map,refCount:0}}function ko(i){i.refCount--,i.refCount===0&&Ow(Lw,function(){i.controller.abort()})}var Mo=null,Yu=0,Cn=0,En=null;function zw(i,r){if(Mo===null){var o=Mo=[];Yu=0,Cn=Zh(),En={status:"pending",value:void 0,then:function(l){o.push(l)}}}return Yu++,r.then(r_,r_),r}function r_(){if(--Yu===0&&Mo!==null){En!==null&&(En.status="fulfilled");var i=Mo;Mo=null,Cn=0,En=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function Bw(i,r){var o=[],l={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return i.then(function(){l.status="fulfilled",l.value=r;for(var d=0;d<o.length;d++)(0,o[d])(r)},function(d){for(l.status="rejected",l.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),l}var s_=A.S;A.S=function(i,r){Ig=Pt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&zw(i,r),s_!==null&&s_(i,r)};var Ns=he(null);function Gu(){var i=Ns.current;return i!==null?i:Ke.pooledCache}function al(i,r){r===null?ae(Ns,Ns.current):ae(Ns,r.pool)}function n_(){var i=Gu();return i===null?null:{parent:dt._currentValue,pool:i}}var kn=Error(n(460)),Xu=Error(n(474)),ll=Error(n(542)),cl={then:function(){}};function o_(i){return i=i.status,i==="fulfilled"||i==="rejected"}function a_(i,r,o){switch(o=i[o],o===void 0?i.push(r):o!==r&&(r.then(lr,lr),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,c_(i),i;default:if(typeof r.status=="string")r.then(lr,lr);else{if(i=Ke,i!==null&&100<i.shellSuspendCounter)throw Error(n(482));i=r,i.status="pending",i.then(function(l){if(r.status==="pending"){var d=r;d.status="fulfilled",d.value=l}},function(l){if(r.status==="pending"){var d=r;d.status="rejected",d.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,c_(i),i}throw As=r,kn}}function Ts(i){try{var r=i._init;return r(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(As=o,kn):o}}var As=null;function l_(){if(As===null)throw Error(n(459));var i=As;return As=null,i}function c_(i){if(i===kn||i===ll)throw Error(n(483))}var Mn=null,Ro=0;function ul(i){var r=Ro;return Ro+=1,Mn===null&&(Mn=[]),a_(Mn,i,r)}function No(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function hl(i,r){throw r.$$typeof===b?Error(n(525)):(i=Object.prototype.toString.call(r),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function u_(i){function r(H,B){if(i){var P=H.deletions;P===null?(H.deletions=[B],H.flags|=16):P.push(B)}}function o(H,B){if(!i)return null;for(;B!==null;)r(H,B),B=B.sibling;return null}function l(H){for(var B=new Map;H!==null;)H.key!==null?B.set(H.key,H):B.set(H.index,H),H=H.sibling;return B}function d(H,B){return H=ur(H,B),H.index=0,H.sibling=null,H}function f(H,B,P){return H.index=P,i?(P=H.alternate,P!==null?(P=P.index,P<B?(H.flags|=67108866,B):P):(H.flags|=67108866,B)):(H.flags|=1048576,B)}function S(H){return i&&H.alternate===null&&(H.flags|=67108866),H}function k(H,B,P,X){return B===null||B.tag!==6?(B=Hu(P,H.mode,X),B.return=H,B):(B=d(B,P),B.return=H,B)}function O(H,B,P,X){var pe=P.type;return pe===C?Y(H,B,P.props.children,X,P.key):B!==null&&(B.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===te&&Ts(pe)===B.type)?(B=d(B,P.props),No(B,P),B.return=H,B):(B=rl(P.type,P.key,P.props,null,H.mode,X),No(B,P),B.return=H,B)}function U(H,B,P,X){return B===null||B.tag!==4||B.stateNode.containerInfo!==P.containerInfo||B.stateNode.implementation!==P.implementation?(B=Pu(P,H.mode,X),B.return=H,B):(B=d(B,P.children||[]),B.return=H,B)}function Y(H,B,P,X,pe){return B===null||B.tag!==7?(B=Es(P,H.mode,X,pe),B.return=H,B):(B=d(B,P),B.return=H,B)}function Q(H,B,P){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Hu(""+B,H.mode,P),B.return=H,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case x:return P=rl(B.type,B.key,B.props,null,H.mode,P),No(P,B),P.return=H,P;case w:return B=Pu(B,H.mode,P),B.return=H,B;case te:return B=Ts(B),Q(H,B,P)}if(W(B)||G(B))return B=Es(B,H.mode,P,null),B.return=H,B;if(typeof B.then=="function")return Q(H,ul(B),P);if(B.$$typeof===T)return Q(H,ol(H,B),P);hl(H,B)}return null}function F(H,B,P,X){var pe=B!==null?B.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return pe!==null?null:k(H,B,""+P,X);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case x:return P.key===pe?O(H,B,P,X):null;case w:return P.key===pe?U(H,B,P,X):null;case te:return P=Ts(P),F(H,B,P,X)}if(W(P)||G(P))return pe!==null?null:Y(H,B,P,X,null);if(typeof P.then=="function")return F(H,B,ul(P),X);if(P.$$typeof===T)return F(H,B,ol(H,P),X);hl(H,P)}return null}function $(H,B,P,X,pe){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return H=H.get(P)||null,k(B,H,""+X,pe);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case x:return H=H.get(X.key===null?P:X.key)||null,O(B,H,X,pe);case w:return H=H.get(X.key===null?P:X.key)||null,U(B,H,X,pe);case te:return X=Ts(X),$(H,B,P,X,pe)}if(W(X)||G(X))return H=H.get(P)||null,Y(B,H,X,pe,null);if(typeof X.then=="function")return $(H,B,P,ul(X),pe);if(X.$$typeof===T)return $(H,B,P,ol(B,X),pe);hl(B,X)}return null}function ue(H,B,P,X){for(var pe=null,je=null,de=B,Ce=B=0,De=null;de!==null&&Ce<P.length;Ce++){de.index>Ce?(De=de,de=null):De=de.sibling;var He=F(H,de,P[Ce],X);if(He===null){de===null&&(de=De);break}i&&de&&He.alternate===null&&r(H,de),B=f(He,B,Ce),je===null?pe=He:je.sibling=He,je=He,de=De}if(Ce===P.length)return o(H,de),Oe&&hr(H,Ce),pe;if(de===null){for(;Ce<P.length;Ce++)de=Q(H,P[Ce],X),de!==null&&(B=f(de,B,Ce),je===null?pe=de:je.sibling=de,je=de);return Oe&&hr(H,Ce),pe}for(de=l(de);Ce<P.length;Ce++)De=$(de,H,Ce,P[Ce],X),De!==null&&(i&&De.alternate!==null&&de.delete(De.key===null?Ce:De.key),B=f(De,B,Ce),je===null?pe=De:je.sibling=De,je=De);return i&&de.forEach(function(os){return r(H,os)}),Oe&&hr(H,Ce),pe}function ge(H,B,P,X){if(P==null)throw Error(n(151));for(var pe=null,je=null,de=B,Ce=B=0,De=null,He=P.next();de!==null&&!He.done;Ce++,He=P.next()){de.index>Ce?(De=de,de=null):De=de.sibling;var os=F(H,de,He.value,X);if(os===null){de===null&&(de=De);break}i&&de&&os.alternate===null&&r(H,de),B=f(os,B,Ce),je===null?pe=os:je.sibling=os,je=os,de=De}if(He.done)return o(H,de),Oe&&hr(H,Ce),pe;if(de===null){for(;!He.done;Ce++,He=P.next())He=Q(H,He.value,X),He!==null&&(B=f(He,B,Ce),je===null?pe=He:je.sibling=He,je=He);return Oe&&hr(H,Ce),pe}for(de=l(de);!He.done;Ce++,He=P.next())He=$(de,H,Ce,He.value,X),He!==null&&(i&&He.alternate!==null&&de.delete(He.key===null?Ce:He.key),B=f(He,B,Ce),je===null?pe=He:je.sibling=He,je=He);return i&&de.forEach(function(KC){return r(H,KC)}),Oe&&hr(H,Ce),pe}function $e(H,B,P,X){if(typeof P=="object"&&P!==null&&P.type===C&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case x:e:{for(var pe=P.key;B!==null;){if(B.key===pe){if(pe=P.type,pe===C){if(B.tag===7){o(H,B.sibling),X=d(B,P.props.children),X.return=H,H=X;break e}}else if(B.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===te&&Ts(pe)===B.type){o(H,B.sibling),X=d(B,P.props),No(X,P),X.return=H,H=X;break e}o(H,B);break}else r(H,B);B=B.sibling}P.type===C?(X=Es(P.props.children,H.mode,X,P.key),X.return=H,H=X):(X=rl(P.type,P.key,P.props,null,H.mode,X),No(X,P),X.return=H,H=X)}return S(H);case w:e:{for(pe=P.key;B!==null;){if(B.key===pe)if(B.tag===4&&B.stateNode.containerInfo===P.containerInfo&&B.stateNode.implementation===P.implementation){o(H,B.sibling),X=d(B,P.children||[]),X.return=H,H=X;break e}else{o(H,B);break}else r(H,B);B=B.sibling}X=Pu(P,H.mode,X),X.return=H,H=X}return S(H);case te:return P=Ts(P),$e(H,B,P,X)}if(W(P))return ue(H,B,P,X);if(G(P)){if(pe=G(P),typeof pe!="function")throw Error(n(150));return P=pe.call(P),ge(H,B,P,X)}if(typeof P.then=="function")return $e(H,B,ul(P),X);if(P.$$typeof===T)return $e(H,B,ol(H,P),X);hl(H,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,B!==null&&B.tag===6?(o(H,B.sibling),X=d(B,P),X.return=H,H=X):(o(H,B),X=Hu(P,H.mode,X),X.return=H,H=X),S(H)):o(H,B)}return function(H,B,P,X){try{Ro=0;var pe=$e(H,B,P,X);return Mn=null,pe}catch(de){if(de===kn||de===ll)throw de;var je=ni(29,de,null,H.mode);return je.lanes=X,je.return=H,je}finally{}}}var Ds=u_(!0),h_=u_(!1),Wr=!1;function Zu(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qu(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function qr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function $r(i,r,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(Pe&2)!==0){var d=l.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),l.pending=r,r=il(i),Yp(i,null,o),r}return tl(i,l,r,o),il(i)}function To(i,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var l=r.lanes;l&=i.pendingLanes,o|=l,r.lanes=o,ip(i,o)}}function Ju(i,r){var o=i.updateQueue,l=i.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var d=null,f=null;if(o=o.firstBaseUpdate,o!==null){do{var S={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};f===null?d=f=S:f=f.next=S,o=o.next}while(o!==null);f===null?d=f=r:f=f.next=r}else d=f=r;o={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:f,shared:l.shared,callbacks:l.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=r:i.next=r,o.lastBaseUpdate=r}var eh=!1;function Ao(){if(eh){var i=En;if(i!==null)throw i}}function Do(i,r,o,l){eh=!1;var d=i.updateQueue;Wr=!1;var f=d.firstBaseUpdate,S=d.lastBaseUpdate,k=d.shared.pending;if(k!==null){d.shared.pending=null;var O=k,U=O.next;O.next=null,S===null?f=U:S.next=U,S=O;var Y=i.alternate;Y!==null&&(Y=Y.updateQueue,k=Y.lastBaseUpdate,k!==S&&(k===null?Y.firstBaseUpdate=U:k.next=U,Y.lastBaseUpdate=O))}if(f!==null){var Q=d.baseState;S=0,Y=U=O=null,k=f;do{var F=k.lane&-536870913,$=F!==k.lane;if($?(Ae&F)===F:(l&F)===F){F!==0&&F===Cn&&(eh=!0),Y!==null&&(Y=Y.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ue=i,ge=k;F=r;var $e=o;switch(ge.tag){case 1:if(ue=ge.payload,typeof ue=="function"){Q=ue.call($e,Q,F);break e}Q=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ge.payload,F=typeof ue=="function"?ue.call($e,Q,F):ue,F==null)break e;Q=v({},Q,F);break e;case 2:Wr=!0}}F=k.callback,F!==null&&(i.flags|=64,$&&(i.flags|=8192),$=d.callbacks,$===null?d.callbacks=[F]:$.push(F))}else $={lane:F,tag:k.tag,payload:k.payload,callback:k.callback,next:null},Y===null?(U=Y=$,O=Q):Y=Y.next=$,S|=F;if(k=k.next,k===null){if(k=d.shared.pending,k===null)break;$=k,k=$.next,$.next=null,d.lastBaseUpdate=$,d.shared.pending=null}}while(!0);Y===null&&(O=Q),d.baseState=O,d.firstBaseUpdate=U,d.lastBaseUpdate=Y,f===null&&(d.shared.lanes=0),Xr|=S,i.lanes=S,i.memoizedState=Q}}function d_(i,r){if(typeof i!="function")throw Error(n(191,i));i.call(r)}function f_(i,r){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)d_(o[i],r)}var Rn=he(null),dl=he(0);function m_(i,r){i=xr,ae(dl,i),ae(Rn,r),xr=i|r.baseLanes}function th(){ae(dl,xr),ae(Rn,Rn.current)}function ih(){xr=dl.current,ne(Rn),ne(dl)}var oi=he(null),Ei=null;function Vr(i){var r=i.alternate;ae(ct,ct.current&1),ae(oi,i),Ei===null&&(r===null||Rn.current!==null||r.memoizedState!==null)&&(Ei=i)}function rh(i){ae(ct,ct.current),ae(oi,i),Ei===null&&(Ei=i)}function p_(i){i.tag===22?(ae(ct,ct.current),ae(oi,i),Ei===null&&(Ei=i)):Kr()}function Kr(){ae(ct,ct.current),ae(oi,oi.current)}function ai(i){ne(oi),Ei===i&&(Ei=null),ne(ct)}var ct=he(0);function fl(i){for(var r=i;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||cd(o)||ud(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var mr=0,we=null,We=null,ft=null,ml=!1,Nn=!1,Os=!1,pl=0,Oo=0,Tn=null,jw=0;function nt(){throw Error(n(321))}function sh(i,r){if(r===null)return!1;for(var o=0;o<r.length&&o<i.length;o++)if(!si(i[o],r[o]))return!1;return!0}function nh(i,r,o,l,d,f){return mr=f,we=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,A.H=i===null||i.memoizedState===null?Q_:bh,Os=!1,f=o(l,d),Os=!1,Nn&&(f=g_(r,o,l,d)),__(i),f}function __(i){A.H=Bo;var r=We!==null&&We.next!==null;if(mr=0,ft=We=we=null,ml=!1,Oo=0,Tn=null,r)throw Error(n(300));i===null||mt||(i=i.dependencies,i!==null&&nl(i)&&(mt=!0))}function g_(i,r,o,l){we=i;var d=0;do{if(Nn&&(Tn=null),Oo=0,Nn=!1,25<=d)throw Error(n(301));if(d+=1,ft=We=null,i.updateQueue!=null){var f=i.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}A.H=J_,f=r(o,l)}while(Nn);return f}function Hw(){var i=A.H,r=i.useState()[0];return r=typeof r.then=="function"?Lo(r):r,i=i.useState()[0],(We!==null?We.memoizedState:null)!==i&&(we.flags|=1024),r}function oh(){var i=pl!==0;return pl=0,i}function ah(i,r,o){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~o}function lh(i){if(ml){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}ml=!1}mr=0,ft=We=we=null,Nn=!1,Oo=pl=0,Tn=null}function Ut(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ft===null?we.memoizedState=ft=i:ft=ft.next=i,ft}function ut(){if(We===null){var i=we.alternate;i=i!==null?i.memoizedState:null}else i=We.next;var r=ft===null?we.memoizedState:ft.next;if(r!==null)ft=r,We=i;else{if(i===null)throw we.alternate===null?Error(n(467)):Error(n(310));We=i,i={memoizedState:We.memoizedState,baseState:We.baseState,baseQueue:We.baseQueue,queue:We.queue,next:null},ft===null?we.memoizedState=ft=i:ft=ft.next=i}return ft}function _l(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(i){var r=Oo;return Oo+=1,Tn===null&&(Tn=[]),i=a_(Tn,i,r),r=we,(ft===null?r.memoizedState:ft.next)===null&&(r=r.alternate,A.H=r===null||r.memoizedState===null?Q_:bh),i}function gl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Lo(i);if(i.$$typeof===T)return Dt(i)}throw Error(n(438,String(i)))}function ch(i){var r=null,o=we.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var l=we.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(d){return d.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=_l(),we.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(i),l=0;l<i;l++)o[l]=oe;return r.index++,o}function pr(i,r){return typeof r=="function"?r(i):r}function vl(i){var r=ut();return uh(r,We,i)}function uh(i,r,o){var l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=o;var d=i.baseQueue,f=l.pending;if(f!==null){if(d!==null){var S=d.next;d.next=f.next,f.next=S}r.baseQueue=d=f,l.pending=null}if(f=i.baseState,d===null)i.memoizedState=f;else{r=d.next;var k=S=null,O=null,U=r,Y=!1;do{var Q=U.lane&-536870913;if(Q!==U.lane?(Ae&Q)===Q:(mr&Q)===Q){var F=U.revertLane;if(F===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),Q===Cn&&(Y=!0);else if((mr&F)===F){U=U.next,F===Cn&&(Y=!0);continue}else Q={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},O===null?(k=O=Q,S=f):O=O.next=Q,we.lanes|=F,Xr|=F;Q=U.action,Os&&o(f,Q),f=U.hasEagerState?U.eagerState:o(f,Q)}else F={lane:Q,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},O===null?(k=O=F,S=f):O=O.next=F,we.lanes|=Q,Xr|=Q;U=U.next}while(U!==null&&U!==r);if(O===null?S=f:O.next=k,!si(f,i.memoizedState)&&(mt=!0,Y&&(o=En,o!==null)))throw o;i.memoizedState=f,i.baseState=S,i.baseQueue=O,l.lastRenderedState=f}return d===null&&(l.lanes=0),[i.memoizedState,l.dispatch]}function hh(i){var r=ut(),o=r.queue;if(o===null)throw Error(n(311));o.lastRenderedReducer=i;var l=o.dispatch,d=o.pending,f=r.memoizedState;if(d!==null){o.pending=null;var S=d=d.next;do f=i(f,S.action),S=S.next;while(S!==d);si(f,r.memoizedState)||(mt=!0),r.memoizedState=f,r.baseQueue===null&&(r.baseState=f),o.lastRenderedState=f}return[f,l]}function v_(i,r,o){var l=we,d=ut(),f=Oe;if(f){if(o===void 0)throw Error(n(407));o=o()}else o=r();var S=!si((We||d).memoizedState,o);if(S&&(d.memoizedState=o,mt=!0),d=d.queue,mh(S_.bind(null,l,d,i),[i]),d.getSnapshot!==r||S||ft!==null&&ft.memoizedState.tag&1){if(l.flags|=2048,An(9,{destroy:void 0},b_.bind(null,l,d,o,r),null),Ke===null)throw Error(n(349));f||(mr&127)!==0||y_(l,r,o)}return o}function y_(i,r,o){i.flags|=16384,i={getSnapshot:r,value:o},r=we.updateQueue,r===null?(r=_l(),we.updateQueue=r,r.stores=[i]):(o=r.stores,o===null?r.stores=[i]:o.push(i))}function b_(i,r,o,l){r.value=o,r.getSnapshot=l,x_(r)&&w_(i)}function S_(i,r,o){return o(function(){x_(r)&&w_(i)})}function x_(i){var r=i.getSnapshot;i=i.value;try{var o=r();return!si(i,o)}catch{return!0}}function w_(i){var r=Cs(i,2);r!==null&&Jt(r,i,2)}function dh(i){var r=Ut();if(typeof i=="function"){var o=i;if(i=o(),Os){Br(!0);try{o()}finally{Br(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:i},r}function C_(i,r,o,l){return i.baseState=o,uh(i,We,typeof l=="function"?l:pr)}function Pw(i,r,o,l,d){if(Sl(i))throw Error(n(485));if(i=r.action,i!==null){var f={payload:d,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){f.listeners.push(S)}};A.T!==null?o(!0):f.isTransition=!1,l(f),o=r.pending,o===null?(f.next=r.pending=f,E_(r,f)):(f.next=o.next,r.pending=o.next=f)}}function E_(i,r){var o=r.action,l=r.payload,d=i.state;if(r.isTransition){var f=A.T,S={};A.T=S;try{var k=o(d,l),O=A.S;O!==null&&O(S,k),k_(i,r,k)}catch(U){fh(i,r,U)}finally{f!==null&&S.types!==null&&(f.types=S.types),A.T=f}}else try{f=o(d,l),k_(i,r,f)}catch(U){fh(i,r,U)}}function k_(i,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){M_(i,r,l)},function(l){return fh(i,r,l)}):M_(i,r,o)}function M_(i,r,o){r.status="fulfilled",r.value=o,R_(r),i.state=o,r=i.pending,r!==null&&(o=r.next,o===r?i.pending=null:(o=o.next,r.next=o,E_(i,o)))}function fh(i,r,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=o,R_(r),r=r.next;while(r!==l)}i.action=null}function R_(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function N_(i,r){return r}function T_(i,r){if(Oe){var o=Ke.formState;if(o!==null){e:{var l=we;if(Oe){if(Qe){t:{for(var d=Qe,f=Ci;d.nodeType!==8;){if(!f){d=null;break t}if(d=ki(d.nextSibling),d===null){d=null;break t}}f=d.data,d=f==="F!"||f==="F"?d:null}if(d){Qe=ki(d.nextSibling),l=d.data==="F!";break e}}Ir(l)}l=!1}l&&(r=o[0])}}return o=Ut(),o.memoizedState=o.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:N_,lastRenderedState:r},o.queue=l,o=G_.bind(null,we,l),l.dispatch=o,l=dh(!1),f=yh.bind(null,we,!1,l.queue),l=Ut(),d={state:r,dispatch:null,action:i,pending:null},l.queue=d,o=Pw.bind(null,we,d,f,o),d.dispatch=o,l.memoizedState=i,[r,o,!1]}function A_(i){var r=ut();return D_(r,We,i)}function D_(i,r,o){if(r=uh(i,r,N_)[0],i=vl(pr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=Lo(r)}catch(S){throw S===kn?ll:S}else l=r;r=ut();var d=r.queue,f=d.dispatch;return o!==r.memoizedState&&(we.flags|=2048,An(9,{destroy:void 0},Uw.bind(null,d,o),null)),[l,f,i]}function Uw(i,r){i.action=r}function O_(i){var r=ut(),o=We;if(o!==null)return D_(r,o,i);ut(),r=r.memoizedState,o=ut();var l=o.queue.dispatch;return o.memoizedState=i,[r,l,!1]}function An(i,r,o,l){return i={tag:i,create:o,deps:l,inst:r,next:null},r=we.updateQueue,r===null&&(r=_l(),we.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=i.next=i:(l=o.next,o.next=i,i.next=l,r.lastEffect=i),i}function L_(){return ut().memoizedState}function yl(i,r,o,l){var d=Ut();we.flags|=i,d.memoizedState=An(1|r,{destroy:void 0},o,l===void 0?null:l)}function bl(i,r,o,l){var d=ut();l=l===void 0?null:l;var f=d.memoizedState.inst;We!==null&&l!==null&&sh(l,We.memoizedState.deps)?d.memoizedState=An(r,f,o,l):(we.flags|=i,d.memoizedState=An(1|r,f,o,l))}function z_(i,r){yl(8390656,8,i,r)}function mh(i,r){bl(2048,8,i,r)}function Iw(i){we.flags|=4;var r=we.updateQueue;if(r===null)r=_l(),we.updateQueue=r,r.events=[i];else{var o=r.events;o===null?r.events=[i]:o.push(i)}}function B_(i){var r=ut().memoizedState;return Iw({ref:r,nextImpl:i}),function(){if((Pe&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function j_(i,r){return bl(4,2,i,r)}function H_(i,r){return bl(4,4,i,r)}function P_(i,r){if(typeof r=="function"){i=i();var o=r(i);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function U_(i,r,o){o=o!=null?o.concat([i]):null,bl(4,4,P_.bind(null,r,i),o)}function ph(){}function I_(i,r){var o=ut();r=r===void 0?null:r;var l=o.memoizedState;return r!==null&&sh(r,l[1])?l[0]:(o.memoizedState=[i,r],i)}function F_(i,r){var o=ut();r=r===void 0?null:r;var l=o.memoizedState;if(r!==null&&sh(r,l[1]))return l[0];if(l=i(),Os){Br(!0);try{i()}finally{Br(!1)}}return o.memoizedState=[l,r],l}function _h(i,r,o){return o===void 0||(mr&1073741824)!==0&&(Ae&261930)===0?i.memoizedState=r:(i.memoizedState=o,i=Wg(),we.lanes|=i,Xr|=i,o)}function W_(i,r,o,l){return si(o,r)?o:Rn.current!==null?(i=_h(i,o,l),si(i,r)||(mt=!0),i):(mr&42)===0||(mr&1073741824)!==0&&(Ae&261930)===0?(mt=!0,i.memoizedState=o):(i=Wg(),we.lanes|=i,Xr|=i,r)}function q_(i,r,o,l,d){var f=L.p;L.p=f!==0&&8>f?f:8;var S=A.T,k={};A.T=k,yh(i,!1,r,o);try{var O=d(),U=A.S;if(U!==null&&U(k,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var Y=Bw(O,l);zo(i,r,Y,ui(i))}else zo(i,r,l,ui(i))}catch(Q){zo(i,r,{then:function(){},status:"rejected",reason:Q},ui())}finally{L.p=f,S!==null&&k.types!==null&&(S.types=k.types),A.T=S}}function Fw(){}function gh(i,r,o,l){if(i.tag!==5)throw Error(n(476));var d=$_(i).queue;q_(i,d,r,z,o===null?Fw:function(){return V_(i),o(l)})}function $_(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:z},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pr,lastRenderedState:o},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function V_(i){var r=$_(i);r.next===null&&(r=i.alternate.memoizedState),zo(i,r.next.queue,{},ui())}function vh(){return Dt(Qo)}function K_(){return ut().memoizedState}function Y_(){return ut().memoizedState}function Ww(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var o=ui();i=qr(o);var l=$r(r,i,o);l!==null&&(Jt(l,r,o),To(l,r,o)),r={cache:Ku()},i.payload=r;return}r=r.return}}function qw(i,r,o){var l=ui();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Sl(i)?X_(r,o):(o=Bu(i,r,o,l),o!==null&&(Jt(o,i,l),Z_(o,r,l)))}function G_(i,r,o){var l=ui();zo(i,r,o,l)}function zo(i,r,o,l){var d={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Sl(i))X_(r,d);else{var f=i.alternate;if(i.lanes===0&&(f===null||f.lanes===0)&&(f=r.lastRenderedReducer,f!==null))try{var S=r.lastRenderedState,k=f(S,o);if(d.hasEagerState=!0,d.eagerState=k,si(k,S))return tl(i,r,d,0),Ke===null&&el(),!1}catch{}finally{}if(o=Bu(i,r,d,l),o!==null)return Jt(o,i,l),Z_(o,r,l),!0}return!1}function yh(i,r,o,l){if(l={lane:2,revertLane:Zh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Sl(i)){if(r)throw Error(n(479))}else r=Bu(i,o,l,2),r!==null&&Jt(r,i,2)}function Sl(i){var r=i.alternate;return i===we||r!==null&&r===we}function X_(i,r){Nn=ml=!0;var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}function Z_(i,r,o){if((o&4194048)!==0){var l=r.lanes;l&=i.pendingLanes,o|=l,r.lanes=o,ip(i,o)}}var Bo={readContext:Dt,use:gl,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useLayoutEffect:nt,useInsertionEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useSyncExternalStore:nt,useId:nt,useHostTransitionStatus:nt,useFormState:nt,useActionState:nt,useOptimistic:nt,useMemoCache:nt,useCacheRefresh:nt};Bo.useEffectEvent=nt;var Q_={readContext:Dt,use:gl,useCallback:function(i,r){return Ut().memoizedState=[i,r===void 0?null:r],i},useContext:Dt,useEffect:z_,useImperativeHandle:function(i,r,o){o=o!=null?o.concat([i]):null,yl(4194308,4,P_.bind(null,r,i),o)},useLayoutEffect:function(i,r){return yl(4194308,4,i,r)},useInsertionEffect:function(i,r){yl(4,2,i,r)},useMemo:function(i,r){var o=Ut();r=r===void 0?null:r;var l=i();if(Os){Br(!0);try{i()}finally{Br(!1)}}return o.memoizedState=[l,r],l},useReducer:function(i,r,o){var l=Ut();if(o!==void 0){var d=o(r);if(Os){Br(!0);try{o(r)}finally{Br(!1)}}}else d=r;return l.memoizedState=l.baseState=d,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:d},l.queue=i,i=i.dispatch=qw.bind(null,we,i),[l.memoizedState,i]},useRef:function(i){var r=Ut();return i={current:i},r.memoizedState=i},useState:function(i){i=dh(i);var r=i.queue,o=G_.bind(null,we,r);return r.dispatch=o,[i.memoizedState,o]},useDebugValue:ph,useDeferredValue:function(i,r){var o=Ut();return _h(o,i,r)},useTransition:function(){var i=dh(!1);return i=q_.bind(null,we,i.queue,!0,!1),Ut().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,o){var l=we,d=Ut();if(Oe){if(o===void 0)throw Error(n(407));o=o()}else{if(o=r(),Ke===null)throw Error(n(349));(Ae&127)!==0||y_(l,r,o)}d.memoizedState=o;var f={value:o,getSnapshot:r};return d.queue=f,z_(S_.bind(null,l,f,i),[i]),l.flags|=2048,An(9,{destroy:void 0},b_.bind(null,l,f,o,r),null),o},useId:function(){var i=Ut(),r=Ke.identifierPrefix;if(Oe){var o=Vi,l=$i;o=(l&~(1<<32-ri(l)-1)).toString(32)+o,r="_"+r+"R_"+o,o=pl++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=jw++,r="_"+r+"r_"+o.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:vh,useFormState:T_,useActionState:T_,useOptimistic:function(i){var r=Ut();r.memoizedState=r.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=yh.bind(null,we,!0,o),o.dispatch=r,[i,r]},useMemoCache:ch,useCacheRefresh:function(){return Ut().memoizedState=Ww.bind(null,we)},useEffectEvent:function(i){var r=Ut(),o={impl:i};return r.memoizedState=o,function(){if((Pe&2)!==0)throw Error(n(440));return o.impl.apply(void 0,arguments)}}},bh={readContext:Dt,use:gl,useCallback:I_,useContext:Dt,useEffect:mh,useImperativeHandle:U_,useInsertionEffect:j_,useLayoutEffect:H_,useMemo:F_,useReducer:vl,useRef:L_,useState:function(){return vl(pr)},useDebugValue:ph,useDeferredValue:function(i,r){var o=ut();return W_(o,We.memoizedState,i,r)},useTransition:function(){var i=vl(pr)[0],r=ut().memoizedState;return[typeof i=="boolean"?i:Lo(i),r]},useSyncExternalStore:v_,useId:K_,useHostTransitionStatus:vh,useFormState:A_,useActionState:A_,useOptimistic:function(i,r){var o=ut();return C_(o,We,i,r)},useMemoCache:ch,useCacheRefresh:Y_};bh.useEffectEvent=B_;var J_={readContext:Dt,use:gl,useCallback:I_,useContext:Dt,useEffect:mh,useImperativeHandle:U_,useInsertionEffect:j_,useLayoutEffect:H_,useMemo:F_,useReducer:hh,useRef:L_,useState:function(){return hh(pr)},useDebugValue:ph,useDeferredValue:function(i,r){var o=ut();return We===null?_h(o,i,r):W_(o,We.memoizedState,i,r)},useTransition:function(){var i=hh(pr)[0],r=ut().memoizedState;return[typeof i=="boolean"?i:Lo(i),r]},useSyncExternalStore:v_,useId:K_,useHostTransitionStatus:vh,useFormState:O_,useActionState:O_,useOptimistic:function(i,r){var o=ut();return We!==null?C_(o,We,i,r):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:ch,useCacheRefresh:Y_};J_.useEffectEvent=B_;function Sh(i,r,o,l){r=i.memoizedState,o=o(l,r),o=o==null?r:v({},r,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var xh={enqueueSetState:function(i,r,o){i=i._reactInternals;var l=ui(),d=qr(l);d.payload=r,o!=null&&(d.callback=o),r=$r(i,d,l),r!==null&&(Jt(r,i,l),To(r,i,l))},enqueueReplaceState:function(i,r,o){i=i._reactInternals;var l=ui(),d=qr(l);d.tag=1,d.payload=r,o!=null&&(d.callback=o),r=$r(i,d,l),r!==null&&(Jt(r,i,l),To(r,i,l))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var o=ui(),l=qr(o);l.tag=2,r!=null&&(l.callback=r),r=$r(i,l,o),r!==null&&(Jt(r,i,o),To(r,i,o))}};function eg(i,r,o,l,d,f,S){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(l,f,S):r.prototype&&r.prototype.isPureReactComponent?!xo(o,l)||!xo(d,f):!0}function tg(i,r,o,l){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,l),r.state!==i&&xh.enqueueReplaceState(r,r.state,null)}function Ls(i,r){var o=r;if("ref"in r){o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}if(i=i.defaultProps){o===r&&(o=v({},o));for(var d in i)o[d]===void 0&&(o[d]=i[d])}return o}function ig(i){Ja(i)}function rg(i){console.error(i)}function sg(i){Ja(i)}function xl(i,r){try{var o=i.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function ng(i,r,o){try{var l=i.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function wh(i,r,o){return o=qr(o),o.tag=3,o.payload={element:null},o.callback=function(){xl(i,r)},o}function og(i){return i=qr(i),i.tag=3,i}function ag(i,r,o,l){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var f=l.value;i.payload=function(){return d(f)},i.callback=function(){ng(r,o,l)}}var S=o.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(i.callback=function(){ng(r,o,l),typeof d!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var k=l.stack;this.componentDidCatch(l.value,{componentStack:k!==null?k:""})})}function $w(i,r,o,l,d){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=o.alternate,r!==null&&wn(r,o,d,!0),o=oi.current,o!==null){switch(o.tag){case 31:case 13:return Ei===null?Ll():o.alternate===null&&ot===0&&(ot=3),o.flags&=-257,o.flags|=65536,o.lanes=d,l===cl?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([l]):r.add(l),Yh(i,l,d)),!1;case 22:return o.flags|=65536,l===cl?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([l]):o.add(l)),Yh(i,l,d)),!1}throw Error(n(435,o.tag))}return Yh(i,l,d),Ll(),!1}if(Oe)return r=oi.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=d,l!==Fu&&(i=Error(n(422),{cause:l}),Eo(Si(i,o)))):(l!==Fu&&(r=Error(n(423),{cause:l}),Eo(Si(r,o))),i=i.current.alternate,i.flags|=65536,d&=-d,i.lanes|=d,l=Si(l,o),d=wh(i.stateNode,l,d),Ju(i,d),ot!==4&&(ot=2)),!1;var f=Error(n(520),{cause:l});if(f=Si(f,o),qo===null?qo=[f]:qo.push(f),ot!==4&&(ot=2),r===null)return!0;l=Si(l,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,i=d&-d,o.lanes|=i,i=wh(o.stateNode,l,i),Ju(o,i),!1;case 1:if(r=o.type,f=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Zr===null||!Zr.has(f))))return o.flags|=65536,d&=-d,o.lanes|=d,d=og(d),ag(d,i,o,l),Ju(o,d),!1}o=o.return}while(o!==null);return!1}var Ch=Error(n(461)),mt=!1;function Ot(i,r,o,l){r.child=i===null?h_(r,null,o,l):Ds(r,i.child,o,l)}function lg(i,r,o,l,d){o=o.render;var f=r.ref;if("ref"in l){var S={};for(var k in l)k!=="ref"&&(S[k]=l[k])}else S=l;return Rs(r),l=nh(i,r,o,S,f,d),k=oh(),i!==null&&!mt?(ah(i,r,d),_r(i,r,d)):(Oe&&k&&Uu(r),r.flags|=1,Ot(i,r,l,d),r.child)}function cg(i,r,o,l,d){if(i===null){var f=o.type;return typeof f=="function"&&!ju(f)&&f.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=f,ug(i,r,f,l,d)):(i=rl(o.type,null,l,r,r.mode,d),i.ref=r.ref,i.return=r,r.child=i)}if(f=i.child,!Dh(i,d)){var S=f.memoizedProps;if(o=o.compare,o=o!==null?o:xo,o(S,l)&&i.ref===r.ref)return _r(i,r,d)}return r.flags|=1,i=ur(f,l),i.ref=r.ref,i.return=r,r.child=i}function ug(i,r,o,l,d){if(i!==null){var f=i.memoizedProps;if(xo(f,l)&&i.ref===r.ref)if(mt=!1,r.pendingProps=l=f,Dh(i,d))(i.flags&131072)!==0&&(mt=!0);else return r.lanes=i.lanes,_r(i,r,d)}return Eh(i,r,o,l,d)}function hg(i,r,o,l){var d=l.children,f=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(f=f!==null?f.baseLanes|o:o,i!==null){for(l=r.child=i.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~f}else l=0,r.child=null;return dg(i,r,f,o,l)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&al(r,f!==null?f.cachePool:null),f!==null?m_(r,f):th(),p_(r);else return l=r.lanes=536870912,dg(i,r,f!==null?f.baseLanes|o:o,o,l)}else f!==null?(al(r,f.cachePool),m_(r,f),Kr(),r.memoizedState=null):(i!==null&&al(r,null),th(),Kr());return Ot(i,r,d,o),r.child}function jo(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function dg(i,r,o,l,d){var f=Gu();return f=f===null?null:{parent:dt._currentValue,pool:f},r.memoizedState={baseLanes:o,cachePool:f},i!==null&&al(r,null),th(),p_(r),i!==null&&wn(i,r,l,!0),r.childLanes=d,null}function wl(i,r){return r=El({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function fg(i,r,o){return Ds(r,i.child,null,o),i=wl(r,r.pendingProps),i.flags|=2,ai(r),r.memoizedState=null,i}function Vw(i,r,o){var l=r.pendingProps,d=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(Oe){if(l.mode==="hidden")return i=wl(r,l),r.lanes=536870912,jo(null,i);if(rh(r),(i=Qe)?(i=Ev(i,Ci),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:Pr!==null?{id:$i,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},o=Xp(i),o.return=r,r.child=o,At=r,Qe=null)):i=null,i===null)throw Ir(r);return r.lanes=536870912,null}return wl(r,l)}var f=i.memoizedState;if(f!==null){var S=f.dehydrated;if(rh(r),d)if(r.flags&256)r.flags&=-257,r=fg(i,r,o);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(n(558));else if(mt||wn(i,r,o,!1),d=(o&i.childLanes)!==0,mt||d){if(l=Ke,l!==null&&(S=rp(l,o),S!==0&&S!==f.retryLane))throw f.retryLane=S,Cs(i,S),Jt(l,i,S),Ch;Ll(),r=fg(i,r,o)}else i=f.treeContext,Qe=ki(S.nextSibling),At=r,Oe=!0,Ur=null,Ci=!1,i!==null&&Jp(r,i),r=wl(r,l),r.flags|=4096;return r}return i=ur(i.child,{mode:l.mode,children:l.children}),i.ref=r.ref,r.child=i,i.return=r,i}function Cl(i,r){var o=r.ref;if(o===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(n(284));(i===null||i.ref!==o)&&(r.flags|=4194816)}}function Eh(i,r,o,l,d){return Rs(r),o=nh(i,r,o,l,void 0,d),l=oh(),i!==null&&!mt?(ah(i,r,d),_r(i,r,d)):(Oe&&l&&Uu(r),r.flags|=1,Ot(i,r,o,d),r.child)}function mg(i,r,o,l,d,f){return Rs(r),r.updateQueue=null,o=g_(r,l,o,d),__(i),l=oh(),i!==null&&!mt?(ah(i,r,f),_r(i,r,f)):(Oe&&l&&Uu(r),r.flags|=1,Ot(i,r,o,f),r.child)}function pg(i,r,o,l,d){if(Rs(r),r.stateNode===null){var f=yn,S=o.contextType;typeof S=="object"&&S!==null&&(f=Dt(S)),f=new o(l,f),r.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=xh,r.stateNode=f,f._reactInternals=r,f=r.stateNode,f.props=l,f.state=r.memoizedState,f.refs={},Zu(r),S=o.contextType,f.context=typeof S=="object"&&S!==null?Dt(S):yn,f.state=r.memoizedState,S=o.getDerivedStateFromProps,typeof S=="function"&&(Sh(r,o,S,l),f.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(S=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),S!==f.state&&xh.enqueueReplaceState(f,f.state,null),Do(r,l,f,d),Ao(),f.state=r.memoizedState),typeof f.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(i===null){f=r.stateNode;var k=r.memoizedProps,O=Ls(o,k);f.props=O;var U=f.context,Y=o.contextType;S=yn,typeof Y=="object"&&Y!==null&&(S=Dt(Y));var Q=o.getDerivedStateFromProps;Y=typeof Q=="function"||typeof f.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,Y||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(k||U!==S)&&tg(r,f,l,S),Wr=!1;var F=r.memoizedState;f.state=F,Do(r,l,f,d),Ao(),U=r.memoizedState,k||F!==U||Wr?(typeof Q=="function"&&(Sh(r,o,Q,l),U=r.memoizedState),(O=Wr||eg(r,o,O,l,F,U,S))?(Y||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(r.flags|=4194308)):(typeof f.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=U),f.props=l,f.state=U,f.context=S,l=O):(typeof f.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{f=r.stateNode,Qu(i,r),S=r.memoizedProps,Y=Ls(o,S),f.props=Y,Q=r.pendingProps,F=f.context,U=o.contextType,O=yn,typeof U=="object"&&U!==null&&(O=Dt(U)),k=o.getDerivedStateFromProps,(U=typeof k=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S!==Q||F!==O)&&tg(r,f,l,O),Wr=!1,F=r.memoizedState,f.state=F,Do(r,l,f,d),Ao();var $=r.memoizedState;S!==Q||F!==$||Wr||i!==null&&i.dependencies!==null&&nl(i.dependencies)?(typeof k=="function"&&(Sh(r,o,k,l),$=r.memoizedState),(Y=Wr||eg(r,o,Y,l,F,$,O)||i!==null&&i.dependencies!==null&&nl(i.dependencies))?(U||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(l,$,O),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(l,$,O)),typeof f.componentDidUpdate=="function"&&(r.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof f.componentDidUpdate!="function"||S===i.memoizedProps&&F===i.memoizedState||(r.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&F===i.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=$),f.props=l,f.state=$,f.context=O,l=Y):(typeof f.componentDidUpdate!="function"||S===i.memoizedProps&&F===i.memoizedState||(r.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&F===i.memoizedState||(r.flags|=1024),l=!1)}return f=l,Cl(i,r),l=(r.flags&128)!==0,f||l?(f=r.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:f.render(),r.flags|=1,i!==null&&l?(r.child=Ds(r,i.child,null,d),r.child=Ds(r,null,o,d)):Ot(i,r,o,d),r.memoizedState=f.state,i=r.child):i=_r(i,r,d),i}function _g(i,r,o,l){return ks(),r.flags|=256,Ot(i,r,o,l),r.child}var kh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Mh(i){return{baseLanes:i,cachePool:n_()}}function Rh(i,r,o){return i=i!==null?i.childLanes&~o:0,r&&(i|=ci),i}function gg(i,r,o){var l=r.pendingProps,d=!1,f=(r.flags&128)!==0,S;if((S=f)||(S=i!==null&&i.memoizedState===null?!1:(ct.current&2)!==0),S&&(d=!0,r.flags&=-129),S=(r.flags&32)!==0,r.flags&=-33,i===null){if(Oe){if(d?Vr(r):Kr(),(i=Qe)?(i=Ev(i,Ci),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:Pr!==null?{id:$i,overflow:Vi}:null,retryLane:536870912,hydrationErrors:null},o=Xp(i),o.return=r,r.child=o,At=r,Qe=null)):i=null,i===null)throw Ir(r);return ud(i)?r.lanes=32:r.lanes=536870912,null}var k=l.children;return l=l.fallback,d?(Kr(),d=r.mode,k=El({mode:"hidden",children:k},d),l=Es(l,d,o,null),k.return=r,l.return=r,k.sibling=l,r.child=k,l=r.child,l.memoizedState=Mh(o),l.childLanes=Rh(i,S,o),r.memoizedState=kh,jo(null,l)):(Vr(r),Nh(r,k))}var O=i.memoizedState;if(O!==null&&(k=O.dehydrated,k!==null)){if(f)r.flags&256?(Vr(r),r.flags&=-257,r=Th(i,r,o)):r.memoizedState!==null?(Kr(),r.child=i.child,r.flags|=128,r=null):(Kr(),k=l.fallback,d=r.mode,l=El({mode:"visible",children:l.children},d),k=Es(k,d,o,null),k.flags|=2,l.return=r,k.return=r,l.sibling=k,r.child=l,Ds(r,i.child,null,o),l=r.child,l.memoizedState=Mh(o),l.childLanes=Rh(i,S,o),r.memoizedState=kh,r=jo(null,l));else if(Vr(r),ud(k)){if(S=k.nextSibling&&k.nextSibling.dataset,S)var U=S.dgst;S=U,l=Error(n(419)),l.stack="",l.digest=S,Eo({value:l,source:null,stack:null}),r=Th(i,r,o)}else if(mt||wn(i,r,o,!1),S=(o&i.childLanes)!==0,mt||S){if(S=Ke,S!==null&&(l=rp(S,o),l!==0&&l!==O.retryLane))throw O.retryLane=l,Cs(i,l),Jt(S,i,l),Ch;cd(k)||Ll(),r=Th(i,r,o)}else cd(k)?(r.flags|=192,r.child=i.child,r=null):(i=O.treeContext,Qe=ki(k.nextSibling),At=r,Oe=!0,Ur=null,Ci=!1,i!==null&&Jp(r,i),r=Nh(r,l.children),r.flags|=4096);return r}return d?(Kr(),k=l.fallback,d=r.mode,O=i.child,U=O.sibling,l=ur(O,{mode:"hidden",children:l.children}),l.subtreeFlags=O.subtreeFlags&65011712,U!==null?k=ur(U,k):(k=Es(k,d,o,null),k.flags|=2),k.return=r,l.return=r,l.sibling=k,r.child=l,jo(null,l),l=r.child,k=i.child.memoizedState,k===null?k=Mh(o):(d=k.cachePool,d!==null?(O=dt._currentValue,d=d.parent!==O?{parent:O,pool:O}:d):d=n_(),k={baseLanes:k.baseLanes|o,cachePool:d}),l.memoizedState=k,l.childLanes=Rh(i,S,o),r.memoizedState=kh,jo(i.child,l)):(Vr(r),o=i.child,i=o.sibling,o=ur(o,{mode:"visible",children:l.children}),o.return=r,o.sibling=null,i!==null&&(S=r.deletions,S===null?(r.deletions=[i],r.flags|=16):S.push(i)),r.child=o,r.memoizedState=null,o)}function Nh(i,r){return r=El({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function El(i,r){return i=ni(22,i,null,r),i.lanes=0,i}function Th(i,r,o){return Ds(r,i.child,null,o),i=Nh(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function vg(i,r,o){i.lanes|=r;var l=i.alternate;l!==null&&(l.lanes|=r),$u(i.return,r,o)}function Ah(i,r,o,l,d,f){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:d,treeForkCount:f}:(S.isBackwards=r,S.rendering=null,S.renderingStartTime=0,S.last=l,S.tail=o,S.tailMode=d,S.treeForkCount=f)}function yg(i,r,o){var l=r.pendingProps,d=l.revealOrder,f=l.tail;l=l.children;var S=ct.current,k=(S&2)!==0;if(k?(S=S&1|2,r.flags|=128):S&=1,ae(ct,S),Ot(i,r,l,o),l=Oe?Co:0,!k&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&vg(i,o,r);else if(i.tag===19)vg(i,o,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(d){case"forwards":for(o=r.child,d=null;o!==null;)i=o.alternate,i!==null&&fl(i)===null&&(d=o),o=o.sibling;o=d,o===null?(d=r.child,r.child=null):(d=o.sibling,o.sibling=null),Ah(r,!1,d,o,f,l);break;case"backwards":case"unstable_legacy-backwards":for(o=null,d=r.child,r.child=null;d!==null;){if(i=d.alternate,i!==null&&fl(i)===null){r.child=d;break}i=d.sibling,d.sibling=o,o=d,d=i}Ah(r,!0,o,null,f,l);break;case"together":Ah(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function _r(i,r,o){if(i!==null&&(r.dependencies=i.dependencies),Xr|=r.lanes,(o&r.childLanes)===0)if(i!==null){if(wn(i,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,o=ur(i,i.pendingProps),r.child=o,o.return=r;i.sibling!==null;)i=i.sibling,o=o.sibling=ur(i,i.pendingProps),o.return=r;o.sibling=null}return r.child}function Dh(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&nl(i)))}function Kw(i,r,o){switch(r.tag){case 3:Ue(r,r.stateNode.containerInfo),Fr(r,dt,i.memoizedState.cache),ks();break;case 27:case 5:ce(r);break;case 4:Ue(r,r.stateNode.containerInfo);break;case 10:Fr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,rh(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated!==null?(Vr(r),r.flags|=128,null):(o&r.child.childLanes)!==0?gg(i,r,o):(Vr(r),i=_r(i,r,o),i!==null?i.sibling:null);Vr(r);break;case 19:var d=(i.flags&128)!==0;if(l=(o&r.childLanes)!==0,l||(wn(i,r,o,!1),l=(o&r.childLanes)!==0),d){if(l)return yg(i,r,o);r.flags|=128}if(d=r.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ae(ct,ct.current),l)break;return null;case 22:return r.lanes=0,hg(i,r,o,r.pendingProps);case 24:Fr(r,dt,i.memoizedState.cache)}return _r(i,r,o)}function bg(i,r,o){if(i!==null)if(i.memoizedProps!==r.pendingProps)mt=!0;else{if(!Dh(i,o)&&(r.flags&128)===0)return mt=!1,Kw(i,r,o);mt=(i.flags&131072)!==0}else mt=!1,Oe&&(r.flags&1048576)!==0&&Qp(r,Co,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(i=Ts(r.elementType),r.type=i,typeof i=="function")ju(i)?(l=Ls(i,l),r.tag=1,r=pg(null,r,i,l,o)):(r.tag=0,r=Eh(null,r,i,l,o));else{if(i!=null){var d=i.$$typeof;if(d===N){r.tag=11,r=lg(null,r,i,l,o);break e}else if(d===q){r.tag=14,r=cg(null,r,i,l,o);break e}}throw r=V(i)||i,Error(n(306,r,""))}}return r;case 0:return Eh(i,r,r.type,r.pendingProps,o);case 1:return l=r.type,d=Ls(l,r.pendingProps),pg(i,r,l,d,o);case 3:e:{if(Ue(r,r.stateNode.containerInfo),i===null)throw Error(n(387));l=r.pendingProps;var f=r.memoizedState;d=f.element,Qu(i,r),Do(r,l,null,o);var S=r.memoizedState;if(l=S.cache,Fr(r,dt,l),l!==f.cache&&Vu(r,[dt],o,!0),Ao(),l=S.element,f.isDehydrated)if(f={element:l,isDehydrated:!1,cache:S.cache},r.updateQueue.baseState=f,r.memoizedState=f,r.flags&256){r=_g(i,r,l,o);break e}else if(l!==d){d=Si(Error(n(424)),r),Eo(d),r=_g(i,r,l,o);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Qe=ki(i.firstChild),At=r,Oe=!0,Ur=null,Ci=!0,o=h_(r,null,l,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(ks(),l===d){r=_r(i,r,o);break e}Ot(i,r,l,o)}r=r.child}return r;case 26:return Cl(i,r),i===null?(o=Av(r.type,null,r.pendingProps,null))?r.memoizedState=o:Oe||(o=r.type,i=r.pendingProps,l=Il(ve.current).createElement(o),l[Tt]=r,l[Kt]=i,Lt(l,o,i),xt(l),r.stateNode=l):r.memoizedState=Av(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return ce(r),i===null&&Oe&&(l=r.stateNode=Rv(r.type,r.pendingProps,ve.current),At=r,Ci=!0,d=Qe,ts(r.type)?(hd=d,Qe=ki(l.firstChild)):Qe=d),Ot(i,r,r.pendingProps.children,o),Cl(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&Oe&&((d=l=Qe)&&(l=wC(l,r.type,r.pendingProps,Ci),l!==null?(r.stateNode=l,At=r,Qe=ki(l.firstChild),Ci=!1,d=!0):d=!1),d||Ir(r)),ce(r),d=r.type,f=r.pendingProps,S=i!==null?i.memoizedProps:null,l=f.children,od(d,f)?l=null:S!==null&&od(d,S)&&(r.flags|=32),r.memoizedState!==null&&(d=nh(i,r,Hw,null,null,o),Qo._currentValue=d),Cl(i,r),Ot(i,r,l,o),r.child;case 6:return i===null&&Oe&&((i=o=Qe)&&(o=CC(o,r.pendingProps,Ci),o!==null?(r.stateNode=o,At=r,Qe=null,i=!0):i=!1),i||Ir(r)),null;case 13:return gg(i,r,o);case 4:return Ue(r,r.stateNode.containerInfo),l=r.pendingProps,i===null?r.child=Ds(r,null,l,o):Ot(i,r,l,o),r.child;case 11:return lg(i,r,r.type,r.pendingProps,o);case 7:return Ot(i,r,r.pendingProps,o),r.child;case 8:return Ot(i,r,r.pendingProps.children,o),r.child;case 12:return Ot(i,r,r.pendingProps.children,o),r.child;case 10:return l=r.pendingProps,Fr(r,r.type,l.value),Ot(i,r,l.children,o),r.child;case 9:return d=r.type._context,l=r.pendingProps.children,Rs(r),d=Dt(d),l=l(d),r.flags|=1,Ot(i,r,l,o),r.child;case 14:return cg(i,r,r.type,r.pendingProps,o);case 15:return ug(i,r,r.type,r.pendingProps,o);case 19:return yg(i,r,o);case 31:return Vw(i,r,o);case 22:return hg(i,r,o,r.pendingProps);case 24:return Rs(r),l=Dt(dt),i===null?(d=Gu(),d===null&&(d=Ke,f=Ku(),d.pooledCache=f,f.refCount++,f!==null&&(d.pooledCacheLanes|=o),d=f),r.memoizedState={parent:l,cache:d},Zu(r),Fr(r,dt,d)):((i.lanes&o)!==0&&(Qu(i,r),Do(r,null,null,o),Ao()),d=i.memoizedState,f=r.memoizedState,d.parent!==l?(d={parent:l,cache:l},r.memoizedState=d,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=d),Fr(r,dt,l)):(l=f.cache,Fr(r,dt,l),l!==d.cache&&Vu(r,[dt],o,!0))),Ot(i,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function gr(i){i.flags|=4}function Oh(i,r,o,l,d){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(d&335544128)===d)if(i.stateNode.complete)i.flags|=8192;else if(Kg())i.flags|=8192;else throw As=cl,Xu}else i.flags&=-16777217}function Sg(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Bv(r))if(Kg())i.flags|=8192;else throw As=cl,Xu}function kl(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?ep():536870912,i.lanes|=r,zn|=r)}function Ho(i,r){if(!Oe)switch(i.tailMode){case"hidden":r=i.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:l.sibling=null}}function Je(i){var r=i.alternate!==null&&i.alternate.child===i.child,o=0,l=0;if(r)for(var d=i.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=i,d=d.sibling;else for(d=i.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=i,d=d.sibling;return i.subtreeFlags|=l,i.childLanes=o,r}function Yw(i,r,o){var l=r.pendingProps;switch(Iu(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(r),null;case 1:return Je(r),null;case 3:return o=r.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),fr(dt),xe(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(xn(r)?gr(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Wu())),Je(r),null;case 26:var d=r.type,f=r.memoizedState;return i===null?(gr(r),f!==null?(Je(r),Sg(r,f)):(Je(r),Oh(r,d,null,l,o))):f?f!==i.memoizedState?(gr(r),Je(r),Sg(r,f)):(Je(r),r.flags&=-16777217):(i=i.memoizedProps,i!==l&&gr(r),Je(r),Oh(r,d,i,l,o)),null;case 27:if(Te(r),o=ve.current,d=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==l&&gr(r);else{if(!l){if(r.stateNode===null)throw Error(n(166));return Je(r),null}i=ie.current,xn(r)?e_(r):(i=Rv(d,l,o),r.stateNode=i,gr(r))}return Je(r),null;case 5:if(Te(r),d=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==l&&gr(r);else{if(!l){if(r.stateNode===null)throw Error(n(166));return Je(r),null}if(f=ie.current,xn(r))e_(r);else{var S=Il(ve.current);switch(f){case 1:f=S.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:f=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":f=S.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":f=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":f=S.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof l.is=="string"?S.createElement("select",{is:l.is}):S.createElement("select"),l.multiple?f.multiple=!0:l.size&&(f.size=l.size);break;default:f=typeof l.is=="string"?S.createElement(d,{is:l.is}):S.createElement(d)}}f[Tt]=r,f[Kt]=l;e:for(S=r.child;S!==null;){if(S.tag===5||S.tag===6)f.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===r)break e;for(;S.sibling===null;){if(S.return===null||S.return===r)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}r.stateNode=f;e:switch(Lt(f,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&gr(r)}}return Je(r),Oh(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,o),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==l&&gr(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(n(166));if(i=ve.current,xn(r)){if(i=r.stateNode,o=r.memoizedProps,l=null,d=At,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}i[Tt]=r,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||gv(i.nodeValue,o)),i||Ir(r,!0)}else i=Il(i).createTextNode(l),i[Tt]=r,r.stateNode=i}return Je(r),null;case 31:if(o=r.memoizedState,i===null||i.memoizedState!==null){if(l=xn(r),o!==null){if(i===null){if(!l)throw Error(n(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(557));i[Tt]=r}else ks(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Je(r),i=!1}else o=Wu(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return r.flags&256?(ai(r),r):(ai(r),null);if((r.flags&128)!==0)throw Error(n(558))}return Je(r),null;case 13:if(l=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(d=xn(r),l!==null&&l.dehydrated!==null){if(i===null){if(!d)throw Error(n(318));if(d=r.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(n(317));d[Tt]=r}else ks(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Je(r),d=!1}else d=Wu(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),d=!0;if(!d)return r.flags&256?(ai(r),r):(ai(r),null)}return ai(r),(r.flags&128)!==0?(r.lanes=o,r):(o=l!==null,i=i!==null&&i.memoizedState!==null,o&&(l=r.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==d&&(l.flags|=2048)),o!==i&&o&&(r.child.flags|=8192),kl(r,r.updateQueue),Je(r),null);case 4:return xe(),i===null&&td(r.stateNode.containerInfo),Je(r),null;case 10:return fr(r.type),Je(r),null;case 19:if(ne(ct),l=r.memoizedState,l===null)return Je(r),null;if(d=(r.flags&128)!==0,f=l.rendering,f===null)if(d)Ho(l,!1);else{if(ot!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(f=fl(i),f!==null){for(r.flags|=128,Ho(l,!1),i=f.updateQueue,r.updateQueue=i,kl(r,i),r.subtreeFlags=0,i=o,o=r.child;o!==null;)Gp(o,i),o=o.sibling;return ae(ct,ct.current&1|2),Oe&&hr(r,l.treeForkCount),r.child}i=i.sibling}l.tail!==null&&Pt()>Al&&(r.flags|=128,d=!0,Ho(l,!1),r.lanes=4194304)}else{if(!d)if(i=fl(f),i!==null){if(r.flags|=128,d=!0,i=i.updateQueue,r.updateQueue=i,kl(r,i),Ho(l,!0),l.tail===null&&l.tailMode==="hidden"&&!f.alternate&&!Oe)return Je(r),null}else 2*Pt()-l.renderingStartTime>Al&&o!==536870912&&(r.flags|=128,d=!0,Ho(l,!1),r.lanes=4194304);l.isBackwards?(f.sibling=r.child,r.child=f):(i=l.last,i!==null?i.sibling=f:r.child=f,l.last=f)}return l.tail!==null?(i=l.tail,l.rendering=i,l.tail=i.sibling,l.renderingStartTime=Pt(),i.sibling=null,o=ct.current,ae(ct,d?o&1|2:o&1),Oe&&hr(r,l.treeForkCount),i):(Je(r),null);case 22:case 23:return ai(r),ih(),l=r.memoizedState!==null,i!==null?i.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(o&536870912)!==0&&(r.flags&128)===0&&(Je(r),r.subtreeFlags&6&&(r.flags|=8192)):Je(r),o=r.updateQueue,o!==null&&kl(r,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==o&&(r.flags|=2048),i!==null&&ne(Ns),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),fr(dt),Je(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function Gw(i,r){switch(Iu(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return fr(dt),xe(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return Te(r),null;case 31:if(r.memoizedState!==null){if(ai(r),r.alternate===null)throw Error(n(340));ks()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(ai(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));ks()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return ne(ct),null;case 4:return xe(),null;case 10:return fr(r.type),null;case 22:case 23:return ai(r),ih(),i!==null&&ne(Ns),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return fr(dt),null;case 25:return null;default:return null}}function xg(i,r){switch(Iu(r),r.tag){case 3:fr(dt),xe();break;case 26:case 27:case 5:Te(r);break;case 4:xe();break;case 31:r.memoizedState!==null&&ai(r);break;case 13:ai(r);break;case 19:ne(ct);break;case 10:fr(r.type);break;case 22:case 23:ai(r),ih(),i!==null&&ne(Ns);break;case 24:fr(dt)}}function Po(i,r){try{var o=r.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var d=l.next;o=d;do{if((o.tag&i)===i){l=void 0;var f=o.create,S=o.inst;l=f(),S.destroy=l}o=o.next}while(o!==d)}}catch(k){Fe(r,r.return,k)}}function Yr(i,r,o){try{var l=r.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var f=d.next;l=f;do{if((l.tag&i)===i){var S=l.inst,k=S.destroy;if(k!==void 0){S.destroy=void 0,d=r;var O=o,U=k;try{U()}catch(Y){Fe(d,O,Y)}}}l=l.next}while(l!==f)}}catch(Y){Fe(r,r.return,Y)}}function wg(i){var r=i.updateQueue;if(r!==null){var o=i.stateNode;try{f_(r,o)}catch(l){Fe(i,i.return,l)}}}function Cg(i,r,o){o.props=Ls(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Fe(i,r,l)}}function Uo(i,r){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var l=i.stateNode;break;case 30:l=i.stateNode;break;default:l=i.stateNode}typeof o=="function"?i.refCleanup=o(l):o.current=l}}catch(d){Fe(i,r,d)}}function Ki(i,r){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(d){Fe(i,r,d)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){Fe(i,r,d)}else o.current=null}function Eg(i){var r=i.type,o=i.memoizedProps,l=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(d){Fe(i,i.return,d)}}function Lh(i,r,o){try{var l=i.stateNode;gC(l,i.type,o,r),l[Kt]=r}catch(d){Fe(i,i.return,d)}}function kg(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ts(i.type)||i.tag===4}function zh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||kg(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ts(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Bh(i,r,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(i),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=lr));else if(l!==4&&(l===27&&ts(i.type)&&(o=i.stateNode,r=null),i=i.child,i!==null))for(Bh(i,r,o),i=i.sibling;i!==null;)Bh(i,r,o),i=i.sibling}function Ml(i,r,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,r?o.insertBefore(i,r):o.appendChild(i);else if(l!==4&&(l===27&&ts(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(Ml(i,r,o),i=i.sibling;i!==null;)Ml(i,r,o),i=i.sibling}function Mg(i){var r=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,d=r.attributes;d.length;)r.removeAttributeNode(d[0]);Lt(r,l,o),r[Tt]=i,r[Kt]=o}catch(f){Fe(i,i.return,f)}}var vr=!1,pt=!1,jh=!1,Rg=typeof WeakSet=="function"?WeakSet:Set,wt=null;function Xw(i,r){if(i=i.containerInfo,sd=Yl,i=Up(i),Tu(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var d=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{o.nodeType,f.nodeType}catch{o=null;break e}var S=0,k=-1,O=-1,U=0,Y=0,Q=i,F=null;t:for(;;){for(var $;Q!==o||d!==0&&Q.nodeType!==3||(k=S+d),Q!==f||l!==0&&Q.nodeType!==3||(O=S+l),Q.nodeType===3&&(S+=Q.nodeValue.length),($=Q.firstChild)!==null;)F=Q,Q=$;for(;;){if(Q===i)break t;if(F===o&&++U===d&&(k=S),F===f&&++Y===l&&(O=S),($=Q.nextSibling)!==null)break;Q=F,F=Q.parentNode}Q=$}o=k===-1||O===-1?null:{start:k,end:O}}else o=null}o=o||{start:0,end:0}}else o=null;for(nd={focusedElem:i,selectionRange:o},Yl=!1,wt=r;wt!==null;)if(r=wt,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,wt=i;else for(;wt!==null;){switch(r=wt,f=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)d=i[o],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&f!==null){i=void 0,o=r,d=f.memoizedProps,f=f.memoizedState,l=o.stateNode;try{var ue=Ls(o.type,d);i=l.getSnapshotBeforeUpdate(ue,f),l.__reactInternalSnapshotBeforeUpdate=i}catch(ge){Fe(o,o.return,ge)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,o=i.nodeType,o===9)ld(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":ld(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(n(163))}if(i=r.sibling,i!==null){i.return=r.return,wt=i;break}wt=r.return}}function Ng(i,r,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:br(i,o),l&4&&Po(5,o);break;case 1:if(br(i,o),l&4)if(i=o.stateNode,r===null)try{i.componentDidMount()}catch(S){Fe(o,o.return,S)}else{var d=Ls(o.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(d,r,i.__reactInternalSnapshotBeforeUpdate)}catch(S){Fe(o,o.return,S)}}l&64&&wg(o),l&512&&Uo(o,o.return);break;case 3:if(br(i,o),l&64&&(i=o.updateQueue,i!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{f_(i,r)}catch(S){Fe(o,o.return,S)}}break;case 27:r===null&&l&4&&Mg(o);case 26:case 5:br(i,o),r===null&&l&4&&Eg(o),l&512&&Uo(o,o.return);break;case 12:br(i,o);break;case 31:br(i,o),l&4&&Dg(i,o);break;case 13:br(i,o),l&4&&Og(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=nC.bind(null,o),EC(i,o))));break;case 22:if(l=o.memoizedState!==null||vr,!l){r=r!==null&&r.memoizedState!==null||pt,d=vr;var f=pt;vr=l,(pt=r)&&!f?Sr(i,o,(o.subtreeFlags&8772)!==0):br(i,o),vr=d,pt=f}break;case 30:break;default:br(i,o)}}function Tg(i){var r=i.alternate;r!==null&&(i.alternate=null,Tg(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&fu(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var tt=null,Gt=!1;function yr(i,r,o){for(o=o.child;o!==null;)Ag(i,r,o),o=o.sibling}function Ag(i,r,o){if(ii&&typeof ii.onCommitFiberUnmount=="function")try{ii.onCommitFiberUnmount(co,o)}catch{}switch(o.tag){case 26:pt||Ki(o,r),yr(i,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:pt||Ki(o,r);var l=tt,d=Gt;ts(o.type)&&(tt=o.stateNode,Gt=!1),yr(i,r,o),Go(o.stateNode),tt=l,Gt=d;break;case 5:pt||Ki(o,r);case 6:if(l=tt,d=Gt,tt=null,yr(i,r,o),tt=l,Gt=d,tt!==null)if(Gt)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(o.stateNode)}catch(f){Fe(o,r,f)}else try{tt.removeChild(o.stateNode)}catch(f){Fe(o,r,f)}break;case 18:tt!==null&&(Gt?(i=tt,wv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),Wn(i)):wv(tt,o.stateNode));break;case 4:l=tt,d=Gt,tt=o.stateNode.containerInfo,Gt=!0,yr(i,r,o),tt=l,Gt=d;break;case 0:case 11:case 14:case 15:Yr(2,o,r),pt||Yr(4,o,r),yr(i,r,o);break;case 1:pt||(Ki(o,r),l=o.stateNode,typeof l.componentWillUnmount=="function"&&Cg(o,r,l)),yr(i,r,o);break;case 21:yr(i,r,o);break;case 22:pt=(l=pt)||o.memoizedState!==null,yr(i,r,o),pt=l;break;default:yr(i,r,o)}}function Dg(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Wn(i)}catch(o){Fe(r,r.return,o)}}}function Og(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Wn(i)}catch(o){Fe(r,r.return,o)}}function Zw(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new Rg),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new Rg),r;default:throw Error(n(435,i.tag))}}function Rl(i,r){var o=Zw(i);r.forEach(function(l){if(!o.has(l)){o.add(l);var d=oC.bind(null,i,l);l.then(d,d)}})}function Xt(i,r){var o=r.deletions;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l],f=i,S=r,k=S;e:for(;k!==null;){switch(k.tag){case 27:if(ts(k.type)){tt=k.stateNode,Gt=!1;break e}break;case 5:tt=k.stateNode,Gt=!1;break e;case 3:case 4:tt=k.stateNode.containerInfo,Gt=!0;break e}k=k.return}if(tt===null)throw Error(n(160));Ag(f,S,d),tt=null,Gt=!1,f=d.alternate,f!==null&&(f.return=null),d.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Lg(r,i),r=r.sibling}var ji=null;function Lg(i,r){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Xt(r,i),Zt(i),l&4&&(Yr(3,i,i.return),Po(3,i),Yr(5,i,i.return));break;case 1:Xt(r,i),Zt(i),l&512&&(pt||o===null||Ki(o,o.return)),l&64&&vr&&(i=i.updateQueue,i!==null&&(l=i.callbacks,l!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var d=ji;if(Xt(r,i),Zt(i),l&512&&(pt||o===null||Ki(o,o.return)),l&4){var f=o!==null?o.memoizedState:null;if(l=i.memoizedState,o===null)if(l===null)if(i.stateNode===null){e:{l=i.type,o=i.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":f=d.getElementsByTagName("title")[0],(!f||f[fo]||f[Tt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=d.createElement(l),d.head.insertBefore(f,d.querySelector("head > title"))),Lt(f,l,o),f[Tt]=i,xt(f),l=f;break e;case"link":var S=Lv("link","href",d).get(l+(o.href||""));if(S){for(var k=0;k<S.length;k++)if(f=S[k],f.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&f.getAttribute("rel")===(o.rel==null?null:o.rel)&&f.getAttribute("title")===(o.title==null?null:o.title)&&f.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){S.splice(k,1);break t}}f=d.createElement(l),Lt(f,l,o),d.head.appendChild(f);break;case"meta":if(S=Lv("meta","content",d).get(l+(o.content||""))){for(k=0;k<S.length;k++)if(f=S[k],f.getAttribute("content")===(o.content==null?null:""+o.content)&&f.getAttribute("name")===(o.name==null?null:o.name)&&f.getAttribute("property")===(o.property==null?null:o.property)&&f.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&f.getAttribute("charset")===(o.charSet==null?null:o.charSet)){S.splice(k,1);break t}}f=d.createElement(l),Lt(f,l,o),d.head.appendChild(f);break;default:throw Error(n(468,l))}f[Tt]=i,xt(f),l=f}i.stateNode=l}else zv(d,i.type,i.stateNode);else i.stateNode=Ov(d,l,i.memoizedProps);else f!==l?(f===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):f.count--,l===null?zv(d,i.type,i.stateNode):Ov(d,l,i.memoizedProps)):l===null&&i.stateNode!==null&&Lh(i,i.memoizedProps,o.memoizedProps)}break;case 27:Xt(r,i),Zt(i),l&512&&(pt||o===null||Ki(o,o.return)),o!==null&&l&4&&Lh(i,i.memoizedProps,o.memoizedProps);break;case 5:if(Xt(r,i),Zt(i),l&512&&(pt||o===null||Ki(o,o.return)),i.flags&32){d=i.stateNode;try{dn(d,"")}catch(ue){Fe(i,i.return,ue)}}l&4&&i.stateNode!=null&&(d=i.memoizedProps,Lh(i,d,o!==null?o.memoizedProps:d)),l&1024&&(jh=!0);break;case 6:if(Xt(r,i),Zt(i),l&4){if(i.stateNode===null)throw Error(n(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(ue){Fe(i,i.return,ue)}}break;case 3:if(ql=null,d=ji,ji=Fl(r.containerInfo),Xt(r,i),ji=d,Zt(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{Wn(r.containerInfo)}catch(ue){Fe(i,i.return,ue)}jh&&(jh=!1,zg(i));break;case 4:l=ji,ji=Fl(i.stateNode.containerInfo),Xt(r,i),Zt(i),ji=l;break;case 12:Xt(r,i),Zt(i);break;case 31:Xt(r,i),Zt(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Rl(i,l)));break;case 13:Xt(r,i),Zt(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Tl=Pt()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Rl(i,l)));break;case 22:d=i.memoizedState!==null;var O=o!==null&&o.memoizedState!==null,U=vr,Y=pt;if(vr=U||d,pt=Y||O,Xt(r,i),pt=Y,vr=U,Zt(i),l&8192)e:for(r=i.stateNode,r._visibility=d?r._visibility&-2:r._visibility|1,d&&(o===null||O||vr||pt||zs(i)),o=null,r=i;;){if(r.tag===5||r.tag===26){if(o===null){O=o=r;try{if(f=O.stateNode,d)S=f.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{k=O.stateNode;var Q=O.memoizedProps.style,F=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;k.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ue){Fe(O,O.return,ue)}}}else if(r.tag===6){if(o===null){O=r;try{O.stateNode.nodeValue=d?"":O.memoizedProps}catch(ue){Fe(O,O.return,ue)}}}else if(r.tag===18){if(o===null){O=r;try{var $=O.stateNode;d?Cv($,!0):Cv(O.stateNode,!1)}catch(ue){Fe(O,O.return,ue)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=i.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,Rl(i,o))));break;case 19:Xt(r,i),Zt(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Rl(i,l)));break;case 30:break;case 21:break;default:Xt(r,i),Zt(i)}}function Zt(i){var r=i.flags;if(r&2){try{for(var o,l=i.return;l!==null;){if(kg(l)){o=l;break}l=l.return}if(o==null)throw Error(n(160));switch(o.tag){case 27:var d=o.stateNode,f=zh(i);Ml(i,f,d);break;case 5:var S=o.stateNode;o.flags&32&&(dn(S,""),o.flags&=-33);var k=zh(i);Ml(i,k,S);break;case 3:case 4:var O=o.stateNode.containerInfo,U=zh(i);Bh(i,U,O);break;default:throw Error(n(161))}}catch(Y){Fe(i,i.return,Y)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function zg(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;zg(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function br(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Ng(i,r.alternate,r),r=r.sibling}function zs(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Yr(4,r,r.return),zs(r);break;case 1:Ki(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&Cg(r,r.return,o),zs(r);break;case 27:Go(r.stateNode);case 26:case 5:Ki(r,r.return),zs(r);break;case 22:r.memoizedState===null&&zs(r);break;case 30:zs(r);break;default:zs(r)}i=i.sibling}}function Sr(i,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var l=r.alternate,d=i,f=r,S=f.flags;switch(f.tag){case 0:case 11:case 15:Sr(d,f,o),Po(4,f);break;case 1:if(Sr(d,f,o),l=f,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(U){Fe(l,l.return,U)}if(l=f,d=l.updateQueue,d!==null){var k=l.stateNode;try{var O=d.shared.hiddenCallbacks;if(O!==null)for(d.shared.hiddenCallbacks=null,d=0;d<O.length;d++)d_(O[d],k)}catch(U){Fe(l,l.return,U)}}o&&S&64&&wg(f),Uo(f,f.return);break;case 27:Mg(f);case 26:case 5:Sr(d,f,o),o&&l===null&&S&4&&Eg(f),Uo(f,f.return);break;case 12:Sr(d,f,o);break;case 31:Sr(d,f,o),o&&S&4&&Dg(d,f);break;case 13:Sr(d,f,o),o&&S&4&&Og(d,f);break;case 22:f.memoizedState===null&&Sr(d,f,o),Uo(f,f.return);break;case 30:break;default:Sr(d,f,o)}r=r.sibling}}function Hh(i,r){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&ko(o))}function Ph(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&ko(i))}function Hi(i,r,o,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Bg(i,r,o,l),r=r.sibling}function Bg(i,r,o,l){var d=r.flags;switch(r.tag){case 0:case 11:case 15:Hi(i,r,o,l),d&2048&&Po(9,r);break;case 1:Hi(i,r,o,l);break;case 3:Hi(i,r,o,l),d&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&ko(i)));break;case 12:if(d&2048){Hi(i,r,o,l),i=r.stateNode;try{var f=r.memoizedProps,S=f.id,k=f.onPostCommit;typeof k=="function"&&k(S,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(O){Fe(r,r.return,O)}}else Hi(i,r,o,l);break;case 31:Hi(i,r,o,l);break;case 13:Hi(i,r,o,l);break;case 23:break;case 22:f=r.stateNode,S=r.alternate,r.memoizedState!==null?f._visibility&2?Hi(i,r,o,l):Io(i,r):f._visibility&2?Hi(i,r,o,l):(f._visibility|=2,Dn(i,r,o,l,(r.subtreeFlags&10256)!==0||!1)),d&2048&&Hh(S,r);break;case 24:Hi(i,r,o,l),d&2048&&Ph(r.alternate,r);break;default:Hi(i,r,o,l)}}function Dn(i,r,o,l,d){for(d=d&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var f=i,S=r,k=o,O=l,U=S.flags;switch(S.tag){case 0:case 11:case 15:Dn(f,S,k,O,d),Po(8,S);break;case 23:break;case 22:var Y=S.stateNode;S.memoizedState!==null?Y._visibility&2?Dn(f,S,k,O,d):Io(f,S):(Y._visibility|=2,Dn(f,S,k,O,d)),d&&U&2048&&Hh(S.alternate,S);break;case 24:Dn(f,S,k,O,d),d&&U&2048&&Ph(S.alternate,S);break;default:Dn(f,S,k,O,d)}r=r.sibling}}function Io(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=i,l=r,d=l.flags;switch(l.tag){case 22:Io(o,l),d&2048&&Hh(l.alternate,l);break;case 24:Io(o,l),d&2048&&Ph(l.alternate,l);break;default:Io(o,l)}r=r.sibling}}var Fo=8192;function On(i,r,o){if(i.subtreeFlags&Fo)for(i=i.child;i!==null;)jg(i,r,o),i=i.sibling}function jg(i,r,o){switch(i.tag){case 26:On(i,r,o),i.flags&Fo&&i.memoizedState!==null&&jC(o,ji,i.memoizedState,i.memoizedProps);break;case 5:On(i,r,o);break;case 3:case 4:var l=ji;ji=Fl(i.stateNode.containerInfo),On(i,r,o),ji=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=Fo,Fo=16777216,On(i,r,o),Fo=l):On(i,r,o));break;default:On(i,r,o)}}function Hg(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function Wo(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];wt=l,Ug(l,i)}Hg(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Pg(i),i=i.sibling}function Pg(i){switch(i.tag){case 0:case 11:case 15:Wo(i),i.flags&2048&&Yr(9,i,i.return);break;case 3:Wo(i);break;case 12:Wo(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,Nl(i)):Wo(i);break;default:Wo(i)}}function Nl(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];wt=l,Ug(l,i)}Hg(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Yr(8,r,r.return),Nl(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Nl(r));break;default:Nl(r)}i=i.sibling}}function Ug(i,r){for(;wt!==null;){var o=wt;switch(o.tag){case 0:case 11:case 15:Yr(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ko(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,wt=l;else e:for(o=i;wt!==null;){l=wt;var d=l.sibling,f=l.return;if(Tg(l),l===o){wt=null;break e}if(d!==null){d.return=f,wt=d;break e}wt=f}}}var Qw={getCacheForType:function(i){var r=Dt(dt),o=r.data.get(i);return o===void 0&&(o=i(),r.data.set(i,o)),o},cacheSignal:function(){return Dt(dt).controller.signal}},Jw=typeof WeakMap=="function"?WeakMap:Map,Pe=0,Ke=null,Me=null,Ae=0,Ie=0,li=null,Gr=!1,Ln=!1,Uh=!1,xr=0,ot=0,Xr=0,Bs=0,Ih=0,ci=0,zn=0,qo=null,Qt=null,Fh=!1,Tl=0,Ig=0,Al=1/0,Dl=null,Zr=null,vt=0,Qr=null,Bn=null,wr=0,Wh=0,qh=null,Fg=null,$o=0,$h=null;function ui(){return(Pe&2)!==0&&Ae!==0?Ae&-Ae:A.T!==null?Zh():sp()}function Wg(){if(ci===0)if((Ae&536870912)===0||Oe){var i=Ua;Ua<<=1,(Ua&3932160)===0&&(Ua=262144),ci=i}else ci=536870912;return i=oi.current,i!==null&&(i.flags|=32),ci}function Jt(i,r,o){(i===Ke&&(Ie===2||Ie===9)||i.cancelPendingCommit!==null)&&(jn(i,0),Jr(i,Ae,ci,!1)),ho(i,o),((Pe&2)===0||i!==Ke)&&(i===Ke&&((Pe&2)===0&&(Bs|=o),ot===4&&Jr(i,Ae,ci,!1)),Yi(i))}function qg(i,r,o){if((Pe&6)!==0)throw Error(n(327));var l=!o&&(r&127)===0&&(r&i.expiredLanes)===0||uo(i,r),d=l?iC(i,r):Kh(i,r,!0),f=l;do{if(d===0){Ln&&!l&&Jr(i,r,0,!1);break}else{if(o=i.current.alternate,f&&!eC(o)){d=Kh(i,r,!1),f=!1;continue}if(d===2){if(f=r,i.errorRecoveryDisabledLanes&f)var S=0;else S=i.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){r=S;e:{var k=i;d=qo;var O=k.current.memoizedState.isDehydrated;if(O&&(jn(k,S).flags|=256),S=Kh(k,S,!1),S!==2){if(Uh&&!O){k.errorRecoveryDisabledLanes|=f,Bs|=f,d=4;break e}f=Qt,Qt=d,f!==null&&(Qt===null?Qt=f:Qt.push.apply(Qt,f))}d=S}if(f=!1,d!==2)continue}}if(d===1){jn(i,0),Jr(i,r,0,!0);break}e:{switch(l=i,f=d,f){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:Jr(l,r,ci,!Gr);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(d=Tl+300-Pt(),10<d)){if(Jr(l,r,ci,!Gr),Fa(l,0,!0)!==0)break e;wr=r,l.timeoutHandle=Sv($g.bind(null,l,o,Qt,Dl,Fh,r,ci,Bs,zn,Gr,f,"Throttled",-0,0),d);break e}$g(l,o,Qt,Dl,Fh,r,ci,Bs,zn,Gr,f,null,-0,0)}}break}while(!0);Yi(i)}function $g(i,r,o,l,d,f,S,k,O,U,Y,Q,F,$){if(i.timeoutHandle=-1,Q=r.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:lr},jg(r,f,Q);var ue=(f&62914560)===f?Tl-Pt():(f&4194048)===f?Ig-Pt():0;if(ue=HC(Q,ue),ue!==null){wr=f,i.cancelPendingCommit=ue(Jg.bind(null,i,r,f,o,l,d,S,k,O,Y,Q,null,F,$)),Jr(i,f,S,!U);return}}Jg(i,r,f,o,l,d,S,k,O)}function eC(i){for(var r=i;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var d=o[l],f=d.getSnapshot;d=d.value;try{if(!si(f(),d))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Jr(i,r,o,l){r&=~Ih,r&=~Bs,i.suspendedLanes|=r,i.pingedLanes&=~r,l&&(i.warmLanes|=r),l=i.expirationTimes;for(var d=r;0<d;){var f=31-ri(d),S=1<<f;l[f]=-1,d&=~S}o!==0&&tp(i,o,r)}function Ol(){return(Pe&6)===0?(Vo(0),!1):!0}function Vh(){if(Me!==null){if(Ie===0)var i=Me.return;else i=Me,dr=Ms=null,lh(i),Mn=null,Ro=0,i=Me;for(;i!==null;)xg(i.alternate,i),i=i.return;Me=null}}function jn(i,r){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,bC(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),wr=0,Vh(),Ke=i,Me=o=ur(i.current,null),Ae=r,Ie=0,li=null,Gr=!1,Ln=uo(i,r),Uh=!1,zn=ci=Ih=Bs=Xr=ot=0,Qt=qo=null,Fh=!1,(r&8)!==0&&(r|=r&32);var l=i.entangledLanes;if(l!==0)for(i=i.entanglements,l&=r;0<l;){var d=31-ri(l),f=1<<d;r|=i[d],l&=~f}return xr=r,el(),o}function Vg(i,r){we=null,A.H=Bo,r===kn||r===ll?(r=l_(),Ie=3):r===Xu?(r=l_(),Ie=4):Ie=r===Ch?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,li=r,Me===null&&(ot=1,xl(i,Si(r,i.current)))}function Kg(){var i=oi.current;return i===null?!0:(Ae&4194048)===Ae?Ei===null:(Ae&62914560)===Ae||(Ae&536870912)!==0?i===Ei:!1}function Yg(){var i=A.H;return A.H=Bo,i===null?Bo:i}function Gg(){var i=A.A;return A.A=Qw,i}function Ll(){ot=4,Gr||(Ae&4194048)!==Ae&&oi.current!==null||(Ln=!0),(Xr&134217727)===0&&(Bs&134217727)===0||Ke===null||Jr(Ke,Ae,ci,!1)}function Kh(i,r,o){var l=Pe;Pe|=2;var d=Yg(),f=Gg();(Ke!==i||Ae!==r)&&(Dl=null,jn(i,r)),r=!1;var S=ot;e:do try{if(Ie!==0&&Me!==null){var k=Me,O=li;switch(Ie){case 8:Vh(),S=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(r=!0);var U=Ie;if(Ie=0,li=null,Hn(i,k,O,U),o&&Ln){S=0;break e}break;default:U=Ie,Ie=0,li=null,Hn(i,k,O,U)}}tC(),S=ot;break}catch(Y){Vg(i,Y)}while(!0);return r&&i.shellSuspendCounter++,dr=Ms=null,Pe=l,A.H=d,A.A=f,Me===null&&(Ke=null,Ae=0,el()),S}function tC(){for(;Me!==null;)Xg(Me)}function iC(i,r){var o=Pe;Pe|=2;var l=Yg(),d=Gg();Ke!==i||Ae!==r?(Dl=null,Al=Pt()+500,jn(i,r)):Ln=uo(i,r);e:do try{if(Ie!==0&&Me!==null){r=Me;var f=li;t:switch(Ie){case 1:Ie=0,li=null,Hn(i,r,f,1);break;case 2:case 9:if(o_(f)){Ie=0,li=null,Zg(r);break}r=function(){Ie!==2&&Ie!==9||Ke!==i||(Ie=7),Yi(i)},f.then(r,r);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:o_(f)?(Ie=0,li=null,Zg(r)):(Ie=0,li=null,Hn(i,r,f,7));break;case 5:var S=null;switch(Me.tag){case 26:S=Me.memoizedState;case 5:case 27:var k=Me;if(S?Bv(S):k.stateNode.complete){Ie=0,li=null;var O=k.sibling;if(O!==null)Me=O;else{var U=k.return;U!==null?(Me=U,zl(U)):Me=null}break t}}Ie=0,li=null,Hn(i,r,f,5);break;case 6:Ie=0,li=null,Hn(i,r,f,6);break;case 8:Vh(),ot=6;break e;default:throw Error(n(462))}}rC();break}catch(Y){Vg(i,Y)}while(!0);return dr=Ms=null,A.H=l,A.A=d,Pe=o,Me!==null?0:(Ke=null,Ae=0,el(),ot)}function rC(){for(;Me!==null&&!qi();)Xg(Me)}function Xg(i){var r=bg(i.alternate,i,xr);i.memoizedProps=i.pendingProps,r===null?zl(i):Me=r}function Zg(i){var r=i,o=r.alternate;switch(r.tag){case 15:case 0:r=mg(o,r,r.pendingProps,r.type,void 0,Ae);break;case 11:r=mg(o,r,r.pendingProps,r.type.render,r.ref,Ae);break;case 5:lh(r);default:xg(o,r),r=Me=Gp(r,xr),r=bg(o,r,xr)}i.memoizedProps=i.pendingProps,r===null?zl(i):Me=r}function Hn(i,r,o,l){dr=Ms=null,lh(r),Mn=null,Ro=0;var d=r.return;try{if($w(i,d,r,o,Ae)){ot=1,xl(i,Si(o,i.current)),Me=null;return}}catch(f){if(d!==null)throw Me=d,f;ot=1,xl(i,Si(o,i.current)),Me=null;return}r.flags&32768?(Oe||l===1?i=!0:Ln||(Ae&536870912)!==0?i=!1:(Gr=i=!0,(l===2||l===9||l===3||l===6)&&(l=oi.current,l!==null&&l.tag===13&&(l.flags|=16384))),Qg(r,i)):zl(r)}function zl(i){var r=i;do{if((r.flags&32768)!==0){Qg(r,Gr);return}i=r.return;var o=Yw(r.alternate,r,xr);if(o!==null){Me=o;return}if(r=r.sibling,r!==null){Me=r;return}Me=r=i}while(r!==null);ot===0&&(ot=5)}function Qg(i,r){do{var o=Gw(i.alternate,i);if(o!==null){o.flags&=32767,Me=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(i=i.sibling,i!==null)){Me=i;return}Me=i=o}while(i!==null);ot=6,Me=null}function Jg(i,r,o,l,d,f,S,k,O){i.cancelPendingCommit=null;do Bl();while(vt!==0);if((Pe&6)!==0)throw Error(n(327));if(r!==null){if(r===i.current)throw Error(n(177));if(f=r.lanes|r.childLanes,f|=zu,Bx(i,o,f,S,k,O),i===Ke&&(Me=Ke=null,Ae=0),Bn=r,Qr=i,wr=o,Wh=f,qh=d,Fg=l,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,aC(nn,function(){return sv(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=A.T,A.T=null,d=L.p,L.p=2,S=Pe,Pe|=4;try{Xw(i,r,o)}finally{Pe=S,L.p=d,A.T=l}}vt=1,ev(),tv(),iv()}}function ev(){if(vt===1){vt=0;var i=Qr,r=Bn,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=A.T,A.T=null;var l=L.p;L.p=2;var d=Pe;Pe|=4;try{Lg(r,i);var f=nd,S=Up(i.containerInfo),k=f.focusedElem,O=f.selectionRange;if(S!==k&&k&&k.ownerDocument&&Pp(k.ownerDocument.documentElement,k)){if(O!==null&&Tu(k)){var U=O.start,Y=O.end;if(Y===void 0&&(Y=U),"selectionStart"in k)k.selectionStart=U,k.selectionEnd=Math.min(Y,k.value.length);else{var Q=k.ownerDocument||document,F=Q&&Q.defaultView||window;if(F.getSelection){var $=F.getSelection(),ue=k.textContent.length,ge=Math.min(O.start,ue),$e=O.end===void 0?ge:Math.min(O.end,ue);!$.extend&&ge>$e&&(S=$e,$e=ge,ge=S);var H=Hp(k,ge),B=Hp(k,$e);if(H&&B&&($.rangeCount!==1||$.anchorNode!==H.node||$.anchorOffset!==H.offset||$.focusNode!==B.node||$.focusOffset!==B.offset)){var P=Q.createRange();P.setStart(H.node,H.offset),$.removeAllRanges(),ge>$e?($.addRange(P),$.extend(B.node,B.offset)):(P.setEnd(B.node,B.offset),$.addRange(P))}}}}for(Q=[],$=k;$=$.parentNode;)$.nodeType===1&&Q.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<Q.length;k++){var X=Q[k];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}Yl=!!sd,nd=sd=null}finally{Pe=d,L.p=l,A.T=o}}i.current=r,vt=2}}function tv(){if(vt===2){vt=0;var i=Qr,r=Bn,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=A.T,A.T=null;var l=L.p;L.p=2;var d=Pe;Pe|=4;try{Ng(i,r.alternate,r)}finally{Pe=d,L.p=l,A.T=o}}vt=3}}function iv(){if(vt===4||vt===3){vt=0,au();var i=Qr,r=Bn,o=wr,l=Fg;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?vt=5:(vt=0,Bn=Qr=null,rv(i,i.pendingLanes));var d=i.pendingLanes;if(d===0&&(Zr=null),hu(o),r=r.stateNode,ii&&typeof ii.onCommitFiberRoot=="function")try{ii.onCommitFiberRoot(co,r,void 0,(r.current.flags&128)===128)}catch{}if(l!==null){r=A.T,d=L.p,L.p=2,A.T=null;try{for(var f=i.onRecoverableError,S=0;S<l.length;S++){var k=l[S];f(k.value,{componentStack:k.stack})}}finally{A.T=r,L.p=d}}(wr&3)!==0&&Bl(),Yi(i),d=i.pendingLanes,(o&261930)!==0&&(d&42)!==0?i===$h?$o++:($o=0,$h=i):$o=0,Vo(0)}}function rv(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,ko(r)))}function Bl(){return ev(),tv(),iv(),sv()}function sv(){if(vt!==5)return!1;var i=Qr,r=Wh;Wh=0;var o=hu(wr),l=A.T,d=L.p;try{L.p=32>o?32:o,A.T=null,o=qh,qh=null;var f=Qr,S=wr;if(vt=0,Bn=Qr=null,wr=0,(Pe&6)!==0)throw Error(n(331));var k=Pe;if(Pe|=4,Pg(f.current),Bg(f,f.current,S,o),Pe=k,Vo(0,!1),ii&&typeof ii.onPostCommitFiberRoot=="function")try{ii.onPostCommitFiberRoot(co,f)}catch{}return!0}finally{L.p=d,A.T=l,rv(i,r)}}function nv(i,r,o){r=Si(o,r),r=wh(i.stateNode,r,2),i=$r(i,r,2),i!==null&&(ho(i,2),Yi(i))}function Fe(i,r,o){if(i.tag===3)nv(i,i,o);else for(;r!==null;){if(r.tag===3){nv(r,i,o);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Zr===null||!Zr.has(l))){i=Si(o,i),o=og(2),l=$r(r,o,2),l!==null&&(ag(o,l,r,i),ho(l,2),Yi(l));break}}r=r.return}}function Yh(i,r,o){var l=i.pingCache;if(l===null){l=i.pingCache=new Jw;var d=new Set;l.set(r,d)}else d=l.get(r),d===void 0&&(d=new Set,l.set(r,d));d.has(o)||(Uh=!0,d.add(o),i=sC.bind(null,i,r,o),r.then(i,i))}function sC(i,r,o){var l=i.pingCache;l!==null&&l.delete(r),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,Ke===i&&(Ae&o)===o&&(ot===4||ot===3&&(Ae&62914560)===Ae&&300>Pt()-Tl?(Pe&2)===0&&jn(i,0):Ih|=o,zn===Ae&&(zn=0)),Yi(i)}function ov(i,r){r===0&&(r=ep()),i=Cs(i,r),i!==null&&(ho(i,r),Yi(i))}function nC(i){var r=i.memoizedState,o=0;r!==null&&(o=r.retryLane),ov(i,o)}function oC(i,r){var o=0;switch(i.tag){case 31:case 13:var l=i.stateNode,d=i.memoizedState;d!==null&&(o=d.retryLane);break;case 19:l=i.stateNode;break;case 22:l=i.stateNode._retryCache;break;default:throw Error(n(314))}l!==null&&l.delete(r),ov(i,o)}function aC(i,r){return zr(i,r)}var jl=null,Pn=null,Gh=!1,Hl=!1,Xh=!1,es=0;function Yi(i){i!==Pn&&i.next===null&&(Pn===null?jl=Pn=i:Pn=Pn.next=i),Hl=!0,Gh||(Gh=!0,cC())}function Vo(i,r){if(!Xh&&Hl){Xh=!0;do for(var o=!1,l=jl;l!==null;){if(i!==0){var d=l.pendingLanes;if(d===0)var f=0;else{var S=l.suspendedLanes,k=l.pingedLanes;f=(1<<31-ri(42|i)+1)-1,f&=d&~(S&~k),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(o=!0,uv(l,f))}else f=Ae,f=Fa(l,l===Ke?f:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(f&3)===0||uo(l,f)||(o=!0,uv(l,f));l=l.next}while(o);Xh=!1}}function lC(){av()}function av(){Hl=Gh=!1;var i=0;es!==0&&yC()&&(i=es);for(var r=Pt(),o=null,l=jl;l!==null;){var d=l.next,f=lv(l,r);f===0?(l.next=null,o===null?jl=d:o.next=d,d===null&&(Pn=o)):(o=l,(i!==0||(f&3)!==0)&&(Hl=!0)),l=d}vt!==0&&vt!==5||Vo(i),es!==0&&(es=0)}function lv(i,r){for(var o=i.suspendedLanes,l=i.pingedLanes,d=i.expirationTimes,f=i.pendingLanes&-62914561;0<f;){var S=31-ri(f),k=1<<S,O=d[S];O===-1?((k&o)===0||(k&l)!==0)&&(d[S]=zx(k,r)):O<=r&&(i.expiredLanes|=k),f&=~k}if(r=Ke,o=Ae,o=Fa(i,i===r?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===r&&(Ie===2||Ie===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&lo(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||uo(i,o)){if(r=o&-o,r===i.callbackPriority)return r;switch(l!==null&&lo(l),hu(o)){case 2:case 8:o=sn;break;case 32:o=nn;break;case 268435456:o=Jm;break;default:o=nn}return l=cv.bind(null,i),o=zr(o,l),i.callbackPriority=r,i.callbackNode=o,r}return l!==null&&l!==null&&lo(l),i.callbackPriority=2,i.callbackNode=null,2}function cv(i,r){if(vt!==0&&vt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Bl()&&i.callbackNode!==o)return null;var l=Ae;return l=Fa(i,i===Ke?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(qg(i,l,r),lv(i,Pt()),i.callbackNode!=null&&i.callbackNode===o?cv.bind(null,i):null)}function uv(i,r){if(Bl())return null;qg(i,r,!0)}function cC(){SC(function(){(Pe&6)!==0?zr(vs,lC):av()})}function Zh(){if(es===0){var i=Cn;i===0&&(i=Pa,Pa<<=1,(Pa&261888)===0&&(Pa=256)),es=i}return es}function hv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Va(""+i)}function dv(i,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,i.id&&o.setAttribute("form",i.id),r.parentNode.insertBefore(o,r),i=new FormData(i),o.parentNode.removeChild(o),i}function uC(i,r,o,l,d){if(r==="submit"&&o&&o.stateNode===d){var f=hv((d[Kt]||null).action),S=l.submitter;S&&(r=(r=S[Kt]||null)?hv(r.formAction):S.getAttribute("formAction"),r!==null&&(f=r,S=null));var k=new Xa("action","action",null,l,d);i.push({event:k,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(es!==0){var O=S?dv(d,S):new FormData(d);gh(o,{pending:!0,data:O,method:d.method,action:f},null,O)}}else typeof f=="function"&&(k.preventDefault(),O=S?dv(d,S):new FormData(d),gh(o,{pending:!0,data:O,method:d.method,action:f},f,O))},currentTarget:d}]})}}for(var Qh=0;Qh<Lu.length;Qh++){var Jh=Lu[Qh],hC=Jh.toLowerCase(),dC=Jh[0].toUpperCase()+Jh.slice(1);Bi(hC,"on"+dC)}Bi(Wp,"onAnimationEnd"),Bi(qp,"onAnimationIteration"),Bi($p,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(Rw,"onTransitionRun"),Bi(Nw,"onTransitionStart"),Bi(Tw,"onTransitionCancel"),Bi(Vp,"onTransitionEnd"),un("onMouseEnter",["mouseout","mouseover"]),un("onMouseLeave",["mouseout","mouseover"]),un("onPointerEnter",["pointerout","pointerover"]),un("onPointerLeave",["pointerout","pointerover"]),bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),bs("onBeforeInput",["compositionend","keypress","textInput","paste"]),bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ko="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),fC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ko));function fv(i,r){r=(r&4)!==0;for(var o=0;o<i.length;o++){var l=i[o],d=l.event;l=l.listeners;e:{var f=void 0;if(r)for(var S=l.length-1;0<=S;S--){var k=l[S],O=k.instance,U=k.currentTarget;if(k=k.listener,O!==f&&d.isPropagationStopped())break e;f=k,d.currentTarget=U;try{f(d)}catch(Y){Ja(Y)}d.currentTarget=null,f=O}else for(S=0;S<l.length;S++){if(k=l[S],O=k.instance,U=k.currentTarget,k=k.listener,O!==f&&d.isPropagationStopped())break e;f=k,d.currentTarget=U;try{f(d)}catch(Y){Ja(Y)}d.currentTarget=null,f=O}}}}function Re(i,r){var o=r[du];o===void 0&&(o=r[du]=new Set);var l=i+"__bubble";o.has(l)||(mv(r,i,2,!1),o.add(l))}function ed(i,r,o){var l=0;r&&(l|=4),mv(o,i,l,r)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function td(i){if(!i[Pl]){i[Pl]=!0,ap.forEach(function(o){o!=="selectionchange"&&(fC.has(o)||ed(o,!1,i),ed(o,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[Pl]||(r[Pl]=!0,ed("selectionchange",!1,r))}}function mv(i,r,o,l){switch(Wv(r)){case 2:var d=IC;break;case 8:d=FC;break;default:d=_d}o=d.bind(null,r,o,i),d=void 0,!Su||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(d=!0),l?d!==void 0?i.addEventListener(r,o,{capture:!0,passive:d}):i.addEventListener(r,o,!0):d!==void 0?i.addEventListener(r,o,{passive:d}):i.addEventListener(r,o,!1)}function id(i,r,o,l,d){var f=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var S=l.tag;if(S===3||S===4){var k=l.stateNode.containerInfo;if(k===d)break;if(S===4)for(S=l.return;S!==null;){var O=S.tag;if((O===3||O===4)&&S.stateNode.containerInfo===d)return;S=S.return}for(;k!==null;){if(S=an(k),S===null)return;if(O=S.tag,O===5||O===6||O===26||O===27){l=f=S;continue e}k=k.parentNode}}l=l.return}yp(function(){var U=f,Y=yu(o),Q=[];e:{var F=Kp.get(i);if(F!==void 0){var $=Xa,ue=i;switch(i){case"keypress":if(Ya(o)===0)break e;case"keydown":case"keyup":$=ow;break;case"focusin":ue="focus",$=Eu;break;case"focusout":ue="blur",$=Eu;break;case"beforeblur":case"afterblur":$=Eu;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=xp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=Yx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=cw;break;case Wp:case qp:case $p:$=Zx;break;case Vp:$=hw;break;case"scroll":case"scrollend":$=Vx;break;case"wheel":$=fw;break;case"copy":case"cut":case"paste":$=Jx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=Cp;break;case"toggle":case"beforetoggle":$=pw}var ge=(r&4)!==0,$e=!ge&&(i==="scroll"||i==="scrollend"),H=ge?F!==null?F+"Capture":null:F;ge=[];for(var B=U,P;B!==null;){var X=B;if(P=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||P===null||H===null||(X=po(B,H),X!=null&&ge.push(Yo(B,X,P))),$e)break;B=B.return}0<ge.length&&(F=new $(F,ue,null,o,Y),Q.push({event:F,listeners:ge}))}}if((r&7)===0){e:{if(F=i==="mouseover"||i==="pointerover",$=i==="mouseout"||i==="pointerout",F&&o!==vu&&(ue=o.relatedTarget||o.fromElement)&&(an(ue)||ue[on]))break e;if(($||F)&&(F=Y.window===Y?Y:(F=Y.ownerDocument)?F.defaultView||F.parentWindow:window,$?(ue=o.relatedTarget||o.toElement,$=U,ue=ue?an(ue):null,ue!==null&&($e=c(ue),ge=ue.tag,ue!==$e||ge!==5&&ge!==27&&ge!==6)&&(ue=null)):($=null,ue=U),$!==ue)){if(ge=xp,X="onMouseLeave",H="onMouseEnter",B="mouse",(i==="pointerout"||i==="pointerover")&&(ge=Cp,X="onPointerLeave",H="onPointerEnter",B="pointer"),$e=$==null?F:mo($),P=ue==null?F:mo(ue),F=new ge(X,B+"leave",$,o,Y),F.target=$e,F.relatedTarget=P,X=null,an(Y)===U&&(ge=new ge(H,B+"enter",ue,o,Y),ge.target=P,ge.relatedTarget=$e,X=ge),$e=X,$&&ue)t:{for(ge=mC,H=$,B=ue,P=0,X=H;X;X=ge(X))P++;X=0;for(var pe=B;pe;pe=ge(pe))X++;for(;0<P-X;)H=ge(H),P--;for(;0<X-P;)B=ge(B),X--;for(;P--;){if(H===B||B!==null&&H===B.alternate){ge=H;break t}H=ge(H),B=ge(B)}ge=null}else ge=null;$!==null&&pv(Q,F,$,ge,!1),ue!==null&&$e!==null&&pv(Q,$e,ue,ge,!0)}}e:{if(F=U?mo(U):window,$=F.nodeName&&F.nodeName.toLowerCase(),$==="select"||$==="input"&&F.type==="file")var je=Dp;else if(Tp(F))if(Op)je=Ew;else{je=ww;var de=xw}else $=F.nodeName,!$||$.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?U&&gu(U.elementType)&&(je=Dp):je=Cw;if(je&&(je=je(i,U))){Ap(Q,je,o,Y);break e}de&&de(i,F,U),i==="focusout"&&U&&F.type==="number"&&U.memoizedProps.value!=null&&_u(F,"number",F.value)}switch(de=U?mo(U):window,i){case"focusin":(Tp(de)||de.contentEditable==="true")&&(_n=de,Au=U,wo=null);break;case"focusout":wo=Au=_n=null;break;case"mousedown":Du=!0;break;case"contextmenu":case"mouseup":case"dragend":Du=!1,Ip(Q,o,Y);break;case"selectionchange":if(Mw)break;case"keydown":case"keyup":Ip(Q,o,Y)}var Ce;if(Mu)e:{switch(i){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else pn?Rp(i,o)&&(De="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(De="onCompositionStart");De&&(Ep&&o.locale!=="ko"&&(pn||De!=="onCompositionStart"?De==="onCompositionEnd"&&pn&&(Ce=bp()):(Hr=Y,xu="value"in Hr?Hr.value:Hr.textContent,pn=!0)),de=Ul(U,De),0<de.length&&(De=new wp(De,i,null,o,Y),Q.push({event:De,listeners:de}),Ce?De.data=Ce:(Ce=Np(o),Ce!==null&&(De.data=Ce)))),(Ce=gw?vw(i,o):yw(i,o))&&(De=Ul(U,"onBeforeInput"),0<De.length&&(de=new wp("onBeforeInput","beforeinput",null,o,Y),Q.push({event:de,listeners:De}),de.data=Ce)),uC(Q,i,U,o,Y)}fv(Q,r)})}function Yo(i,r,o){return{instance:i,listener:r,currentTarget:o}}function Ul(i,r){for(var o=r+"Capture",l=[];i!==null;){var d=i,f=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||f===null||(d=po(i,o),d!=null&&l.unshift(Yo(i,d,f)),d=po(i,r),d!=null&&l.push(Yo(i,d,f))),i.tag===3)return l;i=i.return}return[]}function mC(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function pv(i,r,o,l,d){for(var f=r._reactName,S=[];o!==null&&o!==l;){var k=o,O=k.alternate,U=k.stateNode;if(k=k.tag,O!==null&&O===l)break;k!==5&&k!==26&&k!==27||U===null||(O=U,d?(U=po(o,f),U!=null&&S.unshift(Yo(o,U,O))):d||(U=po(o,f),U!=null&&S.push(Yo(o,U,O)))),o=o.return}S.length!==0&&i.push({event:r,listeners:S})}var pC=/\r\n?/g,_C=/\u0000|\uFFFD/g;function _v(i){return(typeof i=="string"?i:""+i).replace(pC,`
|
|
26
|
+
`).replace(_C,"")}function gv(i,r){return r=_v(r),_v(i)===r}function qe(i,r,o,l,d,f){switch(o){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||dn(i,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&dn(i,""+l);break;case"className":qa(i,"class",l);break;case"tabIndex":qa(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":qa(i,o,l);break;case"style":gp(i,l,f);break;case"data":if(r!=="object"){qa(i,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||o!=="href")){i.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Va(""+l),i.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){i.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(o==="formAction"?(r!=="input"&&qe(i,r,"name",d.name,d,null),qe(i,r,"formEncType",d.formEncType,d,null),qe(i,r,"formMethod",d.formMethod,d,null),qe(i,r,"formTarget",d.formTarget,d,null)):(qe(i,r,"encType",d.encType,d,null),qe(i,r,"method",d.method,d,null),qe(i,r,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Va(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=lr);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("scrollend",i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(n(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(n(60));i.innerHTML=o}}break;case"multiple":i.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":i.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){i.removeAttribute("xlink:href");break}o=Va(""+l),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""+l):i.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":l===!0?i.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,l):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?i.setAttribute(o,l):i.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?i.removeAttribute(o):i.setAttribute(o,l);break;case"popover":Re("beforetoggle",i),Re("toggle",i),Wa(i,"popover",l);break;case"xlinkActuate":ar(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ar(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ar(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ar(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ar(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ar(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ar(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ar(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ar(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Wa(i,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=qx.get(o)||o,Wa(i,o,l))}}function rd(i,r,o,l,d,f){switch(o){case"style":gp(i,l,f);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(n(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(n(60));i.innerHTML=o}}break;case"children":typeof l=="string"?dn(i,l):(typeof l=="number"||typeof l=="bigint")&&dn(i,""+l);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("scrollend",i);break;case"onClick":l!=null&&(i.onclick=lr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lp.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),r=o.slice(2,d?o.length-7:void 0),f=i[Kt]||null,f=f!=null?f[o]:null,typeof f=="function"&&i.removeEventListener(r,f,d),typeof l=="function")){typeof f!="function"&&f!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(r,l,d);break e}o in i?i[o]=l:l===!0?i.setAttribute(o,""):Wa(i,o,l)}}}function Lt(i,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",i),Re("load",i);var l=!1,d=!1,f;for(f in o)if(o.hasOwnProperty(f)){var S=o[f];if(S!=null)switch(f){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:qe(i,r,f,S,o,null)}}d&&qe(i,r,"srcSet",o.srcSet,o,null),l&&qe(i,r,"src",o.src,o,null);return;case"input":Re("invalid",i);var k=f=S=d=null,O=null,U=null;for(l in o)if(o.hasOwnProperty(l)){var Y=o[l];if(Y!=null)switch(l){case"name":d=Y;break;case"type":S=Y;break;case"checked":O=Y;break;case"defaultChecked":U=Y;break;case"value":f=Y;break;case"defaultValue":k=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(n(137,r));break;default:qe(i,r,l,Y,o,null)}}fp(i,f,k,O,U,S,d,!1);return;case"select":Re("invalid",i),l=S=f=null;for(d in o)if(o.hasOwnProperty(d)&&(k=o[d],k!=null))switch(d){case"value":f=k;break;case"defaultValue":S=k;break;case"multiple":l=k;default:qe(i,r,d,k,o,null)}r=f,o=S,i.multiple=!!l,r!=null?hn(i,!!l,r,!1):o!=null&&hn(i,!!l,o,!0);return;case"textarea":Re("invalid",i),f=d=l=null;for(S in o)if(o.hasOwnProperty(S)&&(k=o[S],k!=null))switch(S){case"value":l=k;break;case"defaultValue":d=k;break;case"children":f=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(n(91));break;default:qe(i,r,S,k,o,null)}pp(i,l,d,f);return;case"option":for(O in o)if(o.hasOwnProperty(O)&&(l=o[O],l!=null))switch(O){case"selected":i.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:qe(i,r,O,l,o,null)}return;case"dialog":Re("beforetoggle",i),Re("toggle",i),Re("cancel",i),Re("close",i);break;case"iframe":case"object":Re("load",i);break;case"video":case"audio":for(l=0;l<Ko.length;l++)Re(Ko[l],i);break;case"image":Re("error",i),Re("load",i);break;case"details":Re("toggle",i);break;case"embed":case"source":case"link":Re("error",i),Re("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in o)if(o.hasOwnProperty(U)&&(l=o[U],l!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:qe(i,r,U,l,o,null)}return;default:if(gu(r)){for(Y in o)o.hasOwnProperty(Y)&&(l=o[Y],l!==void 0&&rd(i,r,Y,l,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(l=o[k],l!=null&&qe(i,r,k,l,o,null))}function gC(i,r,o,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,f=null,S=null,k=null,O=null,U=null,Y=null;for($ in o){var Q=o[$];if(o.hasOwnProperty($)&&Q!=null)switch($){case"checked":break;case"value":break;case"defaultValue":O=Q;default:l.hasOwnProperty($)||qe(i,r,$,null,l,Q)}}for(var F in l){var $=l[F];if(Q=o[F],l.hasOwnProperty(F)&&($!=null||Q!=null))switch(F){case"type":f=$;break;case"name":d=$;break;case"checked":U=$;break;case"defaultChecked":Y=$;break;case"value":S=$;break;case"defaultValue":k=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(n(137,r));break;default:$!==Q&&qe(i,r,F,$,l,Q)}}pu(i,S,k,O,U,Y,f,d);return;case"select":$=S=k=F=null;for(f in o)if(O=o[f],o.hasOwnProperty(f)&&O!=null)switch(f){case"value":break;case"multiple":$=O;default:l.hasOwnProperty(f)||qe(i,r,f,null,l,O)}for(d in l)if(f=l[d],O=o[d],l.hasOwnProperty(d)&&(f!=null||O!=null))switch(d){case"value":F=f;break;case"defaultValue":k=f;break;case"multiple":S=f;default:f!==O&&qe(i,r,d,f,l,O)}r=k,o=S,l=$,F!=null?hn(i,!!o,F,!1):!!l!=!!o&&(r!=null?hn(i,!!o,r,!0):hn(i,!!o,o?[]:"",!1));return;case"textarea":$=F=null;for(k in o)if(d=o[k],o.hasOwnProperty(k)&&d!=null&&!l.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:qe(i,r,k,null,l,d)}for(S in l)if(d=l[S],f=o[S],l.hasOwnProperty(S)&&(d!=null||f!=null))switch(S){case"value":F=d;break;case"defaultValue":$=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(n(91));break;default:d!==f&&qe(i,r,S,d,l,f)}mp(i,F,$);return;case"option":for(var ue in o)if(F=o[ue],o.hasOwnProperty(ue)&&F!=null&&!l.hasOwnProperty(ue))switch(ue){case"selected":i.selected=!1;break;default:qe(i,r,ue,null,l,F)}for(O in l)if(F=l[O],$=o[O],l.hasOwnProperty(O)&&F!==$&&(F!=null||$!=null))switch(O){case"selected":i.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:qe(i,r,O,F,l,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ge in o)F=o[ge],o.hasOwnProperty(ge)&&F!=null&&!l.hasOwnProperty(ge)&&qe(i,r,ge,null,l,F);for(U in l)if(F=l[U],$=o[U],l.hasOwnProperty(U)&&F!==$&&(F!=null||$!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(n(137,r));break;default:qe(i,r,U,F,l,$)}return;default:if(gu(r)){for(var $e in o)F=o[$e],o.hasOwnProperty($e)&&F!==void 0&&!l.hasOwnProperty($e)&&rd(i,r,$e,void 0,l,F);for(Y in l)F=l[Y],$=o[Y],!l.hasOwnProperty(Y)||F===$||F===void 0&&$===void 0||rd(i,r,Y,F,l,$);return}}for(var H in o)F=o[H],o.hasOwnProperty(H)&&F!=null&&!l.hasOwnProperty(H)&&qe(i,r,H,null,l,F);for(Q in l)F=l[Q],$=o[Q],!l.hasOwnProperty(Q)||F===$||F==null&&$==null||qe(i,r,Q,F,l,$)}function vv(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vC(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var d=o[l],f=d.transferSize,S=d.initiatorType,k=d.duration;if(f&&k&&vv(S)){for(S=0,k=d.responseEnd,l+=1;l<o.length;l++){var O=o[l],U=O.startTime;if(U>k)break;var Y=O.transferSize,Q=O.initiatorType;Y&&vv(Q)&&(O=O.responseEnd,S+=Y*(O<k?1:(k-U)/(O-U)))}if(--l,r+=8*(f+S)/(d.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var sd=null,nd=null;function Il(i){return i.nodeType===9?i:i.ownerDocument}function yv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function bv(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function od(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ad=null;function yC(){var i=window.event;return i&&i.type==="popstate"?i===ad?!1:(ad=i,!0):(ad=null,!1)}var Sv=typeof setTimeout=="function"?setTimeout:void 0,bC=typeof clearTimeout=="function"?clearTimeout:void 0,xv=typeof Promise=="function"?Promise:void 0,SC=typeof queueMicrotask=="function"?queueMicrotask:typeof xv<"u"?function(i){return xv.resolve(null).then(i).catch(xC)}:Sv;function xC(i){setTimeout(function(){throw i})}function ts(i){return i==="head"}function wv(i,r){var o=r,l=0;do{var d=o.nextSibling;if(i.removeChild(o),d&&d.nodeType===8)if(o=d.data,o==="/$"||o==="/&"){if(l===0){i.removeChild(d),Wn(r);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")Go(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,Go(o);for(var f=o.firstChild;f;){var S=f.nextSibling,k=f.nodeName;f[fo]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&f.rel.toLowerCase()==="stylesheet"||o.removeChild(f),f=S}}else o==="body"&&Go(i.ownerDocument.body);o=d}while(o);Wn(r)}function Cv(i,r){var o=i;i=0;do{var l=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),l&&l.nodeType===8)if(o=l.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=l}while(o)}function ld(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":ld(o),fu(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function wC(i,r,o,l){for(;i.nodeType===1;){var d=o;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(l){if(!i[fo])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(f=i.getAttribute("rel"),f==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(f!==d.rel||i.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||i.getAttribute("title")!==(d.title==null?null:d.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(f=i.getAttribute("src"),(f!==(d.src==null?null:d.src)||i.getAttribute("type")!==(d.type==null?null:d.type)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&f&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var f=d.name==null?null:""+d.name;if(d.type==="hidden"&&i.getAttribute("name")===f)return i}else return i;if(i=ki(i.nextSibling),i===null)break}return null}function CC(i,r,o){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=ki(i.nextSibling),i===null))return null;return i}function Ev(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=ki(i.nextSibling),i===null))return null;return i}function cd(i){return i.data==="$?"||i.data==="$~"}function ud(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function EC(i,r){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||o.readyState!=="loading")r();else{var l=function(){r(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),i._reactRetry=l}}function ki(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var hd=null;function kv(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(r===0)return ki(i.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}i=i.nextSibling}return null}function Mv(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return i;r--}else o!=="/$"&&o!=="/&"||r++}i=i.previousSibling}return null}function Rv(i,r,o){switch(r=Il(o),i){case"html":if(i=r.documentElement,!i)throw Error(n(452));return i;case"head":if(i=r.head,!i)throw Error(n(453));return i;case"body":if(i=r.body,!i)throw Error(n(454));return i;default:throw Error(n(451))}}function Go(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);fu(i)}var Mi=new Map,Nv=new Set;function Fl(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Cr=L.d;L.d={f:kC,r:MC,D:RC,C:NC,L:TC,m:AC,X:OC,S:DC,M:LC};function kC(){var i=Cr.f(),r=Ol();return i||r}function MC(i){var r=ln(i);r!==null&&r.tag===5&&r.type==="form"?V_(r):Cr.r(i)}var Un=typeof document>"u"?null:document;function Tv(i,r,o){var l=Un;if(l&&typeof r=="string"&&r){var d=yi(r);d='link[rel="'+i+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),Nv.has(d)||(Nv.add(d),i={rel:i,crossOrigin:o,href:r},l.querySelector(d)===null&&(r=l.createElement("link"),Lt(r,"link",i),xt(r),l.head.appendChild(r)))}}function RC(i){Cr.D(i),Tv("dns-prefetch",i,null)}function NC(i,r){Cr.C(i,r),Tv("preconnect",i,r)}function TC(i,r,o){Cr.L(i,r,o);var l=Un;if(l&&i&&r){var d='link[rel="preload"][as="'+yi(r)+'"]';r==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+yi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+yi(o.imageSizes)+'"]')):d+='[href="'+yi(i)+'"]';var f=d;switch(r){case"style":f=In(i);break;case"script":f=Fn(i)}Mi.has(f)||(i=v({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:i,as:r},o),Mi.set(f,i),l.querySelector(d)!==null||r==="style"&&l.querySelector(Xo(f))||r==="script"&&l.querySelector(Zo(f))||(r=l.createElement("link"),Lt(r,"link",i),xt(r),l.head.appendChild(r)))}}function AC(i,r){Cr.m(i,r);var o=Un;if(o&&i){var l=r&&typeof r.as=="string"?r.as:"script",d='link[rel="modulepreload"][as="'+yi(l)+'"][href="'+yi(i)+'"]',f=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Fn(i)}if(!Mi.has(f)&&(i=v({rel:"modulepreload",href:i},r),Mi.set(f,i),o.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Zo(f)))return}l=o.createElement("link"),Lt(l,"link",i),xt(l),o.head.appendChild(l)}}}function DC(i,r,o){Cr.S(i,r,o);var l=Un;if(l&&i){var d=cn(l).hoistableStyles,f=In(i);r=r||"default";var S=d.get(f);if(!S){var k={loading:0,preload:null};if(S=l.querySelector(Xo(f)))k.loading=5;else{i=v({rel:"stylesheet",href:i,"data-precedence":r},o),(o=Mi.get(f))&&dd(i,o);var O=S=l.createElement("link");xt(O),Lt(O,"link",i),O._p=new Promise(function(U,Y){O.onload=U,O.onerror=Y}),O.addEventListener("load",function(){k.loading|=1}),O.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Wl(S,r,l)}S={type:"stylesheet",instance:S,count:1,state:k},d.set(f,S)}}}function OC(i,r){Cr.X(i,r);var o=Un;if(o&&i){var l=cn(o).hoistableScripts,d=Fn(i),f=l.get(d);f||(f=o.querySelector(Zo(d)),f||(i=v({src:i,async:!0},r),(r=Mi.get(d))&&fd(i,r),f=o.createElement("script"),xt(f),Lt(f,"link",i),o.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(d,f))}}function LC(i,r){Cr.M(i,r);var o=Un;if(o&&i){var l=cn(o).hoistableScripts,d=Fn(i),f=l.get(d);f||(f=o.querySelector(Zo(d)),f||(i=v({src:i,async:!0,type:"module"},r),(r=Mi.get(d))&&fd(i,r),f=o.createElement("script"),xt(f),Lt(f,"link",i),o.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},l.set(d,f))}}function Av(i,r,o,l){var d=(d=ve.current)?Fl(d):null;if(!d)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=In(o.href),o=cn(d).hoistableStyles,l=o.get(r),l||(l={type:"style",instance:null,count:0,state:null},o.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=In(o.href);var f=cn(d).hoistableStyles,S=f.get(i);if(S||(d=d.ownerDocument||d,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(i,S),(f=d.querySelector(Xo(i)))&&!f._p&&(S.instance=f,S.state.loading=5),Mi.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Mi.set(i,o),f||zC(d,i,o,S.state))),r&&l===null)throw Error(n(528,""));return S}if(r&&l!==null)throw Error(n(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Fn(o),o=cn(d).hoistableScripts,l=o.get(r),l||(l={type:"script",instance:null,count:0,state:null},o.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function In(i){return'href="'+yi(i)+'"'}function Xo(i){return'link[rel="stylesheet"]['+i+"]"}function Dv(i){return v({},i,{"data-precedence":i.precedence,precedence:null})}function zC(i,r,o,l){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=i.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Lt(r,"link",o),xt(r),i.head.appendChild(r))}function Fn(i){return'[src="'+yi(i)+'"]'}function Zo(i){return"script[async]"+i}function Ov(i,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var l=i.querySelector('style[data-href~="'+yi(o.href)+'"]');if(l)return r.instance=l,xt(l),l;var d=v({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(i.ownerDocument||i).createElement("style"),xt(l),Lt(l,"style",d),Wl(l,o.precedence,i),r.instance=l;case"stylesheet":d=In(o.href);var f=i.querySelector(Xo(d));if(f)return r.state.loading|=4,r.instance=f,xt(f),f;l=Dv(o),(d=Mi.get(d))&&dd(l,d),f=(i.ownerDocument||i).createElement("link"),xt(f);var S=f;return S._p=new Promise(function(k,O){S.onload=k,S.onerror=O}),Lt(f,"link",l),r.state.loading|=4,Wl(f,o.precedence,i),r.instance=f;case"script":return f=Fn(o.src),(d=i.querySelector(Zo(f)))?(r.instance=d,xt(d),d):(l=o,(d=Mi.get(f))&&(l=v({},o),fd(l,d)),i=i.ownerDocument||i,d=i.createElement("script"),xt(d),Lt(d,"link",l),i.head.appendChild(d),r.instance=d);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,Wl(l,o.precedence,i));return r.instance}function Wl(i,r,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,f=d,S=0;S<l.length;S++){var k=l[S];if(k.dataset.precedence===r)f=k;else if(f!==d)break}f?f.parentNode.insertBefore(i,f.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(i,r.firstChild))}function dd(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function fd(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var ql=null;function Lv(i,r,o){if(ql===null){var l=new Map,d=ql=new Map;d.set(o,l)}else d=ql,l=d.get(o),l||(l=new Map,d.set(o,l));if(l.has(i))return l;for(l.set(i,null),o=o.getElementsByTagName(i),d=0;d<o.length;d++){var f=o[d];if(!(f[fo]||f[Tt]||i==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var S=f.getAttribute(r)||"";S=i+S;var k=l.get(S);k?k.push(f):l.set(S,[f])}}return l}function zv(i,r,o){i=i.ownerDocument||i,i.head.insertBefore(o,r==="title"?i.querySelector("head > title"):null)}function BC(i,r,o){if(o===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Bv(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function jC(i,r,o,l){if(o.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var d=In(l.href),f=r.querySelector(Xo(d));if(f){r=f._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=$l.bind(i),r.then(i,i)),o.state.loading|=4,o.instance=f,xt(f);return}f=r.ownerDocument||r,l=Dv(l),(d=Mi.get(d))&&dd(l,d),f=f.createElement("link"),xt(f);var S=f;S._p=new Promise(function(k,O){S.onload=k,S.onerror=O}),Lt(f,"link",l),o.instance=f}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=$l.bind(i),r.addEventListener("load",o),r.addEventListener("error",o))}}var md=0;function HC(i,r){return i.stylesheets&&i.count===0&&Kl(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var l=setTimeout(function(){if(i.stylesheets&&Kl(i,i.stylesheets),i.unsuspend){var f=i.unsuspend;i.unsuspend=null,f()}},6e4+r);0<i.imgBytes&&md===0&&(md=62500*vC());var d=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Kl(i,i.stylesheets),i.unsuspend)){var f=i.unsuspend;i.unsuspend=null,f()}},(i.imgBytes>md?50:800)+r);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function $l(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kl(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Vl=null;function Kl(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Vl=new Map,r.forEach(PC,i),Vl=null,$l.call(i))}function PC(i,r){if(!(r.state.loading&4)){var o=Vl.get(i);if(o)var l=o.get(null);else{o=new Map,Vl.set(i,o);for(var d=i.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<d.length;f++){var S=d[f];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(o.set(S.dataset.precedence,S),l=S)}l&&o.set(null,l)}d=r.instance,S=d.getAttribute("data-precedence"),f=o.get(S)||l,f===l&&o.set(null,d),o.set(S,d),this.count++,l=$l.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),f?f.parentNode.insertBefore(d,f.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(d,i.firstChild)),r.state.loading|=4}}var Qo={$$typeof:T,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function UC(i,r,o,l,d,f,S,k,O){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=cu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cu(0),this.hiddenUpdates=cu(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=f,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function jv(i,r,o,l,d,f,S,k,O,U,Y,Q){return i=new UC(i,r,o,S,O,U,Y,Q,k),r=1,f===!0&&(r|=24),f=ni(3,null,null,r),i.current=f,f.stateNode=i,r=Ku(),r.refCount++,i.pooledCache=r,r.refCount++,f.memoizedState={element:l,isDehydrated:o,cache:r},Zu(f),i}function Hv(i){return i?(i=yn,i):yn}function Pv(i,r,o,l,d,f){d=Hv(d),l.context===null?l.context=d:l.pendingContext=d,l=qr(r),l.payload={element:o},f=f===void 0?null:f,f!==null&&(l.callback=f),o=$r(i,l,r),o!==null&&(Jt(o,i,r),To(o,i,r))}function Uv(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<r?o:r}}function pd(i,r){Uv(i,r),(i=i.alternate)&&Uv(i,r)}function Iv(i){if(i.tag===13||i.tag===31){var r=Cs(i,67108864);r!==null&&Jt(r,i,67108864),pd(i,67108864)}}function Fv(i){if(i.tag===13||i.tag===31){var r=ui();r=uu(r);var o=Cs(i,r);o!==null&&Jt(o,i,r),pd(i,r)}}var Yl=!0;function IC(i,r,o,l){var d=A.T;A.T=null;var f=L.p;try{L.p=2,_d(i,r,o,l)}finally{L.p=f,A.T=d}}function FC(i,r,o,l){var d=A.T;A.T=null;var f=L.p;try{L.p=8,_d(i,r,o,l)}finally{L.p=f,A.T=d}}function _d(i,r,o,l){if(Yl){var d=gd(l);if(d===null)id(i,r,l,Gl,o),qv(i,l);else if(qC(d,i,r,o,l))l.stopPropagation();else if(qv(i,l),r&4&&-1<WC.indexOf(i)){for(;d!==null;){var f=ln(d);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var S=ys(f.pendingLanes);if(S!==0){var k=f;for(k.pendingLanes|=2,k.entangledLanes|=2;S;){var O=1<<31-ri(S);k.entanglements[1]|=O,S&=~O}Yi(f),(Pe&6)===0&&(Al=Pt()+500,Vo(0))}}break;case 31:case 13:k=Cs(f,2),k!==null&&Jt(k,f,2),Ol(),pd(f,2)}if(f=gd(l),f===null&&id(i,r,l,Gl,o),f===d)break;d=f}d!==null&&l.stopPropagation()}else id(i,r,l,null,o)}}function gd(i){return i=yu(i),vd(i)}var Gl=null;function vd(i){if(Gl=null,i=an(i),i!==null){var r=c(i);if(r===null)i=null;else{var o=r.tag;if(o===13){if(i=u(r),i!==null)return i;i=null}else if(o===31){if(i=h(r),i!==null)return i;i=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return Gl=i,null}function Wv(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Be()){case vs:return 2;case sn:return 8;case nn:case lu:return 32;case Jm:return 268435456;default:return 32}default:return 32}}var yd=!1,is=null,rs=null,ss=null,Jo=new Map,ea=new Map,ns=[],WC="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function qv(i,r){switch(i){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":rs=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":Jo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":ea.delete(r.pointerId)}}function ta(i,r,o,l,d,f){return i===null||i.nativeEvent!==f?(i={blockedOn:r,domEventName:o,eventSystemFlags:l,nativeEvent:f,targetContainers:[d]},r!==null&&(r=ln(r),r!==null&&Iv(r)),i):(i.eventSystemFlags|=l,r=i.targetContainers,d!==null&&r.indexOf(d)===-1&&r.push(d),i)}function qC(i,r,o,l,d){switch(r){case"focusin":return is=ta(is,i,r,o,l,d),!0;case"dragenter":return rs=ta(rs,i,r,o,l,d),!0;case"mouseover":return ss=ta(ss,i,r,o,l,d),!0;case"pointerover":var f=d.pointerId;return Jo.set(f,ta(Jo.get(f)||null,i,r,o,l,d)),!0;case"gotpointercapture":return f=d.pointerId,ea.set(f,ta(ea.get(f)||null,i,r,o,l,d)),!0}return!1}function $v(i){var r=an(i.target);if(r!==null){var o=c(r);if(o!==null){if(r=o.tag,r===13){if(r=u(o),r!==null){i.blockedOn=r,np(i.priority,function(){Fv(o)});return}}else if(r===31){if(r=h(o),r!==null){i.blockedOn=r,np(i.priority,function(){Fv(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Xl(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var o=gd(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);vu=l,o.target.dispatchEvent(l),vu=null}else return r=ln(o),r!==null&&Iv(r),i.blockedOn=o,!1;r.shift()}return!0}function Vv(i,r,o){Xl(i)&&o.delete(r)}function $C(){yd=!1,is!==null&&Xl(is)&&(is=null),rs!==null&&Xl(rs)&&(rs=null),ss!==null&&Xl(ss)&&(ss=null),Jo.forEach(Vv),ea.forEach(Vv)}function Zl(i,r){i.blockedOn===r&&(i.blockedOn=null,yd||(yd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,$C)))}var Ql=null;function Kv(i){Ql!==i&&(Ql=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ql===i&&(Ql=null);for(var r=0;r<i.length;r+=3){var o=i[r],l=i[r+1],d=i[r+2];if(typeof l!="function"){if(vd(l||o)===null)continue;break}var f=ln(o);f!==null&&(i.splice(r,3),r-=3,gh(f,{pending:!0,data:d,method:o.method,action:l},l,d))}}))}function Wn(i){function r(O){return Zl(O,i)}is!==null&&Zl(is,i),rs!==null&&Zl(rs,i),ss!==null&&Zl(ss,i),Jo.forEach(r),ea.forEach(r);for(var o=0;o<ns.length;o++){var l=ns[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<ns.length&&(o=ns[0],o.blockedOn===null);)$v(o),o.blockedOn===null&&ns.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var d=o[l],f=o[l+1],S=d[Kt]||null;if(typeof f=="function")S||Kv(o);else if(S){var k=null;if(f&&f.hasAttribute("formAction")){if(d=f,S=f[Kt]||null)k=S.formAction;else if(vd(d)!==null)continue}else k=S.action;typeof k=="function"?o[l+1]=k:(o.splice(l,3),l-=3),Kv(o)}}}function Yv(){function i(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(S){return d=S})},focusReset:"manual",scroll:"manual"})}function r(){d!==null&&(d(),d=null),l||setTimeout(o,20)}function o(){if(!l&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){l=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),d!==null&&(d(),d=null)}}}function bd(i){this._internalRoot=i}Jl.prototype.render=bd.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));var o=r.current,l=ui();Pv(o,l,i,r,null,null)},Jl.prototype.unmount=bd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Pv(i.current,2,null,i,null,null),Ol(),r[on]=null}};function Jl(i){this._internalRoot=i}Jl.prototype.unstable_scheduleHydration=function(i){if(i){var r=sp();i={blockedOn:null,target:i,priority:r};for(var o=0;o<ns.length&&r!==0&&r<ns[o].priority;o++);ns.splice(o,0,i),o===0&&$v(i)}};var Gv=t.version;if(Gv!=="19.2.4")throw Error(n(527,Gv,"19.2.4"));L.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=p(r),i=i!==null?y(i):null,i=i===null?null:i.stateNode,i};var VC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ec=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ec.isDisabled&&ec.supportsFiber)try{co=ec.inject(VC),ii=ec}catch{}}return ia.createRoot=function(i,r){if(!a(i))throw Error(n(299));var o=!1,l="",d=ig,f=rg,S=sg;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(f=r.onCaughtError),r.onRecoverableError!==void 0&&(S=r.onRecoverableError)),r=jv(i,1,!1,null,null,o,l,null,d,f,S,Yv),i[on]=r.current,td(i),new bd(r)},ia.hydrateRoot=function(i,r,o){if(!a(i))throw Error(n(299));var l=!1,d="",f=ig,S=rg,k=sg,O=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(f=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(O=o.formState)),r=jv(i,1,!0,r,o??null,l,d,O,f,S,k,Yv),r.context=Hv(null),o=r.current,l=ui(),l=uu(l),d=qr(l),d.callback=null,$r(o,d,l),o=l,r.current.lanes=o,ho(r,o),Yi(r),i[on]=r.current,td(i),new Jl(r)},ia.version="19.2.4",ia}var Jv;function s2(){if(Jv)return Sd.exports;Jv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sd.exports=r2(),Sd.exports}var n2=s2();const Cd="rcc_token";function o2(){const[e,t]=g.useState(()=>localStorage.getItem(Cd)),[s,n]=g.useState(null),[a,c]=g.useState(null),[u,h]=g.useState(!1);g.useEffect(()=>{const v=new AbortController;return fetch("/api/auth/status",{signal:v.signal}).then(b=>b.json()).then(b=>n(b.initialized)).catch(b=>{b.name!=="AbortError"&&n(!1)}),()=>v.abort()},[]),g.useEffect(()=>{if(!e)return;const v=new AbortController;return fetch("/api/auth/session",{method:"POST",headers:{Authorization:`Bearer ${e}`},signal:v.signal}).catch(()=>{}),()=>v.abort()},[e]);const m=g.useCallback(async v=>{h(!0),c(null);try{const b=await fetch("/api/auth/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:v})}),x=await b.json();return b.ok?(n(!0),!0):(c(x.error||"Setup failed"),!1)}catch{return c("Connection failed"),!1}finally{h(!1)}},[]),p=g.useCallback(async v=>{h(!0),c(null);try{const b=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:v})}),x=await b.json();return b.ok?(localStorage.setItem(Cd,x.token),t(x.token),!0):(c(x.error||"Login failed"),!1)}catch{return c("Connection failed"),!1}finally{h(!1)}},[]),y=g.useCallback(()=>{fetch("/api/auth/logout",{method:"POST"}).catch(()=>{}),localStorage.removeItem(Cd),t(null)},[]);return{token:e,initialized:s,error:a,loading:u,setup:m,login:p,logout:y}}const Ed=10,a2=3e4,l2=75e3,c2=6e4;function u2(e,t,s){const[n,a]=g.useState("disconnected"),c=g.useRef(null),u=g.useRef(0),h=g.useRef(void 0),m=g.useRef(void 0),p=g.useRef("disconnected"),y=g.useRef(0),v=g.useRef(null),b=g.useRef([]),x=g.useRef(t);x.current=t;const w=g.useRef(s);w.current=s;const C=g.useCallback(W=>{p.current=W,a(W)},[]),E=g.useCallback(()=>{m.current&&(clearInterval(m.current),m.current=void 0),h.current&&(clearTimeout(h.current),h.current=void 0)},[]),M=g.useCallback(()=>y.current?Date.now()-y.current>l2:!1,[]),R=g.useCallback(W=>{m.current&&clearInterval(m.current),m.current=setInterval(()=>{if(W.readyState===WebSocket.OPEN){if(!document.hidden&&p.current==="authenticated"&&M()){u.current=0,W.close();return}W.send(JSON.stringify({type:"ping"}))}},a2)},[M]),T=g.useCallback(W=>{if(W.readyState!==WebSocket.OPEN||b.current.length===0)return;const A=[...b.current];b.current=[];for(const L of A)W.send(JSON.stringify(L))},[]),N=g.useCallback(()=>{if(!e)return;const W=c.current;W&&(W.readyState===WebSocket.OPEN||W.readyState===WebSocket.CONNECTING)&&W.close(),E(),C("connecting");const A=location.protocol==="https:"?"wss:":"ws:",L=new WebSocket(`${A}//${location.host}/ws`);c.current=L,L.onopen=()=>{if(c.current!==L){L.close();return}C("connected"),u.current=0,y.current=Date.now(),L.send(JSON.stringify({type:"auth",token:e})),R(L)},L.onmessage=z=>{var K;if(c.current===L)try{const ee=JSON.parse(z.data);if(y.current=Date.now(),ee.type==="auth_result")if(ee.payload.success)C("authenticated"),T(L);else{b.current=[],u.current=Ed,L.close(),(K=w.current)==null||K.call(w);return}x.current(ee)}catch{}},L.onclose=()=>{if(c.current===L)c.current=null;else return;if(C("disconnected"),E(),u.current<Ed){const z=Math.min(1e3*Math.pow(2,u.current),3e4);u.current++,h.current=setTimeout(N,z)}},L.onerror=()=>{}},[E,T,R,e,C]),D=g.useCallback(W=>{const A=c.current;if((A==null?void 0:A.readyState)===WebSocket.OPEN&&p.current==="authenticated"&&!M()){A.send(JSON.stringify(W));return}if(b.current.push(W),u.current=0,A&&(A.readyState===WebSocket.OPEN||A.readyState===WebSocket.CONNECTING)){A.close();return}N()},[N,M]),j=g.useCallback(()=>{var W;E(),u.current=Ed,b.current=[],y.current=0,v.current=null,(W=c.current)==null||W.close(),c.current=null,C("disconnected")},[E,C]),q=g.useCallback((W,A,L,z)=>{D({type:"chat",payload:{prompt:W,cwd:A,resumeSessionId:L,...z!=null&&z.model?{model:z.model}:{},...z!=null&&z.effort?{effort:z.effort}:{},...z!=null&&z.thinking?{thinking:z.thinking}:{},...z!=null&&z.permissionMode?{permissionMode:z.permissionMode}:{}}})},[D]),te=g.useCallback(W=>{D({type:"set_model",payload:{model:W}})},[D]),re=g.useCallback(W=>{D({type:"set_permission_mode",payload:{mode:W}})},[D]),oe=g.useCallback((W,A)=>{const L={...W?{cwd:W}:{},...A?{sessionId:A}:{}};D({type:"request_capabilities",payload:Object.keys(L).length>0?L:void 0})},[D]),Z=g.useCallback(()=>{D({type:"interrupt"})},[D]),G=g.useCallback(()=>{D({type:"abort"})},[D]),I=g.useCallback((W,A,L)=>{D({type:"permission_response",payload:{requestId:W,behavior:A,sessionId:L}})},[D]),V=g.useCallback(W=>{D({type:"reattach",payload:{sessionId:W}})},[D]);return g.useEffect(()=>{const W=()=>{const A=c.current;if(document.hidden){v.current=Date.now();return}const L=v.current?Date.now()-v.current:0;if(v.current=null,!!e){if(!A||A.readyState===WebSocket.CLOSED){u.current=0,N();return}if(A.readyState===WebSocket.OPEN){if(L>=c2||M()){u.current=0,A.close();return}R(A)}}};return document.addEventListener("visibilitychange",W),()=>document.removeEventListener("visibilitychange",W)},[e,R,N,M]),g.useEffect(()=>(e&&N(),()=>{j()}),[e,N,j]),{status:n,sendChat:q,interrupt:Z,abort:G,disconnect:j,setModel:te,setPermissionMode:re,requestCapabilities:oe,sendPermissionResponse:I,reattachSession:V,sendRaw:D}}function h2(e){return Array.from(e,t=>t.toString(16).padStart(2,"0"))}function Fs(){const e=globalThis.crypto;if(typeof(e==null?void 0:e.randomUUID)=="function")return e.randomUUID();if(typeof(e==null?void 0:e.getRandomValues)=="function"){const t=e.getRandomValues(new Uint8Array(16));t[6]=t[6]&15|64,t[8]=t[8]&63|128;const s=h2(t);return[s.slice(0,4).join(""),s.slice(4,6).join(""),s.slice(6,8).join(""),s.slice(8,10).join(""),s.slice(10,16).join("")].join("-")}return`fallback-${Date.now()}-${Math.random().toString(16).slice(2)}`}function d2(){const[e,t]=g.useState([]),[s,n]=g.useState(!1),[a,c]=g.useState(null),u=g.useRef({blocks:[],toolInputs:new Map}),h=g.useRef(0),m=g.useRef(null);g.useEffect(()=>()=>{h.current&&(cancelAnimationFrame(h.current),h.current=0)},[]);const p=g.useCallback((E,M)=>{const R={id:Fs(),role:"user",blocks:[{type:"text",text:E}],timestamp:Date.now(),attachments:M!=null&&M.length?M:void 0};t(T=>[...T,R])},[]),y=g.useCallback(E=>{switch(E.type){case"chat_started":{n(!0),u.current={blocks:[],toolInputs:new Map};const M={id:Fs(),role:"assistant",blocks:[],timestamp:Date.now(),isStreaming:!0};t(R=>[...R,M]);break}case"stream_delta":{const{text:M,blockIndex:R}=E.payload;u.current.blocks[R]=u.current.blocks[R]||{type:"text",text:""};const T=u.current.blocks[R];T.type==="text"&&(T.text+=M),v(u.current.blocks);break}case"thinking_start":{const{blockIndex:M}=E.payload;u.current.blocks[M]={type:"thinking",thinking:"",collapsed:!1},v(u.current.blocks);break}case"thinking_delta":{const{thinking:M,blockIndex:R}=E.payload,T=u.current.blocks[R];(T==null?void 0:T.type)==="thinking"&&(T.thinking+=M),v(u.current.blocks);break}case"tool_start":{const{id:M,name:R,blockIndex:T}=E.payload;u.current.blocks[T]={type:"tool_use",id:M,name:R,input:"",collapsed:!1},u.current.toolInputs.set(T,""),v(u.current.blocks);break}case"tool_input_delta":{const{delta:M,blockIndex:R}=E.payload,N=(u.current.toolInputs.get(R)||"")+M;u.current.toolInputs.set(R,N);const D=u.current.blocks[R];(D==null?void 0:D.type)==="tool_use"&&(D.input=N),v(u.current.blocks);break}case"assistant_message":{const M=E.payload.content.map(R=>{if(R.type==="text")return{type:"text",text:R.text};if(R.type==="thinking")return{type:"thinking",thinking:R.thinking,collapsed:!0};if(R.type==="tool_use")return{type:"tool_use",id:R.id,name:R.name,input:typeof R.input=="string"?R.input:JSON.stringify(R.input,null,2),collapsed:!0};if(R.type==="tool_result"){const T=typeof R.content=="string"?R.content:JSON.stringify(R.content);return t(N=>{const D=[...N];for(let j=D.length-1;j>=0;j--){if(D[j].role!=="assistant")continue;const q=D[j].blocks.findIndex(te=>te.type==="tool_use"&&te.id===R.tool_use_id);if(q!==-1){const te=[...D[j].blocks],re=te[q];re.type==="tool_use"&&(te[q]={...re,result:T,isError:R.is_error}),D[j]={...D[j],blocks:te};break}}return D}),null}return{type:"text",text:"[unknown block]"}}).filter(Boolean);M.length>0&&(h.current&&(cancelAnimationFrame(h.current),h.current=0,m.current=null),u.current.blocks=[],u.current.toolInputs=new Map,t(R=>{const T=[...R],N=T.length-1;return N>=0&&T[N].role==="assistant"&&T[N].isStreaming?T[N]={...T[N],blocks:M,isStreaming:!1}:T.push({id:Fs(),role:"assistant",blocks:M,timestamp:Date.now()}),T}));break}case"system_init":{c(E.payload.sessionId);break}case"result":case"chat_complete":{n(!1),h.current&&(cancelAnimationFrame(h.current),h.current=0,m.current=null),u.current={blocks:[],toolInputs:new Map},t(M=>{const R=[...M],T=R.length-1;return T>=0&&R[T].isStreaming&&(R[T].blocks.length===0?R.pop():R[T]={...R[T],isStreaming:!1}),R});break}case"error":{const M=E.payload.message,R=M==="Session is no longer active";n(!1),h.current&&(cancelAnimationFrame(h.current),h.current=0,m.current=null),u.current={blocks:[],toolInputs:new Map},R&&c(null),t(T=>{const N=[...T],D=N.length-1;return D>=0&&N[D].isStreaming&&(N[D].blocks.length===0?N.pop():N[D]={...N[D],isStreaming:!1}),R||N.push({id:Fs(),role:"assistant",blocks:[{type:"text",text:`Error: ${M}`}],timestamp:Date.now()}),N});break}case"permission_request":{const{sessionId:M,requestId:R,toolName:T,input:N,decisionReason:D,description:j}=E.payload,q={type:"permission_request",sessionId:M,requestId:R,toolName:T,input:N,status:"pending",decisionReason:D,description:j};u.current.blocks.push(q),v(u.current.blocks);break}}},[]);function v(E){m.current=E,h.current||(h.current=requestAnimationFrame(()=>{h.current=0;const M=m.current;if(!M)return;m.current=null;const R=M.filter(Boolean);t(T=>{const N=T.length-1,D=N>=0?T[N]:null;if((D==null?void 0:D.role)==="assistant"&&D.isStreaming){const j=T.slice();return j[N]={...T[N],blocks:R},j}return[...T,{id:Fs(),role:"assistant",blocks:R,timestamp:Date.now(),isStreaming:!0}]})}))}const b=g.useCallback(()=>{h.current&&(cancelAnimationFrame(h.current),h.current=0,m.current=null),u.current={blocks:[],toolInputs:new Map},t([]),n(!1),c(null)},[]),x=g.useCallback((E,M)=>{t(R=>{const T=[...R];for(let N=T.length-1;N>=0;N--){const D=T[N],j=D.blocks.findIndex(q=>q.type==="permission_request"&&q.requestId===E);if(j!==-1){const q=[...D.blocks],te=q[j];te.type==="permission_request"&&(q[j]={...te,status:M}),T[N]={...D,blocks:q};break}}return T})},[]);function w(E){const M=/\n\n\[Attached files:\n([\s\S]*?)\n\]$/,R=E.match(M);if(!R)return{cleanText:E,attachments:[]};const T=E.replace(M,""),N=R[1].split(`
|
|
27
|
+
`).filter(q=>q.startsWith("- ")),D={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",pdf:"application/pdf",txt:"text/plain",ts:"text/typescript",tsx:"text/typescript",js:"text/javascript",json:"application/json"},j=N.map(q=>{var I;const te=q.slice(2).trim(),re=te.split("/").pop()||te,oe=re.split("-"),Z=oe.length>5?oe.slice(5).join("-"):re,G=((I=Z.split(".").pop())==null?void 0:I.toLowerCase())||"";return{name:Z,mimeType:D[G]||"application/octet-stream",serverPath:te,serverFileName:re}});return{cleanText:T,attachments:j}}const C=g.useCallback(E=>{const M=[];for(const R of E)if(R.type==="user"){const T=R.message,N=T==null?void 0:T.content;let D="";if(typeof N=="string"?D=N:Array.isArray(N)&&(D=N.filter(j=>j.type==="text").map(j=>j.text).join("")),D){const{cleanText:j,attachments:q}=w(D);M.push({id:R.uuid,role:"user",blocks:[{type:"text",text:j}],timestamp:Date.now(),attachments:q.length?q:void 0})}}else if(R.type==="assistant"){const T=R.message,N=T==null?void 0:T.content;if(Array.isArray(N)){const D=[];for(const j of N)j.type==="text"&&j.text?D.push({type:"text",text:j.text}):j.type==="thinking"&&j.thinking?D.push({type:"thinking",thinking:j.thinking,collapsed:!0}):j.type==="tool_use"&&D.push({type:"tool_use",id:j.id,name:j.name,input:typeof j.input=="string"?j.input:JSON.stringify(j.input,null,2),collapsed:!0});D.length>0&&M.push({id:R.uuid,role:"assistant",blocks:D,timestamp:Date.now()})}}t(M),n(!1)},[]);return{messages:e,isProcessing:s,currentSessionId:a,addUserMessage:p,handleServerMessage:y,clearMessages:b,loadHistoryMessages:C,updatePermissionStatus:x}}function f2(e,t){const[s,n]=g.useState([]),[a,c]=g.useState(null),[u,h]=g.useState(!1),m=g.useRef(null),p=g.useRef(null),y=g.useRef(0),v=g.useCallback(async()=>{var E;if(!e)return;(E=m.current)==null||E.abort();const C=new AbortController;m.current=C,h(!0);try{const M=new URLSearchParams({limit:"30"});t&&M.set("dir",t);const R=await fetch(`/api/threads?${M}`,{headers:{Authorization:`Bearer ${e}`},signal:C.signal});if(R.ok){const T=await R.json();n(T.threads||[])}}catch(M){if(M instanceof DOMException&&M.name==="AbortError")return}finally{m.current===C&&(m.current=null,h(!1))}},[e,t]),b=g.useCallback(async C=>{var M;if(!e)return[];(M=p.current)==null||M.abort();const E=new AbortController;p.current=E;try{const R=await fetch(`/api/threads/${C}/messages`,{headers:{Authorization:`Bearer ${e}`},signal:E.signal});return R.ok?(await R.json()).messages||[]:[]}finally{p.current===E&&(p.current=null)}},[e]),x=g.useCallback(async C=>{const E=++y.current;c(C);try{const M=await b(C);return E!==y.current?null:M}catch(M){if(M instanceof DOMException&&M.name==="AbortError")return null;throw M}},[b]),w=g.useCallback(()=>{c(null)},[]);return g.useEffect(()=>{e&&v()},[e,v]),g.useEffect(()=>()=>{var C,E;(C=m.current)==null||C.abort(),(E=p.current)==null||E.abort()},[]),{threads:s,activeThreadId:a,setActiveThreadId:c,loading:u,fetchThreads:v,switchThread:x,startNewThread:w}}const Qy="rcc_theme",m2="#faf9f5",p2="#1a1915";function e0(){const e=localStorage.getItem(Qy);return e==="light"||e==="dark"||e==="system"?e:"system"}function _2(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function kd(e){return e==="system"?_2()?"dark":"light":e}function Md(e){const t=document.documentElement;e==="dark"?t.classList.add("dark"):t.classList.remove("dark");const s=document.querySelector('meta[name="theme-color"]');s&&s.setAttribute("content",e==="dark"?p2:m2)}function g2(){const[e,t]=g.useState(e0),[s,n]=g.useState(()=>kd(e0())),a=g.useCallback(c=>{localStorage.setItem(Qy,c),t(c);const u=kd(c);n(u),Md(u)},[]);return g.useEffect(()=>{Md(s)},[]),g.useEffect(()=>{if(e!=="system")return;const c=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{const h=kd("system");n(h),Md(h)};return c.addEventListener("change",u),()=>c.removeEventListener("change",u)},[e]),{theme:e,resolved:s,setTheme:a}}const Jy="rcc_preferences",Rd={effort:"high",thinking:"adaptive",permissionMode:"acceptEdits"};function v2(){try{const e=localStorage.getItem(Jy);return e?{...Rd,...JSON.parse(e)}:Rd}catch{return Rd}}function y2(){const[e,t]=g.useState(v2),s=g.useCallback((n,a)=>{t(c=>{const u={...c,[n]:a};return localStorage.setItem(Jy,JSON.stringify(u)),u})},[]);return{preferences:e,updatePreference:s}}const eb="rcc_models";function b2(){try{const e=localStorage.getItem(eb);if(e){const t=JSON.parse(e);if(Array.isArray(t)&&t.length>0)return t}}catch{}return[]}function S2(e,t){const[s,n]=g.useState(b2),[a,c]=g.useState([]),[u,h]=g.useState([]),[m,p]=g.useState(e||""),[y,v]=g.useState(t||"acceptEdits"),b=g.useCallback(w=>{w.model&&p(w.model),w.permissionMode&&v(w.permissionMode),w.mcpServers&&h(w.mcpServers)},[]),x=g.useCallback(w=>{n(w.models),c(w.commands),h(w.mcpServers);try{localStorage.setItem(eb,JSON.stringify(w.models))}catch{}},[]);return{models:s,commands:a,mcpServers:u,currentModel:m,currentPermissionMode:y,setCurrentModel:p,setCurrentPermissionMode:v,handleSystemInit:b,handleCapabilities:x}}function x2(){const[e,t]=g.useState([]),s=g.useCallback(u=>{const h=Array.from(u).map(m=>({id:Fs(),file:m,name:m.name,type:m.type,size:m.size,preview:m.type.startsWith("image/")?URL.createObjectURL(m):void 0,uploadStatus:"pending"}));t(m=>[...m,...h])},[]),n=g.useCallback(u=>{t(h=>{const m=h.find(p=>p.id===u);return m!=null&&m.preview&&URL.revokeObjectURL(m.preview),h.filter(p=>p.id!==u)})},[]),a=g.useCallback(async u=>{const h=e.filter(y=>y.uploadStatus==="pending");if(h.length===0)return e.filter(y=>y.serverPath).map(y=>({name:y.name,mimeType:y.type,serverPath:y.serverPath,serverFileName:y.serverPath.split("/").pop()}));const m=[];for(const y of h){t(v=>v.map(b=>b.id===y.id?{...b,uploadStatus:"uploading"}:b));try{const v=new FormData;v.append("file",y.file);const b=await fetch("/api/upload",{method:"POST",headers:{Authorization:`Bearer ${u}`},body:v});if(!b.ok){const w=await b.json().catch(()=>({error:"Upload failed"}));throw new Error(w.error)}const x=await b.json();m.push({name:x.fileName,mimeType:x.mimeType,serverPath:x.filePath,serverFileName:x.filePath.split("/").pop()}),t(w=>w.map(C=>C.id===y.id?{...C,uploadStatus:"done",serverPath:x.filePath}:C))}catch{t(v=>v.map(b=>b.id===y.id?{...b,uploadStatus:"error"}:b))}}return[...e.filter(y=>y.uploadStatus==="done"&&y.serverPath).map(y=>({name:y.name,mimeType:y.type,serverPath:y.serverPath,serverFileName:y.serverPath.split("/").pop()})),...m]},[e]),c=g.useCallback(()=>{t(u=>{for(const h of u)h.preview&&URL.revokeObjectURL(h.preview);return[]})},[]);return{attachments:e,addAttachments:s,removeAttachment:n,uploadAll:a,clear:c}}const ra="rcc_active_project";function w2(e){const[t,s]=g.useState([]),[n,a]=g.useState(null),[c,u]=g.useState(!1);g.useEffect(()=>{try{const v=localStorage.getItem(ra);v&&a(JSON.parse(v))}catch{}},[]);const h=g.useCallback(async()=>{if(e){u(!0);try{const v=await fetch("/api/projects",{headers:{Authorization:`Bearer ${e}`}});if(v.ok){const x=(await v.json()).projects||[];s(x),a(w=>w&&!x.some(C=>C.path===w.path)?(localStorage.removeItem(ra),null):w)}}catch{}finally{u(!1)}}},[e]);g.useEffect(()=>{e&&h()},[e,h]);const m=g.useCallback(v=>{a(v),v?localStorage.setItem(ra,JSON.stringify(v)):localStorage.removeItem(ra)},[]),p=g.useCallback(async(v,b)=>{if(!e)return;const x=await fetch("/api/projects",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({path:v,name:b})});if(x.ok){const C=(await x.json()).project;s(E=>[...E,C]),m(C)}else{const w=await x.json();throw new Error(w.error||"Failed to add project")}},[e,m]),y=g.useCallback(async v=>{if(!e)return;(await fetch("/api/projects",{method:"DELETE",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({path:v})})).ok&&(s(x=>x.filter(w=>w.path!==v)),a(x=>(x==null?void 0:x.path)===v?(localStorage.removeItem(ra),null):x))},[e]);return{projects:t,activeProject:n,loading:c,fetchProjects:h,switchProject:m,addProject:p,removeProject:y}}let C2=0;function E2(){const[e,t]=g.useState([]),s=g.useCallback(u=>{const h=`ref_${++C2}_${Date.now()}`;t(m=>m.some(y=>y.type!==u.type||y.path!==u.path?!1:y.type==="code_snippet"&&u.type==="code_snippet"?y.startLine===u.startLine&&y.endLine===u.endLine:!0)?m:[...m,{...u,id:h}])},[]),n=g.useCallback(u=>{t(h=>h.filter(m=>m.id!==u))},[]),a=g.useCallback(()=>{t([])},[]),c=g.useCallback(()=>{if(e.length===0)return"";const u=["[Referenced context:"];for(const h of e)h.type==="file"?u.push(`- ${h.path} (file)`):h.type==="folder"?u.push(`- ${h.path}/ (folder)`):h.type==="code_snippet"&&(u.push(`- ${h.path}:${h.startLine}-${h.endLine}`),u.push("```"),u.push(h.content),u.push("```"));return u.push("]"),u.join(`
|
|
28
|
+
`)},[e]);return{references:e,addReference:s,removeReference:n,clear:a,serialize:c}}function k2(e){const[t,s]=g.useState(new Map),[n,a]=g.useState(null),[c,u]=g.useState(!1),h=g.useRef(null),m=g.useRef(null),p=g.useCallback(R=>{h.current=R},[]),y=g.useCallback((R,T,N)=>{const D=Fs();return e({type:"terminal_create",payload:{id:D,cwd:R,cols:T,rows:N}}),D},[e]),v=g.useCallback((R,T)=>{e({type:"terminal_input",payload:{id:R,data:T}})},[e]),b=g.useCallback((R,T,N)=>{e({type:"terminal_resize",payload:{id:R,cols:T,rows:N}})},[e]),x=g.useCallback(R=>{e({type:"terminal_destroy",payload:{id:R}}),s(T=>{const N=new Map(T);return N.delete(R),N}),a(T=>T===R?null:T)},[e]),w=g.useCallback(()=>{e({type:"terminal_list"})},[e]),C=g.useCallback((R,T,N)=>{u(!0),m.current=t.size===0?{cwd:R,cols:T,rows:N}:null,w()},[w,t.size]),E=g.useCallback(()=>{m.current=null,u(!1)},[]),M=g.useCallback(R=>{var T;switch(R.type){case"terminal_created":{const N=R.payload;s(D=>{const j=new Map(D);return j.set(N.id,{id:N.id,shell:N.shell,cwd:N.cwd}),j}),a(N.id),u(!0);break}case"terminal_output":{const N=R.payload;(T=h.current)==null||T.call(h,N.id,N.data);break}case"terminal_exited":{const N=R.payload;s(D=>{const j=new Map(D);return j.delete(N.id),j}),a(D=>D===N.id?null:D);break}case"terminal_list":{const N=R.payload,D=new Map;for(const j of N.terminals)D.set(j.id,{id:j.id,shell:j.shell,cwd:j.cwd});if(s(D),a(j=>j&&D.has(j)?j:D.keys().next().value??null),m.current)if(D.size===0){const j=m.current;m.current=null,y(j.cwd,j.cols,j.rows)}else m.current=null;break}}},[y]);return{terminals:t,activeTerminalId:n,setActiveTerminalId:a,terminalPanelVisible:c,setTerminalPanelVisible:u,openTerminalPanel:C,closeTerminalPanel:E,createTerminal:y,sendInput:v,resizeTerminal:b,destroyTerminal:x,requestTerminalList:w,handleServerMessage:M,registerOutputCallback:p}}function M2(){const[e,t]=g.useState([]),[s,n]=g.useState(null),[a,c]=g.useState(""),u=g.useCallback(m=>{const{terminalId:p,port:y,url:v}=m.payload;t(b=>b.some(x=>x.port===y)?b:[...b,{terminalId:p,port:y,url:v}]),n(b=>b??y)},[]),h=g.useCallback(m=>{t(p=>{const y=p.filter(v=>v.terminalId!==m);return n(v=>{var b;return v&&!y.some(x=>x.port===v)?((b=y[0])==null?void 0:b.port)??null:v}),y})},[]);return{detectedPorts:e,activePreviewPort:s,setActivePreviewPort:n,customPreviewUrl:a,setCustomPreviewUrl:c,handlePortDetected:u,removePortsForTerminal:h}}/**
|
|
29
|
+
* @license lucide-react v0.577.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/const tb=(...e)=>e.filter((t,s,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===s).join(" ").trim();/**
|
|
34
|
+
* @license lucide-react v0.577.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/const R2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
39
|
+
* @license lucide-react v0.577.0 - ISC
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the ISC license.
|
|
42
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/const N2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,n)=>n?n.toUpperCase():s.toLowerCase());/**
|
|
44
|
+
* @license lucide-react v0.577.0 - ISC
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the ISC license.
|
|
47
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/const t0=e=>{const t=N2(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
49
|
+
* @license lucide-react v0.577.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/var T2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
54
|
+
* @license lucide-react v0.577.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/const A2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
59
|
+
* @license lucide-react v0.577.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const D2=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:a="",children:c,iconNode:u,...h},m)=>g.createElement("svg",{ref:m,...T2,width:t,height:t,stroke:e,strokeWidth:n?Number(s)*24/Number(t):s,className:tb("lucide",a),...!c&&!A2(h)&&{"aria-hidden":"true"},...h},[...u.map(([p,y])=>g.createElement(p,y)),...Array.isArray(c)?c:[c]]));/**
|
|
64
|
+
* @license lucide-react v0.577.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const fe=(e,t)=>{const s=g.forwardRef(({className:n,...a},c)=>g.createElement(D2,{ref:c,iconNode:t,className:tb(`lucide-${R2(t0(e))}`,`lucide-${e}`,n),...a}));return s.displayName=t0(e),s};/**
|
|
69
|
+
* @license lucide-react v0.577.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const O2=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],i0=fe("arrow-left",O2);/**
|
|
74
|
+
* @license lucide-react v0.577.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const L2=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ib=fe("arrow-up",L2);/**
|
|
79
|
+
* @license lucide-react v0.577.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const z2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],tm=fe("at-sign",z2);/**
|
|
84
|
+
* @license lucide-react v0.577.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const B2=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],rb=fe("book-open",B2);/**
|
|
89
|
+
* @license lucide-react v0.577.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const j2=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],sb=fe("bot",j2);/**
|
|
94
|
+
* @license lucide-react v0.577.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const H2=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],P2=fe("brain",H2);/**
|
|
99
|
+
* @license lucide-react v0.577.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const U2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fi=fe("check",U2);/**
|
|
104
|
+
* @license lucide-react v0.577.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const I2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ga=fe("chevron-down",I2);/**
|
|
109
|
+
* @license lucide-react v0.577.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const F2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jn=fe("chevron-right",F2);/**
|
|
114
|
+
* @license lucide-react v0.577.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const W2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],q2=fe("circle-alert",W2);/**
|
|
119
|
+
* @license lucide-react v0.577.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const $2=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],im=fe("code",$2);/**
|
|
124
|
+
* @license lucide-react v0.577.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const V2=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],K2=fe("cpu",V2);/**
|
|
129
|
+
* @license lucide-react v0.577.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const Y2=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],G2=fe("ellipsis-vertical",Y2);/**
|
|
134
|
+
* @license lucide-react v0.577.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const X2=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Z2=fe("external-link",X2);/**
|
|
139
|
+
* @license lucide-react v0.577.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const Q2=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],J2=fe("file-braces",Q2);/**
|
|
144
|
+
* @license lucide-react v0.577.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const eE=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],It=fe("file-code",eE);/**
|
|
149
|
+
* @license lucide-react v0.577.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const tE=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],nb=fe("file-plus-corner",tE);/**
|
|
154
|
+
* @license lucide-react v0.577.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const iE=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],rE=fe("file-plus",iE);/**
|
|
159
|
+
* @license lucide-react v0.577.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const sE=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],nE=fe("file-search",sE);/**
|
|
164
|
+
* @license lucide-react v0.577.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const oE=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ti=fe("file-text",oE);/**
|
|
169
|
+
* @license lucide-react v0.577.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const aE=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],lE=fe("file",aE);/**
|
|
174
|
+
* @license lucide-react v0.577.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const cE=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],r0=fe("folder-git-2",cE);/**
|
|
179
|
+
* @license lucide-react v0.577.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const uE=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Ws=fe("folder-open",uE);/**
|
|
184
|
+
* @license lucide-react v0.577.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const hE=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ob=fe("folder-plus",hE);/**
|
|
189
|
+
* @license lucide-react v0.577.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const dE=[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]],ab=fe("folder-search",dE);/**
|
|
194
|
+
* @license lucide-react v0.577.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const fE=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],mE=fe("folder-tree",fE);/**
|
|
199
|
+
* @license lucide-react v0.577.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const pE=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],lb=fe("folder",pE);/**
|
|
204
|
+
* @license lucide-react v0.577.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const _E=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Ys=fe("globe",_E);/**
|
|
209
|
+
* @license lucide-react v0.577.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const gE=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],vE=fe("hash",gE);/**
|
|
214
|
+
* @license lucide-react v0.577.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const yE=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],s0=fe("layers",yE);/**
|
|
219
|
+
* @license lucide-react v0.577.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const bE=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],cb=fe("list-checks",bE);/**
|
|
224
|
+
* @license lucide-react v0.577.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const SE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qs=fe("loader-circle",SE);/**
|
|
229
|
+
* @license lucide-react v0.577.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const xE=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],wE=fe("log-out",xE);/**
|
|
234
|
+
* @license lucide-react v0.577.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const CE=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],EE=fe("menu",CE);/**
|
|
239
|
+
* @license lucide-react v0.577.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const kE=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],wc=fe("message-square",kE);/**
|
|
244
|
+
* @license lucide-react v0.577.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const ME=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],RE=fe("monitor",ME);/**
|
|
249
|
+
* @license lucide-react v0.577.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const NE=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ub=fe("moon",NE);/**
|
|
254
|
+
* @license lucide-react v0.577.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const TE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],AE=fe("panel-left-close",TE);/**
|
|
259
|
+
* @license lucide-react v0.577.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const DE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],OE=fe("panel-left",DE);/**
|
|
264
|
+
* @license lucide-react v0.577.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const LE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],zE=fe("panel-right-close",LE);/**
|
|
269
|
+
* @license lucide-react v0.577.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const BE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],jE=fe("panel-right",BE);/**
|
|
274
|
+
* @license lucide-react v0.577.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const HE=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],PE=fe("paperclip",HE);/**
|
|
279
|
+
* @license lucide-react v0.577.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const UE=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],hb=fe("pencil",UE);/**
|
|
284
|
+
* @license lucide-react v0.577.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const IE=[["path",{d:"M9 2v6",key:"17ngun"}],["path",{d:"M15 2v6",key:"s7yy2p"}],["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M6 11V8h12v3a6 6 0 1 1-12 0Z",key:"wtfw2c"}]],FE=fe("plug-2",IE);/**
|
|
289
|
+
* @license lucide-react v0.577.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const WE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Vs=fe("plus",WE);/**
|
|
294
|
+
* @license lucide-react v0.577.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const qE=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],db=fe("refresh-cw",qE);/**
|
|
299
|
+
* @license lucide-react v0.577.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const $E=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fb=fe("search",$E);/**
|
|
304
|
+
* @license lucide-react v0.577.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const VE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],KE=fe("shield-alert",VE);/**
|
|
309
|
+
* @license lucide-react v0.577.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const YE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],nf=fe("shield-check",YE);/**
|
|
314
|
+
* @license lucide-react v0.577.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const GE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]],XE=fe("shield-question-mark",GE);/**
|
|
319
|
+
* @license lucide-react v0.577.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const ZE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],n0=fe("shield-x",ZE);/**
|
|
324
|
+
* @license lucide-react v0.577.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const QE=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],JE=fe("slash",QE);/**
|
|
329
|
+
* @license lucide-react v0.577.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const ek=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],o0=fe("sparkles",ek);/**
|
|
334
|
+
* @license lucide-react v0.577.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const tk=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],a0=fe("square-terminal",tk);/**
|
|
339
|
+
* @license lucide-react v0.577.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const ik=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],rk=fe("square",ik);/**
|
|
344
|
+
* @license lucide-react v0.577.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const sk=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],mb=fe("sun",sk);/**
|
|
349
|
+
* @license lucide-react v0.577.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const nk=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],rm=fe("terminal",nk);/**
|
|
354
|
+
* @license lucide-react v0.577.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const ok=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],of=fe("trash-2",ok);/**
|
|
359
|
+
* @license lucide-react v0.577.0 - ISC
|
|
360
|
+
*
|
|
361
|
+
* This source code is licensed under the ISC license.
|
|
362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
363
|
+
*/const ak=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Js=fe("x",ak);/**
|
|
364
|
+
* @license lucide-react v0.577.0 - ISC
|
|
365
|
+
*
|
|
366
|
+
* This source code is licensed under the ISC license.
|
|
367
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
368
|
+
*/const lk=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],sm=fe("zap",lk);function ye(...e){return GC(Xy(e))}function Cc({className:e,type:t,...s}){return _.jsx("input",{type:t,"data-slot":"input",className:ye("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",e),...s})}const l0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,c0=Xy,pb=(e,t)=>s=>{var n;if((t==null?void 0:t.variants)==null)return c0(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:a,defaultVariants:c}=t,u=Object.keys(a).map(p=>{const y=s==null?void 0:s[p],v=c==null?void 0:c[p];if(y===null)return null;const b=l0(y)||l0(v);return a[p][b]}),h=s&&Object.entries(s).reduce((p,y)=>{let[v,b]=y;return b===void 0||(p[v]=b),p},{}),m=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((p,y)=>{let{class:v,className:b,...x}=y;return Object.entries(x).every(w=>{let[C,E]=w;return Array.isArray(E)?E.includes({...c,...h}[C]):{...c,...h}[C]===E})?[...p,v,b]:p},[]);return c0(e,u,m,s==null?void 0:s.class,s==null?void 0:s.className)};function u0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gs(...e){return t=>{let s=!1;const n=e.map(a=>{const c=u0(a,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let a=0;a<n.length;a++){const c=n[a];typeof c=="function"?c():u0(e[a],null)}}}}function Xe(...e){return g.useCallback(gs(...e),e)}function ck(e){const t=uk(e),s=g.forwardRef((n,a)=>{const{children:c,...u}=n,h=g.Children.toArray(c),m=h.find(dk);if(m){const p=m.props.children,y=h.map(v=>v===m?g.Children.count(p)>1?g.Children.only(null):g.isValidElement(p)?p.props.children:null:v);return _.jsx(t,{...u,ref:a,children:g.isValidElement(p)?g.cloneElement(p,void 0,y):null})}return _.jsx(t,{...u,ref:a,children:c})});return s.displayName=`${e}.Slot`,s}function uk(e){const t=g.forwardRef((s,n)=>{const{children:a,...c}=s;if(g.isValidElement(a)){const u=mk(a),h=fk(c,a.props);return a.type!==g.Fragment&&(h.ref=n?gs(n,u):u),g.cloneElement(a,h)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hk=Symbol("radix.slottable");function dk(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hk}function fk(e,t){const s={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?s[n]=(...h)=>{const m=c(...h);return a(...h),m}:a&&(s[n]=a):n==="style"?s[n]={...a,...c}:n==="className"&&(s[n]=[a,c].filter(Boolean).join(" "))}return{...e,...s}}function mk(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var pk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=pk.reduce((e,t)=>{const s=ck(`Primitive.${t}`),n=g.forwardRef((a,c)=>{const{asChild:u,...h}=a,m=u?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),_.jsx(m,{...h,ref:c})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _b(e,t){e&&em.flushSync(()=>e.dispatchEvent(t))}var _k=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),gk="VisuallyHidden",gb=g.forwardRef((e,t)=>_.jsx(Le.span,{...e,ref:t,style:{..._k,...e.style}}));gb.displayName=gk;var vk=gb;function yk(e,t){const s=g.createContext(t),n=c=>{const{children:u,...h}=c,m=g.useMemo(()=>h,Object.values(h));return _.jsx(s.Provider,{value:m,children:u})};n.displayName=e+"Provider";function a(c){const u=g.useContext(s);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[n,a]}function sr(e,t=[]){let s=[];function n(c,u){const h=g.createContext(u),m=s.length;s=[...s,u];const p=v=>{var M;const{scope:b,children:x,...w}=v,C=((M=b==null?void 0:b[e])==null?void 0:M[m])||h,E=g.useMemo(()=>w,Object.values(w));return _.jsx(C.Provider,{value:E,children:x})};p.displayName=c+"Provider";function y(v,b){var C;const x=((C=b==null?void 0:b[e])==null?void 0:C[m])||h,w=g.useContext(x);if(w)return w;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${c}\``)}return[p,y]}const a=()=>{const c=s.map(u=>g.createContext(u));return function(h){const m=(h==null?void 0:h[e])||c;return g.useMemo(()=>({[`__scope${e}`]:{...h,[e]:m}}),[h,m])}};return a.scopeName=e,[n,bk(a,...t)]}function bk(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(c){const u=n.reduce((h,{useScope:m,scopeName:p})=>{const v=m(c)[`__scope${p}`];return{...h,...v}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return s.scopeName=t.scopeName,s}function h0(e){const t=Sk(e),s=g.forwardRef((n,a)=>{const{children:c,...u}=n,h=g.Children.toArray(c),m=h.find(wk);if(m){const p=m.props.children,y=h.map(v=>v===m?g.Children.count(p)>1?g.Children.only(null):g.isValidElement(p)?p.props.children:null:v);return _.jsx(t,{...u,ref:a,children:g.isValidElement(p)?g.cloneElement(p,void 0,y):null})}return _.jsx(t,{...u,ref:a,children:c})});return s.displayName=`${e}.Slot`,s}function Sk(e){const t=g.forwardRef((s,n)=>{const{children:a,...c}=s;if(g.isValidElement(a)){const u=Ek(a),h=Ck(c,a.props);return a.type!==g.Fragment&&(h.ref=n?gs(n,u):u),g.cloneElement(a,h)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xk=Symbol("radix.slottable");function wk(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xk}function Ck(e,t){const s={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?s[n]=(...h)=>{const m=c(...h);return a(...h),m}:a&&(s[n]=a):n==="style"?s[n]={...a,...c}:n==="className"&&(s[n]=[a,c].filter(Boolean).join(" "))}return{...e,...s}}function Ek(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function vb(e){const t=e+"CollectionProvider",[s,n]=sr(t),[a,c]=s(t,{collectionRef:{current:null},itemMap:new Map}),u=C=>{const{scope:E,children:M}=C,R=js.useRef(null),T=js.useRef(new Map).current;return _.jsx(a,{scope:E,itemMap:T,collectionRef:R,children:M})};u.displayName=t;const h=e+"CollectionSlot",m=h0(h),p=js.forwardRef((C,E)=>{const{scope:M,children:R}=C,T=c(h,M),N=Xe(E,T.collectionRef);return _.jsx(m,{ref:N,children:R})});p.displayName=h;const y=e+"CollectionItemSlot",v="data-radix-collection-item",b=h0(y),x=js.forwardRef((C,E)=>{const{scope:M,children:R,...T}=C,N=js.useRef(null),D=Xe(E,N),j=c(y,M);return js.useEffect(()=>(j.itemMap.set(N,{ref:N,...T}),()=>void j.itemMap.delete(N))),_.jsx(b,{[v]:"",ref:D,children:R})});x.displayName=y;function w(C){const E=c(e+"CollectionConsumer",C);return js.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const T=Array.from(R.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((j,q)=>T.indexOf(j.ref.current)-T.indexOf(q.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:u,Slot:p,ItemSlot:x},w,n]}function _e(e,t,{checkForDefaultPrevented:s=!0}={}){return function(a){if(e==null||e(a),s===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}var _i=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},kk=Zy[" useInsertionEffect ".trim().toString()]||_i;function ka({prop:e,defaultProp:t,onChange:s=()=>{},caller:n}){const[a,c,u]=Mk({defaultProp:t,onChange:s}),h=e!==void 0,m=h?e:a;{const y=g.useRef(e!==void 0);g.useEffect(()=>{const v=y.current;v!==h&&console.warn(`${n} is changing from ${v?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=h},[h,n])}const p=g.useCallback(y=>{var v;if(h){const b=Rk(y)?y(e):y;b!==e&&((v=u.current)==null||v.call(u,b))}else c(y)},[h,e,c,u]);return[m,p]}function Mk({defaultProp:e,onChange:t}){const[s,n]=g.useState(e),a=g.useRef(s),c=g.useRef(t);return kk(()=>{c.current=t},[t]),g.useEffect(()=>{var u;a.current!==s&&((u=c.current)==null||u.call(c,s),a.current=s)},[s,a]),[s,n,c]}function Rk(e){return typeof e=="function"}function Nk(e,t){return g.useReducer((s,n)=>t[s][n]??s,e)}var Wt=e=>{const{present:t,children:s}=e,n=Tk(t),a=typeof s=="function"?s({present:n.isPresent}):g.Children.only(s),c=Xe(n.ref,Ak(a));return typeof s=="function"||n.isPresent?g.cloneElement(a,{ref:c}):null};Wt.displayName="Presence";function Tk(e){const[t,s]=g.useState(),n=g.useRef(null),a=g.useRef(e),c=g.useRef("none"),u=e?"mounted":"unmounted",[h,m]=Nk(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const p=tc(n.current);c.current=h==="mounted"?p:"none"},[h]),_i(()=>{const p=n.current,y=a.current;if(y!==e){const b=c.current,x=tc(p);e?m("MOUNT"):x==="none"||(p==null?void 0:p.display)==="none"?m("UNMOUNT"):m(y&&b!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,m]),_i(()=>{if(t){let p;const y=t.ownerDocument.defaultView??window,v=x=>{const C=tc(n.current).includes(CSS.escape(x.animationName));if(x.target===t&&C&&(m("ANIMATION_END"),!a.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",p=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=x=>{x.target===t&&(c.current=tc(n.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{y.clearTimeout(p),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:g.useCallback(p=>{n.current=p?getComputedStyle(p):null,s(p)},[])}}function tc(e){return(e==null?void 0:e.animationName)||"none"}function Ak(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Dk=Zy[" useId ".trim().toString()]||(()=>{}),Ok=0;function fs(e){const[t,s]=g.useState(Dk());return _i(()=>{s(n=>n??String(Ok++))},[e]),e||(t?`radix-${t}`:"")}var Uc="Collapsible",[Lk]=sr(Uc),[zk,nm]=Lk(Uc),yb=g.forwardRef((e,t)=>{const{__scopeCollapsible:s,open:n,defaultOpen:a,disabled:c,onOpenChange:u,...h}=e,[m,p]=ka({prop:n,defaultProp:a??!1,onChange:u,caller:Uc});return _.jsx(zk,{scope:s,disabled:c,contentId:fs(),open:m,onOpenToggle:g.useCallback(()=>p(y=>!y),[p]),children:_.jsx(Le.div,{"data-state":am(m),"data-disabled":c?"":void 0,...h,ref:t})})});yb.displayName=Uc;var bb="CollapsibleTrigger",Sb=g.forwardRef((e,t)=>{const{__scopeCollapsible:s,...n}=e,a=nm(bb,s);return _.jsx(Le.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":am(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:t,onClick:_e(e.onClick,a.onOpenToggle)})});Sb.displayName=bb;var om="CollapsibleContent",xb=g.forwardRef((e,t)=>{const{forceMount:s,...n}=e,a=nm(om,e.__scopeCollapsible);return _.jsx(Wt,{present:s||a.open,children:({present:c})=>_.jsx(Bk,{...n,ref:t,present:c})})});xb.displayName=om;var Bk=g.forwardRef((e,t)=>{const{__scopeCollapsible:s,present:n,children:a,...c}=e,u=nm(om,s),[h,m]=g.useState(n),p=g.useRef(null),y=Xe(t,p),v=g.useRef(0),b=v.current,x=g.useRef(0),w=x.current,C=u.open||h,E=g.useRef(C),M=g.useRef(void 0);return g.useEffect(()=>{const R=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(R)},[]),_i(()=>{const R=p.current;if(R){M.current=M.current||{transitionDuration:R.style.transitionDuration,animationName:R.style.animationName},R.style.transitionDuration="0s",R.style.animationName="none";const T=R.getBoundingClientRect();v.current=T.height,x.current=T.width,E.current||(R.style.transitionDuration=M.current.transitionDuration,R.style.animationName=M.current.animationName),m(n)}},[u.open,n]),_.jsx(Le.div,{"data-state":am(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!C,...c,ref:y,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:C&&a})});function am(e){return e?"open":"closed"}var jk=yb,Hk=Sb,Pk=xb,Uk=g.createContext(void 0);function lm(e){const t=g.useContext(Uk);return e||t||"ltr"}function Bt(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...s)=>{var n;return(n=t.current)==null?void 0:n.call(t,...s)},[])}function Ik(e,t=globalThis==null?void 0:globalThis.document){const s=Bt(e);g.useEffect(()=>{const n=a=>{a.key==="Escape"&&s(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[s,t])}var Fk="DismissableLayer",af="dismissableLayer.update",Wk="dismissableLayer.pointerDownOutside",qk="dismissableLayer.focusOutside",d0,wb=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ic=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:c,onInteractOutside:u,onDismiss:h,...m}=e,p=g.useContext(wb),[y,v]=g.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=g.useState({}),w=Xe(t,q=>v(q)),C=Array.from(p.layers),[E]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),M=C.indexOf(E),R=y?C.indexOf(y):-1,T=p.layersWithOutsidePointerEventsDisabled.size>0,N=R>=M,D=Kk(q=>{const te=q.target,re=[...p.branches].some(oe=>oe.contains(te));!N||re||(a==null||a(q),u==null||u(q),q.defaultPrevented||h==null||h())},b),j=Yk(q=>{const te=q.target;[...p.branches].some(oe=>oe.contains(te))||(c==null||c(q),u==null||u(q),q.defaultPrevented||h==null||h())},b);return Ik(q=>{R===p.layers.size-1&&(n==null||n(q),!q.defaultPrevented&&h&&(q.preventDefault(),h()))},b),g.useEffect(()=>{if(y)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(d0=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(y)),p.layers.add(y),f0(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=d0)}},[y,b,s,p]),g.useEffect(()=>()=>{y&&(p.layers.delete(y),p.layersWithOutsidePointerEventsDisabled.delete(y),f0())},[y,p]),g.useEffect(()=>{const q=()=>x({});return document.addEventListener(af,q),()=>document.removeEventListener(af,q)},[]),_.jsx(Le.div,{...m,ref:w,style:{pointerEvents:T?N?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,j.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,D.onPointerDownCapture)})});Ic.displayName=Fk;var $k="DismissableLayerBranch",Vk=g.forwardRef((e,t)=>{const s=g.useContext(wb),n=g.useRef(null),a=Xe(t,n);return g.useEffect(()=>{const c=n.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),_.jsx(Le.div,{...e,ref:a})});Vk.displayName=$k;function Kk(e,t=globalThis==null?void 0:globalThis.document){const s=Bt(e),n=g.useRef(!1),a=g.useRef(()=>{});return g.useEffect(()=>{const c=h=>{if(h.target&&!n.current){let m=function(){Cb(Wk,s,p,{discrete:!0})};const p={originalEvent:h};h.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=m,t.addEventListener("click",a.current,{once:!0})):m()}else t.removeEventListener("click",a.current);n.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",c),t.removeEventListener("click",a.current)}},[t,s]),{onPointerDownCapture:()=>n.current=!0}}function Yk(e,t=globalThis==null?void 0:globalThis.document){const s=Bt(e),n=g.useRef(!1);return g.useEffect(()=>{const a=c=>{c.target&&!n.current&&Cb(qk,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,s]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function f0(){const e=new CustomEvent(af);document.dispatchEvent(e)}function Cb(e,t,s,{discrete:n}){const a=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&a.addEventListener(e,t,{once:!0}),n?_b(a,c):a.dispatchEvent(c)}var Nd="focusScope.autoFocusOnMount",Td="focusScope.autoFocusOnUnmount",m0={bubbles:!1,cancelable:!0},Gk="FocusScope",cm=g.forwardRef((e,t)=>{const{loop:s=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:c,...u}=e,[h,m]=g.useState(null),p=Bt(a),y=Bt(c),v=g.useRef(null),b=Xe(t,C=>m(C)),x=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let C=function(T){if(x.paused||!h)return;const N=T.target;h.contains(N)?v.current=N:us(v.current,{select:!0})},E=function(T){if(x.paused||!h)return;const N=T.relatedTarget;N!==null&&(h.contains(N)||us(v.current,{select:!0}))},M=function(T){if(document.activeElement===document.body)for(const D of T)D.removedNodes.length>0&&us(h)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const R=new MutationObserver(M);return h&&R.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),R.disconnect()}}},[n,h,x.paused]),g.useEffect(()=>{if(h){_0.add(x);const C=document.activeElement;if(!h.contains(C)){const M=new CustomEvent(Nd,m0);h.addEventListener(Nd,p),h.dispatchEvent(M),M.defaultPrevented||(Xk(tM(Eb(h)),{select:!0}),document.activeElement===C&&us(h))}return()=>{h.removeEventListener(Nd,p),setTimeout(()=>{const M=new CustomEvent(Td,m0);h.addEventListener(Td,y),h.dispatchEvent(M),M.defaultPrevented||us(C??document.body,{select:!0}),h.removeEventListener(Td,y),_0.remove(x)},0)}}},[h,p,y,x]);const w=g.useCallback(C=>{if(!s&&!n||x.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,M=document.activeElement;if(E&&M){const R=C.currentTarget,[T,N]=Zk(R);T&&N?!C.shiftKey&&M===N?(C.preventDefault(),s&&us(T,{select:!0})):C.shiftKey&&M===T&&(C.preventDefault(),s&&us(N,{select:!0})):M===R&&C.preventDefault()}},[s,n,x.paused]);return _.jsx(Le.div,{tabIndex:-1,...u,ref:b,onKeyDown:w})});cm.displayName=Gk;function Xk(e,{select:t=!1}={}){const s=document.activeElement;for(const n of e)if(us(n,{select:t}),document.activeElement!==s)return}function Zk(e){const t=Eb(e),s=p0(t,e),n=p0(t.reverse(),e);return[s,n]}function Eb(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function p0(e,t){for(const s of e)if(!Qk(s,{upTo:t}))return s}function Qk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Jk(e){return e instanceof HTMLInputElement&&"select"in e}function us(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&Jk(e)&&t&&e.select()}}var _0=eM();function eM(){let e=[];return{add(t){const s=e[0];t!==s&&(s==null||s.pause()),e=g0(e,t),e.unshift(t)},remove(t){var s;e=g0(e,t),(s=e[0])==null||s.resume()}}}function g0(e,t){const s=[...e],n=s.indexOf(t);return n!==-1&&s.splice(n,1),s}function tM(e){return e.filter(t=>t.tagName!=="A")}var iM="Portal",Fc=g.forwardRef((e,t)=>{var h;const{container:s,...n}=e,[a,c]=g.useState(!1);_i(()=>c(!0),[]);const u=s||a&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return u?XC.createPortal(_.jsx(Le.div,{...n,ref:t}),u):null});Fc.displayName=iM;var Ad=0;function kb(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??v0()),document.body.insertAdjacentElement("beforeend",e[1]??v0()),Ad++,()=>{Ad===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ad--}},[])}function v0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Qi=function(){return Qi=Object.assign||function(t){for(var s,n=1,a=arguments.length;n<a;n++){s=arguments[n];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(t[c]=s[c])}return t},Qi.apply(this,arguments)};function Mb(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(s[n[a]]=e[n[a]]);return s}function rM(e,t,s){if(s||arguments.length===2)for(var n=0,a=t.length,c;n<a;n++)(c||!(n in t))&&(c||(c=Array.prototype.slice.call(t,0,n)),c[n]=t[n]);return e.concat(c||Array.prototype.slice.call(t))}var fc="right-scroll-bar-position",mc="width-before-scroll-bar",sM="with-scroll-bars-hidden",nM="--removed-body-scroll-bar-size";function Dd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oM(e,t){var s=g.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(n){var a=s.value;a!==n&&(s.value=n,s.callback(n,a))}}}})[0];return s.callback=t,s.facade}var aM=typeof window<"u"?g.useLayoutEffect:g.useEffect,y0=new WeakMap;function lM(e,t){var s=oM(null,function(n){return e.forEach(function(a){return Dd(a,n)})});return aM(function(){var n=y0.get(s);if(n){var a=new Set(n),c=new Set(e),u=s.current;a.forEach(function(h){c.has(h)||Dd(h,null)}),c.forEach(function(h){a.has(h)||Dd(h,u)})}y0.set(s,e)},[e]),s}function cM(e){return e}function uM(e,t){t===void 0&&(t=cM);var s=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var u=t(c,n);return s.push(u),function(){s=s.filter(function(h){return h!==u})}},assignSyncMedium:function(c){for(n=!0;s.length;){var u=s;s=[],u.forEach(c)}s={push:function(h){return c(h)},filter:function(){return s}}},assignMedium:function(c){n=!0;var u=[];if(s.length){var h=s;s=[],h.forEach(c),u=s}var m=function(){var y=u;u=[],y.forEach(c)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(y){u.push(y),p()},filter:function(y){return u=u.filter(y),s}}}};return a}function hM(e){e===void 0&&(e={});var t=uM(null);return t.options=Qi({async:!0,ssr:!1},e),t}var Rb=function(e){var t=e.sideCar,s=Mb(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return g.createElement(n,Qi({},s))};Rb.isSideCarExport=!0;function dM(e,t){return e.useMedium(t),Rb}var Nb=hM(),Od=function(){},Wc=g.forwardRef(function(e,t){var s=g.useRef(null),n=g.useState({onScrollCapture:Od,onWheelCapture:Od,onTouchMoveCapture:Od}),a=n[0],c=n[1],u=e.forwardProps,h=e.children,m=e.className,p=e.removeScrollBar,y=e.enabled,v=e.shards,b=e.sideCar,x=e.noRelative,w=e.noIsolation,C=e.inert,E=e.allowPinchZoom,M=e.as,R=M===void 0?"div":M,T=e.gapMode,N=Mb(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=b,j=lM([s,t]),q=Qi(Qi({},N),a);return g.createElement(g.Fragment,null,y&&g.createElement(D,{sideCar:Nb,removeScrollBar:p,shards:v,noRelative:x,noIsolation:w,inert:C,setCallbacks:c,allowPinchZoom:!!E,lockRef:s,gapMode:T}),u?g.cloneElement(g.Children.only(h),Qi(Qi({},q),{ref:j})):g.createElement(R,Qi({},q,{className:m,ref:j}),h))});Wc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Wc.classNames={fullWidth:mc,zeroRight:fc};var fM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fM();return t&&e.setAttribute("nonce",t),e}function pM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _M(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gM=function(){var e=0,t=null;return{add:function(s){e==0&&(t=mM())&&(pM(t,s),_M(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vM=function(){var e=gM();return function(t,s){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},Tb=function(){var e=vM(),t=function(s){var n=s.styles,a=s.dynamic;return e(n,a),null};return t},yM={left:0,top:0,right:0,gap:0},Ld=function(e){return parseInt(e||"",10)||0},bM=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Ld(s),Ld(n),Ld(a)]},SM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yM;var t=bM(e),s=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-s+t[2]-t[0])}},xM=Tb(),Zn="data-scroll-locked",wM=function(e,t,s,n){var a=e.left,c=e.top,u=e.right,h=e.gap;return s===void 0&&(s="margin"),`
|
|
369
|
+
.`.concat(sM,` {
|
|
370
|
+
overflow: hidden `).concat(n,`;
|
|
371
|
+
padding-right: `).concat(h,"px ").concat(n,`;
|
|
372
|
+
}
|
|
373
|
+
body[`).concat(Zn,`] {
|
|
374
|
+
overflow: hidden `).concat(n,`;
|
|
375
|
+
overscroll-behavior: contain;
|
|
376
|
+
`).concat([t&&"position: relative ".concat(n,";"),s==="margin"&&`
|
|
377
|
+
padding-left: `.concat(a,`px;
|
|
378
|
+
padding-top: `).concat(c,`px;
|
|
379
|
+
padding-right: `).concat(u,`px;
|
|
380
|
+
margin-left:0;
|
|
381
|
+
margin-top:0;
|
|
382
|
+
margin-right: `).concat(h,"px ").concat(n,`;
|
|
383
|
+
`),s==="padding"&&"padding-right: ".concat(h,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.`).concat(fc,` {
|
|
387
|
+
right: `).concat(h,"px ").concat(n,`;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.`).concat(mc,` {
|
|
391
|
+
margin-right: `).concat(h,"px ").concat(n,`;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.`).concat(fc," .").concat(fc,` {
|
|
395
|
+
right: 0 `).concat(n,`;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.`).concat(mc," .").concat(mc,` {
|
|
399
|
+
margin-right: 0 `).concat(n,`;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
body[`).concat(Zn,`] {
|
|
403
|
+
`).concat(nM,": ").concat(h,`px;
|
|
404
|
+
}
|
|
405
|
+
`)},b0=function(){var e=parseInt(document.body.getAttribute(Zn)||"0",10);return isFinite(e)?e:0},CM=function(){g.useEffect(function(){return document.body.setAttribute(Zn,(b0()+1).toString()),function(){var e=b0()-1;e<=0?document.body.removeAttribute(Zn):document.body.setAttribute(Zn,e.toString())}},[])},EM=function(e){var t=e.noRelative,s=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;CM();var c=g.useMemo(function(){return SM(a)},[a]);return g.createElement(xM,{styles:wM(c,!t,a,s?"":"!important")})},lf=!1;if(typeof window<"u")try{var ic=Object.defineProperty({},"passive",{get:function(){return lf=!0,!0}});window.addEventListener("test",ic,ic),window.removeEventListener("test",ic,ic)}catch{lf=!1}var qn=lf?{passive:!1}:!1,kM=function(e){return e.tagName==="TEXTAREA"},Ab=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!kM(e)&&s[t]==="visible")},MM=function(e){return Ab(e,"overflowY")},RM=function(e){return Ab(e,"overflowX")},S0=function(e,t){var s=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=Db(e,n);if(a){var c=Ob(e,n),u=c[1],h=c[2];if(u>h)return!0}n=n.parentNode}while(n&&n!==s.body);return!1},NM=function(e){var t=e.scrollTop,s=e.scrollHeight,n=e.clientHeight;return[t,s,n]},TM=function(e){var t=e.scrollLeft,s=e.scrollWidth,n=e.clientWidth;return[t,s,n]},Db=function(e,t){return e==="v"?MM(t):RM(t)},Ob=function(e,t){return e==="v"?NM(t):TM(t)},AM=function(e,t){return e==="h"&&t==="rtl"?-1:1},DM=function(e,t,s,n,a){var c=AM(e,window.getComputedStyle(t).direction),u=c*n,h=s.target,m=t.contains(h),p=!1,y=u>0,v=0,b=0;do{if(!h)break;var x=Ob(e,h),w=x[0],C=x[1],E=x[2],M=C-E-c*w;(w||M)&&Db(e,h)&&(v+=M,b+=w);var R=h.parentNode;h=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!m&&h!==document.body||m&&(t.contains(h)||t===h));return(y&&Math.abs(v)<1||!y&&Math.abs(b)<1)&&(p=!0),p},rc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},x0=function(e){return[e.deltaX,e.deltaY]},w0=function(e){return e&&"current"in e?e.current:e},OM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},LM=function(e){return`
|
|
406
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
407
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
408
|
+
`)},zM=0,$n=[];function BM(e){var t=g.useRef([]),s=g.useRef([0,0]),n=g.useRef(),a=g.useState(zM++)[0],c=g.useState(Tb)[0],u=g.useRef(e);g.useEffect(function(){u.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var C=rM([e.lockRef.current],(e.shards||[]).map(w0),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var h=g.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!u.current.allowPinchZoom;var M=rc(C),R=s.current,T="deltaX"in C?C.deltaX:R[0]-M[0],N="deltaY"in C?C.deltaY:R[1]-M[1],D,j=C.target,q=Math.abs(T)>Math.abs(N)?"h":"v";if("touches"in C&&q==="h"&&j.type==="range")return!1;var te=window.getSelection(),re=te&&te.anchorNode,oe=re?re===j||re.contains(j):!1;if(oe)return!1;var Z=S0(q,j);if(!Z)return!0;if(Z?D=q:(D=q==="v"?"h":"v",Z=S0(q,j)),!Z)return!1;if(!n.current&&"changedTouches"in C&&(T||N)&&(n.current=D),!D)return!0;var G=n.current||D;return DM(G,E,C,G==="h"?T:N)},[]),m=g.useCallback(function(C){var E=C;if(!(!$n.length||$n[$n.length-1]!==c)){var M="deltaY"in E?x0(E):rc(E),R=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&OM(D.delta,M)})[0];if(R&&R.should){E.cancelable&&E.preventDefault();return}if(!R){var T=(u.current.shards||[]).map(w0).filter(Boolean).filter(function(D){return D.contains(E.target)}),N=T.length>0?h(E,T[0]):!u.current.noIsolation;N&&E.cancelable&&E.preventDefault()}}},[]),p=g.useCallback(function(C,E,M,R){var T={name:C,delta:E,target:M,should:R,shadowParent:jM(M)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(N){return N!==T})},1)},[]),y=g.useCallback(function(C){s.current=rc(C),n.current=void 0},[]),v=g.useCallback(function(C){p(C.type,x0(C),C.target,h(C,e.lockRef.current))},[]),b=g.useCallback(function(C){p(C.type,rc(C),C.target,h(C,e.lockRef.current))},[]);g.useEffect(function(){return $n.push(c),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",m,qn),document.addEventListener("touchmove",m,qn),document.addEventListener("touchstart",y,qn),function(){$n=$n.filter(function(C){return C!==c}),document.removeEventListener("wheel",m,qn),document.removeEventListener("touchmove",m,qn),document.removeEventListener("touchstart",y,qn)}},[]);var x=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(c,{styles:LM(a)}):null,x?g.createElement(EM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const HM=dM(Nb,BM);var um=g.forwardRef(function(e,t){return g.createElement(Wc,Qi({},e,{ref:t,sideCar:HM}))});um.classNames=Wc.classNames;var PM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vn=new WeakMap,sc=new WeakMap,nc={},zd=0,Lb=function(e){return e&&(e.host||Lb(e.parentNode))},UM=function(e,t){return t.map(function(s){if(e.contains(s))return s;var n=Lb(s);return n&&e.contains(n)?n:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},IM=function(e,t,s,n){var a=UM(t,Array.isArray(e)?e:[e]);nc[s]||(nc[s]=new WeakMap);var c=nc[s],u=[],h=new Set,m=new Set(a),p=function(v){!v||h.has(v)||(h.add(v),p(v.parentNode))};a.forEach(p);var y=function(v){!v||m.has(v)||Array.prototype.forEach.call(v.children,function(b){if(h.has(b))y(b);else try{var x=b.getAttribute(n),w=x!==null&&x!=="false",C=(Vn.get(b)||0)+1,E=(c.get(b)||0)+1;Vn.set(b,C),c.set(b,E),u.push(b),C===1&&w&&sc.set(b,!0),E===1&&b.setAttribute(s,"true"),w||b.setAttribute(n,"true")}catch(M){console.error("aria-hidden: cannot operate on ",b,M)}})};return y(t),h.clear(),zd++,function(){u.forEach(function(v){var b=Vn.get(v)-1,x=c.get(v)-1;Vn.set(v,b),c.set(v,x),b||(sc.has(v)||v.removeAttribute(n),sc.delete(v)),x||v.removeAttribute(s)}),zd--,zd||(Vn=new WeakMap,Vn=new WeakMap,sc=new WeakMap,nc={})}},zb=function(e,t,s){s===void 0&&(s="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=PM(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),IM(n,a,s,"aria-hidden")):function(){return null}};function FM(e){const t=WM(e),s=g.forwardRef((n,a)=>{const{children:c,...u}=n,h=g.Children.toArray(c),m=h.find($M);if(m){const p=m.props.children,y=h.map(v=>v===m?g.Children.count(p)>1?g.Children.only(null):g.isValidElement(p)?p.props.children:null:v);return _.jsx(t,{...u,ref:a,children:g.isValidElement(p)?g.cloneElement(p,void 0,y):null})}return _.jsx(t,{...u,ref:a,children:c})});return s.displayName=`${e}.Slot`,s}function WM(e){const t=g.forwardRef((s,n)=>{const{children:a,...c}=s;if(g.isValidElement(a)){const u=KM(a),h=VM(c,a.props);return a.type!==g.Fragment&&(h.ref=n?gs(n,u):u),g.cloneElement(a,h)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qM=Symbol("radix.slottable");function $M(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qM}function VM(e,t){const s={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?s[n]=(...h)=>{const m=c(...h);return a(...h),m}:a&&(s[n]=a):n==="style"?s[n]={...a,...c}:n==="className"&&(s[n]=[a,c].filter(Boolean).join(" "))}return{...e,...s}}function KM(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var qc="Dialog",[Bb]=sr(qc),[YM,Fi]=Bb(qc),jb=e=>{const{__scopeDialog:t,children:s,open:n,defaultOpen:a,onOpenChange:c,modal:u=!0}=e,h=g.useRef(null),m=g.useRef(null),[p,y]=ka({prop:n,defaultProp:a??!1,onChange:c,caller:qc});return _.jsx(YM,{scope:t,triggerRef:h,contentRef:m,contentId:fs(),titleId:fs(),descriptionId:fs(),open:p,onOpenChange:y,onOpenToggle:g.useCallback(()=>y(v=>!v),[y]),modal:u,children:s})};jb.displayName=qc;var Hb="DialogTrigger",GM=g.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,a=Fi(Hb,s),c=Xe(t,a.triggerRef);return _.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":fm(a.open),...n,ref:c,onClick:_e(e.onClick,a.onOpenToggle)})});GM.displayName=Hb;var hm="DialogPortal",[XM,Pb]=Bb(hm,{forceMount:void 0}),Ub=e=>{const{__scopeDialog:t,forceMount:s,children:n,container:a}=e,c=Fi(hm,t);return _.jsx(XM,{scope:t,forceMount:s,children:g.Children.map(n,u=>_.jsx(Wt,{present:s||c.open,children:_.jsx(Fc,{asChild:!0,container:a,children:u})}))})};Ub.displayName=hm;var Ec="DialogOverlay",Ib=g.forwardRef((e,t)=>{const s=Pb(Ec,e.__scopeDialog),{forceMount:n=s.forceMount,...a}=e,c=Fi(Ec,e.__scopeDialog);return c.modal?_.jsx(Wt,{present:n||c.open,children:_.jsx(QM,{...a,ref:t})}):null});Ib.displayName=Ec;var ZM=FM("DialogOverlay.RemoveScroll"),QM=g.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,a=Fi(Ec,s);return _.jsx(um,{as:ZM,allowPinchZoom:!0,shards:[a.contentRef],children:_.jsx(Le.div,{"data-state":fm(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Gs="DialogContent",Fb=g.forwardRef((e,t)=>{const s=Pb(Gs,e.__scopeDialog),{forceMount:n=s.forceMount,...a}=e,c=Fi(Gs,e.__scopeDialog);return _.jsx(Wt,{present:n||c.open,children:c.modal?_.jsx(JM,{...a,ref:t}):_.jsx(e5,{...a,ref:t})})});Fb.displayName=Gs;var JM=g.forwardRef((e,t)=>{const s=Fi(Gs,e.__scopeDialog),n=g.useRef(null),a=Xe(t,s.contentRef,n);return g.useEffect(()=>{const c=n.current;if(c)return zb(c)},[]),_.jsx(Wb,{...e,ref:a,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),(u=s.triggerRef.current)==null||u.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0;(u.button===2||h)&&c.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,c=>c.preventDefault())})}),e5=g.forwardRef((e,t)=>{const s=Fi(Gs,e.__scopeDialog),n=g.useRef(!1),a=g.useRef(!1);return _.jsx(Wb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var u,h;(u=e.onCloseAutoFocus)==null||u.call(e,c),c.defaultPrevented||(n.current||(h=s.triggerRef.current)==null||h.focus(),c.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:c=>{var m,p;(m=e.onInteractOutside)==null||m.call(e,c),c.defaultPrevented||(n.current=!0,c.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const u=c.target;((p=s.triggerRef.current)==null?void 0:p.contains(u))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&a.current&&c.preventDefault()}})}),Wb=g.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:c,...u}=e,h=Fi(Gs,s),m=g.useRef(null),p=Xe(t,m);return kb(),_.jsxs(_.Fragment,{children:[_.jsx(cm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:c,children:_.jsx(Ic,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":fm(h.open),...u,ref:p,onDismiss:()=>h.onOpenChange(!1)})}),_.jsxs(_.Fragment,{children:[_.jsx(i5,{titleId:h.titleId}),_.jsx(s5,{contentRef:m,descriptionId:h.descriptionId})]})]})}),dm="DialogTitle",qb=g.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,a=Fi(dm,s);return _.jsx(Le.h2,{id:a.titleId,...n,ref:t})});qb.displayName=dm;var $b="DialogDescription",t5=g.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,a=Fi($b,s);return _.jsx(Le.p,{id:a.descriptionId,...n,ref:t})});t5.displayName=$b;var Vb="DialogClose",Kb=g.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,a=Fi(Vb,s);return _.jsx(Le.button,{type:"button",...n,ref:t,onClick:_e(e.onClick,()=>a.onOpenChange(!1))})});Kb.displayName=Vb;function fm(e){return e?"open":"closed"}var Yb="DialogTitleWarning",[qO,Gb]=yk(Yb,{contentName:Gs,titleName:dm,docsSlug:"dialog"}),i5=({titleId:e})=>{const t=Gb(Yb),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
409
|
+
|
|
410
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
411
|
+
|
|
412
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},r5="DialogDescriptionWarning",s5=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gb(r5).contentName}}.`;return g.useEffect(()=>{var c;const a=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},n5=jb,o5=Ub,a5=Ib,l5=Fb,c5=qb,u5=Kb,Bd={exports:{}},jd={};/**
|
|
413
|
+
* @license React
|
|
414
|
+
* use-sync-external-store-shim.production.js
|
|
415
|
+
*
|
|
416
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the MIT license found in the
|
|
419
|
+
* LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/var C0;function h5(){if(C0)return jd;C0=1;var e=Gy();function t(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var s=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function h(v,b){var x=b(),w=n({inst:{value:x,getSnapshot:b}}),C=w[0].inst,E=w[1];return c(function(){C.value=x,C.getSnapshot=b,m(C)&&E({inst:C})},[v,x,b]),a(function(){return m(C)&&E({inst:C}),v(function(){m(C)&&E({inst:C})})},[v]),u(x),x}function m(v){var b=v.getSnapshot;v=v.value;try{var x=b();return!s(v,x)}catch{return!0}}function p(v,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:h;return jd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,jd}var E0;function d5(){return E0||(E0=1,Bd.exports=h5()),Bd.exports}var f5=d5();function m5(){return f5.useSyncExternalStore(p5,()=>!0,()=>!1)}function p5(){return()=>{}}var mm="Avatar",[_5]=sr(mm),[g5,Xb]=_5(mm),Zb=g.forwardRef((e,t)=>{const{__scopeAvatar:s,...n}=e,[a,c]=g.useState("idle");return _.jsx(g5,{scope:s,imageLoadingStatus:a,onImageLoadingStatusChange:c,children:_.jsx(Le.span,{...n,ref:t})})});Zb.displayName=mm;var Qb="AvatarImage",v5=g.forwardRef((e,t)=>{const{__scopeAvatar:s,src:n,onLoadingStatusChange:a=()=>{},...c}=e,u=Xb(Qb,s),h=y5(n,c),m=Bt(p=>{a(p),u.onImageLoadingStatusChange(p)});return _i(()=>{h!=="idle"&&m(h)},[h,m]),h==="loaded"?_.jsx(Le.img,{...c,ref:t,src:n}):null});v5.displayName=Qb;var Jb="AvatarFallback",eS=g.forwardRef((e,t)=>{const{__scopeAvatar:s,delayMs:n,...a}=e,c=Xb(Jb,s),[u,h]=g.useState(n===void 0);return g.useEffect(()=>{if(n!==void 0){const m=window.setTimeout(()=>h(!0),n);return()=>window.clearTimeout(m)}},[n]),u&&c.imageLoadingStatus!=="loaded"?_.jsx(Le.span,{...a,ref:t}):null});eS.displayName=Jb;function k0(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function y5(e,{referrerPolicy:t,crossOrigin:s}){const n=m5(),a=g.useRef(null),c=n?(a.current||(a.current=new window.Image),a.current):null,[u,h]=g.useState(()=>k0(c,e));return _i(()=>{h(k0(c,e))},[c,e]),_i(()=>{const m=v=>()=>{h(v)};if(!c)return;const p=m("loaded"),y=m("error");return c.addEventListener("load",p),c.addEventListener("error",y),t&&(c.referrerPolicy=t),typeof s=="string"&&(c.crossOrigin=s),()=>{c.removeEventListener("load",p),c.removeEventListener("error",y)}},[c,s,t]),u}var b5=Zb,S5=eS;function x5(e){const[t,s]=g.useState(void 0);return _i(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const c=a[0];let u,h;if("borderBoxSize"in c){const m=c.borderBoxSize,p=Array.isArray(m)?m[0]:m;u=p.inlineSize,h=p.blockSize}else u=e.offsetWidth,h=e.offsetHeight;s({width:u,height:h})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else s(void 0)},[e]),t}const w5=["top","right","bottom","left"],ps=Math.min,mi=Math.max,kc=Math.round,oc=Math.floor,tr=e=>({x:e,y:e}),C5={left:"right",right:"left",bottom:"top",top:"bottom"};function cf(e,t,s){return mi(e,ps(t,s))}function Tr(e,t){return typeof e=="function"?e(t):e}function Ar(e){return e.split("-")[0]}function so(e){return e.split("-")[1]}function pm(e){return e==="x"?"y":"x"}function _m(e){return e==="y"?"height":"width"}function Ji(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function gm(e){return pm(Ji(e))}function E5(e,t,s){s===void 0&&(s=!1);const n=so(e),a=gm(e),c=_m(a);let u=a==="x"?n===(s?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=Mc(u)),[u,Mc(u)]}function k5(e){const t=Mc(e);return[uf(e),t,uf(t)]}function uf(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const M0=["left","right"],R0=["right","left"],M5=["top","bottom"],R5=["bottom","top"];function N5(e,t,s){switch(e){case"top":case"bottom":return s?t?R0:M0:t?M0:R0;case"left":case"right":return t?M5:R5;default:return[]}}function T5(e,t,s,n){const a=so(e);let c=N5(Ar(e),s==="start",n);return a&&(c=c.map(u=>u+"-"+a),t&&(c=c.concat(c.map(uf)))),c}function Mc(e){const t=Ar(e);return C5[t]+e.slice(t.length)}function A5(e){return{top:0,right:0,bottom:0,left:0,...e}}function tS(e){return typeof e!="number"?A5(e):{top:e,right:e,bottom:e,left:e}}function Rc(e){const{x:t,y:s,width:n,height:a}=e;return{width:n,height:a,top:s,left:t,right:t+n,bottom:s+a,x:t,y:s}}function N0(e,t,s){let{reference:n,floating:a}=e;const c=Ji(t),u=gm(t),h=_m(u),m=Ar(t),p=c==="y",y=n.x+n.width/2-a.width/2,v=n.y+n.height/2-a.height/2,b=n[h]/2-a[h]/2;let x;switch(m){case"top":x={x:y,y:n.y-a.height};break;case"bottom":x={x:y,y:n.y+n.height};break;case"right":x={x:n.x+n.width,y:v};break;case"left":x={x:n.x-a.width,y:v};break;default:x={x:n.x,y:n.y}}switch(so(t)){case"start":x[u]-=b*(s&&p?-1:1);break;case"end":x[u]+=b*(s&&p?-1:1);break}return x}async function D5(e,t){var s;t===void 0&&(t={});const{x:n,y:a,platform:c,rects:u,elements:h,strategy:m}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=Tr(t,e),w=tS(x),E=h[b?v==="floating"?"reference":"floating":v],M=Rc(await c.getClippingRect({element:(s=await(c.isElement==null?void 0:c.isElement(E)))==null||s?E:E.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(h.floating)),boundary:p,rootBoundary:y,strategy:m})),R=v==="floating"?{x:n,y:a,width:u.floating.width,height:u.floating.height}:u.reference,T=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),N=await(c.isElement==null?void 0:c.isElement(T))?await(c.getScale==null?void 0:c.getScale(T))||{x:1,y:1}:{x:1,y:1},D=Rc(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:R,offsetParent:T,strategy:m}):R);return{top:(M.top-D.top+w.top)/N.y,bottom:(D.bottom-M.bottom+w.bottom)/N.y,left:(M.left-D.left+w.left)/N.x,right:(D.right-M.right+w.right)/N.x}}const O5=50,L5=async(e,t,s)=>{const{placement:n="bottom",strategy:a="absolute",middleware:c=[],platform:u}=s,h=u.detectOverflow?u:{...u,detectOverflow:D5},m=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:a}),{x:y,y:v}=N0(p,n,m),b=n,x=0;const w={};for(let C=0;C<c.length;C++){const E=c[C];if(!E)continue;const{name:M,fn:R}=E,{x:T,y:N,data:D,reset:j}=await R({x:y,y:v,initialPlacement:n,placement:b,strategy:a,middlewareData:w,rects:p,platform:h,elements:{reference:e,floating:t}});y=T??y,v=N??v,w[M]={...w[M],...D},j&&x<O5&&(x++,typeof j=="object"&&(j.placement&&(b=j.placement),j.rects&&(p=j.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:a}):j.rects),{x:y,y:v}=N0(p,b,m)),C=-1)}return{x:y,y:v,placement:b,strategy:a,middlewareData:w}},z5=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:n,placement:a,rects:c,platform:u,elements:h,middlewareData:m}=t,{element:p,padding:y=0}=Tr(e,t)||{};if(p==null)return{};const v=tS(y),b={x:s,y:n},x=gm(a),w=_m(x),C=await u.getDimensions(p),E=x==="y",M=E?"top":"left",R=E?"bottom":"right",T=E?"clientHeight":"clientWidth",N=c.reference[w]+c.reference[x]-b[x]-c.floating[w],D=b[x]-c.reference[x],j=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let q=j?j[T]:0;(!q||!await(u.isElement==null?void 0:u.isElement(j)))&&(q=h.floating[T]||c.floating[w]);const te=N/2-D/2,re=q/2-C[w]/2-1,oe=ps(v[M],re),Z=ps(v[R],re),G=oe,I=q-C[w]-Z,V=q/2-C[w]/2+te,W=cf(G,V,I),A=!m.arrow&&so(a)!=null&&V!==W&&c.reference[w]/2-(V<G?oe:Z)-C[w]/2<0,L=A?V<G?V-G:V-I:0;return{[x]:b[x]+L,data:{[x]:W,centerOffset:V-W-L,...A&&{alignmentOffset:L}},reset:A}}}),B5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,n;const{placement:a,middlewareData:c,rects:u,initialPlacement:h,platform:m,elements:p}=t,{mainAxis:y=!0,crossAxis:v=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...E}=Tr(e,t);if((s=c.arrow)!=null&&s.alignmentOffset)return{};const M=Ar(a),R=Ji(h),T=Ar(h)===h,N=await(m.isRTL==null?void 0:m.isRTL(p.floating)),D=b||(T||!C?[Mc(h)]:k5(h)),j=w!=="none";!b&&j&&D.push(...T5(h,C,w,N));const q=[h,...D],te=await m.detectOverflow(t,E),re=[];let oe=((n=c.flip)==null?void 0:n.overflows)||[];if(y&&re.push(te[M]),v){const V=E5(a,u,N);re.push(te[V[0]],te[V[1]])}if(oe=[...oe,{placement:a,overflows:re}],!re.every(V=>V<=0)){var Z,G;const V=(((Z=c.flip)==null?void 0:Z.index)||0)+1,W=q[V];if(W&&(!(v==="alignment"?R!==Ji(W):!1)||oe.every(z=>Ji(z.placement)===R?z.overflows[0]>0:!0)))return{data:{index:V,overflows:oe},reset:{placement:W}};let A=(G=oe.filter(L=>L.overflows[0]<=0).sort((L,z)=>L.overflows[1]-z.overflows[1])[0])==null?void 0:G.placement;if(!A)switch(x){case"bestFit":{var I;const L=(I=oe.filter(z=>{if(j){const K=Ji(z.placement);return K===R||K==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(K=>K>0).reduce((K,ee)=>K+ee,0)]).sort((z,K)=>z[1]-K[1])[0])==null?void 0:I[0];L&&(A=L);break}case"initialPlacement":A=h;break}if(a!==A)return{reset:{placement:A}}}return{}}}};function T0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function A0(e){return w5.some(t=>e[t]>=0)}const j5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:s,platform:n}=t,{strategy:a="referenceHidden",...c}=Tr(e,t);switch(a){case"referenceHidden":{const u=await n.detectOverflow(t,{...c,elementContext:"reference"}),h=T0(u,s.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:A0(h)}}}case"escaped":{const u=await n.detectOverflow(t,{...c,altBoundary:!0}),h=T0(u,s.floating);return{data:{escapedOffsets:h,escaped:A0(h)}}}default:return{}}}}},iS=new Set(["left","top"]);async function H5(e,t){const{placement:s,platform:n,elements:a}=e,c=await(n.isRTL==null?void 0:n.isRTL(a.floating)),u=Ar(s),h=so(s),m=Ji(s)==="y",p=iS.has(u)?-1:1,y=c&&m?-1:1,v=Tr(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:w}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return h&&typeof w=="number"&&(x=h==="end"?w*-1:w),m?{x:x*y,y:b*p}:{x:b*p,y:x*y}}const P5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,n;const{x:a,y:c,placement:u,middlewareData:h}=t,m=await H5(t,e);return u===((s=h.offset)==null?void 0:s.placement)&&(n=h.arrow)!=null&&n.alignmentOffset?{}:{x:a+m.x,y:c+m.y,data:{...m,placement:u}}}}},U5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:n,placement:a,platform:c}=t,{mainAxis:u=!0,crossAxis:h=!1,limiter:m={fn:M=>{let{x:R,y:T}=M;return{x:R,y:T}}},...p}=Tr(e,t),y={x:s,y:n},v=await c.detectOverflow(t,p),b=Ji(Ar(a)),x=pm(b);let w=y[x],C=y[b];if(u){const M=x==="y"?"top":"left",R=x==="y"?"bottom":"right",T=w+v[M],N=w-v[R];w=cf(T,w,N)}if(h){const M=b==="y"?"top":"left",R=b==="y"?"bottom":"right",T=C+v[M],N=C-v[R];C=cf(T,C,N)}const E=m.fn({...t,[x]:w,[b]:C});return{...E,data:{x:E.x-s,y:E.y-n,enabled:{[x]:u,[b]:h}}}}}},I5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:s,y:n,placement:a,rects:c,middlewareData:u}=t,{offset:h=0,mainAxis:m=!0,crossAxis:p=!0}=Tr(e,t),y={x:s,y:n},v=Ji(a),b=pm(v);let x=y[b],w=y[v];const C=Tr(h,t),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(m){const T=b==="y"?"height":"width",N=c.reference[b]-c.floating[T]+E.mainAxis,D=c.reference[b]+c.reference[T]-E.mainAxis;x<N?x=N:x>D&&(x=D)}if(p){var M,R;const T=b==="y"?"width":"height",N=iS.has(Ar(a)),D=c.reference[v]-c.floating[T]+(N&&((M=u.offset)==null?void 0:M[v])||0)+(N?0:E.crossAxis),j=c.reference[v]+c.reference[T]+(N?0:((R=u.offset)==null?void 0:R[v])||0)-(N?E.crossAxis:0);w<D?w=D:w>j&&(w=j)}return{[b]:x,[v]:w}}}},F5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var s,n;const{placement:a,rects:c,platform:u,elements:h}=t,{apply:m=()=>{},...p}=Tr(e,t),y=await u.detectOverflow(t,p),v=Ar(a),b=so(a),x=Ji(a)==="y",{width:w,height:C}=c.floating;let E,M;v==="top"||v==="bottom"?(E=v,M=b===(await(u.isRTL==null?void 0:u.isRTL(h.floating))?"start":"end")?"left":"right"):(M=v,E=b==="end"?"top":"bottom");const R=C-y.top-y.bottom,T=w-y.left-y.right,N=ps(C-y[E],R),D=ps(w-y[M],T),j=!t.middlewareData.shift;let q=N,te=D;if((s=t.middlewareData.shift)!=null&&s.enabled.x&&(te=T),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(q=R),j&&!b){const oe=mi(y.left,0),Z=mi(y.right,0),G=mi(y.top,0),I=mi(y.bottom,0);x?te=w-2*(oe!==0||Z!==0?oe+Z:mi(y.left,y.right)):q=C-2*(G!==0||I!==0?G+I:mi(y.top,y.bottom))}await m({...t,availableWidth:te,availableHeight:q});const re=await u.getDimensions(h.floating);return w!==re.width||C!==re.height?{reset:{rects:!0}}:{}}}};function $c(){return typeof window<"u"}function no(e){return rS(e)?(e.nodeName||"").toLowerCase():"#document"}function pi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nr(e){var t;return(t=(rS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function rS(e){return $c()?e instanceof Node||e instanceof pi(e).Node:!1}function Ui(e){return $c()?e instanceof Element||e instanceof pi(e).Element:!1}function Dr(e){return $c()?e instanceof HTMLElement||e instanceof pi(e).HTMLElement:!1}function D0(e){return!$c()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pi(e).ShadowRoot}function Ma(e){const{overflow:t,overflowX:s,overflowY:n,display:a}=Ii(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+s)&&a!=="inline"&&a!=="contents"}function W5(e){return/^(table|td|th)$/.test(no(e))}function Vc(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const q5=/transform|translate|scale|rotate|perspective|filter/,$5=/paint|layout|strict|content/,Hs=e=>!!e&&e!=="none";let Hd;function vm(e){const t=Ui(e)?Ii(e):e;return Hs(t.transform)||Hs(t.translate)||Hs(t.scale)||Hs(t.rotate)||Hs(t.perspective)||!ym()&&(Hs(t.backdropFilter)||Hs(t.filter))||q5.test(t.willChange||"")||$5.test(t.contain||"")}function V5(e){let t=_s(e);for(;Dr(t)&&!eo(t);){if(vm(t))return t;if(Vc(t))return null;t=_s(t)}return null}function ym(){return Hd==null&&(Hd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hd}function eo(e){return/^(html|body|#document)$/.test(no(e))}function Ii(e){return pi(e).getComputedStyle(e)}function Kc(e){return Ui(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _s(e){if(no(e)==="html")return e;const t=e.assignedSlot||e.parentNode||D0(e)&&e.host||nr(e);return D0(t)?t.host:t}function sS(e){const t=_s(e);return eo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Dr(t)&&Ma(t)?t:sS(t)}function va(e,t,s){var n;t===void 0&&(t=[]),s===void 0&&(s=!0);const a=sS(e),c=a===((n=e.ownerDocument)==null?void 0:n.body),u=pi(a);if(c){const h=hf(u);return t.concat(u,u.visualViewport||[],Ma(a)?a:[],h&&s?va(h):[])}else return t.concat(a,va(a,[],s))}function hf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nS(e){const t=Ii(e);let s=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Dr(e),c=a?e.offsetWidth:s,u=a?e.offsetHeight:n,h=kc(s)!==c||kc(n)!==u;return h&&(s=c,n=u),{width:s,height:n,$:h}}function bm(e){return Ui(e)?e:e.contextElement}function Qn(e){const t=bm(e);if(!Dr(t))return tr(1);const s=t.getBoundingClientRect(),{width:n,height:a,$:c}=nS(t);let u=(c?kc(s.width):s.width)/n,h=(c?kc(s.height):s.height)/a;return(!u||!Number.isFinite(u))&&(u=1),(!h||!Number.isFinite(h))&&(h=1),{x:u,y:h}}const K5=tr(0);function oS(e){const t=pi(e);return!ym()||!t.visualViewport?K5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Y5(e,t,s){return t===void 0&&(t=!1),!s||t&&s!==pi(e)?!1:t}function Xs(e,t,s,n){t===void 0&&(t=!1),s===void 0&&(s=!1);const a=e.getBoundingClientRect(),c=bm(e);let u=tr(1);t&&(n?Ui(n)&&(u=Qn(n)):u=Qn(e));const h=Y5(c,s,n)?oS(c):tr(0);let m=(a.left+h.x)/u.x,p=(a.top+h.y)/u.y,y=a.width/u.x,v=a.height/u.y;if(c){const b=pi(c),x=n&&Ui(n)?pi(n):n;let w=b,C=hf(w);for(;C&&n&&x!==w;){const E=Qn(C),M=C.getBoundingClientRect(),R=Ii(C),T=M.left+(C.clientLeft+parseFloat(R.paddingLeft))*E.x,N=M.top+(C.clientTop+parseFloat(R.paddingTop))*E.y;m*=E.x,p*=E.y,y*=E.x,v*=E.y,m+=T,p+=N,w=pi(C),C=hf(w)}}return Rc({width:y,height:v,x:m,y:p})}function Yc(e,t){const s=Kc(e).scrollLeft;return t?t.left+s:Xs(nr(e)).left+s}function aS(e,t){const s=e.getBoundingClientRect(),n=s.left+t.scrollLeft-Yc(e,s),a=s.top+t.scrollTop;return{x:n,y:a}}function G5(e){let{elements:t,rect:s,offsetParent:n,strategy:a}=e;const c=a==="fixed",u=nr(n),h=t?Vc(t.floating):!1;if(n===u||h&&c)return s;let m={scrollLeft:0,scrollTop:0},p=tr(1);const y=tr(0),v=Dr(n);if((v||!v&&!c)&&((no(n)!=="body"||Ma(u))&&(m=Kc(n)),v)){const x=Xs(n);p=Qn(n),y.x=x.x+n.clientLeft,y.y=x.y+n.clientTop}const b=u&&!v&&!c?aS(u,m):tr(0);return{width:s.width*p.x,height:s.height*p.y,x:s.x*p.x-m.scrollLeft*p.x+y.x+b.x,y:s.y*p.y-m.scrollTop*p.y+y.y+b.y}}function X5(e){return Array.from(e.getClientRects())}function Z5(e){const t=nr(e),s=Kc(e),n=e.ownerDocument.body,a=mi(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),c=mi(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let u=-s.scrollLeft+Yc(e);const h=-s.scrollTop;return Ii(n).direction==="rtl"&&(u+=mi(t.clientWidth,n.clientWidth)-a),{width:a,height:c,x:u,y:h}}const O0=25;function Q5(e,t){const s=pi(e),n=nr(e),a=s.visualViewport;let c=n.clientWidth,u=n.clientHeight,h=0,m=0;if(a){c=a.width,u=a.height;const y=ym();(!y||y&&t==="fixed")&&(h=a.offsetLeft,m=a.offsetTop)}const p=Yc(n);if(p<=0){const y=n.ownerDocument,v=y.body,b=getComputedStyle(v),x=y.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(n.clientWidth-v.clientWidth-x);w<=O0&&(c-=w)}else p<=O0&&(c+=p);return{width:c,height:u,x:h,y:m}}function J5(e,t){const s=Xs(e,!0,t==="fixed"),n=s.top+e.clientTop,a=s.left+e.clientLeft,c=Dr(e)?Qn(e):tr(1),u=e.clientWidth*c.x,h=e.clientHeight*c.y,m=a*c.x,p=n*c.y;return{width:u,height:h,x:m,y:p}}function L0(e,t,s){let n;if(t==="viewport")n=Q5(e,s);else if(t==="document")n=Z5(nr(e));else if(Ui(t))n=J5(t,s);else{const a=oS(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Rc(n)}function lS(e,t){const s=_s(e);return s===t||!Ui(s)||eo(s)?!1:Ii(s).position==="fixed"||lS(s,t)}function eR(e,t){const s=t.get(e);if(s)return s;let n=va(e,[],!1).filter(h=>Ui(h)&&no(h)!=="body"),a=null;const c=Ii(e).position==="fixed";let u=c?_s(e):e;for(;Ui(u)&&!eo(u);){const h=Ii(u),m=vm(u);!m&&h.position==="fixed"&&(a=null),(c?!m&&!a:!m&&h.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Ma(u)&&!m&&lS(e,u))?n=n.filter(y=>y!==u):a=h,u=_s(u)}return t.set(e,n),n}function tR(e){let{element:t,boundary:s,rootBoundary:n,strategy:a}=e;const u=[...s==="clippingAncestors"?Vc(t)?[]:eR(t,this._c):[].concat(s),n],h=L0(t,u[0],a);let m=h.top,p=h.right,y=h.bottom,v=h.left;for(let b=1;b<u.length;b++){const x=L0(t,u[b],a);m=mi(x.top,m),p=ps(x.right,p),y=ps(x.bottom,y),v=mi(x.left,v)}return{width:p-v,height:y-m,x:v,y:m}}function iR(e){const{width:t,height:s}=nS(e);return{width:t,height:s}}function rR(e,t,s){const n=Dr(t),a=nr(t),c=s==="fixed",u=Xs(e,!0,c,t);let h={scrollLeft:0,scrollTop:0};const m=tr(0);function p(){m.x=Yc(a)}if(n||!n&&!c)if((no(t)!=="body"||Ma(a))&&(h=Kc(t)),n){const x=Xs(t,!0,c,t);m.x=x.x+t.clientLeft,m.y=x.y+t.clientTop}else a&&p();c&&!n&&a&&p();const y=a&&!n&&!c?aS(a,h):tr(0),v=u.left+h.scrollLeft-m.x-y.x,b=u.top+h.scrollTop-m.y-y.y;return{x:v,y:b,width:u.width,height:u.height}}function Pd(e){return Ii(e).position==="static"}function z0(e,t){if(!Dr(e)||Ii(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return nr(e)===s&&(s=s.ownerDocument.body),s}function cS(e,t){const s=pi(e);if(Vc(e))return s;if(!Dr(e)){let a=_s(e);for(;a&&!eo(a);){if(Ui(a)&&!Pd(a))return a;a=_s(a)}return s}let n=z0(e,t);for(;n&&W5(n)&&Pd(n);)n=z0(n,t);return n&&eo(n)&&Pd(n)&&!vm(n)?s:n||V5(e)||s}const sR=async function(e){const t=this.getOffsetParent||cS,s=this.getDimensions,n=await s(e.floating);return{reference:rR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function nR(e){return Ii(e).direction==="rtl"}const oR={convertOffsetParentRelativeRectToViewportRelativeRect:G5,getDocumentElement:nr,getClippingRect:tR,getOffsetParent:cS,getElementRects:sR,getClientRects:X5,getDimensions:iR,getScale:Qn,isElement:Ui,isRTL:nR};function uS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aR(e,t){let s=null,n;const a=nr(e);function c(){var h;clearTimeout(n),(h=s)==null||h.disconnect(),s=null}function u(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),c();const p=e.getBoundingClientRect(),{left:y,top:v,width:b,height:x}=p;if(h||t(),!b||!x)return;const w=oc(v),C=oc(a.clientWidth-(y+b)),E=oc(a.clientHeight-(v+x)),M=oc(y),T={rootMargin:-w+"px "+-C+"px "+-E+"px "+-M+"px",threshold:mi(0,ps(1,m))||1};let N=!0;function D(j){const q=j[0].intersectionRatio;if(q!==m){if(!N)return u();q?u(!1,q):n=setTimeout(()=>{u(!1,1e-7)},1e3)}q===1&&!uS(p,e.getBoundingClientRect())&&u(),N=!1}try{s=new IntersectionObserver(D,{...T,root:a.ownerDocument})}catch{s=new IntersectionObserver(D,T)}s.observe(e)}return u(!0),c}function lR(e,t,s,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:m=!1}=n,p=bm(e),y=a||c?[...p?va(p):[],...t?va(t):[]]:[];y.forEach(M=>{a&&M.addEventListener("scroll",s,{passive:!0}),c&&M.addEventListener("resize",s)});const v=p&&h?aR(p,s):null;let b=-1,x=null;u&&(x=new ResizeObserver(M=>{let[R]=M;R&&R.target===p&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var T;(T=x)==null||T.observe(t)})),s()}),p&&!m&&x.observe(p),t&&x.observe(t));let w,C=m?Xs(e):null;m&&E();function E(){const M=Xs(e);C&&!uS(C,M)&&s(),C=M,w=requestAnimationFrame(E)}return s(),()=>{var M;y.forEach(R=>{a&&R.removeEventListener("scroll",s),c&&R.removeEventListener("resize",s)}),v==null||v(),(M=x)==null||M.disconnect(),x=null,m&&cancelAnimationFrame(w)}}const cR=P5,uR=U5,hR=B5,dR=F5,fR=j5,B0=z5,mR=I5,pR=(e,t,s)=>{const n=new Map,a={platform:oR,...s},c={...a.platform,_c:n};return L5(e,t,{...a,platform:c})};var _R=typeof document<"u",gR=function(){},pc=_R?g.useLayoutEffect:gR;function Nc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let s,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(n=s;n--!==0;)if(!Nc(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),s=a.length,s!==Object.keys(t).length)return!1;for(n=s;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=s;n--!==0;){const c=a[n];if(!(c==="_owner"&&e.$$typeof)&&!Nc(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function hS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function j0(e,t){const s=hS(e);return Math.round(t*s)/s}function Ud(e){const t=g.useRef(e);return pc(()=>{t.current=e}),t}function vR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:n=[],platform:a,elements:{reference:c,floating:u}={},transform:h=!0,whileElementsMounted:m,open:p}=e,[y,v]=g.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=g.useState(n);Nc(b,n)||x(n);const[w,C]=g.useState(null),[E,M]=g.useState(null),R=g.useCallback(z=>{z!==j.current&&(j.current=z,C(z))},[]),T=g.useCallback(z=>{z!==q.current&&(q.current=z,M(z))},[]),N=c||w,D=u||E,j=g.useRef(null),q=g.useRef(null),te=g.useRef(y),re=m!=null,oe=Ud(m),Z=Ud(a),G=Ud(p),I=g.useCallback(()=>{if(!j.current||!q.current)return;const z={placement:t,strategy:s,middleware:b};Z.current&&(z.platform=Z.current),pR(j.current,q.current,z).then(K=>{const ee={...K,isPositioned:G.current!==!1};V.current&&!Nc(te.current,ee)&&(te.current=ee,em.flushSync(()=>{v(ee)}))})},[b,t,s,Z,G]);pc(()=>{p===!1&&te.current.isPositioned&&(te.current.isPositioned=!1,v(z=>({...z,isPositioned:!1})))},[p]);const V=g.useRef(!1);pc(()=>(V.current=!0,()=>{V.current=!1}),[]),pc(()=>{if(N&&(j.current=N),D&&(q.current=D),N&&D){if(oe.current)return oe.current(N,D,I);I()}},[N,D,I,oe,re]);const W=g.useMemo(()=>({reference:j,floating:q,setReference:R,setFloating:T}),[R,T]),A=g.useMemo(()=>({reference:N,floating:D}),[N,D]),L=g.useMemo(()=>{const z={position:s,left:0,top:0};if(!A.floating)return z;const K=j0(A.floating,y.x),ee=j0(A.floating,y.y);return h?{...z,transform:"translate("+K+"px, "+ee+"px)",...hS(A.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:K,top:ee}},[s,h,A.floating,y.x,y.y]);return g.useMemo(()=>({...y,update:I,refs:W,elements:A,floatingStyles:L}),[y,I,W,A,L])}const yR=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:n,padding:a}=typeof e=="function"?e(s):e;return n&&t(n)?n.current!=null?B0({element:n.current,padding:a}).fn(s):{}:n?B0({element:n,padding:a}).fn(s):{}}}},bR=(e,t)=>{const s=cR(e);return{name:s.name,fn:s.fn,options:[e,t]}},SR=(e,t)=>{const s=uR(e);return{name:s.name,fn:s.fn,options:[e,t]}},xR=(e,t)=>({fn:mR(e).fn,options:[e,t]}),wR=(e,t)=>{const s=hR(e);return{name:s.name,fn:s.fn,options:[e,t]}},CR=(e,t)=>{const s=dR(e);return{name:s.name,fn:s.fn,options:[e,t]}},ER=(e,t)=>{const s=fR(e);return{name:s.name,fn:s.fn,options:[e,t]}},kR=(e,t)=>{const s=yR(e);return{name:s.name,fn:s.fn,options:[e,t]}};var MR="Arrow",dS=g.forwardRef((e,t)=>{const{children:s,width:n=10,height:a=5,...c}=e;return _.jsx(Le.svg,{...c,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:_.jsx("polygon",{points:"0,0 30,0 15,10"})})});dS.displayName=MR;var RR=dS,Sm="Popper",[fS,Gc]=sr(Sm),[NR,mS]=fS(Sm),pS=e=>{const{__scopePopper:t,children:s}=e,[n,a]=g.useState(null);return _.jsx(NR,{scope:t,anchor:n,onAnchorChange:a,children:s})};pS.displayName=Sm;var _S="PopperAnchor",gS=g.forwardRef((e,t)=>{const{__scopePopper:s,virtualRef:n,...a}=e,c=mS(_S,s),u=g.useRef(null),h=Xe(t,u),m=g.useRef(null);return g.useEffect(()=>{const p=m.current;m.current=(n==null?void 0:n.current)||u.current,p!==m.current&&c.onAnchorChange(m.current)}),n?null:_.jsx(Le.div,{...a,ref:h})});gS.displayName=_S;var xm="PopperContent",[TR,AR]=fS(xm),vS=g.forwardRef((e,t)=>{var Ne,Ue,xe,ce,Te,Ge;const{__scopePopper:s,side:n="bottom",sideOffset:a=0,align:c="center",alignOffset:u=0,arrowPadding:h=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:x="optimized",onPlaced:w,...C}=e,E=mS(xm,s),[M,R]=g.useState(null),T=Xe(t,be=>R(be)),[N,D]=g.useState(null),j=x5(N),q=(j==null?void 0:j.width)??0,te=(j==null?void 0:j.height)??0,re=n+(c!=="center"?"-"+c:""),oe=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},Z=Array.isArray(p)?p:[p],G=Z.length>0,I={padding:oe,boundary:Z.filter(OR),altBoundary:G},{refs:V,floatingStyles:W,placement:A,isPositioned:L,middlewareData:z}=vR({strategy:"fixed",placement:re,whileElementsMounted:(...be)=>lR(...be,{animationFrame:x==="always"}),elements:{reference:E.anchor},middleware:[bR({mainAxis:a+te,alignmentAxis:u}),m&&SR({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?xR():void 0,...I}),m&&wR({...I}),CR({...I,apply:({elements:be,rects:ze,availableWidth:Li,availableHeight:Ze})=>{const{width:zi,height:Wi}=ze.reference,gi=be.floating.style;gi.setProperty("--radix-popper-available-width",`${Li}px`),gi.setProperty("--radix-popper-available-height",`${Ze}px`),gi.setProperty("--radix-popper-anchor-width",`${zi}px`),gi.setProperty("--radix-popper-anchor-height",`${Wi}px`)}}),N&&kR({element:N,padding:h}),LR({arrowWidth:q,arrowHeight:te}),b&&ER({strategy:"referenceHidden",...I})]}),[K,ee]=SS(A),he=Bt(w);_i(()=>{L&&(he==null||he())},[L,he]);const ne=(Ne=z.arrow)==null?void 0:Ne.x,ae=(Ue=z.arrow)==null?void 0:Ue.y,ie=((xe=z.arrow)==null?void 0:xe.centerOffset)!==0,[me,ve]=g.useState();return _i(()=>{M&&ve(window.getComputedStyle(M).zIndex)},[M]),_.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:L?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(ce=z.transformOrigin)==null?void 0:ce.x,(Te=z.transformOrigin)==null?void 0:Te.y].join(" "),...((Ge=z.hide)==null?void 0:Ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:_.jsx(TR,{scope:s,placedSide:K,onArrowChange:D,arrowX:ne,arrowY:ae,shouldHideArrow:ie,children:_.jsx(Le.div,{"data-side":K,"data-align":ee,...C,ref:T,style:{...C.style,animation:L?void 0:"none"}})})})});vS.displayName=xm;var yS="PopperArrow",DR={top:"bottom",right:"left",bottom:"top",left:"right"},bS=g.forwardRef(function(t,s){const{__scopePopper:n,...a}=t,c=AR(yS,n),u=DR[c.placedSide];return _.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:_.jsx(RR,{...a,ref:s,style:{...a.style,display:"block"}})})});bS.displayName=yS;function OR(e){return e!==null}var LR=e=>({name:"transformOrigin",options:e,fn(t){var E,M,R;const{placement:s,rects:n,middlewareData:a}=t,u=((E=a.arrow)==null?void 0:E.centerOffset)!==0,h=u?0:e.arrowWidth,m=u?0:e.arrowHeight,[p,y]=SS(s),v={start:"0%",center:"50%",end:"100%"}[y],b=(((M=a.arrow)==null?void 0:M.x)??0)+h/2,x=(((R=a.arrow)==null?void 0:R.y)??0)+m/2;let w="",C="";return p==="bottom"?(w=u?v:`${b}px`,C=`${-m}px`):p==="top"?(w=u?v:`${b}px`,C=`${n.floating.height+m}px`):p==="right"?(w=`${-m}px`,C=u?v:`${x}px`):p==="left"&&(w=`${n.floating.width+m}px`,C=u?v:`${x}px`),{data:{x:w,y:C}}}});function SS(e){const[t,s="center"]=e.split("-");return[t,s]}var xS=pS,wS=gS,CS=vS,ES=bS,Id="rovingFocusGroup.onEntryFocus",zR={bubbles:!1,cancelable:!0},Ra="RovingFocusGroup",[df,kS,BR]=vb(Ra),[jR,MS]=sr(Ra,[BR]),[HR,PR]=jR(Ra),RS=g.forwardRef((e,t)=>_.jsx(df.Provider,{scope:e.__scopeRovingFocusGroup,children:_.jsx(df.Slot,{scope:e.__scopeRovingFocusGroup,children:_.jsx(UR,{...e,ref:t})})}));RS.displayName=Ra;var UR=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,orientation:n,loop:a=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:y=!1,...v}=e,b=g.useRef(null),x=Xe(t,b),w=lm(c),[C,E]=ka({prop:u,defaultProp:h??null,onChange:m,caller:Ra}),[M,R]=g.useState(!1),T=Bt(p),N=kS(s),D=g.useRef(!1),[j,q]=g.useState(0);return g.useEffect(()=>{const te=b.current;if(te)return te.addEventListener(Id,T),()=>te.removeEventListener(Id,T)},[T]),_.jsx(HR,{scope:s,orientation:n,dir:w,loop:a,currentTabStopId:C,onItemFocus:g.useCallback(te=>E(te),[E]),onItemShiftTab:g.useCallback(()=>R(!0),[]),onFocusableItemAdd:g.useCallback(()=>q(te=>te+1),[]),onFocusableItemRemove:g.useCallback(()=>q(te=>te-1),[]),children:_.jsx(Le.div,{tabIndex:M||j===0?-1:0,"data-orientation":n,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{D.current=!0}),onFocus:_e(e.onFocus,te=>{const re=!D.current;if(te.target===te.currentTarget&&re&&!M){const oe=new CustomEvent(Id,zR);if(te.currentTarget.dispatchEvent(oe),!oe.defaultPrevented){const Z=N().filter(A=>A.focusable),G=Z.find(A=>A.active),I=Z.find(A=>A.id===C),W=[G,I,...Z].filter(Boolean).map(A=>A.ref.current);AS(W,y)}}D.current=!1}),onBlur:_e(e.onBlur,()=>R(!1))})})}),NS="RovingFocusGroupItem",TS=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,focusable:n=!0,active:a=!1,tabStopId:c,children:u,...h}=e,m=fs(),p=c||m,y=PR(NS,s),v=y.currentTabStopId===p,b=kS(s),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:C}=y;return g.useEffect(()=>{if(n)return x(),()=>w()},[n,x,w]),_.jsx(df.ItemSlot,{scope:s,id:p,focusable:n,active:a,children:_.jsx(Le.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...h,ref:t,onMouseDown:_e(e.onMouseDown,E=>{n?y.onItemFocus(p):E.preventDefault()}),onFocus:_e(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:_e(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){y.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const M=WR(E,y.orientation,y.dir);if(M!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let T=b().filter(N=>N.focusable).map(N=>N.ref.current);if(M==="last")T.reverse();else if(M==="prev"||M==="next"){M==="prev"&&T.reverse();const N=T.indexOf(E.currentTarget);T=y.loop?qR(T,N+1):T.slice(N+1)}setTimeout(()=>AS(T))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:C!=null}):u})})});TS.displayName=NS;var IR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function FR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function WR(e,t,s){const n=FR(e.key,s);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return IR[n]}function AS(e,t=!1){const s=document.activeElement;for(const n of e)if(n===s||(n.focus({preventScroll:t}),document.activeElement!==s))return}function qR(e,t){return e.map((s,n)=>e[(t+n)%e.length])}var $R=RS,VR=TS;function KR(e){const t=YR(e),s=g.forwardRef((n,a)=>{const{children:c,...u}=n,h=g.Children.toArray(c),m=h.find(XR);if(m){const p=m.props.children,y=h.map(v=>v===m?g.Children.count(p)>1?g.Children.only(null):g.isValidElement(p)?p.props.children:null:v);return _.jsx(t,{...u,ref:a,children:g.isValidElement(p)?g.cloneElement(p,void 0,y):null})}return _.jsx(t,{...u,ref:a,children:c})});return s.displayName=`${e}.Slot`,s}function YR(e){const t=g.forwardRef((s,n)=>{const{children:a,...c}=s;if(g.isValidElement(a)){const u=QR(a),h=ZR(c,a.props);return a.type!==g.Fragment&&(h.ref=n?gs(n,u):u),g.cloneElement(a,h)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GR=Symbol("radix.slottable");function XR(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GR}function ZR(e,t){const s={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?s[n]=(...h)=>{const m=c(...h);return a(...h),m}:a&&(s[n]=a):n==="style"?s[n]={...a,...c}:n==="className"&&(s[n]=[a,c].filter(Boolean).join(" "))}return{...e,...s}}function QR(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var ff=["Enter"," "],JR=["ArrowDown","PageUp","Home"],DS=["ArrowUp","PageDown","End"],eN=[...JR,...DS],tN={ltr:[...ff,"ArrowRight"],rtl:[...ff,"ArrowLeft"]},iN={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Na="Menu",[ya,rN,sN]=vb(Na),[en,OS]=sr(Na,[sN,Gc,MS]),Xc=Gc(),LS=MS(),[nN,tn]=en(Na),[oN,Ta]=en(Na),zS=e=>{const{__scopeMenu:t,open:s=!1,children:n,dir:a,onOpenChange:c,modal:u=!0}=e,h=Xc(t),[m,p]=g.useState(null),y=g.useRef(!1),v=Bt(c),b=lm(a);return g.useEffect(()=>{const x=()=>{y.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>y.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),_.jsx(xS,{...h,children:_.jsx(nN,{scope:t,open:s,onOpenChange:v,content:m,onContentChange:p,children:_.jsx(oN,{scope:t,onClose:g.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:b,modal:u,children:n})})})};zS.displayName=Na;var aN="MenuAnchor",wm=g.forwardRef((e,t)=>{const{__scopeMenu:s,...n}=e,a=Xc(s);return _.jsx(wS,{...a,...n,ref:t})});wm.displayName=aN;var Cm="MenuPortal",[lN,BS]=en(Cm,{forceMount:void 0}),jS=e=>{const{__scopeMenu:t,forceMount:s,children:n,container:a}=e,c=tn(Cm,t);return _.jsx(lN,{scope:t,forceMount:s,children:_.jsx(Wt,{present:s||c.open,children:_.jsx(Fc,{asChild:!0,container:a,children:n})})})};jS.displayName=Cm;var Ai="MenuContent",[cN,Em]=en(Ai),HS=g.forwardRef((e,t)=>{const s=BS(Ai,e.__scopeMenu),{forceMount:n=s.forceMount,...a}=e,c=tn(Ai,e.__scopeMenu),u=Ta(Ai,e.__scopeMenu);return _.jsx(ya.Provider,{scope:e.__scopeMenu,children:_.jsx(Wt,{present:n||c.open,children:_.jsx(ya.Slot,{scope:e.__scopeMenu,children:u.modal?_.jsx(uN,{...a,ref:t}):_.jsx(hN,{...a,ref:t})})})})}),uN=g.forwardRef((e,t)=>{const s=tn(Ai,e.__scopeMenu),n=g.useRef(null),a=Xe(t,n);return g.useEffect(()=>{const c=n.current;if(c)return zb(c)},[]),_.jsx(km,{...e,ref:a,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),hN=g.forwardRef((e,t)=>{const s=tn(Ai,e.__scopeMenu);return _.jsx(km,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),dN=KR("MenuContent.ScrollLock"),km=g.forwardRef((e,t)=>{const{__scopeMenu:s,loop:n=!1,trapFocus:a,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:h,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,disableOutsideScroll:w,...C}=e,E=tn(Ai,s),M=Ta(Ai,s),R=Xc(s),T=LS(s),N=rN(s),[D,j]=g.useState(null),q=g.useRef(null),te=Xe(t,q,E.onContentChange),re=g.useRef(0),oe=g.useRef(""),Z=g.useRef(0),G=g.useRef(null),I=g.useRef("right"),V=g.useRef(0),W=w?um:g.Fragment,A=w?{as:dN,allowPinchZoom:!0}:void 0,L=K=>{var Ne,Ue;const ee=oe.current+K,he=N().filter(xe=>!xe.disabled),ne=document.activeElement,ae=(Ne=he.find(xe=>xe.ref.current===ne))==null?void 0:Ne.textValue,ie=he.map(xe=>xe.textValue),me=CN(ie,ee,ae),ve=(Ue=he.find(xe=>xe.textValue===me))==null?void 0:Ue.ref.current;(function xe(ce){oe.current=ce,window.clearTimeout(re.current),ce!==""&&(re.current=window.setTimeout(()=>xe(""),1e3))})(ee),ve&&setTimeout(()=>ve.focus())};g.useEffect(()=>()=>window.clearTimeout(re.current),[]),kb();const z=g.useCallback(K=>{var he,ne;return I.current===((he=G.current)==null?void 0:he.side)&&kN(K,(ne=G.current)==null?void 0:ne.area)},[]);return _.jsx(cN,{scope:s,searchRef:oe,onItemEnter:g.useCallback(K=>{z(K)&&K.preventDefault()},[z]),onItemLeave:g.useCallback(K=>{var ee;z(K)||((ee=q.current)==null||ee.focus(),j(null))},[z]),onTriggerLeave:g.useCallback(K=>{z(K)&&K.preventDefault()},[z]),pointerGraceTimerRef:Z,onPointerGraceIntentChange:g.useCallback(K=>{G.current=K},[]),children:_.jsx(W,{...A,children:_.jsx(cm,{asChild:!0,trapped:a,onMountAutoFocus:_e(c,K=>{var ee;K.preventDefault(),(ee=q.current)==null||ee.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:_.jsx(Ic,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,children:_.jsx($R,{asChild:!0,...T,dir:M.dir,orientation:"vertical",loop:n,currentTabStopId:D,onCurrentTabStopIdChange:j,onEntryFocus:_e(m,K=>{M.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:_.jsx(CS,{role:"menu","aria-orientation":"vertical","data-state":e1(E.open),"data-radix-menu-content":"",dir:M.dir,...R,...C,ref:te,style:{outline:"none",...C.style},onKeyDown:_e(C.onKeyDown,K=>{const he=K.target.closest("[data-radix-menu-content]")===K.currentTarget,ne=K.ctrlKey||K.altKey||K.metaKey,ae=K.key.length===1;he&&(K.key==="Tab"&&K.preventDefault(),!ne&&ae&&L(K.key));const ie=q.current;if(K.target!==ie||!eN.includes(K.key))return;K.preventDefault();const ve=N().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);DS.includes(K.key)&&ve.reverse(),xN(ve)}),onBlur:_e(e.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(re.current),oe.current="")}),onPointerMove:_e(e.onPointerMove,ba(K=>{const ee=K.target,he=V.current!==K.clientX;if(K.currentTarget.contains(ee)&&he){const ne=K.clientX>V.current?"right":"left";I.current=ne,V.current=K.clientX}}))})})})})})})});HS.displayName=Ai;var fN="MenuGroup",Mm=g.forwardRef((e,t)=>{const{__scopeMenu:s,...n}=e;return _.jsx(Le.div,{role:"group",...n,ref:t})});Mm.displayName=fN;var mN="MenuLabel",PS=g.forwardRef((e,t)=>{const{__scopeMenu:s,...n}=e;return _.jsx(Le.div,{...n,ref:t})});PS.displayName=mN;var Tc="MenuItem",H0="menu.itemSelect",Zc=g.forwardRef((e,t)=>{const{disabled:s=!1,onSelect:n,...a}=e,c=g.useRef(null),u=Ta(Tc,e.__scopeMenu),h=Em(Tc,e.__scopeMenu),m=Xe(t,c),p=g.useRef(!1),y=()=>{const v=c.current;if(!s&&v){const b=new CustomEvent(H0,{bubbles:!0,cancelable:!0});v.addEventListener(H0,x=>n==null?void 0:n(x),{once:!0}),_b(v,b),b.defaultPrevented?p.current=!1:u.onClose()}};return _.jsx(US,{...a,ref:m,disabled:s,onClick:_e(e.onClick,y),onPointerDown:v=>{var b;(b=e.onPointerDown)==null||b.call(e,v),p.current=!0},onPointerUp:_e(e.onPointerUp,v=>{var b;p.current||(b=v.currentTarget)==null||b.click()}),onKeyDown:_e(e.onKeyDown,v=>{const b=h.searchRef.current!=="";s||b&&v.key===" "||ff.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Zc.displayName=Tc;var US=g.forwardRef((e,t)=>{const{__scopeMenu:s,disabled:n=!1,textValue:a,...c}=e,u=Em(Tc,s),h=LS(s),m=g.useRef(null),p=Xe(t,m),[y,v]=g.useState(!1),[b,x]=g.useState("");return g.useEffect(()=>{const w=m.current;w&&x((w.textContent??"").trim())},[c.children]),_.jsx(ya.ItemSlot,{scope:s,disabled:n,textValue:a??b,children:_.jsx(VR,{asChild:!0,...h,focusable:!n,children:_.jsx(Le.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...c,ref:p,onPointerMove:_e(e.onPointerMove,ba(w=>{n?u.onItemLeave(w):(u.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_e(e.onPointerLeave,ba(w=>u.onItemLeave(w))),onFocus:_e(e.onFocus,()=>v(!0)),onBlur:_e(e.onBlur,()=>v(!1))})})})}),pN="MenuCheckboxItem",IS=g.forwardRef((e,t)=>{const{checked:s=!1,onCheckedChange:n,...a}=e;return _.jsx(VS,{scope:e.__scopeMenu,checked:s,children:_.jsx(Zc,{role:"menuitemcheckbox","aria-checked":Ac(s)?"mixed":s,...a,ref:t,"data-state":Nm(s),onSelect:_e(a.onSelect,()=>n==null?void 0:n(Ac(s)?!0:!s),{checkForDefaultPrevented:!1})})})});IS.displayName=pN;var FS="MenuRadioGroup",[_N,gN]=en(FS,{value:void 0,onValueChange:()=>{}}),WS=g.forwardRef((e,t)=>{const{value:s,onValueChange:n,...a}=e,c=Bt(n);return _.jsx(_N,{scope:e.__scopeMenu,value:s,onValueChange:c,children:_.jsx(Mm,{...a,ref:t})})});WS.displayName=FS;var qS="MenuRadioItem",$S=g.forwardRef((e,t)=>{const{value:s,...n}=e,a=gN(qS,e.__scopeMenu),c=s===a.value;return _.jsx(VS,{scope:e.__scopeMenu,checked:c,children:_.jsx(Zc,{role:"menuitemradio","aria-checked":c,...n,ref:t,"data-state":Nm(c),onSelect:_e(n.onSelect,()=>{var u;return(u=a.onValueChange)==null?void 0:u.call(a,s)},{checkForDefaultPrevented:!1})})})});$S.displayName=qS;var Rm="MenuItemIndicator",[VS,vN]=en(Rm,{checked:!1}),KS=g.forwardRef((e,t)=>{const{__scopeMenu:s,forceMount:n,...a}=e,c=vN(Rm,s);return _.jsx(Wt,{present:n||Ac(c.checked)||c.checked===!0,children:_.jsx(Le.span,{...a,ref:t,"data-state":Nm(c.checked)})})});KS.displayName=Rm;var yN="MenuSeparator",YS=g.forwardRef((e,t)=>{const{__scopeMenu:s,...n}=e;return _.jsx(Le.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});YS.displayName=yN;var bN="MenuArrow",GS=g.forwardRef((e,t)=>{const{__scopeMenu:s,...n}=e,a=Xc(s);return _.jsx(ES,{...a,...n,ref:t})});GS.displayName=bN;var SN="MenuSub",[$O,XS]=en(SN),ua="MenuSubTrigger",ZS=g.forwardRef((e,t)=>{const s=tn(ua,e.__scopeMenu),n=Ta(ua,e.__scopeMenu),a=XS(ua,e.__scopeMenu),c=Em(ua,e.__scopeMenu),u=g.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:m}=c,p={__scopeMenu:e.__scopeMenu},y=g.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return g.useEffect(()=>y,[y]),g.useEffect(()=>{const v=h.current;return()=>{window.clearTimeout(v),m(null)}},[h,m]),_.jsx(wm,{asChild:!0,...p,children:_.jsx(US,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":a.contentId,"data-state":e1(s.open),...e,ref:gs(t,a.onTriggerChange),onClick:v=>{var b;(b=e.onClick)==null||b.call(e,v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:_e(e.onPointerMove,ba(v=>{c.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!s.open&&!u.current&&(c.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{s.onOpenChange(!0),y()},100))})),onPointerLeave:_e(e.onPointerLeave,ba(v=>{var x,w;y();const b=(x=s.content)==null?void 0:x.getBoundingClientRect();if(b){const C=(w=s.content)==null?void 0:w.dataset.side,E=C==="right",M=E?-5:5,R=b[E?"left":"right"],T=b[E?"right":"left"];c.onPointerGraceIntentChange({area:[{x:v.clientX+M,y:v.clientY},{x:R,y:b.top},{x:T,y:b.top},{x:T,y:b.bottom},{x:R,y:b.bottom}],side:C}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(v),v.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:_e(e.onKeyDown,v=>{var x;const b=c.searchRef.current!=="";e.disabled||b&&v.key===" "||tN[n.dir].includes(v.key)&&(s.onOpenChange(!0),(x=s.content)==null||x.focus(),v.preventDefault())})})})});ZS.displayName=ua;var QS="MenuSubContent",JS=g.forwardRef((e,t)=>{const s=BS(Ai,e.__scopeMenu),{forceMount:n=s.forceMount,...a}=e,c=tn(Ai,e.__scopeMenu),u=Ta(Ai,e.__scopeMenu),h=XS(QS,e.__scopeMenu),m=g.useRef(null),p=Xe(t,m);return _.jsx(ya.Provider,{scope:e.__scopeMenu,children:_.jsx(Wt,{present:n||c.open,children:_.jsx(ya.Slot,{scope:e.__scopeMenu,children:_.jsx(km,{id:h.contentId,"aria-labelledby":h.triggerId,...a,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{var v;u.isUsingKeyboardRef.current&&((v=m.current)==null||v.focus()),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:_e(e.onFocusOutside,y=>{y.target!==h.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:_e(e.onEscapeKeyDown,y=>{u.onClose(),y.preventDefault()}),onKeyDown:_e(e.onKeyDown,y=>{var x;const v=y.currentTarget.contains(y.target),b=iN[u.dir].includes(y.key);v&&b&&(c.onOpenChange(!1),(x=h.trigger)==null||x.focus(),y.preventDefault())})})})})})});JS.displayName=QS;function e1(e){return e?"open":"closed"}function Ac(e){return e==="indeterminate"}function Nm(e){return Ac(e)?"indeterminate":e?"checked":"unchecked"}function xN(e){const t=document.activeElement;for(const s of e)if(s===t||(s.focus(),document.activeElement!==t))return}function wN(e,t){return e.map((s,n)=>e[(t+n)%e.length])}function CN(e,t,s){const a=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,c=s?e.indexOf(s):-1;let u=wN(e,Math.max(c,0));a.length===1&&(u=u.filter(p=>p!==s));const m=u.find(p=>p.toLowerCase().startsWith(a.toLowerCase()));return m!==s?m:void 0}function EN(e,t){const{x:s,y:n}=e;let a=!1;for(let c=0,u=t.length-1;c<t.length;u=c++){const h=t[c],m=t[u],p=h.x,y=h.y,v=m.x,b=m.y;y>n!=b>n&&s<(v-p)*(n-y)/(b-y)+p&&(a=!a)}return a}function kN(e,t){if(!t)return!1;const s={x:e.clientX,y:e.clientY};return EN(s,t)}function ba(e){return t=>t.pointerType==="mouse"?e(t):void 0}var MN=zS,RN=wm,NN=jS,TN=HS,AN=Mm,DN=PS,ON=Zc,LN=IS,zN=WS,BN=$S,jN=KS,HN=YS,PN=GS,UN=ZS,IN=JS,Qc="DropdownMenu",[FN]=sr(Qc,[OS]),qt=OS(),[WN,t1]=FN(Qc),i1=e=>{const{__scopeDropdownMenu:t,children:s,dir:n,open:a,defaultOpen:c,onOpenChange:u,modal:h=!0}=e,m=qt(t),p=g.useRef(null),[y,v]=ka({prop:a,defaultProp:c??!1,onChange:u,caller:Qc});return _.jsx(WN,{scope:t,triggerId:fs(),triggerRef:p,contentId:fs(),open:y,onOpenChange:v,onOpenToggle:g.useCallback(()=>v(b=>!b),[v]),modal:h,children:_.jsx(MN,{...m,open:y,onOpenChange:v,dir:n,modal:h,children:s})})};i1.displayName=Qc;var r1="DropdownMenuTrigger",s1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,disabled:n=!1,...a}=e,c=t1(r1,s),u=qt(s);return _.jsx(RN,{asChild:!0,...u,children:_.jsx(Le.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:gs(t,c.triggerRef),onPointerDown:_e(e.onPointerDown,h=>{!n&&h.button===0&&h.ctrlKey===!1&&(c.onOpenToggle(),c.open||h.preventDefault())}),onKeyDown:_e(e.onKeyDown,h=>{n||(["Enter"," "].includes(h.key)&&c.onOpenToggle(),h.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(h.key)&&h.preventDefault())})})})});s1.displayName=r1;var qN="DropdownMenuPortal",n1=e=>{const{__scopeDropdownMenu:t,...s}=e,n=qt(t);return _.jsx(NN,{...n,...s})};n1.displayName=qN;var o1="DropdownMenuContent",a1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=t1(o1,s),c=qt(s),u=g.useRef(!1);return _.jsx(TN,{id:a.contentId,"aria-labelledby":a.triggerId,...c,...n,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,h=>{var m;u.current||(m=a.triggerRef.current)==null||m.focus(),u.current=!1,h.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,h=>{const m=h.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,y=m.button===2||p;(!a.modal||y)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});a1.displayName=o1;var $N="DropdownMenuGroup",VN=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(AN,{...a,...n,ref:t})});VN.displayName=$N;var KN="DropdownMenuLabel",YN=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(DN,{...a,...n,ref:t})});YN.displayName=KN;var GN="DropdownMenuItem",l1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(ON,{...a,...n,ref:t})});l1.displayName=GN;var XN="DropdownMenuCheckboxItem",ZN=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(LN,{...a,...n,ref:t})});ZN.displayName=XN;var QN="DropdownMenuRadioGroup",JN=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(zN,{...a,...n,ref:t})});JN.displayName=QN;var eT="DropdownMenuRadioItem",tT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(BN,{...a,...n,ref:t})});tT.displayName=eT;var iT="DropdownMenuItemIndicator",rT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(jN,{...a,...n,ref:t})});rT.displayName=iT;var sT="DropdownMenuSeparator",c1=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(HN,{...a,...n,ref:t})});c1.displayName=sT;var nT="DropdownMenuArrow",oT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(PN,{...a,...n,ref:t})});oT.displayName=nT;var aT="DropdownMenuSubTrigger",lT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(UN,{...a,...n,ref:t})});lT.displayName=aT;var cT="DropdownMenuSubContent",uT=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:s,...n}=e,a=qt(s);return _.jsx(IN,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uT.displayName=cT;var hT=i1,dT=s1,fT=n1,mT=a1,pT=l1,_T=c1;function gT(e,[t,s]){return Math.min(s,Math.max(t,e))}function vT(e,t){return g.useReducer((s,n)=>t[s][n]??s,e)}var Tm="ScrollArea",[u1]=sr(Tm),[yT,Oi]=u1(Tm),h1=g.forwardRef((e,t)=>{const{__scopeScrollArea:s,type:n="hover",dir:a,scrollHideDelay:c=600,...u}=e,[h,m]=g.useState(null),[p,y]=g.useState(null),[v,b]=g.useState(null),[x,w]=g.useState(null),[C,E]=g.useState(null),[M,R]=g.useState(0),[T,N]=g.useState(0),[D,j]=g.useState(!1),[q,te]=g.useState(!1),re=Xe(t,Z=>m(Z)),oe=lm(a);return _.jsx(yT,{scope:s,type:n,dir:oe,scrollHideDelay:c,scrollArea:h,viewport:p,onViewportChange:y,content:v,onContentChange:b,scrollbarX:x,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:j,scrollbarY:C,onScrollbarYChange:E,scrollbarYEnabled:q,onScrollbarYEnabledChange:te,onCornerWidthChange:R,onCornerHeightChange:N,children:_.jsx(Le.div,{dir:oe,...u,ref:re,style:{position:"relative","--radix-scroll-area-corner-width":M+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});h1.displayName=Tm;var d1="ScrollAreaViewport",f1=g.forwardRef((e,t)=>{const{__scopeScrollArea:s,children:n,nonce:a,...c}=e,u=Oi(d1,s),h=g.useRef(null),m=Xe(t,h,u.onViewportChange);return _.jsxs(_.Fragment,{children:[_.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),_.jsx(Le.div,{"data-radix-scroll-area-viewport":"",...c,ref:m,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:_.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});f1.displayName=d1;var or="ScrollAreaScrollbar",m1=g.forwardRef((e,t)=>{const{forceMount:s,...n}=e,a=Oi(or,e.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:u}=a,h=e.orientation==="horizontal";return g.useEffect(()=>(h?c(!0):u(!0),()=>{h?c(!1):u(!1)}),[h,c,u]),a.type==="hover"?_.jsx(bT,{...n,ref:t,forceMount:s}):a.type==="scroll"?_.jsx(ST,{...n,ref:t,forceMount:s}):a.type==="auto"?_.jsx(p1,{...n,ref:t,forceMount:s}):a.type==="always"?_.jsx(Am,{...n,ref:t}):null});m1.displayName=or;var bT=g.forwardRef((e,t)=>{const{forceMount:s,...n}=e,a=Oi(or,e.__scopeScrollArea),[c,u]=g.useState(!1);return g.useEffect(()=>{const h=a.scrollArea;let m=0;if(h){const p=()=>{window.clearTimeout(m),u(!0)},y=()=>{m=window.setTimeout(()=>u(!1),a.scrollHideDelay)};return h.addEventListener("pointerenter",p),h.addEventListener("pointerleave",y),()=>{window.clearTimeout(m),h.removeEventListener("pointerenter",p),h.removeEventListener("pointerleave",y)}}},[a.scrollArea,a.scrollHideDelay]),_.jsx(Wt,{present:s||c,children:_.jsx(p1,{"data-state":c?"visible":"hidden",...n,ref:t})})}),ST=g.forwardRef((e,t)=>{const{forceMount:s,...n}=e,a=Oi(or,e.__scopeScrollArea),c=e.orientation==="horizontal",u=eu(()=>m("SCROLL_END"),100),[h,m]=vT("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(h==="idle"){const p=window.setTimeout(()=>m("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(p)}},[h,a.scrollHideDelay,m]),g.useEffect(()=>{const p=a.viewport,y=c?"scrollLeft":"scrollTop";if(p){let v=p[y];const b=()=>{const x=p[y];v!==x&&(m("SCROLL"),u()),v=x};return p.addEventListener("scroll",b),()=>p.removeEventListener("scroll",b)}},[a.viewport,c,m,u]),_.jsx(Wt,{present:s||h!=="hidden",children:_.jsx(Am,{"data-state":h==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:_e(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:_e(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),p1=g.forwardRef((e,t)=>{const s=Oi(or,e.__scopeScrollArea),{forceMount:n,...a}=e,[c,u]=g.useState(!1),h=e.orientation==="horizontal",m=eu(()=>{if(s.viewport){const p=s.viewport.offsetWidth<s.viewport.scrollWidth,y=s.viewport.offsetHeight<s.viewport.scrollHeight;u(h?p:y)}},10);return to(s.viewport,m),to(s.content,m),_.jsx(Wt,{present:n||c,children:_.jsx(Am,{"data-state":c?"visible":"hidden",...a,ref:t})})}),Am=g.forwardRef((e,t)=>{const{orientation:s="vertical",...n}=e,a=Oi(or,e.__scopeScrollArea),c=g.useRef(null),u=g.useRef(0),[h,m]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=b1(h.viewport,h.content),y={...n,sizes:h,onSizesChange:m,hasThumb:p>0&&p<1,onThumbChange:b=>c.current=b,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:b=>u.current=b};function v(b,x){return MT(b,u.current,h,x)}return s==="horizontal"?_.jsx(xT,{...y,ref:t,onThumbPositionChange:()=>{if(a.viewport&&c.current){const b=a.viewport.scrollLeft,x=P0(b,h,a.dir);c.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:b=>{a.viewport&&(a.viewport.scrollLeft=b)},onDragScroll:b=>{a.viewport&&(a.viewport.scrollLeft=v(b,a.dir))}}):s==="vertical"?_.jsx(wT,{...y,ref:t,onThumbPositionChange:()=>{if(a.viewport&&c.current){const b=a.viewport.scrollTop,x=P0(b,h);c.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:b=>{a.viewport&&(a.viewport.scrollTop=b)},onDragScroll:b=>{a.viewport&&(a.viewport.scrollTop=v(b))}}):null}),xT=g.forwardRef((e,t)=>{const{sizes:s,onSizesChange:n,...a}=e,c=Oi(or,e.__scopeScrollArea),[u,h]=g.useState(),m=g.useRef(null),p=Xe(t,m,c.onScrollbarXChange);return g.useEffect(()=>{m.current&&h(getComputedStyle(m.current))},[m]),_.jsx(g1,{"data-orientation":"horizontal",...a,ref:p,sizes:s,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Jc(s)+"px",...e.style},onThumbPointerDown:y=>e.onThumbPointerDown(y.x),onDragScroll:y=>e.onDragScroll(y.x),onWheelScroll:(y,v)=>{if(c.viewport){const b=c.viewport.scrollLeft+y.deltaX;e.onWheelScroll(b),x1(b,v)&&y.preventDefault()}},onResize:()=>{m.current&&c.viewport&&u&&n({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:Oc(u.paddingLeft),paddingEnd:Oc(u.paddingRight)}})}})}),wT=g.forwardRef((e,t)=>{const{sizes:s,onSizesChange:n,...a}=e,c=Oi(or,e.__scopeScrollArea),[u,h]=g.useState(),m=g.useRef(null),p=Xe(t,m,c.onScrollbarYChange);return g.useEffect(()=>{m.current&&h(getComputedStyle(m.current))},[m]),_.jsx(g1,{"data-orientation":"vertical",...a,ref:p,sizes:s,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Jc(s)+"px",...e.style},onThumbPointerDown:y=>e.onThumbPointerDown(y.y),onDragScroll:y=>e.onDragScroll(y.y),onWheelScroll:(y,v)=>{if(c.viewport){const b=c.viewport.scrollTop+y.deltaY;e.onWheelScroll(b),x1(b,v)&&y.preventDefault()}},onResize:()=>{m.current&&c.viewport&&u&&n({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:Oc(u.paddingTop),paddingEnd:Oc(u.paddingBottom)}})}})}),[CT,_1]=u1(or),g1=g.forwardRef((e,t)=>{const{__scopeScrollArea:s,sizes:n,hasThumb:a,onThumbChange:c,onThumbPointerUp:u,onThumbPointerDown:h,onThumbPositionChange:m,onDragScroll:p,onWheelScroll:y,onResize:v,...b}=e,x=Oi(or,s),[w,C]=g.useState(null),E=Xe(t,re=>C(re)),M=g.useRef(null),R=g.useRef(""),T=x.viewport,N=n.content-n.viewport,D=Bt(y),j=Bt(m),q=eu(v,10);function te(re){if(M.current){const oe=re.clientX-M.current.left,Z=re.clientY-M.current.top;p({x:oe,y:Z})}}return g.useEffect(()=>{const re=oe=>{const Z=oe.target;(w==null?void 0:w.contains(Z))&&D(oe,N)};return document.addEventListener("wheel",re,{passive:!1}),()=>document.removeEventListener("wheel",re,{passive:!1})},[T,w,N,D]),g.useEffect(j,[n,j]),to(w,q),to(x.content,q),_.jsx(CT,{scope:s,scrollbar:w,hasThumb:a,onThumbChange:Bt(c),onThumbPointerUp:Bt(u),onThumbPositionChange:j,onThumbPointerDown:Bt(h),children:_.jsx(Le.div,{...b,ref:E,style:{position:"absolute",...b.style},onPointerDown:_e(e.onPointerDown,re=>{re.button===0&&(re.target.setPointerCapture(re.pointerId),M.current=w.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),te(re))}),onPointerMove:_e(e.onPointerMove,te),onPointerUp:_e(e.onPointerUp,re=>{const oe=re.target;oe.hasPointerCapture(re.pointerId)&&oe.releasePointerCapture(re.pointerId),document.body.style.webkitUserSelect=R.current,x.viewport&&(x.viewport.style.scrollBehavior=""),M.current=null})})})}),Dc="ScrollAreaThumb",v1=g.forwardRef((e,t)=>{const{forceMount:s,...n}=e,a=_1(Dc,e.__scopeScrollArea);return _.jsx(Wt,{present:s||a.hasThumb,children:_.jsx(ET,{ref:t,...n})})}),ET=g.forwardRef((e,t)=>{const{__scopeScrollArea:s,style:n,...a}=e,c=Oi(Dc,s),u=_1(Dc,s),{onThumbPositionChange:h}=u,m=Xe(t,v=>u.onThumbChange(v)),p=g.useRef(void 0),y=eu(()=>{p.current&&(p.current(),p.current=void 0)},100);return g.useEffect(()=>{const v=c.viewport;if(v){const b=()=>{if(y(),!p.current){const x=RT(v,h);p.current=x,h()}};return h(),v.addEventListener("scroll",b),()=>v.removeEventListener("scroll",b)}},[c.viewport,y,h]),_.jsx(Le.div,{"data-state":u.hasThumb?"visible":"hidden",...a,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:_e(e.onPointerDownCapture,v=>{const x=v.target.getBoundingClientRect(),w=v.clientX-x.left,C=v.clientY-x.top;u.onThumbPointerDown({x:w,y:C})}),onPointerUp:_e(e.onPointerUp,u.onThumbPointerUp)})});v1.displayName=Dc;var Dm="ScrollAreaCorner",y1=g.forwardRef((e,t)=>{const s=Oi(Dm,e.__scopeScrollArea),n=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&n?_.jsx(kT,{...e,ref:t}):null});y1.displayName=Dm;var kT=g.forwardRef((e,t)=>{const{__scopeScrollArea:s,...n}=e,a=Oi(Dm,s),[c,u]=g.useState(0),[h,m]=g.useState(0),p=!!(c&&h);return to(a.scrollbarX,()=>{var v;const y=((v=a.scrollbarX)==null?void 0:v.offsetHeight)||0;a.onCornerHeightChange(y),m(y)}),to(a.scrollbarY,()=>{var v;const y=((v=a.scrollbarY)==null?void 0:v.offsetWidth)||0;a.onCornerWidthChange(y),u(y)}),p?_.jsx(Le.div,{...n,ref:t,style:{width:c,height:h,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Oc(e){return e?parseInt(e,10):0}function b1(e,t){const s=e/t;return isNaN(s)?0:s}function Jc(e){const t=b1(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-s)*t;return Math.max(n,18)}function MT(e,t,s,n="ltr"){const a=Jc(s),c=a/2,u=t||c,h=a-u,m=s.scrollbar.paddingStart+u,p=s.scrollbar.size-s.scrollbar.paddingEnd-h,y=s.content-s.viewport,v=n==="ltr"?[0,y]:[y*-1,0];return S1([m,p],v)(e)}function P0(e,t,s="ltr"){const n=Jc(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,c=t.scrollbar.size-a,u=t.content-t.viewport,h=c-n,m=s==="ltr"?[0,u]:[u*-1,0],p=gT(e,m);return S1([0,u],[0,h])(p)}function S1(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(s-e[0])}}function x1(e,t){return e>0&&e<t}var RT=(e,t=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},n=0;return(function a(){const c={left:e.scrollLeft,top:e.scrollTop},u=s.left!==c.left,h=s.top!==c.top;(u||h)&&t(),s=c,n=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(n)};function eu(e,t){const s=Bt(e),n=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),g.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(s,t)},[s,t])}function to(e,t){const s=Bt(t);_i(()=>{let n=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(s)});return a.observe(e),()=>{window.cancelAnimationFrame(n),a.unobserve(e)}}},[e,s])}var NT=h1,TT=f1,AT=y1,DT="Separator",U0="horizontal",OT=["horizontal","vertical"],w1=g.forwardRef((e,t)=>{const{decorative:s,orientation:n=U0,...a}=e,c=LT(n)?n:U0,h=s?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return _.jsx(Le.div,{"data-orientation":c,...h,...a,ref:t})});w1.displayName=DT;function LT(e){return OT.includes(e)}var zT=w1;function BT(e){const t=jT(e),s=g.forwardRef((n,a)=>{const{children:c,...u}=n,h=g.Children.toArray(c),m=h.find(PT);if(m){const p=m.props.children,y=h.map(v=>v===m?g.Children.count(p)>1?g.Children.only(null):g.isValidElement(p)?p.props.children:null:v);return _.jsx(t,{...u,ref:a,children:g.isValidElement(p)?g.cloneElement(p,void 0,y):null})}return _.jsx(t,{...u,ref:a,children:c})});return s.displayName=`${e}.Slot`,s}var C1=BT("Slot");function jT(e){const t=g.forwardRef((s,n)=>{const{children:a,...c}=s;if(g.isValidElement(a)){const u=IT(a),h=UT(c,a.props);return a.type!==g.Fragment&&(h.ref=n?gs(n,u):u),g.cloneElement(a,h)}return g.Children.count(a)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var HT=Symbol("radix.slottable");function PT(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===HT}function UT(e,t){const s={...t};for(const n in t){const a=e[n],c=t[n];/^on[A-Z]/.test(n)?a&&c?s[n]=(...h)=>{const m=c(...h);return a(...h),m}:a&&(s[n]=a):n==="style"?s[n]={...a,...c}:n==="className"&&(s[n]=[a,c].filter(Boolean).join(" "))}return{...e,...s}}function IT(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var FT=Symbol("radix.slottable");function WT(e){const t=({children:s})=>_.jsx(_.Fragment,{children:s});return t.displayName=`${e}.Slottable`,t.__radixId=FT,t}var[tu]=sr("Tooltip",[Gc]),iu=Gc(),E1="TooltipProvider",qT=700,mf="tooltip.open",[$T,Om]=tu(E1),k1=e=>{const{__scopeTooltip:t,delayDuration:s=qT,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:c}=e,u=g.useRef(!0),h=g.useRef(!1),m=g.useRef(0);return g.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),_.jsx($T,{scope:t,isOpenDelayedRef:u,delayDuration:s,onOpen:g.useCallback(()=>{window.clearTimeout(m.current),u.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>u.current=!0,n)},[n]),isPointerInTransitRef:h,onPointerInTransitChange:g.useCallback(p=>{h.current=p},[]),disableHoverableContent:a,children:c})};k1.displayName=E1;var Sa="Tooltip",[VT,Aa]=tu(Sa),M1=e=>{const{__scopeTooltip:t,children:s,open:n,defaultOpen:a,onOpenChange:c,disableHoverableContent:u,delayDuration:h}=e,m=Om(Sa,e.__scopeTooltip),p=iu(t),[y,v]=g.useState(null),b=fs(),x=g.useRef(0),w=u??m.disableHoverableContent,C=h??m.delayDuration,E=g.useRef(!1),[M,R]=ka({prop:n,defaultProp:a??!1,onChange:q=>{q?(m.onOpen(),document.dispatchEvent(new CustomEvent(mf))):m.onClose(),c==null||c(q)},caller:Sa}),T=g.useMemo(()=>M?E.current?"delayed-open":"instant-open":"closed",[M]),N=g.useCallback(()=>{window.clearTimeout(x.current),x.current=0,E.current=!1,R(!0)},[R]),D=g.useCallback(()=>{window.clearTimeout(x.current),x.current=0,R(!1)},[R]),j=g.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{E.current=!0,R(!0),x.current=0},C)},[C,R]);return g.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),_.jsx(xS,{...p,children:_.jsx(VT,{scope:t,contentId:b,open:M,stateAttribute:T,trigger:y,onTriggerChange:v,onTriggerEnter:g.useCallback(()=>{m.isOpenDelayedRef.current?j():N()},[m.isOpenDelayedRef,j,N]),onTriggerLeave:g.useCallback(()=>{w?D():(window.clearTimeout(x.current),x.current=0)},[D,w]),onOpen:N,onClose:D,disableHoverableContent:w,children:s})})};M1.displayName=Sa;var pf="TooltipTrigger",R1=g.forwardRef((e,t)=>{const{__scopeTooltip:s,...n}=e,a=Aa(pf,s),c=Om(pf,s),u=iu(s),h=g.useRef(null),m=Xe(t,h,a.onTriggerChange),p=g.useRef(!1),y=g.useRef(!1),v=g.useCallback(()=>p.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),_.jsx(wS,{asChild:!0,...u,children:_.jsx(Le.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:m,onPointerMove:_e(e.onPointerMove,b=>{b.pointerType!=="touch"&&!y.current&&!c.isPointerInTransitRef.current&&(a.onTriggerEnter(),y.current=!0)}),onPointerLeave:_e(e.onPointerLeave,()=>{a.onTriggerLeave(),y.current=!1}),onPointerDown:_e(e.onPointerDown,()=>{a.open&&a.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:_e(e.onFocus,()=>{p.current||a.onOpen()}),onBlur:_e(e.onBlur,a.onClose),onClick:_e(e.onClick,a.onClose)})})});R1.displayName=pf;var Lm="TooltipPortal",[KT,YT]=tu(Lm,{forceMount:void 0}),N1=e=>{const{__scopeTooltip:t,forceMount:s,children:n,container:a}=e,c=Aa(Lm,t);return _.jsx(KT,{scope:t,forceMount:s,children:_.jsx(Wt,{present:s||c.open,children:_.jsx(Fc,{asChild:!0,container:a,children:n})})})};N1.displayName=Lm;var io="TooltipContent",T1=g.forwardRef((e,t)=>{const s=YT(io,e.__scopeTooltip),{forceMount:n=s.forceMount,side:a="top",...c}=e,u=Aa(io,e.__scopeTooltip);return _.jsx(Wt,{present:n||u.open,children:u.disableHoverableContent?_.jsx(A1,{side:a,...c,ref:t}):_.jsx(GT,{side:a,...c,ref:t})})}),GT=g.forwardRef((e,t)=>{const s=Aa(io,e.__scopeTooltip),n=Om(io,e.__scopeTooltip),a=g.useRef(null),c=Xe(t,a),[u,h]=g.useState(null),{trigger:m,onClose:p}=s,y=a.current,{onPointerInTransitChange:v}=n,b=g.useCallback(()=>{h(null),v(!1)},[v]),x=g.useCallback((w,C)=>{const E=w.currentTarget,M={x:w.clientX,y:w.clientY},R=eA(M,E.getBoundingClientRect()),T=tA(M,R),N=iA(C.getBoundingClientRect()),D=sA([...T,...N]);h(D),v(!0)},[v]);return g.useEffect(()=>()=>b(),[b]),g.useEffect(()=>{if(m&&y){const w=E=>x(E,y),C=E=>x(E,m);return m.addEventListener("pointerleave",w),y.addEventListener("pointerleave",C),()=>{m.removeEventListener("pointerleave",w),y.removeEventListener("pointerleave",C)}}},[m,y,x,b]),g.useEffect(()=>{if(u){const w=C=>{const E=C.target,M={x:C.clientX,y:C.clientY},R=(m==null?void 0:m.contains(E))||(y==null?void 0:y.contains(E)),T=!rA(M,u);R?b():T&&(b(),p())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[m,y,u,p,b]),_.jsx(A1,{...e,ref:c})}),[XT,ZT]=tu(Sa,{isInside:!1}),QT=WT("TooltipContent"),A1=g.forwardRef((e,t)=>{const{__scopeTooltip:s,children:n,"aria-label":a,onEscapeKeyDown:c,onPointerDownOutside:u,...h}=e,m=Aa(io,s),p=iu(s),{onClose:y}=m;return g.useEffect(()=>(document.addEventListener(mf,y),()=>document.removeEventListener(mf,y)),[y]),g.useEffect(()=>{if(m.trigger){const v=b=>{const x=b.target;x!=null&&x.contains(m.trigger)&&y()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[m.trigger,y]),_.jsx(Ic,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:y,children:_.jsxs(CS,{"data-state":m.stateAttribute,...p,...h,ref:t,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[_.jsx(QT,{children:n}),_.jsx(XT,{scope:s,isInside:!0,children:_.jsx(vk,{id:m.contentId,role:"tooltip",children:a||n})})]})})});T1.displayName=io;var D1="TooltipArrow",JT=g.forwardRef((e,t)=>{const{__scopeTooltip:s,...n}=e,a=iu(s);return ZT(D1,s).isInside?null:_.jsx(ES,{...a,...n,ref:t})});JT.displayName=D1;function eA(e,t){const s=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),c=Math.abs(t.left-e.x);switch(Math.min(s,n,a,c)){case c:return"left";case a:return"right";case s:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function tA(e,t,s=5){const n=[];switch(t){case"top":n.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":n.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":n.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":n.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return n}function iA(e){const{top:t,right:s,bottom:n,left:a}=e;return[{x:a,y:t},{x:s,y:t},{x:s,y:n},{x:a,y:n}]}function rA(e,t){const{x:s,y:n}=e;let a=!1;for(let c=0,u=t.length-1;c<t.length;u=c++){const h=t[c],m=t[u],p=h.x,y=h.y,v=m.x,b=m.y;y>n!=b>n&&s<(v-p)*(n-y)/(b-y)+p&&(a=!a)}return a}function sA(e){const t=e.slice();return t.sort((s,n)=>s.x<n.x?-1:s.x>n.x?1:s.y<n.y?-1:s.y>n.y?1:0),nA(t)}function nA(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const c=t[t.length-1],u=t[t.length-2];if((c.x-u.x)*(a.y-u.y)>=(c.y-u.y)*(a.x-u.x))t.pop();else break}t.push(a)}t.pop();const s=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;s.length>=2;){const c=s[s.length-1],u=s[s.length-2];if((c.x-u.x)*(a.y-u.y)>=(c.y-u.y)*(a.x-u.x))s.pop();else break}s.push(a)}return s.pop(),t.length===1&&s.length===1&&t[0].x===s[0].x&&t[0].y===s[0].y?t:t.concat(s)}var oA=k1,aA=M1,lA=R1,cA=N1,uA=T1;const hA=pb("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-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","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ye({className:e,variant:t="default",size:s="default",asChild:n=!1,...a}){const c=n?C1:"button";return _.jsx(c,{"data-slot":"button","data-variant":t,"data-size":s,className:ye(hA({variant:t,size:s,className:e})),...a})}function dA({initialized:e,onSetup:t,onLogin:s,error:n,loading:a,theme:c,resolved:u,onSetTheme:h}){const[m,p]=g.useState(""),[y,v]=g.useState(""),b=e===!1,x=async w=>{if(w.preventDefault(),b){if(m!==y)return;await t(m)&&await s(m)}else await s(m)};return _.jsxs("div",{className:"relative flex items-center justify-center h-full px-5",children:[_.jsx("button",{onClick:()=>h(u==="dark"?"light":"dark"),className:"absolute top-[calc(1rem+env(safe-area-inset-top,0px))] right-4 p-2 rounded-xl hover:bg-(--color-overlay-hover) text-muted-foreground transition-colors cursor-pointer",children:u==="dark"?_.jsx(mb,{className:"size-5"}):_.jsx(ub,{className:"size-5"})}),_.jsxs("div",{className:"w-full max-w-90 text-center",children:[_.jsx("div",{className:"text-primary mb-4",children:_.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"mx-auto",children:[_.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),_.jsx("path",{d:"M2 17l10 5 10-5"}),_.jsx("path",{d:"M2 12l10 5 10-5"})]})}),_.jsx("h1",{className:"text-[22px] font-semibold mb-2",children:b?"Set Password":"Remote Claude Code"}),_.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:b?"Set a password to secure remote access":"Enter your password to connect"}),_.jsxs("form",{onSubmit:x,className:"flex flex-col gap-3",children:[_.jsx(Cc,{type:"password",placeholder:"Password",value:m,onChange:w=>p(w.target.value),autoFocus:!0,minLength:6,required:!0}),b&&_.jsx(Cc,{type:"password",placeholder:"Confirm password",value:y,onChange:w=>v(w.target.value),minLength:6,required:!0}),n&&_.jsx("p",{className:"text-destructive text-[13px]",children:n}),b&&m&&y&&m!==y&&_.jsx("p",{className:"text-destructive text-[13px]",children:"Passwords do not match"}),_.jsx(Ye,{type:"submit",className:"w-full",disabled:a||!m||b&&m!==y,children:a?"...":b?"Set Password":"Connect"})]})]})]})}const fA=pb("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function mA({className:e,variant:t="default",asChild:s=!1,...n}){const a=s?C1:"span";return _.jsx(a,{"data-slot":"badge","data-variant":t,className:ye(fA({variant:t}),e),...n})}function Mr({...e}){return _.jsx(hT,{"data-slot":"dropdown-menu",...e})}function Rr({...e}){return _.jsx(dT,{"data-slot":"dropdown-menu-trigger",...e})}function Nr({className:e,sideOffset:t=6,...s}){return _.jsx(fT,{children:_.jsx(mT,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ye("z-50 min-w-[160px] overflow-hidden rounded-xl border border-border bg-popover p-1 text-popover-foreground shadow-xl","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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",e),...s})})}function Ct({className:e,...t}){return _.jsx(pT,{"data-slot":"dropdown-menu-item",className:ye("relative flex cursor-pointer select-none items-center gap-2.5 rounded-lg px-3 py-2.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Kn({className:e,...t}){return _.jsx(_T,{"data-slot":"dropdown-menu-separator",className:ye("-mx-1 my-1 h-px bg-border",e),...t})}function zm({...e}){return _.jsx(jk,{"data-slot":"collapsible",...e})}function Bm({...e}){return _.jsx(Hk,{"data-slot":"collapsible-trigger",...e})}function jm({...e}){return _.jsx(Pk,{"data-slot":"collapsible-content",...e})}const pA={Read:ti,Edit:hb,Write:nb,Bash:rm,Glob:ab,Grep:fb,WebSearch:Ys,WebFetch:Ys,Agent:sb,TodoWrite:cb,Skill:sm,LSP:im,NotebookEdit:rb};function _A({name:e,input:t,result:s,isError:n,collapsed:a}){const[c,u]=g.useState(a);g.useEffect(()=>{a&&u(!0)},[a]);const h=pA[e]||Jn,m=gA(e,t);return _.jsx(zm,{open:!c,onOpenChange:p=>u(!p),children:_.jsxs("div",{className:ye("bg-(--color-overlay) border rounded-xl my-2 overflow-hidden transition-colors",n?"border-destructive/50":"border-(--color-overlay-border)"),children:[_.jsx(Bm,{asChild:!0,children:_.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 text-[13px] cursor-pointer hover:bg-(--color-overlay) transition-colors",children:[_.jsx("div",{className:"size-6 rounded-md bg-(--color-overlay) flex items-center justify-center shrink-0",children:_.jsx(h,{className:"size-3.5 text-muted-foreground"})}),_.jsx("span",{className:"font-semibold shrink-0",children:e}),_.jsx("span",{className:"text-muted-foreground text-xs overflow-hidden text-ellipsis whitespace-nowrap flex-1 min-w-0",children:m}),_.jsx("div",{className:"shrink-0",children:c?_.jsx(Jn,{className:"size-3 text-muted-foreground"}):_.jsx(ga,{className:"size-3 text-muted-foreground"})})]})}),_.jsx(jm,{children:_.jsxs("div",{className:"border-t border-(--color-overlay-border) px-3 py-2.5",children:[t&&_.jsx("pre",{className:"font-mono text-xs text-muted-foreground overflow-x-auto max-h-50 overflow-y-auto whitespace-pre-wrap break-all",children:vA(t)}),s&&_.jsx("div",{className:`mt-2 pt-2 border-t border-(--color-overlay-border) ${n?"text-destructive":""}`,children:_.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all max-h-75 overflow-y-auto",children:_f(s,2e3)})})]})})]})})}function gA(e,t){try{const s=JSON.parse(t);switch(e){case"Read":return s.file_path||"";case"Edit":return s.file_path||"";case"Write":return s.file_path||"";case"Bash":return _f(s.command||"",50);case"Glob":return s.pattern||"";case"Grep":return s.pattern||"";case"WebSearch":return s.query||"";default:return""}}catch{return _f(t,40)}}function vA(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function _f(e,t){return e.length>t?e.slice(0,t)+"...":e}const yA={code:e2};function bA(e){const t=e==="user",s=t?"bg-white/15 px-1.5 py-0.5 rounded-md font-mono text-[13px] border border-white/20":"bg-(--color-code-bg) px-1.5 py-0.5 rounded-md font-mono text-[13px] border border-(--color-code-border)";return{h1:({children:n,...a})=>_.jsx("h1",{className:"text-lg font-semibold mt-4 mb-2 first:mt-0",...a,children:n}),h2:({children:n,...a})=>_.jsx("h2",{className:"text-base font-semibold mt-4 mb-2 first:mt-0",...a,children:n}),h3:({children:n,...a})=>_.jsx("h3",{className:"text-sm font-semibold mt-3 mb-1.5 first:mt-0",...a,children:n}),h4:({children:n,...a})=>_.jsx("h4",{className:"text-sm font-semibold mt-2 mb-1 first:mt-0",...a,children:n}),p:({children:n,...a})=>_.jsx("p",{className:"mb-3 last:mb-0 leading-relaxed",...a,children:n}),strong:({children:n})=>_.jsx("strong",{className:"font-semibold",children:n}),em:({children:n})=>_.jsx("em",{className:"italic",children:n}),a:({href:n,children:a,...c})=>_.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:t?"underline underline-offset-2":"text-primary underline underline-offset-2 hover:text-primary/80",...c,children:a}),code:({children:n,className:a,...c})=>a!=null&&a.includes("language-")?_.jsx("code",{className:a,...c,children:n}):_.jsx("code",{className:s,...c,children:n}),pre:({children:n,...a})=>_.jsx("pre",{className:"bg-(--color-code-bg) backdrop-blur-sm rounded-xl p-3.5 my-2.5 overflow-x-auto font-mono text-[13px] leading-normal border border-(--color-code-border)",...a,children:n}),ul:({children:n})=>_.jsx("ul",{className:"list-disc pl-5 mb-3 last:mb-0 space-y-1",children:n}),ol:({children:n})=>_.jsx("ol",{className:"list-decimal pl-5 mb-3 last:mb-0 space-y-1",children:n}),li:({children:n})=>_.jsx("li",{className:"leading-relaxed",children:n}),blockquote:({children:n})=>_.jsx("blockquote",{className:t?"border-l-2 border-white/30 pl-3 my-2 italic opacity-90":"border-l-2 border-primary/30 pl-3 my-2 italic text-muted-foreground",children:n}),table:({children:n})=>_.jsx("div",{className:"overflow-x-auto my-2",children:_.jsx("table",{className:"w-full text-sm border-collapse",children:n})}),thead:({children:n})=>_.jsx("thead",{children:n}),tbody:({children:n})=>_.jsx("tbody",{children:n}),tr:({children:n})=>_.jsx("tr",{children:n}),th:({children:n})=>_.jsx("th",{className:"text-left font-semibold px-3 py-1.5 border-b border-(--color-overlay-border)",children:n}),td:({children:n})=>_.jsx("td",{className:"px-3 py-1.5 border-b border-(--color-overlay-border)/50",children:n}),hr:()=>_.jsx("hr",{className:"my-4 border-t border-(--color-overlay-border)"}),img:({src:n,alt:a,...c})=>_.jsx("img",{src:n,alt:a,className:"max-w-full rounded-lg my-2",...c})}}const O1=g.memo(function({text:t,variant:s="assistant"}){const n=g.useMemo(()=>bA(s),[s]);return t?_.jsx("div",{className:"leading-relaxed break-words",children:_.jsx(ZC,{components:n,plugins:yA,shikiTheme:["github-light","github-dark"],children:t})}):null});function SA({thinking:e,collapsed:t}){const[s,n]=g.useState(t);return g.useEffect(()=>{t&&n(!0)},[t]),e?_.jsx(zm,{open:!s,onOpenChange:a=>n(!a),children:_.jsxs("div",{className:"my-2 rounded-xl bg-warning/5 border border-warning/10 overflow-hidden",children:[_.jsx(Bm,{asChild:!0,children:_.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 text-xs text-warning/80 cursor-pointer hover:bg-warning/5 transition-colors",children:[_.jsx(P2,{className:"size-3.5"}),_.jsx("span",{className:"font-semibold",children:"Thinking"}),s&&_.jsxs("span",{className:"text-muted-foreground text-xs overflow-hidden text-ellipsis whitespace-nowrap flex-1 min-w-0",children:[e.slice(0,60),e.length>60?"...":""]}),_.jsx("div",{className:"ml-auto shrink-0",children:s?_.jsx(Jn,{className:"size-3"}):_.jsx(ga,{className:"size-3"})})]})}),_.jsx(jm,{children:_.jsx("div",{className:"px-3 pb-3 text-[13px] text-muted-foreground/80 max-h-75 overflow-y-auto",children:_.jsx(O1,{text:e})})})]})}):null}const xA={Read:ti,Edit:hb,Write:nb,Bash:rm,Glob:ab,Grep:fb,WebSearch:Ys,WebFetch:Ys,Agent:sb,TodoWrite:cb,Skill:sm,LSP:im,NotebookEdit:rb};function wA({sessionId:e,requestId:t,toolName:s,input:n,status:a,decisionReason:c,onRespond:u}){const[h,m]=g.useState(!1),p=xA[s]||im,y=CA(s,n),v=a==="pending"?"border-warning/60":a==="allowed"?"border-success/50":"border-destructive/50",b=a==="pending"?KE:a==="allowed"?nf:n0,x=a==="pending"?"text-warning":a==="allowed"?"text-success":"text-destructive";return _.jsx(zm,{open:!h,onOpenChange:w=>m(!w),children:_.jsxs("div",{className:ye("bg-(--color-overlay) border rounded-xl my-2 overflow-hidden transition-colors",v),children:[_.jsx(Bm,{asChild:!0,children:_.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 text-[13px] cursor-pointer hover:bg-(--color-overlay) transition-colors",children:[_.jsx("div",{className:ye("size-6 rounded-md flex items-center justify-center shrink-0",a==="pending"?"bg-warning/15":a==="allowed"?"bg-success/15":"bg-destructive/15"),children:_.jsx(b,{className:ye("size-3.5",x)})}),_.jsx("div",{className:"size-6 rounded-md bg-(--color-overlay) flex items-center justify-center shrink-0",children:_.jsx(p,{className:"size-3.5 text-muted-foreground"})}),_.jsx("span",{className:"font-semibold shrink-0",children:s}),_.jsx("span",{className:"text-muted-foreground text-xs overflow-hidden text-ellipsis whitespace-nowrap flex-1 min-w-0",children:y}),_.jsx("div",{className:"shrink-0",children:h?_.jsx(Jn,{className:"size-3 text-muted-foreground"}):_.jsx(ga,{className:"size-3 text-muted-foreground"})})]})}),_.jsx(jm,{children:_.jsxs("div",{className:"border-t border-(--color-overlay-border) px-3 py-2.5",children:[c&&_.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:c}),_.jsx("pre",{className:"font-mono text-xs text-muted-foreground overflow-x-auto max-h-50 overflow-y-auto whitespace-pre-wrap break-all",children:JSON.stringify(n,null,2)})]})}),a==="pending"&&_.jsxs("div",{className:"border-t border-(--color-overlay-border) px-3 py-2 flex items-center justify-end gap-2",children:[_.jsxs("button",{onClick:()=>u(t,"deny",e),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border border-destructive/30 text-destructive hover:bg-destructive/10 transition-colors cursor-pointer",children:[_.jsx(Js,{className:"size-3"}),"Deny"]}),_.jsxs("button",{onClick:()=>u(t,"allow",e),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-success text-white hover:bg-success/90 transition-colors cursor-pointer",children:[_.jsx(fi,{className:"size-3"}),"Allow"]})]}),a!=="pending"&&_.jsx("div",{className:"border-t border-(--color-overlay-border) px-3 py-1.5 flex items-center justify-end",children:_.jsx("span",{className:ye("inline-flex items-center gap-1 text-[11px] font-medium",a==="allowed"?"text-success":"text-destructive"),children:a==="allowed"?_.jsxs(_.Fragment,{children:[_.jsx(nf,{className:"size-3"}),"Allowed"]}):_.jsxs(_.Fragment,{children:[_.jsx(n0,{className:"size-3"}),"Denied"]})})})]})})}function CA(e,t){switch(e){case"Read":return t.file_path||"";case"Edit":return t.file_path||"";case"Write":return t.file_path||"";case"Bash":return EA(t.command||"",60);case"Glob":return t.pattern||"";case"Grep":return t.pattern||"";case"WebSearch":return t.query||"";default:return""}}function EA(e,t){return e.length>t?e.slice(0,t)+"...":e}function kA({className:e,...t}){return _.jsx(b5,{"data-slot":"avatar",className:ye("relative flex shrink-0 overflow-hidden rounded-full",e),...t})}function MA({className:e,...t}){return _.jsx(S5,{"data-slot":"avatar-fallback",className:ye("flex h-full w-full items-center justify-center rounded-full",e),...t})}function RA(e,t){switch(e.type){case"tool_use":return`tool-${e.id}`;case"permission_request":return`perm-${e.requestId}`;default:return`${e.type}-${t}`}}const NA=g.memo(function({message:t,onPermissionRespond:s}){const n=t.role==="user";return _.jsxs("div",{className:`flex gap-2.5 max-w-full ${n?"justify-end":""}`,children:[!n&&_.jsx(kA,{className:"size-8 shrink-0 mt-1",children:_.jsx(MA,{className:"bg-linear-to-br from-primary/80 to-primary text-primary-foreground text-xs font-bold",children:"C"})}),_.jsxs("div",{className:ye("rounded-2xl px-4 py-3",n?"bg-primary text-primary-foreground rounded-br-md max-w-[85%] shadow-md shadow-primary/10":"bg-(--color-assistant-bubble) border border-(--color-assistant-bubble-border) rounded-bl-md max-w-[90%] min-w-0 overflow-hidden"),children:[t.blocks.map((a,c)=>_.jsx(TA,{block:a,isUser:n,onPermissionRespond:s},RA(a,c))),t.isStreaming&&_.jsx("span",{className:"streaming-cursor"}),t.attachments&&t.attachments.length>0&&_.jsx(AA,{attachments:t.attachments,isUser:n})]})]})}),TA=g.memo(function({block:t,isUser:s,onPermissionRespond:n}){switch(t.type){case"text":return _.jsx(O1,{text:t.text,variant:s?"user":"assistant"});case"thinking":return _.jsx(SA,{thinking:t.thinking,collapsed:t.collapsed});case"tool_use":return _.jsx(_A,{name:t.name,input:t.input,result:t.result,isError:t.isError,collapsed:t.collapsed});case"permission_request":return _.jsx(wA,{sessionId:t.sessionId,requestId:t.requestId,toolName:t.toolName,input:t.input,status:t.status,decisionReason:t.decisionReason,description:t.description,onRespond:n||(()=>{})});default:return null}});function AA({attachments:e,isUser:t}){const[s,n]=g.useState(null);return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:ye("flex items-center gap-2 mt-2 flex-wrap",t?"justify-end":""),children:e.map((a,c)=>{var m;const u=a.mimeType.startsWith("image/"),h=((m=a.name.split(".").pop())==null?void 0:m.toLowerCase())||"";return u?_.jsx("img",{src:`/api/uploads/${a.serverFileName}`,alt:a.name,className:"size-12 rounded-lg object-cover border border-primary-foreground/20 cursor-pointer hover:opacity-80 transition-opacity",onClick:()=>n(`/api/uploads/${a.serverFileName}`)},c):_.jsxs("div",{className:ye("size-12 rounded-lg flex flex-col items-center justify-center gap-0.5",t?"bg-primary-foreground/15 border border-primary-foreground/20":"border border-(--color-overlay-border) bg-(--color-overlay)"),title:a.name,children:[_.jsx(ti,{className:ye("size-4",t?"text-primary-foreground/60":"text-muted-foreground/60")}),_.jsx("span",{className:ye("text-[8px] max-w-10 truncate",t?"text-primary-foreground/50":"text-muted-foreground/50"),children:h})]},c)})}),s&&em.createPortal(_.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",onClick:()=>n(null),children:[_.jsx("button",{className:"absolute top-4 right-4 size-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition-colors cursor-pointer",onClick:()=>n(null),children:_.jsx(Js,{className:"size-5 text-white"})}),_.jsx("img",{src:s,alt:"Preview",className:"max-w-[90vw] max-h-[90vh] object-contain rounded-lg shadow-2xl",onClick:a=>a.stopPropagation()})]}),document.body)]})}function I0({messages:e,onPermissionRespond:t}){return _.jsx("div",{className:"flex flex-col gap-4",children:e.map(s=>_.jsx(NA,{message:s,onPermissionRespond:t},s.id))})}function DA({delayDuration:e=300,...t}){return _.jsx(oA,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Da({...e}){return _.jsx(aA,{"data-slot":"tooltip",...e})}function Oa({...e}){return _.jsx(lA,{"data-slot":"tooltip-trigger",...e})}function La({className:e,sideOffset:t=6,...s}){return _.jsx(cA,{children:_.jsx(uA,{"data-slot":"tooltip-content",sideOffset:t,className:ye("z-50 rounded-lg border border-border bg-popover px-2.5 py-1.5 text-xs text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...s})})}function OA(e,t){if(t){const s=t.match(/\b(Opus|Sonnet|Haiku)\b/i);return s?s[1]:t.split(" ").pop()||t}return e.includes("opus")?"Opus":e.includes("sonnet")?"Sonnet":e.includes("haiku")?"Haiku":e.split("-").slice(0,2).join("-")}function LA({currentModel:e,models:t,onSelect:s,disabled:n}){const[a,c]=g.useState(!1),u=t.find(m=>m.value===e),h=OA(e,u==null?void 0:u.displayName);return _.jsxs(Mr,{open:a,onOpenChange:c,children:[_.jsxs(Da,{open:a?!1:void 0,children:[_.jsx(Oa,{asChild:!0,children:_.jsx(Rr,{disabled:n||t.length===0,asChild:!0,children:_.jsxs("button",{className:"inline-flex items-center gap-1 rounded-lg border border-(--color-overlay-border) bg-(--color-overlay) px-2 py-1 text-[11px] text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:[_.jsx(K2,{className:"size-3"}),h]})})}),_.jsx(La,{children:"Model"})]}),_.jsxs(Nr,{align:"start",className:"min-w-40",onCloseAutoFocus:m=>m.preventDefault(),children:[t.map(m=>_.jsxs(Ct,{onClick:()=>s(m.value),children:[_.jsx("span",{className:"flex-1",children:m.displayName||m.value}),m.value===e&&_.jsx(fi,{className:"size-3 text-primary ml-2"})]},m.value)),t.length===0&&_.jsx(Ct,{disabled:!0,children:_.jsx("span",{className:"text-muted-foreground",children:"Loading models..."})})]})]})}const Fd={low:{label:"Low",bars:1},medium:{label:"Medium",bars:2},high:{label:"High",bars:3},max:{label:"Max",bars:4}},zA=["low","medium","high","max"];function F0({level:e,active:t}){return _.jsx("span",{className:"inline-flex items-end gap-px",children:[1,2,3,4].map(s=>_.jsx("span",{className:`w-[3px] rounded-sm transition-colors ${s<=e?t?"bg-primary":"bg-foreground/60":"bg-foreground/15"}`,style:{height:`${6+s*2}px`}},s))})}function BA({effort:e="high",supportedLevels:t,onSelect:s}){const[n,a]=g.useState(!1),c=t&&t.length>0?t:zA,u=Fd[e];return _.jsxs(Mr,{open:n,onOpenChange:a,children:[_.jsxs(Da,{open:n?!1:void 0,children:[_.jsx(Oa,{asChild:!0,children:_.jsx(Rr,{asChild:!0,children:_.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-lg border border-(--color-overlay-border) bg-(--color-overlay) px-2 py-1 text-[11px] text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground transition-colors cursor-pointer",children:_.jsx(F0,{level:u.bars,active:!0})})})}),_.jsx(La,{children:"Effort Level"})]}),_.jsx(Nr,{align:"start",className:"min-w-[130px]",onCloseAutoFocus:h=>h.preventDefault(),children:c.map(h=>_.jsxs(Ct,{onClick:()=>s(h),children:[_.jsx(F0,{level:Fd[h].bars}),_.jsx("span",{className:"ml-2 flex-1",children:Fd[h].label}),h===e&&_.jsx(fi,{className:"size-3 text-primary ml-2"})]},h))})]})}const jA={adaptive:{label:"Adaptive"},enabled:{label:"Enabled"},disabled:{label:"Disabled"}},HA=["adaptive","enabled","disabled"];function PA({thinking:e="adaptive",onSelect:t}){const[s,n]=g.useState(!1),a=e!=="disabled";return _.jsxs(Mr,{open:s,onOpenChange:n,children:[_.jsxs(Da,{open:s?!1:void 0,children:[_.jsx(Oa,{asChild:!0,children:_.jsx(Rr,{asChild:!0,children:_.jsx("button",{className:`inline-flex items-center gap-1 rounded-lg border px-2 py-1 text-[11px] transition-colors cursor-pointer ${a?"border-primary/30 bg-primary/10 text-primary":"border-(--color-overlay-border) bg-(--color-overlay) text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground"}`,children:_.jsx(sm,{className:"size-3"})})})}),_.jsx(La,{children:"Thinking"})]}),_.jsx(Nr,{align:"start",className:"min-w-[130px]",onCloseAutoFocus:c=>c.preventDefault(),children:HA.map(c=>_.jsxs(Ct,{onClick:()=>t(c),children:[_.jsx("span",{className:"flex-1",children:jA[c].label}),c===e&&_.jsx(fi,{className:"size-3 text-primary ml-2"})]},c))})]})}const UA={connected:"bg-success",running:"bg-success",failed:"bg-destructive",error:"bg-destructive",pending:"bg-warning",disabled:"bg-muted-foreground/40"};function IA({servers:e}){if(e.length===0)return null;const t=e.filter(s=>s.status==="connected"||s.status==="running").length;return _.jsxs(Mr,{children:[_.jsx(Rr,{asChild:!0,children:_.jsxs("button",{className:"inline-flex items-center gap-1 rounded-lg border border-(--color-overlay-border) bg-(--color-overlay) px-2 py-1 text-[11px] text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground transition-colors cursor-pointer",children:[_.jsx(FE,{className:"size-3"}),t,"/",e.length]})}),_.jsx(Nr,{align:"start",className:"min-w-[180px]",children:e.map(s=>_.jsxs(Ct,{disabled:!0,children:[_.jsx("span",{className:`size-1.5 rounded-full shrink-0 ${UA[s.status]||"bg-muted-foreground/40"}`}),_.jsx("span",{className:"flex-1 truncate ml-2",children:s.name}),_.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-2",children:s.status})]},s.name))})]})}const Wd={default:{label:"Ask",description:"Ask before edits",Icon:XE},acceptEdits:{label:"Auto-edit",description:"Edit automatically",Icon:nf},plan:{label:"Plan",description:"Plan mode",Icon:nE}},FA=["default","acceptEdits","plan"];function WA({mode:e,onSelect:t,disabled:s}){const[n,a]=g.useState(!1),c=Wd[e]||Wd.acceptEdits,{Icon:u}=c;return _.jsxs(Mr,{open:n,onOpenChange:a,children:[_.jsxs(Da,{open:n?!1:void 0,children:[_.jsx(Oa,{asChild:!0,children:_.jsx(Rr,{asChild:!0,disabled:s,children:_.jsxs("button",{className:"inline-flex items-center gap-1.5 rounded-lg border border-(--color-overlay-border) bg-(--color-overlay) px-2 py-1 text-[11px] text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[_.jsx(u,{className:"size-3.5"}),_.jsx("span",{children:c.label})]})})}),_.jsx(La,{children:"Permission Mode"})]}),_.jsx(Nr,{align:"start",className:"min-w-[170px]",onCloseAutoFocus:h=>h.preventDefault(),children:FA.map(h=>{const{label:m,description:p,Icon:y}=Wd[h];return _.jsxs(Ct,{onClick:()=>t(h),children:[_.jsx(y,{className:"size-4"}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("span",{children:m}),_.jsx("span",{className:"text-muted-foreground text-[10px] ml-1.5",children:p})]}),h===e&&_.jsx(fi,{className:"size-3 text-primary ml-2 shrink-0"})]},h)})})]})}function qA({commands:e,onSelect:t}){return e.length===0?null:_.jsxs(Mr,{children:[_.jsx(Rr,{asChild:!0,children:_.jsx("button",{className:"inline-flex items-center justify-center size-7 rounded-lg border border-(--color-overlay-border) bg-(--color-overlay) text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground transition-colors cursor-pointer",children:_.jsx(JE,{className:"size-3.5"})})}),_.jsx(Nr,{align:"end",className:"min-w-[180px] max-h-[240px] overflow-y-auto",children:e.map(s=>_.jsxs(Ct,{onClick:()=>t(s.name),children:[_.jsxs("span",{className:"text-primary font-mono text-xs",children:["/",s.name]}),s.description&&_.jsx("span",{className:"text-[10px] text-muted-foreground/60 ml-2 truncate",children:s.description})]},s.name))})]})}const $A=g.memo(function({commands:t,selectedIndex:s,onSelect:n}){const a=g.useRef(new Map);return g.useEffect(()=>{const c=a.current.get(s);c==null||c.scrollIntoView({block:"nearest"})},[s]),_.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-2 z-50",children:_.jsx("div",{className:ye("border border-(--color-overlay-border) rounded-xl","bg-popover/95 backdrop-blur-xl shadow-xl","overflow-hidden"),children:_.jsx("div",{className:"overflow-y-auto max-h-[280px] overscroll-contain",children:_.jsx("div",{className:"p-1",children:t.map((c,u)=>_.jsxs("div",{ref:h=>{h?a.current.set(u,h):a.current.delete(u)},className:ye("flex flex-col gap-0.5 px-3 py-2 rounded-lg cursor-pointer transition-colors",u===s?"bg-(--color-overlay-hover)":"hover:bg-(--color-overlay)"),onPointerDown:h=>{h.preventDefault(),n(c)},children:[_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsxs("span",{className:"text-primary font-mono text-sm font-medium",children:["/",c.name]}),c.argumentHint&&_.jsx("span",{className:"text-muted-foreground/40 font-mono text-xs",children:c.argumentHint})]}),c.description&&_.jsx("span",{className:"text-muted-foreground/60 text-xs leading-snug line-clamp-1",children:c.description})]},c.name))})})})})});function VA({onAddAttachments:e,disabled:t}){const s=g.useRef(null);return _.jsxs(_.Fragment,{children:[_.jsxs(Da,{children:[_.jsx(Oa,{asChild:!0,children:_.jsx("button",{type:"button",disabled:t,onClick:()=>{var n;return(n=s.current)==null?void 0:n.click()},className:"inline-flex items-center justify-center size-7 rounded-lg border border-(--color-overlay-border) bg-(--color-overlay) text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:_.jsx(PE,{className:"size-3.5"})})}),_.jsx(La,{children:"Attach files"})]}),_.jsx("input",{ref:s,type:"file",multiple:!0,accept:"image/*,.pdf,.txt,.md,.json,.csv,.xml,.yaml,.yml,.js,.ts,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.hpp,.rb,.sh,.sql,.html,.css",className:"hidden",onChange:n=>{n.target.files&&n.target.files.length>0&&(e(n.target.files),n.target.value="")}})]})}function KA({attachments:e,onRemove:t}){return e.length===0?null:_.jsx("div",{className:"flex items-center gap-2 px-4 pt-3 pb-1 overflow-x-auto scrollbar-none",children:e.map(s=>_.jsxs("div",{className:"relative shrink-0 group",children:[s.type.startsWith("image/")&&s.preview?_.jsx("img",{src:s.preview,alt:s.name,className:"size-12 rounded-lg object-cover border border-(--color-overlay-border)"}):_.jsxs("div",{className:"size-12 rounded-lg border border-(--color-overlay-border) bg-(--color-overlay) flex flex-col items-center justify-center gap-0.5",children:[_.jsx(ti,{className:"size-4 text-muted-foreground/60"}),_.jsx("span",{className:"text-[8px] text-muted-foreground/50 max-w-[40px] truncate",children:s.name.split(".").pop()})]}),s.uploadStatus==="uploading"&&_.jsx("div",{className:"absolute inset-0 rounded-lg bg-background/60 flex items-center justify-center",children:_.jsx(qs,{className:"size-4 text-primary animate-spin"})}),s.uploadStatus==="error"&&_.jsx("div",{className:"absolute inset-0 rounded-lg bg-destructive/10 flex items-center justify-center",children:_.jsx("span",{className:"text-[9px] text-destructive font-medium",children:"Error"})}),_.jsx("button",{type:"button",onClick:()=>t(s.id),className:"absolute -top-1 -right-1 size-4 rounded-full bg-foreground/80 text-background flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:_.jsx(Js,{className:"size-2.5"})})]},s.id))})}function YA(e){return e.type==="code_snippet"?`${e.name}:L${e.startLine}-${e.endLine}`:e.name}function GA(e){switch(e.type){case"file":return It;case"folder":return lb;case"code_snippet":return vE}}function XA({references:e,onRemove:t}){return e.length===0?null:_.jsx("div",{className:"flex flex-wrap gap-1.5 px-4 pt-3 pb-1",children:e.map(s=>{const n=GA(s);return _.jsxs("div",{className:"flex items-center gap-1 px-2 py-0.5 rounded-md bg-(--color-overlay) border border-(--color-overlay-border) text-xs text-foreground/80 max-w-[200px] group",children:[_.jsx(n,{className:"size-3 shrink-0 text-primary/70"}),_.jsx("span",{className:"truncate",children:YA(s)}),_.jsx("button",{onClick:()=>t(s.id),className:"size-3.5 rounded-sm flex items-center justify-center shrink-0 text-muted-foreground/40 hover:text-destructive hover:bg-(--color-overlay-hover) transition-colors ml-0.5 cursor-pointer",children:_.jsx(Js,{className:"size-2.5"})})]},s.id)})})}function W0({onSend:e,onInterrupt:t,isProcessing:s,disabled:n,preferences:a,onUpdatePreference:c,models:u,commands:h,mcpServers:m,currentModel:p,onSetModel:y,currentPermissionMode:v,onSetPermissionMode:b,attachments:x,onAddAttachments:w,onRemoveAttachment:C,references:E,onRemoveReference:M}){const[R,T]=g.useState(""),N=g.useRef(null),D=g.useRef(void 0),[j,q]=g.useState(!1),[te,re]=g.useState(0),[oe,Z]=g.useState(""),G=g.useRef(0);g.useEffect(()=>{const ie=N.current;ie&&!CSS.supports("field-sizing","content")&&(G.current&&cancelAnimationFrame(G.current),G.current=requestAnimationFrame(()=>{G.current=0,ie.style.height="auto",ie.style.height=Math.min(ie.scrollHeight,192)+"px"}))},[R]),g.useEffect(()=>()=>{D.current&&clearTimeout(D.current),G.current&&cancelAnimationFrame(G.current)},[]);const I=g.useMemo(()=>{if(!j)return[];const ie=oe.toLowerCase();return ie?h.filter(me=>{var ve;return me.name.toLowerCase().includes(ie)||((ve=me.description)==null?void 0:ve.toLowerCase().includes(ie))}).sort((me,ve)=>{const Ne=me.name.toLowerCase().startsWith(ie)?0:1,Ue=ve.name.toLowerCase().startsWith(ie)?0:1;return Ne-Ue}):h},[h,oe,j]),V=g.useCallback(()=>{const ie=R.trim();!ie||n||(e(ie),T(""),q(!1),N.current&&(N.current.style.height="auto"))},[R,n,e]),W=g.useCallback(ie=>{var me;T(`/${ie.name} `),q(!1),(me=N.current)==null||me.focus()},[]),A=g.useCallback(ie=>{if(T(ie),ie.startsWith("/")&&h.length>0){const me=ie.slice(1);me.includes(" ")?q(!1):(Z(me),re(0),q(!0))}else q(!1)},[h.length]),L=g.useCallback(ie=>{if(!ie.nativeEvent.isComposing){if(j&&I.length>0)switch(ie.key){case"ArrowDown":ie.preventDefault(),re(me=>(me+1)%I.length);return;case"ArrowUp":ie.preventDefault(),re(me=>(me-1+I.length)%I.length);return;case"Enter":case"Tab":ie.preventDefault(),W(I[te]);return;case"Escape":ie.preventDefault(),q(!1);return}ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),V())}},[j,I,te,W,V]),z=g.useCallback(()=>{D.current=setTimeout(()=>q(!1),150)},[]),K=g.useCallback(()=>{D.current&&(clearTimeout(D.current),D.current=void 0)},[]),ee=g.useCallback(ie=>{var Ne;const me=(Ne=ie.clipboardData)==null?void 0:Ne.items;if(!me)return;const ve=[];for(let Ue=0;Ue<me.length;Ue++)if(me[Ue].kind==="file"){const xe=me[Ue].getAsFile();xe&&ve.push(xe)}if(ve.length>0){ie.preventDefault();const Ue=new DataTransfer;ve.forEach(xe=>Ue.items.add(xe)),w(Ue.files)}},[w]),he=g.useCallback(ie=>{var me;T(ve=>{const Ne=`/${ie} `;return ve?`${Ne}${ve}`:Ne}),(me=N.current)==null||me.focus()},[]),ne=u.find(ie=>ie.value===p),ae=R.trim().length>0&&!n;return _.jsx("div",{className:"px-4 pt-2.5 pb-[max(0.75rem,env(safe-area-inset-bottom))] bg-background/80 backdrop-blur-xl border-t border-(--color-overlay-border)",children:_.jsxs("div",{className:"relative",children:[j&&I.length>0&&_.jsx($A,{commands:I,selectedIndex:te,onSelect:W}),_.jsxs("form",{onSubmit:ie=>{ie.preventDefault(),V()},className:ye("relative rounded-2xl border bg-card/60 overflow-hidden","transition-[border-color,box-shadow] duration-200","border-(--color-overlay-border)","focus-within:border-primary/30 focus-within:ring-2 focus-within:ring-primary/10"),children:[_.jsx(KA,{attachments:x,onRemove:C}),E&&M&&_.jsx(XA,{references:E,onRemove:M}),_.jsx("div",{className:"px-4 pt-3 pb-1",children:_.jsx("textarea",{ref:N,value:R,onChange:ie=>A(ie.target.value),onKeyDown:L,onBlur:z,onFocus:K,onPaste:ee,placeholder:n?"Connecting...":"Message Claude Code...",disabled:n,rows:1,"aria-label":"Message input",className:ye("w-full bg-transparent text-foreground font-sans text-[15px]","resize-none outline-none leading-relaxed","placeholder:text-muted-foreground/50","disabled:opacity-50 disabled:cursor-not-allowed","field-sizing-content max-h-48 min-h-[1.5rem]")})}),_.jsx(DA,{children:_.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[_.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto overscroll-x-contain scrollbar-none whitespace-nowrap",children:[_.jsx(LA,{currentModel:p,models:u,onSelect:y,disabled:s}),_.jsx(BA,{effort:a.effort,supportedLevels:ne==null?void 0:ne.supportedEffortLevels,onSelect:ie=>c("effort",ie)}),_.jsx(PA,{thinking:a.thinking,onSelect:ie=>c("thinking",ie)}),_.jsx(IA,{servers:m}),_.jsx(WA,{mode:v,onSelect:b,disabled:s})]}),_.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[_.jsx(VA,{onAddAttachments:w,disabled:n}),_.jsx(qA,{commands:h,onSelect:he}),s?_.jsx(Ye,{type:"button",variant:"destructive",size:"icon-sm",className:"rounded-full animate-scale-in",onClick:t,"aria-label":"Stop generating",children:_.jsx(rk,{className:"size-3.5"})}):_.jsx(Ye,{type:"submit",size:"icon-sm",className:ye("rounded-full transition-all duration-200 animate-scale-in",ae?"shadow-md shadow-primary/20":"opacity-50"),disabled:!ae,"aria-label":"Send message",children:_.jsx(ib,{className:"size-4"})})]})]})})]})]})})}function xa({className:e,children:t,...s}){return _.jsxs(NT,{"data-slot":"scroll-area",className:ye("relative overflow-hidden",e),...s,children:[_.jsx(TT,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&>div]:block!",children:t}),_.jsx(q0,{}),_.jsx(q0,{orientation:"horizontal"}),_.jsx(AT,{})]})}function q0({className:e,orientation:t="vertical",...s}){return _.jsx(m1,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ye("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...s,children:_.jsx(v1,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function Hm({className:e,orientation:t="horizontal",decorative:s=!0,...n}){return _.jsx(zT,{"data-slot":"separator",decorative:s,orientation:t,className:ye("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...n})}function ZA({className:e,...t}){return _.jsx("div",{"data-slot":"skeleton",className:ye("animate-pulse rounded-md bg-accent",e),...t})}function Pm({...e}){return _.jsx(n5,{"data-slot":"sheet",...e})}function QA({...e}){return _.jsx(o5,{"data-slot":"sheet-portal",...e})}function JA({className:e,...t}){return _.jsx(a5,{"data-slot":"sheet-overlay",className:ye("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function Um({className:e,children:t,side:s="right",...n}){return _.jsxs(QA,{children:[_.jsx(JA,{}),_.jsxs(l5,{"data-slot":"sheet-content",className:ye("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out",s==="right"&&"inset-y-0 right-0 h-full w-3/4 max-w-sm border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",s==="left"&&"inset-y-0 left-0 h-full w-3/4 max-w-sm border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",s==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",s==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...n,children:[t,_.jsxs(u5,{className:"absolute right-4 top-[calc(1rem+env(safe-area-inset-top,0px))] rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[_.jsx(Js,{className:"size-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Im({className:e,...t}){return _.jsx("div",{"data-slot":"sheet-header",className:ye("flex flex-col gap-1.5 p-4",e),...t})}function Fm({className:e,...t}){return _.jsx(c5,{"data-slot":"sheet-title",className:ye("text-lg font-semibold text-foreground",e),...t})}function L1({storageKey:e,defaultWidth:t,minWidth:s,maxWidth:n,side:a}){const[c,u]=g.useState(()=>{const v=localStorage.getItem(e);return v?Math.max(s,Math.min(n,Number(v))):t}),h=g.useRef(c);h.current=c;const m=g.useRef(s);m.current=s;const p=g.useRef(n);p.current=n;const y=g.useCallback(v=>{v.preventDefault();const b=v.clientX,x=h.current;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const w=E=>{const M=a==="left"?E.clientX-b:b-E.clientX,R=Math.max(m.current,Math.min(p.current,x+M));u(R)},C=()=>{document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),localStorage.setItem(e,String(h.current))};document.addEventListener("mousemove",w),document.addEventListener("mouseup",C)},[a,e]);return{width:c,setWidth:u,handleMouseDown:y}}function eD(e){const t=Date.now()-e,s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const n=Math.floor(s/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function tD({threads:e,activeThreadId:t,loading:s,onSelectThread:n,onNewThread:a,isPinned:c,isDesktop:u,isEffectivelyPinned:h,onTogglePin:m,sheetOpen:p,onSheetOpenChange:y,showProjectLabel:v}){const b=M=>{n(M),h||y(!1)},x=()=>{a(),h||y(!1)},{width:w,handleMouseDown:C}=L1({storageKey:"rcc_sidebar_width",defaultWidth:280,minWidth:200,maxWidth:400,side:"left"}),E=_.jsxs(_.Fragment,{children:[_.jsx("div",{className:ye("px-4 pb-3",h?"pt-[calc(0.75rem+env(safe-area-inset-top,0px))]":"pt-[calc(1rem+env(safe-area-inset-top,0px))]",!h&&"pr-10"),children:_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Threads"}),u&&_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-8 rounded-lg hover:bg-(--color-overlay-hover)",onClick:m,"aria-label":c?"Unpin sidebar":"Pin sidebar",children:c?_.jsx(AE,{className:"size-4"}):_.jsx(OE,{className:"size-4"})})]})}),_.jsx("div",{className:"px-4 pb-3",children:_.jsxs(Ye,{variant:"outline",className:"w-full justify-start gap-2.5 h-10 rounded-xl border-dashed border-(--color-overlay-border) bg-(--color-overlay) hover:bg-(--color-overlay-hover) hover:border-border transition-all",onClick:x,children:[_.jsx("div",{className:"size-6 rounded-lg bg-primary/10 flex items-center justify-center",children:_.jsx(Vs,{className:"size-3.5 text-primary"})}),_.jsx("span",{className:"text-sm font-medium",children:"New Thread"})]})}),_.jsx(Hm,{className:"bg-(--color-overlay-border)"}),_.jsx(xa,{className:"flex-1",children:_.jsxs("div",{className:"flex flex-col gap-1 px-3 py-2",children:[s&&e.length===0&&_.jsx("div",{className:"flex flex-col gap-2 px-2 py-4",children:[1,2,3].map(M=>_.jsx(ZA,{className:"h-14 w-full rounded-xl"},M))}),!s&&e.length===0&&_.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground gap-2",children:[_.jsx(wc,{className:"size-8 opacity-30"}),_.jsx("p",{className:"text-sm",children:"No threads yet"})]}),e.map(M=>_.jsxs("button",{onClick:()=>b(M.id),className:ye("flex items-start gap-3 rounded-xl px-3 py-3 text-left text-sm transition-all duration-150 cursor-pointer group overflow-hidden",M.id===t?"bg-primary/10 border border-primary/20":"hover:bg-(--color-overlay-hover) border border-transparent"),children:[_.jsx("div",{className:ye("size-8 rounded-lg flex items-center justify-center shrink-0 mt-0.5 transition-colors",M.id===t?"bg-primary/20 text-primary":"bg-(--color-overlay) text-muted-foreground group-hover:bg-(--color-overlay-hover)"),children:_.jsx(wc,{className:"size-4"})}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("p",{className:ye("truncate font-medium leading-tight",M.id===t?"text-primary":"text-foreground"),children:M.title}),_.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:[eD(M.lastModified),v&&M.cwd&&_.jsx("span",{className:"ml-1.5 text-primary/50",children:M.cwd.split("/").filter(Boolean).pop()})]})]})]},M.id))]})})]});return h?_.jsxs("aside",{className:"shrink-0 h-full bg-card border-r border-(--color-overlay-border) flex flex-col overflow-hidden relative",style:{width:w},children:[E,_.jsx("div",{className:"absolute top-0 bottom-0 right-0 w-1.5 cursor-col-resize z-20 hover:bg-primary/20 active:bg-primary/30 transition-colors",onMouseDown:C})]}):_.jsx(Pm,{open:p,onOpenChange:y,children:_.jsxs(Um,{side:"left",className:"w-[280px] p-0 bg-card border-r border-(--color-overlay-border)",children:[_.jsx(Im,{className:"sr-only",children:_.jsx(Fm,{children:"Threads"})}),E]})})}const iD={ts:It,tsx:It,js:It,jsx:It,py:It,rs:It,go:It,java:It,rb:It,c:It,cpp:It,cs:It,vue:It,svelte:It,json:J2,md:ti,txt:ti,yaml:ti,yml:ti,toml:ti,xml:ti,html:ti,css:ti,scss:ti,less:ti};function rD(e){return e.isDirectory?null:iD[e.extension]||lE}function sD({entry:e,path:t,parentPath:s,depth:n,isExpanded:a,isLoading:c,onToggleExpand:u,onFileSelect:h,onAddFileReference:m,onAddFolderReference:p,onDeleteFile:y,onDeleteFolder:v,children:b}){const[x,w]=g.useState(!1),C=()=>{e.isDirectory?u(t):h(t)},E=T=>{T.stopPropagation(),e.isDirectory?p(t,e.name):m(t,e.name)},M=T=>{T.stopPropagation(),e.isDirectory?v(t,s):y(t,s)},R=e.isDirectory?a?Ws:lb:rD(e);return _.jsxs("div",{children:[_.jsxs("div",{className:ye("flex items-center gap-1 py-1 px-1.5 rounded-md cursor-pointer group/node transition-colors","hover:bg-(--color-overlay-hover)"),style:{paddingLeft:`${n*16+4}px`},onClick:C,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[e.isDirectory?_.jsx("div",{className:"size-4 shrink-0 flex items-center justify-center",children:c?_.jsx(qs,{className:"size-3 animate-spin text-muted-foreground"}):_.jsx(Jn,{className:ye("size-3 text-muted-foreground/60 transition-transform duration-150",a&&"rotate-90")})}):_.jsx("div",{className:"size-4 shrink-0"}),_.jsx(R,{className:ye("size-4 shrink-0",e.isDirectory?"text-primary/70":"text-muted-foreground/70")}),_.jsx("span",{className:"text-[13px] truncate flex-1 min-w-0 text-foreground/90",children:e.name}),x&&_.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[_.jsx("button",{onClick:E,className:"size-5 rounded flex items-center justify-center hover:bg-(--color-overlay) text-muted-foreground/50 hover:text-primary transition-colors",title:"Add reference",children:_.jsx(tm,{className:"size-3"})}),_.jsx("button",{onClick:M,className:"size-5 rounded flex items-center justify-center hover:bg-(--color-overlay) text-muted-foreground/50 hover:text-destructive transition-colors",title:"Delete",children:_.jsx(of,{className:"size-3"})})]})]}),e.isDirectory&&a&&b]})}function z1({parentPath:e,depth:t,tree:s,expandedPaths:n,loadingPaths:a,onLoadDirectory:c,onToggleExpand:u,onFileSelect:h,onAddFileReference:m,onAddFolderReference:p,onDeleteFile:y,onDeleteFolder:v}){const b=s.get(e);return b?_.jsx("div",{children:b.map(x=>{const w=`${e}/${x.name}`,C=n.has(w),E=a.has(w);return _.jsx(sD,{entry:x,path:w,parentPath:e,depth:t,isExpanded:C,isLoading:E,onToggleExpand:M=>{u(M),!n.has(M)&&!s.has(M)&&c(M)},onFileSelect:h,onAddFileReference:m,onAddFolderReference:p,onDeleteFile:y,onDeleteFolder:v,children:x.isDirectory&&C&&_.jsx(z1,{parentPath:w,depth:t+1,tree:s,expandedPaths:n,loadingPaths:a,onLoadDirectory:c,onToggleExpand:u,onFileSelect:h,onAddFileReference:m,onAddFolderReference:p,onDeleteFile:y,onDeleteFolder:v})},x.name)})}):null}function nD({rootPath:e,tree:t,expandedPaths:s,loadingPaths:n,onLoadDirectory:a,onToggleExpand:c,onFileSelect:u,onAddFileReference:h,onAddFolderReference:m,onDeleteFile:p,onDeleteFolder:y}){return g.useEffect(()=>{e&&!t.has(e)&&a(e)},[e,t,a]),t.has(e)?_.jsx("div",{className:"py-1",children:_.jsx(z1,{parentPath:e,depth:0,tree:t,expandedPaths:s,loadingPaths:n,onLoadDirectory:a,onToggleExpand:c,onFileSelect:u,onAddFileReference:h,onAddFolderReference:m,onDeleteFile:p,onDeleteFolder:y})}):_.jsx("div",{className:"flex items-center justify-center py-8 text-muted-foreground/50 text-sm",children:"Loading..."})}function oD({containerRef:e,filePath:t,fileName:s,onAddReference:n}){const[a,c]=g.useState(null),[u,h]=g.useState(null),m=g.useRef(null),p=g.useCallback(v=>{let b=v instanceof Element?v:v.parentElement;for(;b&&b!==e.current;){const x=b.getAttribute("data-line");if(x)return parseInt(x,10);b=b.parentElement}return null},[e]),y=g.useCallback(()=>{const v=window.getSelection();if(!v||v.isCollapsed||!v.rangeCount){c(null),h(null);return}const b=v.getRangeAt(0),x=e.current;if(!x||!x.contains(b.commonAncestorContainer)){c(null),h(null);return}const w=v.toString().trim();if(!w){c(null),h(null);return}const C=p(b.startContainer),E=p(b.endContainer);if(C===null||E===null){c(null),h(null);return}const M=b.getBoundingClientRect(),R=x.getBoundingClientRect();c({top:M.top-R.top-32,left:Math.min(M.left-R.left+M.width/2,R.width-40)}),h({startLine:Math.min(C,E),endLine:Math.max(C,E),content:w})},[e,p]);return g.useEffect(()=>(document.addEventListener("selectionchange",y),()=>document.removeEventListener("selectionchange",y)),[y]),g.useEffect(()=>{const v=b=>{m.current&&!m.current.contains(b.target)&&(c(null),h(null))};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[]),!a||!u?null:_.jsx("div",{ref:m,className:"absolute z-50 animate-in fade-in zoom-in-95 duration-100",style:{top:a.top,left:a.left,transform:"translateX(-50%)"},children:_.jsxs("button",{onClick:()=>{var v;n(u.startLine,u.endLine,u.content),(v=window.getSelection())==null||v.removeAllRanges(),c(null),h(null)},className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-card border border-(--color-overlay-border) shadow-lg text-xs font-medium text-foreground hover:bg-(--color-overlay-hover) transition-colors cursor-pointer",children:[_.jsx(tm,{className:"size-3.5 text-primary"}),_.jsxs("span",{children:["Reference L",u.startLine,"-",u.endLine]})]})})}let qd=null;function aD(){return qd||(qd=QC(async()=>{const{createHighlighter:e}=await import("./code-highlighter-D_0rJlW2.js").then(t=>t.i);return{createHighlighter:e}},__vite__mapDeps([0,1])).then(({createHighlighter:e})=>e({themes:["github-light","github-dark"],langs:[]}))),qd}function B1(e){return e.startsWith("--")?e:e.replace(/-([a-z])/g,(t,s)=>s.toUpperCase())}function lD(e){const t={};for(const[s,n]of Object.entries(e))n==null||n===""||(t[B1(s)]=n);return Object.keys(t).length>0?t:void 0}function cD(e){const t=e.htmlStyle;if(!t)return e.color?{color:e.color}:void 0;if(typeof t=="object")return lD(t);const s={},n=String(t);for(const a of n.split(";")){const c=a.indexOf(":");c>0&&(s[B1(a.slice(0,c).trim())]=a.slice(c+1).trim())}return Object.keys(s).length===0?e.color?{color:e.color}:void 0:s}function uD(e,t){const[s,n]=g.useState(null);return g.useEffect(()=>{if(!e||!t){n(null);return}let a=!1;return(async()=>{try{const c=await aD();c.getLoadedLanguages().includes(t)||await c.loadLanguage(t);const h=c.codeToTokens(e,{lang:t,themes:{light:"github-light",dark:"github-dark"}});a||n(h.tokens)}catch(c){console.warn("[useHighlightedCode] failed for",t,c)}})(),()=>{a=!0}},[e,t]),s}function hD({file:e,loading:t,error:s,isEffectivelyPinned:n,onBack:a,onAddFileReference:c,onAddSnippetReference:u}){const h=g.useRef(null),[m,p]=g.useState(!0),y=uD(e==null?void 0:e.content,e==null?void 0:e.language);if(t)return _.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-muted-foreground",children:[_.jsx(qs,{className:"size-5 animate-spin"}),_.jsx("span",{className:"text-sm",children:"Loading file..."})]});if(s)return _.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-muted-foreground px-4",children:[_.jsx(q2,{className:"size-5 text-destructive/60"}),_.jsx("span",{className:"text-sm text-center",children:s}),_.jsxs(Ye,{variant:"ghost",size:"sm",onClick:a,className:"mt-2",children:[_.jsx(i0,{className:"size-4 mr-1"}),"Back"]})]});if(!e)return null;const v=e.content.split(`
|
|
421
|
+
`);return _.jsxs("div",{className:"flex flex-col h-full",children:[_.jsxs("div",{className:ye("flex items-center gap-2 border-b border-(--color-overlay-border) py-2 pl-3 shrink-0",n?"pr-3":"pr-12"),children:[_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-lg hover:bg-(--color-overlay-hover)",onClick:a,children:_.jsx(i0,{className:"size-4"})}),_.jsx("span",{className:"text-sm font-medium truncate flex-1 min-w-0 text-foreground/90",children:e.name}),_.jsx(Ye,{variant:"ghost",size:"sm",className:ye("h-7 rounded-md px-1.5 text-[11px] text-muted-foreground hover:bg-(--color-overlay-hover) sm:px-2 sm:text-xs",m&&"text-primary"),"aria-pressed":m,"aria-label":m?"Disable line wrap":"Enable line wrap",title:m?"Switch to horizontal scroll":"Switch to line wrap",onClick:()=>p(b=>!b),children:m?"Wrap":"Scroll"}),_.jsxs("button",{onClick:()=>c(e.path,e.name),className:"flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-muted-foreground transition-colors hover:text-primary hover:bg-(--color-overlay-hover) cursor-pointer sm:px-2 sm:text-xs",title:"Reference entire file","aria-label":"Reference entire file",children:[_.jsx(tm,{className:"size-3"}),_.jsx("span",{className:"hidden sm:inline",children:"File"})]})]}),_.jsx(xa,{className:"flex-1",children:_.jsxs("div",{ref:h,className:ye("relative file-viewer-code",m?"w-full":"inline-block min-w-full"),children:[_.jsx(oD,{containerRef:h,filePath:e.path,fileName:e.name,onAddReference:(b,x,w)=>{u(e.path,e.name,b,x,w)}}),_.jsx("table",{className:ye("text-[13px] leading-relaxed font-mono",m?"w-full":"w-max min-w-full"),children:_.jsx("tbody",{children:(y||v).map((b,x)=>_.jsxs("tr",{"data-line":x+1,className:"hover:bg-(--color-overlay)",children:[_.jsx("td",{className:"select-none text-right pr-3 pl-3 text-muted-foreground/40 w-[1%] whitespace-nowrap align-top",children:x+1}),_.jsx("td",{className:ye("pr-4 text-foreground/85",m?"whitespace-pre-wrap break-all":"whitespace-pre"),children:Array.isArray(b)?b.map((w,C)=>_.jsx("span",{style:cD(w),children:w.content},C)):b||`
|
|
422
|
+
`})]},x))})})]})})]})}function dD(e){const[t,s]=g.useState(new Map),[n,a]=g.useState(new Set),[c,u]=g.useState(new Set),h=g.useRef(new Map),m=g.useCallback(async E=>{var R;if(!e)return;(R=h.current.get(E))==null||R.abort();const M=new AbortController;h.current.set(E,M),u(T=>new Set(T).add(E));try{const T=await fetch(`/api/projects/tree?path=${encodeURIComponent(E)}`,{headers:{Authorization:`Bearer ${e}`},signal:M.signal});if(!T.ok)return;const N=await T.json();s(D=>{const j=new Map(D);return j.set(E,N.entries),j})}catch(T){if(T instanceof DOMException&&T.name==="AbortError")return}finally{h.current.delete(E),u(T=>{const N=new Set(T);return N.delete(E),N})}},[e]),p=g.useCallback(E=>{a(M=>{const R=new Set(M);return R.has(E)?R.delete(E):R.add(E),R})},[]),y=g.useCallback(E=>{if(E)m(E);else for(const M of t.keys())m(M)},[t,m]),v=g.useCallback(async(E,M)=>e&&(await fetch("/api/projects/file",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({parent:E,name:M})})).ok?(await m(E),!0):!1,[e,m]),b=g.useCallback(async(E,M)=>e&&(await fetch("/api/projects/file",{method:"DELETE",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({path:E})})).ok?(await m(M),!0):!1,[e,m]),x=g.useCallback(async(E,M)=>e&&(await fetch("/api/projects/mkdir",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({parent:E,name:M})})).ok?(await m(E),!0):!1,[e,m]),w=g.useCallback(async(E,M,R)=>e&&(await fetch("/api/projects/rmdir",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({path:E,force:R})})).ok?(s(N=>{const D=new Map(N);return D.delete(E),D}),a(N=>{const D=new Set(N);return D.delete(E),D}),await m(M),!0):!1,[e,m]),C=g.useCallback(()=>{for(const E of h.current.values())E.abort();h.current.clear(),s(new Map),a(new Set),u(new Set)},[]);return{tree:t,expandedPaths:n,loadingPaths:c,loadDirectory:m,toggleExpand:p,refresh:y,createFile:v,deleteFile:b,createFolder:x,deleteFolder:w,reset:C}}function fD(e){const[t,s]=g.useState(null),[n,a]=g.useState(!1),[c,u]=g.useState(null),h=g.useCallback(async p=>{if(e){a(!0),u(null);try{const y=await fetch(`/api/projects/file?path=${encodeURIComponent(p)}`,{headers:{Authorization:`Bearer ${e}`}}),v=await y.json();if(!y.ok){u(v.error||"Failed to read file"),s(null);return}s(v)}catch{u("Network error"),s(null)}finally{a(!1)}}},[e]),m=g.useCallback(()=>{s(null),u(null)},[]);return{currentFile:t,loading:n,error:c,openFile:h,closeFile:m}}function mD({activeProject:e,token:t,isPinned:s,isDesktop:n,isEffectivelyPinned:a,onTogglePin:c,sheetOpen:u,onSheetOpenChange:h,onAddReference:m}){const p=dD(t),y=fD(t),[v,b]=g.useState("tree"),x=v==="file",w=typeof window<"u"?Math.round(window.innerWidth*.8):1200,{width:C,setWidth:E,handleMouseDown:M}=L1({storageKey:"rcc_explorer_width",defaultWidth:320,minWidth:x?400:240,maxWidth:x?w:500,side:"right"}),R=g.useRef(C),[T,N]=g.useState(!1);g.useEffect(()=>{if(v==="file"){R.current=C,N(!0);const ne=Math.max(500,Math.round(window.innerWidth*.7));E(ne)}else N(!0),E(R.current)},[v]);const[D,j]=g.useState(null),[q,te]=g.useState(""),[re,oe]=g.useState(null),Z=(e==null?void 0:e.path)||null,G=g.useCallback(ne=>{y.openFile(ne),b("file")},[y]),I=g.useCallback(()=>{y.closeFile(),b("tree")},[y]),V=g.useCallback((ne,ae)=>{m({type:"file",path:ne,name:ae})},[m]),W=g.useCallback((ne,ae)=>{m({type:"folder",path:ne,name:ae})},[m]),A=g.useCallback((ne,ae,ie,me,ve)=>{m({type:"code_snippet",path:ne,name:ae,startLine:ie,endLine:me,content:ve})},[m]),L=g.useCallback(async(ne,ae)=>{var ie;confirm(`Delete ${ne.split("/").pop()}?`)&&(await p.deleteFile(ne,ae),((ie=y.currentFile)==null?void 0:ie.path)===ne&&I())},[p,y.currentFile,I]),z=g.useCallback(async(ne,ae)=>{confirm(`Delete ${ne.split("/").pop()}/ and all its contents?`)&&await p.deleteFolder(ne,ae,!0)},[p]),K=g.useCallback((ne,ae)=>{j(ne),te(""),oe(ae||Z)},[Z]),ee=g.useCallback(async()=>{const ne=q.trim();!ne||!re||(D==="file"?await p.createFile(re,ne):D==="folder"&&await p.createFolder(re,ne),j(null),te(""))},[D,q,re,p]);if(!e)return null;const he=_.jsx("div",{className:"flex flex-col h-full",children:v==="tree"?_.jsxs(_.Fragment,{children:[_.jsx("div",{className:ye("px-3 pb-2 shrink-0",a?"pt-[calc(0.75rem+env(safe-area-inset-top,0px))]":"pt-[calc(1rem+env(safe-area-inset-top,0px))] pr-10",!a&&"pl-3"),children:_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("h2",{className:"text-sm font-semibold tracking-tight truncate",children:e.name}),_.jsxs("div",{className:"flex items-center gap-0.5",children:[_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-lg hover:bg-(--color-overlay-hover)",onClick:()=>K("file"),title:"New file",children:_.jsx(rE,{className:"size-3.5"})}),_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-lg hover:bg-(--color-overlay-hover)",onClick:()=>K("folder"),title:"New folder",children:_.jsx(ob,{className:"size-3.5"})}),_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-lg hover:bg-(--color-overlay-hover)",onClick:()=>p.refresh(Z||void 0),title:"Refresh",children:_.jsx(db,{className:"size-3.5"})}),n&&_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-lg hover:bg-(--color-overlay-hover)",onClick:c,title:s?"Unpin panel":"Pin panel",children:s?_.jsx(zE,{className:"size-3.5"}):_.jsx(jE,{className:"size-3.5"})})]})]})}),D&&_.jsx("div",{className:"px-3 pb-2",children:_.jsxs("div",{className:"flex items-center gap-1.5",children:[_.jsx(Cc,{value:q,onChange:ne=>te(ne.target.value),placeholder:D==="file"?"File name...":"Folder name...",className:"h-7 text-xs",autoFocus:!0,onKeyDown:ne=>{ne.key==="Enter"&&ee(),ne.key==="Escape"&&j(null)}}),_.jsx(Ye,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:ee,children:"OK"})]})}),_.jsx(Hm,{className:"bg-(--color-overlay-border)"}),_.jsx(xa,{className:"flex-1",children:Z&&_.jsx(nD,{rootPath:Z,tree:p.tree,expandedPaths:p.expandedPaths,loadingPaths:p.loadingPaths,onLoadDirectory:p.loadDirectory,onToggleExpand:p.toggleExpand,onFileSelect:G,onAddFileReference:V,onAddFolderReference:W,onDeleteFile:L,onDeleteFolder:z})})]}):_.jsx(hD,{file:y.currentFile,loading:y.loading,error:y.error,isEffectivelyPinned:a,onBack:I,onAddFileReference:V,onAddSnippetReference:A})});return a?_.jsxs("aside",{className:"shrink-0 h-full bg-card border-l border-(--color-overlay-border) flex flex-col overflow-hidden relative",style:{width:C,transition:T?"width 300ms ease":void 0},onTransitionEnd:()=>N(!1),children:[_.jsx("div",{className:"absolute top-0 bottom-0 left-0 w-1.5 cursor-col-resize z-20 hover:bg-primary/20 active:bg-primary/30 transition-colors",onMouseDown:M}),he]}):_.jsx(Pm,{open:u,onOpenChange:h,children:_.jsxs(Um,{side:"right",className:ye("p-0 bg-card border-l border-(--color-overlay-border)",v==="file"?"w-[90vw] max-w-none":"w-[320px]"),children:[_.jsx(Im,{className:"sr-only",children:_.jsx(Fm,{children:"File Explorer"})}),he]})})}/**
|
|
423
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
424
|
+
* @license MIT
|
|
425
|
+
*
|
|
426
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
427
|
+
* @license MIT
|
|
428
|
+
*
|
|
429
|
+
* Originally forked from (with the author's permission):
|
|
430
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
431
|
+
* http://bellard.org/jslinux/
|
|
432
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
433
|
+
*/var j1=Object.defineProperty,pD=Object.getOwnPropertyDescriptor,_D=(e,t)=>{for(var s in t)j1(e,s,{get:t[s],enumerable:!0})},lt=(e,t,s,n)=>{for(var a=n>1?void 0:n?pD(t,s):t,c=e.length-1,u;c>=0;c--)(u=e[c])&&(a=(n?u(t,s,a):u(a))||a);return n&&a&&j1(t,s,a),a},le=(e,t)=>(s,n)=>t(s,n,e),$0="Terminal input",gf={get:()=>$0,set:e=>$0=e},V0="Too much output to announce, navigate to rows manually to read",vf={get:()=>V0,set:e=>V0=e};function gD(e){return e.replace(/\r?\n/g,"\r")}function vD(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function yD(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function bD(e,t,s,n){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");H1(a,t,s,n)}}function H1(e,t,s,n){e=gD(e),e=vD(e,s.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(e,!0),t.value=""}function P1(e,t,s){let n=s.getBoundingClientRect(),a=e.clientX-n.left-10,c=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.zIndex="1000",t.focus()}function K0(e,t,s,n,a){P1(e,t,s),a&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function hs(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function ru(e,t=0,s=e.length){let n="";for(let a=t;a<s;++a){let c=e[a];c>65535?(c-=65536,n+=String.fromCharCode((c>>10)+55296)+String.fromCharCode(c%1024+56320)):n+=String.fromCharCode(c)}return n}var SD=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let s=e.length;if(!s)return 0;let n=0,a=0;if(this._interim){let c=e.charCodeAt(a++);56320<=c&&c<=57343?t[n++]=(this._interim-55296)*1024+c-56320+65536:(t[n++]=this._interim,t[n++]=c),this._interim=0}for(let c=a;c<s;++c){let u=e.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=s)return this._interim=u,n;let h=e.charCodeAt(c);56320<=h&&h<=57343?t[n++]=(u-55296)*1024+h-56320+65536:(t[n++]=u,t[n++]=h);continue}u!==65279&&(t[n++]=u)}return n}},xD=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let s=e.length;if(!s)return 0;let n=0,a,c,u,h,m=0,p=0;if(this.interim[0]){let b=!1,x=this.interim[0];x&=(x&224)===192?31:(x&240)===224?15:7;let w=0,C;for(;(C=this.interim[++w]&63)&&w<4;)x<<=6,x|=C;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,M=E-w;for(;p<M;){if(p>=s)return 0;if(C=e[p++],(C&192)!==128){p--,b=!0;break}else this.interim[w++]=C,x<<=6,x|=C&63}b||(E===2?x<128?p--:t[n++]=x:E===3?x<2048||x>=55296&&x<=57343||x===65279||(t[n++]=x):x<65536||x>1114111||(t[n++]=x)),this.interim.fill(0)}let y=s-4,v=p;for(;v<s;){for(;v<y&&!((a=e[v])&128)&&!((c=e[v+1])&128)&&!((u=e[v+2])&128)&&!((h=e[v+3])&128);)t[n++]=a,t[n++]=c,t[n++]=u,t[n++]=h,v+=4;if(a=e[v++],a<128)t[n++]=a;else if((a&224)===192){if(v>=s)return this.interim[0]=a,n;if(c=e[v++],(c&192)!==128){v--;continue}if(m=(a&31)<<6|c&63,m<128){v--;continue}t[n++]=m}else if((a&240)===224){if(v>=s)return this.interim[0]=a,n;if(c=e[v++],(c&192)!==128){v--;continue}if(v>=s)return this.interim[0]=a,this.interim[1]=c,n;if(u=e[v++],(u&192)!==128){v--;continue}if(m=(a&15)<<12|(c&63)<<6|u&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[n++]=m}else if((a&248)===240){if(v>=s)return this.interim[0]=a,n;if(c=e[v++],(c&192)!==128){v--;continue}if(v>=s)return this.interim[0]=a,this.interim[1]=c,n;if(u=e[v++],(u&192)!==128){v--;continue}if(v>=s)return this.interim[0]=a,this.interim[1]=c,this.interim[2]=u,n;if(h=e[v++],(h&192)!==128){v--;continue}if(m=(a&7)<<18|(c&63)<<12|(u&63)<<6|h&63,m<65536||m>1114111)continue;t[n++]=m}}return n}},U1="",ds=" ",za=class I1{constructor(){this.fg=0,this.bg=0,this.extended=new Lc}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new I1;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Lc=class F1{constructor(t=0,s=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=s}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new F1(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Di=class W1 extends za{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Lc,this.combinedData=""}static fromCharData(t){let s=new W1;return s.setFromCharData(t),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?hs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let s=!1;if(t[1].length>2)s=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(n-55296)*1024+a-56320+65536|t[2]<<22:s=!0}else s=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;s&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Y0="di$target",yf="di$dependencies",$d=new Map;function wD(e){return e[yf]||[]}function Nt(e){if($d.has(e))return $d.get(e);let t=function(s,n,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");CD(t,s,a)};return t._id=e,$d.set(e,t),t}function CD(e,t,s){t[Y0]===t?t[yf].push({id:e,index:s}):(t[yf]=[{id:e,index:s}],t[Y0]=t)}var $t=Nt("BufferService"),q1=Nt("CoreMouseService"),rn=Nt("CoreService"),ED=Nt("CharsetService"),Wm=Nt("InstantiationService"),$1=Nt("LogService"),Vt=Nt("OptionsService"),V1=Nt("OscLinkService"),kD=Nt("UnicodeService"),Ba=Nt("DecorationService"),bf=class{constructor(e,t,s){this._bufferService=e,this._optionsService=t,this._oscLinkService=s}provideLinks(e,t){var y;let s=this._bufferService.buffer.lines.get(e-1);if(!s){t(void 0);return}let n=[],a=this._optionsService.rawOptions.linkHandler,c=new Di,u=s.getTrimmedLength(),h=-1,m=-1,p=!1;for(let v=0;v<u;v++)if(!(m===-1&&!s.hasContent(v))){if(s.loadCell(v,c),c.hasExtendedAttrs()&&c.extended.urlId)if(m===-1){m=v,h=c.extended.urlId;continue}else p=c.extended.urlId!==h;else m!==-1&&(p=!0);if(p||m!==-1&&v===u-1){let b=(y=this._oscLinkService.getLinkData(h))==null?void 0:y.uri;if(b){let x={start:{x:m+1,y:e},end:{x:v+(!p&&v===u-1?1:0),y:e}},w=!1;if(!(a!=null&&a.allowNonHttpProtocols))try{let C=new URL(b);["http:","https:"].includes(C.protocol)||(w=!0)}catch{w=!0}w||n.push({text:b,range:x,activate:(C,E)=>a?a.activate(C,E,x):MD(C,E),hover:(C,E)=>{var M;return(M=a==null?void 0:a.hover)==null?void 0:M.call(a,C,E,x)},leave:(C,E)=>{var M;return(M=a==null?void 0:a.leave)==null?void 0:M.call(a,C,E,x)}})}p=!1,c.hasExtendedAttrs()&&c.extended.urlId?(m=v,h=c.extended.urlId):(m=-1,h=-1)}}t(n)}};bf=lt([le(0,$t),le(1,Vt),le(2,V1)],bf);function MD(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
434
|
+
|
|
435
|
+
WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var su=Nt("CharSizeService"),Or=Nt("CoreBrowserService"),qm=Nt("MouseService"),Lr=Nt("RenderService"),RD=Nt("SelectionService"),K1=Nt("CharacterJoinerService"),oo=Nt("ThemeService"),Y1=Nt("LinkProviderService"),ND=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?G0.isErrorNoTelemetry(e)?new G0(e.message+`
|
|
436
|
+
|
|
437
|
+
`+e.stack):new Error(e.message+`
|
|
438
|
+
|
|
439
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},TD=new ND;function _c(e){AD(e)||TD.onUnexpectedError(e)}var Sf="Canceled";function AD(e){return e instanceof DD?!0:e instanceof Error&&e.name===Sf&&e.message===Sf}var DD=class extends Error{constructor(){super(Sf),this.name=this.message}};function OD(e){return new Error(`Illegal argument: ${e}`)}var G0=class xf extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof xf)return t;let s=new xf;return s.message=t.message,s.stack=t.stack,s}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},wf=class G1 extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,G1.prototype)}};function hi(e,t=0){return e[e.length-(1+t)]}var LD;(e=>{function t(c){return c<0}e.isLessThan=t;function s(c){return c<=0}e.isLessThanOrEqual=s;function n(c){return c>0}e.isGreaterThan=n;function a(c){return c===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(LD||(LD={}));function zD(e,t){let s=this,n=!1,a;return function(){return n||(n=!0,t||(a=e.apply(s,arguments))),a}}var X1;(e=>{function t(N){return N&&typeof N=="object"&&typeof N[Symbol.iterator]=="function"}e.is=t;let s=Object.freeze([]);function n(){return s}e.empty=n;function*a(N){yield N}e.single=a;function c(N){return t(N)?N:a(N)}e.wrap=c;function u(N){return N||s}e.from=u;function*h(N){for(let D=N.length-1;D>=0;D--)yield N[D]}e.reverse=h;function m(N){return!N||N[Symbol.iterator]().next().done===!0}e.isEmpty=m;function p(N){return N[Symbol.iterator]().next().value}e.first=p;function y(N,D){let j=0;for(let q of N)if(D(q,j++))return!0;return!1}e.some=y;function v(N,D){for(let j of N)if(D(j))return j}e.find=v;function*b(N,D){for(let j of N)D(j)&&(yield j)}e.filter=b;function*x(N,D){let j=0;for(let q of N)yield D(q,j++)}e.map=x;function*w(N,D){let j=0;for(let q of N)yield*D(q,j++)}e.flatMap=w;function*C(...N){for(let D of N)yield*D}e.concat=C;function E(N,D,j){let q=j;for(let te of N)q=D(q,te);return q}e.reduce=E;function*M(N,D,j=N.length){for(D<0&&(D+=N.length),j<0?j+=N.length:j>N.length&&(j=N.length);D<j;D++)yield N[D]}e.slice=M;function R(N,D=Number.POSITIVE_INFINITY){let j=[];if(D===0)return[j,N];let q=N[Symbol.iterator]();for(let te=0;te<D;te++){let re=q.next();if(re.done)return[j,e.empty()];j.push(re.value)}return[j,{[Symbol.iterator](){return q}}]}e.consume=R;async function T(N){let D=[];for await(let j of N)D.push(j);return Promise.resolve(D)}e.asyncToArray=T})(X1||(X1={}));function Zs(e){if(X1.is(e)){let t=[];for(let s of e)if(s)try{s.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function BD(...e){return it(()=>Zs(e))}function it(e){return{dispose:zD(()=>{e()})}}var Z1=class Q1{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Zs(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Q1.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};Z1.DISABLE_DISPOSED_WARNING=!1;var ms=Z1,ke=class{constructor(){this._store=new ms,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};ke.None=Object.freeze({dispose(){}});var ro=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},kr=typeof window=="object"?window:globalThis,Cf=class Ef{constructor(t){this.element=t,this.next=Ef.Undefined,this.prev=Ef.Undefined}};Cf.Undefined=new Cf(void 0);var rt=Cf,X0=class{constructor(){this._first=rt.Undefined,this._last=rt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===rt.Undefined}clear(){let e=this._first;for(;e!==rt.Undefined;){let t=e.next;e.prev=rt.Undefined,e.next=rt.Undefined,e=t}this._first=rt.Undefined,this._last=rt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let s=new rt(e);if(this._first===rt.Undefined)this._first=s,this._last=s;else if(t){let a=this._last;this._last=s,s.prev=a,a.next=s}else{let a=this._first;this._first=s,s.next=a,a.prev=s}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(s))}}shift(){if(this._first!==rt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==rt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==rt.Undefined&&e.next!==rt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===rt.Undefined&&e.next===rt.Undefined?(this._first=rt.Undefined,this._last=rt.Undefined):e.next===rt.Undefined?(this._last=this._last.prev,this._last.next=rt.Undefined):e.prev===rt.Undefined&&(this._first=this._first.next,this._first.prev=rt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==rt.Undefined;)yield e.element,e=e.next}},jD=globalThis.performance&&typeof globalThis.performance.now=="function",HD=class J1{static create(t){return new J1(t)}constructor(t){this._now=jD&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},jt;(e=>{e.None=()=>ke.None;function t(G,I){return v(G,()=>{},0,void 0,!0,void 0,I)}e.defer=t;function s(G){return(I,V=null,W)=>{let A=!1,L;return L=G(z=>{if(!A)return L?L.dispose():A=!0,I.call(V,z)},null,W),A&&L.dispose(),L}}e.once=s;function n(G,I,V){return p((W,A=null,L)=>G(z=>W.call(A,I(z)),null,L),V)}e.map=n;function a(G,I,V){return p((W,A=null,L)=>G(z=>{I(z),W.call(A,z)},null,L),V)}e.forEach=a;function c(G,I,V){return p((W,A=null,L)=>G(z=>I(z)&&W.call(A,z),null,L),V)}e.filter=c;function u(G){return G}e.signal=u;function h(...G){return(I,V=null,W)=>{let A=BD(...G.map(L=>L(z=>I.call(V,z))));return y(A,W)}}e.any=h;function m(G,I,V,W){let A=V;return n(G,L=>(A=I(A,L),A),W)}e.reduce=m;function p(G,I){let V,W={onWillAddFirstListener(){V=G(A.fire,A)},onDidRemoveLastListener(){V==null||V.dispose()}},A=new se(W);return I==null||I.add(A),A.event}function y(G,I){return I instanceof Array?I.push(G):I&&I.add(G),G}function v(G,I,V=100,W=!1,A=!1,L,z){let K,ee,he,ne=0,ae,ie={leakWarningThreshold:L,onWillAddFirstListener(){K=G(ve=>{ne++,ee=I(ee,ve),W&&!he&&(me.fire(ee),ee=void 0),ae=()=>{let Ne=ee;ee=void 0,he=void 0,(!W||ne>1)&&me.fire(Ne),ne=0},typeof V=="number"?(clearTimeout(he),he=setTimeout(ae,V)):he===void 0&&(he=0,queueMicrotask(ae))})},onWillRemoveListener(){A&&ne>0&&(ae==null||ae())},onDidRemoveLastListener(){ae=void 0,K.dispose()}},me=new se(ie);return z==null||z.add(me),me.event}e.debounce=v;function b(G,I=0,V){return e.debounce(G,(W,A)=>W?(W.push(A),W):[A],I,void 0,!0,void 0,V)}e.accumulate=b;function x(G,I=(W,A)=>W===A,V){let W=!0,A;return c(G,L=>{let z=W||!I(L,A);return W=!1,A=L,z},V)}e.latch=x;function w(G,I,V){return[e.filter(G,I,V),e.filter(G,W=>!I(W),V)]}e.split=w;function C(G,I=!1,V=[],W){let A=V.slice(),L=G(ee=>{A?A.push(ee):K.fire(ee)});W&&W.add(L);let z=()=>{A==null||A.forEach(ee=>K.fire(ee)),A=null},K=new se({onWillAddFirstListener(){L||(L=G(ee=>K.fire(ee)),W&&W.add(L))},onDidAddFirstListener(){A&&(I?setTimeout(z):z())},onDidRemoveLastListener(){L&&L.dispose(),L=null}});return W&&W.add(K),K.event}e.buffer=C;function E(G,I){return(V,W,A)=>{let L=I(new R);return G(function(z){let K=L.evaluate(z);K!==M&&V.call(W,K)},void 0,A)}}e.chain=E;let M=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(V=>(I(V),V)),this}filter(I){return this.steps.push(V=>I(V)?V:M),this}reduce(I,V){let W=V;return this.steps.push(A=>(W=I(W,A),W)),this}latch(I=(V,W)=>V===W){let V=!0,W;return this.steps.push(A=>{let L=V||!I(A,W);return V=!1,W=A,L?A:M}),this}evaluate(I){for(let V of this.steps)if(I=V(I),I===M)break;return I}}function T(G,I,V=W=>W){let W=(...K)=>z.fire(V(...K)),A=()=>G.on(I,W),L=()=>G.removeListener(I,W),z=new se({onWillAddFirstListener:A,onDidRemoveLastListener:L});return z.event}e.fromNodeEventEmitter=T;function N(G,I,V=W=>W){let W=(...K)=>z.fire(V(...K)),A=()=>G.addEventListener(I,W),L=()=>G.removeEventListener(I,W),z=new se({onWillAddFirstListener:A,onDidRemoveLastListener:L});return z.event}e.fromDOMEventEmitter=N;function D(G){return new Promise(I=>s(G)(I))}e.toPromise=D;function j(G){let I=new se;return G.then(V=>{I.fire(V)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=j;function q(G,I){return G(V=>I.fire(V))}e.forward=q;function te(G,I,V){return I(V),G(W=>I(W))}e.runAndSubscribe=te;class re{constructor(I,V){this._observable=I,this._counter=0,this._hasChanged=!1;let W={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new se(W),V&&V.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,V){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function oe(G,I){return new re(G,I).emitter.event}e.fromObservable=oe;function Z(G){return(I,V,W)=>{let A=0,L=!1,z={beginUpdate(){A++},endUpdate(){A--,A===0&&(G.reportChanges(),L&&(L=!1,I.call(V)))},handlePossibleChange(){},handleChange(){L=!0}};G.addObserver(z),G.reportChanges();let K={dispose(){G.removeObserver(z)}};return W instanceof ms?W.add(K):Array.isArray(W)&&W.push(K),K}}e.fromObservableLight=Z})(jt||(jt={}));var kf=class Mf{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Mf._idPool++}`,Mf.all.add(this)}start(t){this._stopWatch=new HD,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};kf.all=new Set,kf._idPool=0;var PD=kf,UD=-1,ex=class tx{constructor(t,s,n=(tx._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=s,this.name=n,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,s){let n=this.threshold;if(n<=0||s<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[c,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(c);let m=new WD(h,c);this._errorHandler(m)}return()=>{let c=this._stacks.get(t.value)||0;this._stacks.set(t.value,c-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,s=0;for(let[n,a]of this._stacks)(!t||s<a)&&(t=[n,a],s=a);return t}};ex._idPool=1;var ID=ex,FD=class ix{constructor(t){this.value=t}static create(){let t=new Error;return new ix(t.stack??"")}print(){console.warn(this.value.split(`
|
|
440
|
+
`).slice(2).join(`
|
|
441
|
+
`))}},WD=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},qD=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},$D=0,Vd=class{constructor(e){this.value=e,this.id=$D++}},VD=2,KD,se=class{constructor(t){var s,n,a,c;this._size=0,this._options=t,this._leakageMon=(s=this._options)!=null&&s.leakWarningThreshold?new ID((t==null?void 0:t.onListenerError)??_c,((n=this._options)==null?void 0:n.leakWarningThreshold)??UD):void 0,this._perfMon=(a=this._options)!=null&&a._profName?new PD(this._options._profName):void 0,this._deliveryQueue=(c=this._options)==null?void 0:c.deliveryQueue}dispose(){var t,s,n,a;this._disposed||(this._disposed=!0,((t=this._deliveryQueue)==null?void 0:t.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(s=this._options)==null?void 0:s.onDidRemoveLastListener)==null||n.call(s),(a=this._leakageMon)==null||a.dispose())}get event(){return this._event??(this._event=(t,s,n)=>{var h,m,p,y,v;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let b=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(b);let x=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],w=new qD(`${b}. HINT: Stack shows most frequent listener (${x[1]}-times)`,x[0]);return(((h=this._options)==null?void 0:h.onListenerError)||_c)(w),ke.None}if(this._disposed)return ke.None;s&&(t=t.bind(s));let a=new Vd(t),c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=FD.create(),c=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof Vd?(this._deliveryQueue??(this._deliveryQueue=new YD),this._listeners=[this._listeners,a]):this._listeners.push(a):((p=(m=this._options)==null?void 0:m.onWillAddFirstListener)==null||p.call(m,this),this._listeners=a,(v=(y=this._options)==null?void 0:y.onDidAddFirstListener)==null||v.call(y,this)),this._size++;let u=it(()=>{c==null||c(),this._removeListener(a)});return n instanceof ms?n.add(u):Array.isArray(n)&&n.push(u),u}),this._event}_removeListener(t){var c,u,h,m;if((u=(c=this._options)==null?void 0:c.onWillRemoveListener)==null||u.call(c,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(m=(h=this._options)==null?void 0:h.onDidRemoveLastListener)==null||m.call(h,this),this._size=0;return}let s=this._listeners,n=s.indexOf(t);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[n]=void 0;let a=this._deliveryQueue.current===this;if(this._size*VD<=s.length){let p=0;for(let y=0;y<s.length;y++)s[y]?s[p++]=s[y]:a&&(this._deliveryQueue.end--,p<this._deliveryQueue.i&&this._deliveryQueue.i--);s.length=p}}_deliver(t,s){var a;if(!t)return;let n=((a=this._options)==null?void 0:a.onListenerError)||_c;if(!n){t.value(s);return}try{t.value(s)}catch(c){n(c)}}_deliverQueue(t){let s=t.current._listeners;for(;t.i<t.end;)this._deliver(s[t.i++],t.value);t.reset()}fire(t){var s,n,a,c;if((s=this._deliveryQueue)!=null&&s.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(a=this._perfMon)==null||a.start(this._size),this._listeners)if(this._listeners instanceof Vd)this._deliver(this._listeners,t);else{let u=this._deliveryQueue;u.enqueue(this,t,this._listeners.length),this._deliverQueue(u)}(c=this._perfMon)==null||c.stop()}hasListeners(){return this._size>0}},YD=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,s){this.i=0,this.end=s,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Rf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new se,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new se,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,s){if(this.getZoomLevel(s)===t)return;let n=this.getWindowId(s);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,s){this.mapWindowIdToZoomFactor.set(this.getWindowId(s),t)}setFullscreen(t,s){if(this.isFullscreen(s)===t)return;let n=this.getWindowId(s);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Rf.INSTANCE=new Rf;var $m=Rf;function GD(e,t,s){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",s)}$m.INSTANCE.onDidChangeZoomLevel;function XD(e){return $m.INSTANCE.getZoomFactor(e)}$m.INSTANCE.onDidChangeFullscreen;var ao=typeof navigator=="object"?navigator.userAgent:"",Nf=ao.indexOf("Firefox")>=0,ZD=ao.indexOf("AppleWebKit")>=0,Vm=ao.indexOf("Chrome")>=0,QD=!Vm&&ao.indexOf("Safari")>=0;ao.indexOf("Electron/")>=0;ao.indexOf("Android")>=0;var Kd=!1;if(typeof kr.matchMedia=="function"){let e=kr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=kr.matchMedia("(display-mode: fullscreen)");Kd=e.matches,GD(kr,e,({matches:s})=>{Kd&&t.matches||(Kd=s)})}var Xn="en",Tf=!1,Af=!1,gc=!1,rx=!1,ac,vc=Xn,Z0=Xn,JD,Pi,Ks=globalThis,zt,Vy;typeof Ks.vscode<"u"&&typeof Ks.vscode.process<"u"?zt=Ks.vscode.process:typeof process<"u"&&typeof((Vy=process==null?void 0:process.versions)==null?void 0:Vy.node)=="string"&&(zt=process);var Ky,e3=typeof((Ky=zt==null?void 0:zt.versions)==null?void 0:Ky.electron)=="string",t3=e3&&(zt==null?void 0:zt.type)==="renderer",Yy;if(typeof zt=="object"){Tf=zt.platform==="win32",Af=zt.platform==="darwin",gc=zt.platform==="linux",gc&&zt.env.SNAP&&zt.env.SNAP_REVISION,zt.env.CI||zt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ac=Xn,vc=Xn;let e=zt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);ac=t.userLocale,Z0=t.osLocale,vc=t.resolvedLanguage||Xn,JD=(Yy=t.languagePack)==null?void 0:Yy.translationsConfigFile}catch{}rx=!0}else typeof navigator=="object"&&!t3?(Pi=navigator.userAgent,Tf=Pi.indexOf("Windows")>=0,Af=Pi.indexOf("Macintosh")>=0,(Pi.indexOf("Macintosh")>=0||Pi.indexOf("iPad")>=0||Pi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,gc=Pi.indexOf("Linux")>=0,(Pi==null?void 0:Pi.indexOf("Mobi"))>=0,vc=globalThis._VSCODE_NLS_LANGUAGE||Xn,ac=navigator.language.toLowerCase(),Z0=ac):console.error("Unable to resolve platform.");var sx=Tf,ir=Af,i3=gc,Q0=rx,rr=Pi,as=vc,r3;(e=>{function t(){return as}e.value=t;function s(){return as.length===2?as==="en":as.length>=3?as[0]==="e"&&as[1]==="n"&&as[2]==="-":!1}e.isDefaultVariant=s;function n(){return as==="en"}e.isDefault=n})(r3||(r3={}));var s3=typeof Ks.postMessage=="function"&&!Ks.importScripts;(()=>{if(s3){let e=[];Ks.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let n=0,a=e.length;n<a;n++){let c=e[n];if(c.id===s.data.vscodeScheduleAsyncWork){e.splice(n,1),c.callback();return}}});let t=0;return s=>{let n=++t;e.push({id:n,callback:s}),Ks.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var n3=!!(rr&&rr.indexOf("Chrome")>=0);rr&&rr.indexOf("Firefox")>=0;!n3&&rr&&rr.indexOf("Safari")>=0;rr&&rr.indexOf("Edg/")>=0;rr&&rr.indexOf("Android")>=0;var Yn=typeof navigator=="object"?navigator:{};Q0||document.queryCommandSupported&&document.queryCommandSupported("copy")||Yn&&Yn.clipboard&&Yn.clipboard.writeText,Q0||Yn&&Yn.clipboard&&Yn.clipboard.readText;var Km=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Yd=new Km,J0=new Km,ey=new Km,o3=new Array(230),nx;(e=>{function t(h){return Yd.keyCodeToStr(h)}e.toString=t;function s(h){return Yd.strToKeyCode(h)}e.fromString=s;function n(h){return J0.keyCodeToStr(h)}e.toUserSettingsUS=n;function a(h){return ey.keyCodeToStr(h)}e.toUserSettingsGeneral=a;function c(h){return J0.strToKeyCode(h)||ey.strToKeyCode(h)}e.fromUserSettings=c;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Yd.keyCodeToStr(h)}e.toElectronAccelerator=u})(nx||(nx={}));var a3=class ox{constructor(t,s,n,a,c){this.ctrlKey=t,this.shiftKey=s,this.altKey=n,this.metaKey=a,this.keyCode=c}equals(t){return t instanceof ox&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",s=this.shiftKey?"1":"0",n=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${s}${n}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new l3([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},l3=class{constructor(e){if(e.length===0)throw OD("chords");this.chords=e}getHashCode(){let e="";for(let t=0,s=this.chords.length;t<s;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function c3(e){if(e.charCode){let s=String.fromCharCode(e.charCode).toUpperCase();return nx.fromString(s)}let t=e.keyCode;if(t===3)return 7;if(Nf)switch(t){case 59:return 85;case 60:if(i3)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ir)return 57;break}else if(ZD&&(ir&&t===93||!ir&&t===92))return 57;return o3[t]||0}var u3=ir?256:2048,h3=512,d3=1024,f3=ir?2048:256,ty=class{constructor(e){var s;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(s=t.getModifierState)==null?void 0:s.call(t,"AltGraph"),this.keyCode=c3(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=u3),this.altKey&&(t|=h3),this.shiftKey&&(t|=d3),this.metaKey&&(t|=f3),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new a3(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},iy=new WeakMap;function m3(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,s=e.parent.location;if(t.origin!=="null"&&s.origin!=="null"&&t.origin!==s.origin)return null}catch{return null}return e.parent}var p3=class{static getSameOriginWindowChain(e){let t=iy.get(e);if(!t){t=[],iy.set(e,t);let s=e,n;do n=m3(s),n?t.push({window:new WeakRef(s),iframeElement:s.frameElement||null}):t.push({window:new WeakRef(s),iframeElement:null}),s=n;while(s)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let s=0,n=0,a=this.getSameOriginWindowChain(e);for(let c of a){let u=c.window.deref();if(s+=(u==null?void 0:u.scrollY)??0,n+=(u==null?void 0:u.scrollX)??0,u===t||!c.iframeElement)break;let h=c.iframeElement.getBoundingClientRect();s+=h.top,n+=h.left}return{top:s,left:n}}},lc=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let s=p3.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},ry=class{constructor(e,t=0,s=0){var a;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=s,this.deltaX=t;let n=!1;if(Vm){let c=navigator.userAgent.match(/Chrome\/(\d+)/);n=(c?parseInt(c[1]):123)<=122}if(e){let c=e,u=e,h=((a=e.view)==null?void 0:a.devicePixelRatio)||1;if(typeof c.wheelDeltaY<"u")n?this.deltaY=c.wheelDeltaY/(120*h):this.deltaY=c.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(e.type==="wheel"){let m=e;m.deltaMode===m.DOM_DELTA_LINE?Nf&&!ir?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof c.wheelDeltaX<"u")QD&&sx?this.deltaX=-(c.wheelDeltaX/120):n?this.deltaX=c.wheelDeltaX/(120*h):this.deltaX=c.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let m=e;m.deltaMode===m.DOM_DELTA_LINE?Nf&&!ir?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*h):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},ax=Object.freeze(function(e,t){let s=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(s)}}}),_3;(e=>{function t(s){return s===e.None||s===e.Cancelled||s instanceof g3?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:jt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ax})})(_3||(_3={}));var g3=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ax:(this._emitter||(this._emitter=new se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Ym=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new wf("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new wf("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},v3=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,s=globalThis){if(this.isDisposed)throw new wf("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=s.setInterval(()=>{e()},t);this.disposable=it(()=>{s.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},y3;(e=>{async function t(n){let a,c=await Promise.all(n.map(u=>u.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return c}e.settled=t;function s(n){return new Promise(async(a,c)=>{try{await n(a,c)}catch(u){c(u)}})}e.withAsyncBody=s})(y3||(y3={}));var sy=class Ni{static fromArray(t){return new Ni(s=>{s.emitMany(t)})}static fromPromise(t){return new Ni(async s=>{s.emitMany(await t)})}static fromPromises(t){return new Ni(async s=>{await Promise.all(t.map(async n=>s.emitOne(await n)))})}static merge(t){return new Ni(async s=>{await Promise.all(t.map(async n=>{for await(let a of n)s.emitOne(a)}))})}constructor(t,s){this._state=0,this._results=[],this._error=null,this._onReturn=s,this._onStateChanged=new se,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(n)),this.resolve()}catch(a){this.reject(a)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await jt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var s;return(s=this._onReturn)==null||s.call(this),{done:!0,value:void 0}}}}static map(t,s){return new Ni(async n=>{for await(let a of t)n.emitOne(s(a))})}map(t){return Ni.map(this,t)}static filter(t,s){return new Ni(async n=>{for await(let a of t)s(a)&&n.emitOne(a)})}filter(t){return Ni.filter(this,t)}static coalesce(t){return Ni.filter(t,s=>!!s)}coalesce(){return Ni.coalesce(this)}static async toPromise(t){let s=[];for await(let n of t)s.push(n);return s}toPromise(){return Ni.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};sy.EMPTY=sy.fromArray([]);var{getWindow:er,getWindowId:b3,onDidRegisterWindow:S3}=(function(){let e=new Map,t={window:kr,disposables:new ms};e.set(kr.vscodeWindowId,t);let s=new se,n=new se,a=new se;function c(u,h){return(typeof u=="number"?e.get(u):void 0)??(h?t:void 0)}return{onDidRegisterWindow:s.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:n.event,registerWindow(u){if(e.has(u.vscodeWindowId))return ke.None;let h=new ms,m={window:u,disposables:h.add(new ms)};return e.set(u.vscodeWindowId,m),h.add(it(()=>{e.delete(u.vscodeWindowId),n.fire(u)})),h.add(Se(u,Et.BEFORE_UNLOAD,()=>{a.fire(u)})),s.fire(m),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:c,getWindow(u){var p;let h=u;if((p=h==null?void 0:h.ownerDocument)!=null&&p.defaultView)return h.ownerDocument.defaultView.window;let m=u;return m!=null&&m.view?m.view.window:kr},getDocument(u){return er(u).document}}})(),x3=class{constructor(e,t,s,n){this._node=e,this._type=t,this._handler=s,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Se(e,t,s,n){return new x3(e,t,s,n)}var ny=function(e,t,s,n){return Se(e,t,s,n)},Gm,w3=class extends v3{constructor(e){super(),this.defaultTarget=e&&er(e)}cancelAndSet(e,t,s){return super.cancelAndSet(e,t,s??this.defaultTarget)}},oy=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){_c(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,s=new Map,n=new Map,a=c=>{s.set(c,!1);let u=e.get(c)??[];for(t.set(c,u),e.set(c,[]),n.set(c,!0);u.length>0;)u.sort(oy.sort),u.shift().execute();n.set(c,!1)};Gm=(c,u,h=0)=>{let m=b3(c),p=new oy(u,h),y=e.get(m);return y||(y=[],e.set(m,y)),y.push(p),s.get(m)||(s.set(m,!0),c.requestAnimationFrame(()=>a(m))),p}})();function C3(e){let t=e.getBoundingClientRect(),s=er(e);return{left:t.left+s.scrollX,top:t.top+s.scrollY,width:t.width,height:t.height}}var Et={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},E3=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=ei(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ei(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ei(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ei(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ei(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ei(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ei(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ei(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ei(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ei(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ei(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=ei(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=ei(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ei(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function ei(e){return typeof e=="number"?`${e}px`:e}function _a(e){return new E3(e)}var lx=class{constructor(){this._hooks=new ms,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let s=this._onStopCallback;this._onStopCallback=null,e&&s&&s(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,s,n,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=a;let c=e;try{e.setPointerCapture(t),this._hooks.add(it(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{c=er(e)}this._hooks.add(Se(c,Et.POINTER_MOVE,u=>{if(u.buttons!==s){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Se(c,Et.POINTER_UP,u=>this.stopMonitoring(!0)))}};function k3(e,t,s){let n=null,a=null;if(typeof s.value=="function"?(n="value",a=s.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof s.get=="function"&&(n="get",a=s.get),!a)throw new Error("not supported");let c=`$memoize$${t}`;s[n]=function(...u){return this.hasOwnProperty(c)||Object.defineProperty(this,c,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[c]}}var Zi;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Zi||(Zi={}));var ha=class Ht extends ke{constructor(){super(),this.dispatched=!1,this.targets=new X0,this.ignoreTargets=new X0,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(jt.runAndSubscribe(S3,({window:t,disposables:s})=>{s.add(Se(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),s.add(Se(t.document,"touchend",n=>this.onTouchEnd(t,n))),s.add(Se(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:kr,disposables:this._store}))}static addTarget(t){if(!Ht.isTouchDevice())return ke.None;Ht.INSTANCE||(Ht.INSTANCE=new Ht);let s=Ht.INSTANCE.targets.push(t);return it(s)}static ignoreTarget(t){if(!Ht.isTouchDevice())return ke.None;Ht.INSTANCE||(Ht.INSTANCE=new Ht);let s=Ht.INSTANCE.ignoreTargets.push(t);return it(s)}static isTouchDevice(){return"ontouchstart"in kr||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let s=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,a=t.targetTouches.length;n<a;n++){let c=t.targetTouches.item(n);this.activeTouches[c.identifier]={id:c.identifier,initialTarget:c.target,initialTimeStamp:s,initialPageX:c.pageX,initialPageY:c.pageY,rollingTimestamps:[s],rollingPageX:[c.pageX],rollingPageY:[c.pageY]};let u=this.newGestureEvent(Zi.Start,c.target);u.pageX=c.pageX,u.pageY=c.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,s){let n=Date.now(),a=Object.keys(this.activeTouches).length;for(let c=0,u=s.changedTouches.length;c<u;c++){let h=s.changedTouches.item(c);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let m=this.activeTouches[h.identifier],p=Date.now()-m.initialTimeStamp;if(p<Ht.HOLD_DELAY&&Math.abs(m.initialPageX-hi(m.rollingPageX))<30&&Math.abs(m.initialPageY-hi(m.rollingPageY))<30){let y=this.newGestureEvent(Zi.Tap,m.initialTarget);y.pageX=hi(m.rollingPageX),y.pageY=hi(m.rollingPageY),this.dispatchEvent(y)}else if(p>=Ht.HOLD_DELAY&&Math.abs(m.initialPageX-hi(m.rollingPageX))<30&&Math.abs(m.initialPageY-hi(m.rollingPageY))<30){let y=this.newGestureEvent(Zi.Contextmenu,m.initialTarget);y.pageX=hi(m.rollingPageX),y.pageY=hi(m.rollingPageY),this.dispatchEvent(y)}else if(a===1){let y=hi(m.rollingPageX),v=hi(m.rollingPageY),b=hi(m.rollingTimestamps)-m.rollingTimestamps[0],x=y-m.rollingPageX[0],w=v-m.rollingPageY[0],C=[...this.targets].filter(E=>m.initialTarget instanceof Node&&E.contains(m.initialTarget));this.inertia(t,C,n,Math.abs(x)/b,x>0?1:-1,y,Math.abs(w)/b,w>0?1:-1,v)}this.dispatchEvent(this.newGestureEvent(Zi.End,m.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,s){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=s,n.tapCount=0,n}dispatchEvent(t){if(t.type===Zi.Tap){let s=new Date().getTime(),n=0;s-this._lastSetTapCountTime>Ht.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=s,t.tapCount=n}else(t.type===Zi.Change||t.type===Zi.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let s=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let a=0,c=t.initialTarget;for(;c&&c!==n;)a++,c=c.parentElement;s.push([a,n])}s.sort((n,a)=>n[0]-a[0]);for(let[n,a]of s)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,s,n,a,c,u,h,m,p){this.handle=Gm(t,()=>{let y=Date.now(),v=y-n,b=0,x=0,w=!0;a+=Ht.SCROLL_FRICTION*v,h+=Ht.SCROLL_FRICTION*v,a>0&&(w=!1,b=c*a*v),h>0&&(w=!1,x=m*h*v);let C=this.newGestureEvent(Zi.Change);C.translationX=b,C.translationY=x,s.forEach(E=>E.dispatchEvent(C)),w||this.inertia(t,s,y,a,c,u+b,h,m,p+x)})}onTouchMove(t){let s=Date.now();for(let n=0,a=t.changedTouches.length;n<a;n++){let c=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("end of an UNKNOWN touch",c);continue}let u=this.activeTouches[c.identifier],h=this.newGestureEvent(Zi.Change,u.initialTarget);h.translationX=c.pageX-hi(u.rollingPageX),h.translationY=c.pageY-hi(u.rollingPageY),h.pageX=c.pageX,h.pageY=c.pageY,this.dispatchEvent(h),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(c.pageX),u.rollingPageY.push(c.pageY),u.rollingTimestamps.push(s)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};ha.SCROLL_FRICTION=-.005,ha.HOLD_DELAY=700,ha.CLEAR_TAP_COUNT_TIME=400,lt([k3],ha,"isTouchDevice",1);var M3=ha,Xm=class extends ke{onclick(e,t){this._register(Se(e,Et.CLICK,s=>t(new lc(er(e),s))))}onmousedown(e,t){this._register(Se(e,Et.MOUSE_DOWN,s=>t(new lc(er(e),s))))}onmouseover(e,t){this._register(Se(e,Et.MOUSE_OVER,s=>t(new lc(er(e),s))))}onmouseleave(e,t){this._register(Se(e,Et.MOUSE_LEAVE,s=>t(new lc(er(e),s))))}onkeydown(e,t){this._register(Se(e,Et.KEY_DOWN,s=>t(new ty(s))))}onkeyup(e,t){this._register(Se(e,Et.KEY_UP,s=>t(new ty(s))))}oninput(e,t){this._register(Se(e,Et.INPUT,t))}onblur(e,t){this._register(Se(e,Et.BLUR,t))}onfocus(e,t){this._register(Se(e,Et.FOCUS,t))}onchange(e,t){this._register(Se(e,Et.CHANGE,t))}ignoreGesture(e){return M3.ignoreTarget(e)}},ay=11,R3=class extends Xm{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=ay+"px",this.domNode.style.height=ay+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new lx),this._register(ny(this.bgDomNode,Et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(ny(this.domNode,Et.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new w3),this._pointerdownScheduleRepeatTimer=this._register(new Ym)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,er(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},N3=class Df{constructor(t,s,n,a,c,u,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(s=s|0,n=n|0,a=a|0,c=c|0,u=u|0,h=h|0),this.rawScrollLeft=a,this.rawScrollTop=h,s<0&&(s=0),a+s>n&&(a=n-s),a<0&&(a=0),c<0&&(c=0),h+c>u&&(h=u-c),h<0&&(h=0),this.width=s,this.scrollWidth=n,this.scrollLeft=a,this.height=c,this.scrollHeight=u,this.scrollTop=h}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,s){return new Df(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,s?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,s?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Df(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,s){let n=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,c=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,h=this.scrollHeight!==t.scrollHeight,m=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:s,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:a,scrollLeftChanged:c,heightChanged:u,scrollHeightChanged:h,scrollTopChanged:m}}},T3=class extends ke{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new N3(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;let s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let s=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===s.scrollLeft&&this._smoothScrolling.to.scrollTop===s.scrollTop)return;let n;t?n=new cy(this._smoothScrolling.from,s,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,s,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let s=this._state.withScrollPosition(e);this._smoothScrolling=cy.start(this._state,s,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let s=this._state;s.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(s,t)))}},ly=class{constructor(e,t,s){this.scrollLeft=e,this.scrollTop=t,this.isDone=s}};function Gd(e,t){let s=t-e;return function(n){return e+s*O3(n)}}function A3(e,t,s){return function(n){return n<s?e(n/s):t((n-s)/(1-s))}}var cy=class Of{constructor(t,s,n,a){this.from=t,this.to=s,this.duration=a,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,s,n){if(Math.abs(t-s)>2.5*n){let a,c;return t<s?(a=t+.75*n,c=s-.75*n):(a=t-.75*n,c=s+.75*n),A3(Gd(t,a),Gd(c,s),.33)}return Gd(t,s)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let s=(t-this.startTime)/this.duration;if(s<1){let n=this.scrollLeft(s),a=this.scrollTop(s);return new ly(n,a,!1)}return new ly(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,s,n){return Of.start(t,s,n)}static start(t,s,n){n=n+10;let a=Date.now()-10;return new Of(t,s,a,n)}};function D3(e){return Math.pow(e,3)}function O3(e){return 1-D3(1-e)}var L3=class extends ke{constructor(e,t,s){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=s,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Ym)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},z3=140,cx=class extends Xm{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new L3(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new lx),this._shouldRender=!0,this.domNode=_a(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Se(this.domNode.domNode,Et.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new R3(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,s,n){this.slider=_a(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof s=="number"&&this.slider.setWidth(s),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Se(this.slider.domNode,Et.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,s=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);s<=a&&a<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,s;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,s=e.offsetY;else{let a=C3(this.domNode.domNode);t=e.pageX-a.left,s=e.pageY-a.top}let n=this._pointerDownRelativePosition(t,s);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),s=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let c=this._sliderOrthogonalPointerPosition(a),u=Math.abs(c-s);if(sx&&u>z3){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let h=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(h))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},ux=class Lf{constructor(t,s,n,a,c,u){this._scrollbarSize=Math.round(s),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=c,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Lf(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let s=Math.round(t);return this._visibleSize!==s?(this._visibleSize=s,this._refreshComputedValues(),!0):!1}setScrollSize(t){let s=Math.round(t);return this._scrollSize!==s?(this._scrollSize=s,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let s=Math.round(t);return this._scrollPosition!==s?(this._scrollPosition=s,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,s,n,a,c){let u=Math.max(0,n-t),h=Math.max(0,u-2*s),m=a>0&&a>n;if(!m)return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let p=Math.round(Math.max(20,Math.floor(n*h/a))),y=(h-p)/(a-n),v=c*y;return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(p),computedSliderRatio:y,computedSliderPosition:Math.round(v)}}_refreshComputedValues(){let t=Lf._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize-this._computedSliderSize/2;return Math.round(s/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize,n=this._scrollPosition;return s<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let s=this._computedSliderPosition+t;return Math.round(s/this._computedSliderRatio)}},B3=class extends cx{constructor(e,t,s){let n=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new ux(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,a.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},j3=class extends cx{constructor(e,t,s){let n=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new ux(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,a.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},H3=500,uy=50,P3=class{constructor(e,t,s){this.timestamp=e,this.deltaX=t,this.deltaY=s,this.score=0}},zf=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,s=0,n=1,a=this._rear;do{let c=a===this._front?t:Math.pow(2,-n);if(t-=c,s+=this._memory[a].score*c,a===this._front)break;a=(this._capacity+a-1)%this._capacity,n++}while(!0);return s<=.5}acceptStandardWheelEvent(t){if(Vm){let s=er(t.browserEvent),n=XD(s);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,s,n){let a=null,c=new P3(t,s,n);this._front===-1&&this._rear===-1?(this._memory[0]=c,this._front=0,this._rear=0):(a=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=c),c.score=this._computeScore(c,a)}_computeScore(t,s){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),s){let a=Math.abs(t.deltaX),c=Math.abs(t.deltaY),u=Math.abs(s.deltaX),h=Math.abs(s.deltaY),m=Math.max(Math.min(a,u),1),p=Math.max(Math.min(c,h),1),y=Math.max(a,u),v=Math.max(c,h);y%m===0&&v%p===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};zf.INSTANCE=new zf;var U3=zf,I3=class extends Xm{constructor(e,t,s){super(),this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new se),this.onWillScroll=this._onWillScroll.event,this._options=W3(t),this._scrollable=s,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let n={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new j3(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new B3(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=_a(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=_a(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=_a(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new Ym),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Zs(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ir&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new ry(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Zs(this._mouseWheelToDispose),e)){let t=s=>{this._onMouseWheel(new ry(s))};this._mouseWheelToDispose.push(Se(this._listenOnDomNode,Et.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var a;if((a=e.browserEvent)!=null&&a.defaultPrevented)return;let t=U3.INSTANCE;t.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let c=e.deltaY*this._options.mouseWheelScrollSensitivity,u=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&u+c===0?u=c=0:Math.abs(c)>=Math.abs(u)?u=0:c=0),this._options.flipAxes&&([c,u]=[u,c]);let h=!ir&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||h)&&!u&&(u=c,c=0),e.browserEvent&&e.browserEvent.altKey&&(u=u*this._options.fastScrollSensitivity,c=c*this._options.fastScrollSensitivity);let m=this._scrollable.getFutureScrollPosition(),p={};if(c){let y=uy*c,v=m.scrollTop-(y<0?Math.floor(y):Math.ceil(y));this._verticalScrollbar.writeScrollPosition(p,v)}if(u){let y=uy*u,v=m.scrollLeft-(y<0?Math.floor(y):Math.ceil(y));this._horizontalScrollbar.writeScrollPosition(p,v)}p=this._scrollable.validateScrollPosition(p),(m.scrollLeft!==p.scrollLeft||m.scrollTop!==p.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(p):this._scrollable.setScrollPositionNow(p),s=!0)}let n=s;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,s=e.scrollLeft>0,n=s?" left":"",a=t?" top":"",c=s||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${c}${a}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),H3)}},F3=class extends I3{constructor(e,t,s){super(e,t,s)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function W3(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,ir&&(t.className+=" mac"),t}var Bf=class extends ke{constructor(e,t,s,n,a,c,u,h){super(),this._bufferService=s,this._optionsService=u,this._renderService=h,this._onRequestScrollLines=this._register(new se),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new T3({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:p=>Gm(n.window,p)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new F3(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},m)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(p=>{this._scrollableElement.updateOptions({handleMouseWheel:!(p&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(jt.runAndSubscribe(c.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=c.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(it(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(it(()=>this._styleElement.remove())),this._register(jt.runAndSubscribe(c.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${c.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${c.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${c.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
442
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(p=>this._handleScroll(p)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),s=t-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};Bf=lt([le(2,$t),le(3,Or),le(4,q1),le(5,oo),le(6,Vt),le(7,Lr)],Bf);var jf=class extends ke{constructor(e,t,s,n,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=s,this._decorationService=n,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(c=>this._removeDecoration(c))),this._register(it(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var n;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((n=e==null?void 0:e.options)==null?void 0:n.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let s=e.options.x??0;return s&&s>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(s)}}_refreshXPosition(e,t=e.element){if(!t)return;let s=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=s?`${s*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=s?`${s*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};jf=lt([le(1,$t),le(2,Or),le(3,Ba),le(4,Lr)],jf);var q3=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,s){return t>=e.startBufferLine-this._linePadding[s||"full"]&&t<=e.endBufferLine+this._linePadding[s||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Gi={full:0,left:0,center:0,right:0},ls={full:0,left:0,center:0,right:0},sa={full:0,left:0,center:0,right:0},zc=class extends ke{constructor(e,t,s,n,a,c,u,h){var p;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=s,this._decorationService=n,this._renderService=a,this._optionsService=c,this._themeService=u,this._coreBrowserService=h,this._colorZoneStore=new q3,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(p=this._viewportElement.parentElement)==null||p.insertBefore(this._canvas,this._viewportElement),this._register(it(()=>{var y;return(y=this._canvas)==null?void 0:y.remove()}));let m=this._canvas.getContext("2d");if(m)this._ctx=m;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);ls.full=this._canvas.width,ls.left=e,ls.center=t,ls.right=e,this._refreshDrawHeightConstants(),sa.full=1,sa.left=1,sa.center=1+ls.left,sa.right=1+ls.left+ls.center}_refreshDrawHeightConstants(){Gi.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Gi.left=t,Gi.center=t,Gi.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Gi.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Gi.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Gi.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Gi.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(sa[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Gi[e.position||"full"]/2),ls[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Gi[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};zc=lt([le(2,$t),le(3,Ba),le(4,Lr),le(5,Vt),le(6,oo),le(7,Or)],zc);var J;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
443
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(J||(J={}));var yc;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(yc||(yc={}));var hx;(e=>e.ST=`${J.ESC}\\`)(hx||(hx={}));var Hf=class{constructor(e,t,s,n,a,c){this._textarea=e,this._compositionView=t,this._bufferService=s,this._optionsService=n,this._coreService=a,this._renderService=c,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let s;t.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(t.start,this._compositionPosition.start):s=this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,s=t.replace(e,"");this._dataAlreadySent=s,t.length>e.length?this._coreService.triggerDataEvent(s,!0):t.length<e.length?this._coreService.triggerDataEvent(`${J.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let c=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Hf=lt([le(2,$t),le(3,Vt),le(4,rn),le(5,Lr)],Hf);var kt=0,Mt=0,Rt=0,at=0,hy={css:"#00000000",rgba:0},gt;(e=>{function t(a,c,u,h){return h!==void 0?`#${Ps(a)}${Ps(c)}${Ps(u)}${Ps(h)}`:`#${Ps(a)}${Ps(c)}${Ps(u)}`}e.toCss=t;function s(a,c,u,h=255){return(a<<24|c<<16|u<<8|h)>>>0}e.toRgba=s;function n(a,c,u,h){return{css:e.toCss(a,c,u,h),rgba:e.toRgba(a,c,u,h)}}e.toColor=n})(gt||(gt={}));var et;(e=>{function t(m,p){if(at=(p.rgba&255)/255,at===1)return{css:p.css,rgba:p.rgba};let y=p.rgba>>24&255,v=p.rgba>>16&255,b=p.rgba>>8&255,x=m.rgba>>24&255,w=m.rgba>>16&255,C=m.rgba>>8&255;kt=x+Math.round((y-x)*at),Mt=w+Math.round((v-w)*at),Rt=C+Math.round((b-C)*at);let E=gt.toCss(kt,Mt,Rt),M=gt.toRgba(kt,Mt,Rt);return{css:E,rgba:M}}e.blend=t;function s(m){return(m.rgba&255)===255}e.isOpaque=s;function n(m,p,y){let v=bc.ensureContrastRatio(m.rgba,p.rgba,y);if(v)return gt.toColor(v>>24&255,v>>16&255,v>>8&255)}e.ensureContrastRatio=n;function a(m){let p=(m.rgba|255)>>>0;return[kt,Mt,Rt]=bc.toChannels(p),{css:gt.toCss(kt,Mt,Rt),rgba:p}}e.opaque=a;function c(m,p){return at=Math.round(p*255),[kt,Mt,Rt]=bc.toChannels(m.rgba),{css:gt.toCss(kt,Mt,Rt,at),rgba:gt.toRgba(kt,Mt,Rt,at)}}e.opacity=c;function u(m,p){return at=m.rgba&255,c(m,at*p/255)}e.multiplyOpacity=u;function h(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=h})(et||(et={}));var st;(e=>{let t,s;try{let a=document.createElement("canvas");a.width=1,a.height=1;let c=a.getContext("2d",{willReadFrequently:!0});c&&(t=c,t.globalCompositeOperation="copy",s=t.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return kt=parseInt(a.slice(1,2).repeat(2),16),Mt=parseInt(a.slice(2,3).repeat(2),16),Rt=parseInt(a.slice(3,4).repeat(2),16),gt.toColor(kt,Mt,Rt);case 5:return kt=parseInt(a.slice(1,2).repeat(2),16),Mt=parseInt(a.slice(2,3).repeat(2),16),Rt=parseInt(a.slice(3,4).repeat(2),16),at=parseInt(a.slice(4,5).repeat(2),16),gt.toColor(kt,Mt,Rt,at);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let c=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return kt=parseInt(c[1]),Mt=parseInt(c[2]),Rt=parseInt(c[3]),at=Math.round((c[5]===void 0?1:parseFloat(c[5]))*255),gt.toColor(kt,Mt,Rt,at);if(!t||!s)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=s,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[kt,Mt,Rt,at]=t.getImageData(0,0,1,1).data,at!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:gt.toRgba(kt,Mt,Rt,at),css:a}}e.toColor=n})(st||(st={}));var Ft;(e=>{function t(n){return s(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function s(n,a,c){let u=n/255,h=a/255,m=c/255,p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),y=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),v=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return p*.2126+y*.7152+v*.0722}e.relativeLuminance2=s})(Ft||(Ft={}));var bc;(e=>{function t(u,h){if(at=(h&255)/255,at===1)return h;let m=h>>24&255,p=h>>16&255,y=h>>8&255,v=u>>24&255,b=u>>16&255,x=u>>8&255;return kt=v+Math.round((m-v)*at),Mt=b+Math.round((p-b)*at),Rt=x+Math.round((y-x)*at),gt.toRgba(kt,Mt,Rt)}e.blend=t;function s(u,h,m){let p=Ft.relativeLuminance(u>>8),y=Ft.relativeLuminance(h>>8);if(Er(p,y)<m){if(y<p){let x=n(u,h,m),w=Er(p,Ft.relativeLuminance(x>>8));if(w<m){let C=a(u,h,m),E=Er(p,Ft.relativeLuminance(C>>8));return w>E?x:C}return x}let v=a(u,h,m),b=Er(p,Ft.relativeLuminance(v>>8));if(b<m){let x=n(u,h,m),w=Er(p,Ft.relativeLuminance(x>>8));return b>w?v:x}return v}}e.ensureContrastRatio=s;function n(u,h,m){let p=u>>24&255,y=u>>16&255,v=u>>8&255,b=h>>24&255,x=h>>16&255,w=h>>8&255,C=Er(Ft.relativeLuminance2(b,x,w),Ft.relativeLuminance2(p,y,v));for(;C<m&&(b>0||x>0||w>0);)b-=Math.max(0,Math.ceil(b*.1)),x-=Math.max(0,Math.ceil(x*.1)),w-=Math.max(0,Math.ceil(w*.1)),C=Er(Ft.relativeLuminance2(b,x,w),Ft.relativeLuminance2(p,y,v));return(b<<24|x<<16|w<<8|255)>>>0}e.reduceLuminance=n;function a(u,h,m){let p=u>>24&255,y=u>>16&255,v=u>>8&255,b=h>>24&255,x=h>>16&255,w=h>>8&255,C=Er(Ft.relativeLuminance2(b,x,w),Ft.relativeLuminance2(p,y,v));for(;C<m&&(b<255||x<255||w<255);)b=Math.min(255,b+Math.ceil((255-b)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),C=Er(Ft.relativeLuminance2(b,x,w),Ft.relativeLuminance2(p,y,v));return(b<<24|x<<16|w<<8|255)>>>0}e.increaseLuminance=a;function c(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=c})(bc||(bc={}));function Ps(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Er(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var $3=class extends za{constructor(e,t,s){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=s}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Bc=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Di}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let s=[],n=t.translateToString(!0),a=0,c=0,u=0,h=t.getFg(0),m=t.getBg(0);for(let p=0;p<t.getTrimmedLength();p++)if(t.loadCell(p,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==m){if(p-a>1){let y=this._getJoinedRanges(n,u,c,t,a);for(let v=0;v<y.length;v++)s.push(y[v])}a=p,u=c,h=this._workCell.fg,m=this._workCell.bg}c+=this._workCell.getChars().length||ds.length}if(this._bufferService.cols-a>1){let p=this._getJoinedRanges(n,u,c,t,a);for(let y=0;y<p.length;y++)s.push(p[y])}return s}_getJoinedRanges(e,t,s,n,a){let c=e.substring(t,s),u=[];try{u=this._characterJoiners[0].handler(c)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let m=this._characterJoiners[h].handler(c);for(let p=0;p<m.length;p++)Bc._mergeRanges(u,m[p])}catch(m){console.error(m)}return this._stringRangesToCellRanges(u,n,a),u}_stringRangesToCellRanges(e,t,s){let n=0,a=!1,c=0,u=e[n];if(u){for(let h=s;h<this._bufferService.cols;h++){let m=t.getWidth(h),p=t.getString(h).length||ds.length;if(m!==0){if(!a&&u[0]<=c&&(u[0]=h,a=!0),u[1]<=c){if(u[1]=h,u=e[++n],!u)break;u[0]<=c?(u[0]=h,a=!0):a=!1}c+=p}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let s=!1;for(let n=0;n<e.length;n++){let a=e[n];if(s){if(t[1]<=a[0])return e[n-1][1]=t[1],e;if(t[1]<=a[1])return e[n-1][1]=Math.max(t[1],a[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=a[0])return e.splice(n,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),s=!0);continue}}return s?e[e.length-1][1]=t[1]:e.push(t),e}};Bc=lt([le(0,$t)],Bc);function V3(e){return 57508<=e&&e<=57558}function K3(e){return 9472<=e&&e<=9631}function Y3(e){return V3(e)||K3(e)}function G3(){return{css:{canvas:cc(),cell:cc()},device:{canvas:cc(),cell:cc(),char:{width:0,height:0,left:0,top:0}}}}function cc(){return{width:0,height:0}}var Pf=class{constructor(e,t,s,n,a,c,u){this._document=e,this._characterJoinerService=t,this._optionsService=s,this._coreBrowserService=n,this._coreService=a,this._decorationService=c,this._themeService=u,this._workCell=new Di,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,s){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=s}createRow(e,t,s,n,a,c,u,h,m,p,y){let v=[],b=this._characterJoinerService.getJoinedCharacters(t),x=this._themeService.colors,w=e.getNoBgTrimmedLength();s&&w<c+1&&(w=c+1);let C,E=0,M="",R=0,T=0,N=0,D=0,j=!1,q=0,te=!1,re=0,oe=0,Z=[],G=p!==-1&&y!==-1;for(let I=0;I<w;I++){e.loadCell(I,this._workCell);let V=this._workCell.getWidth();if(V===0)continue;let W=!1,A=I>=oe,L=I,z=this._workCell;if(b.length>0&&I===b[0][0]&&A){let be=b.shift(),ze=this._isCellInSelection(be[0],t);for(R=be[0]+1;R<be[1];R++)A&&(A=ze===this._isCellInSelection(R,t));A&&(A=!s||c<be[0]||c>=be[1]),A?(W=!0,z=new $3(this._workCell,e.translateToString(!0,be[0],be[1]),be[1]-be[0]),L=be[1]-1,V=z.getWidth()):oe=be[1]}let K=this._isCellInSelection(I,t),ee=s&&I===c,he=G&&I>=p&&I<=y,ne=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,be=>{ne=!0});let ae=z.getChars()||ds;if(ae===" "&&(z.isUnderline()||z.isOverline())&&(ae=" "),re=V*h-m.get(ae,z.isBold(),z.isItalic()),!C)C=this._document.createElement("span");else if(E&&(K&&te||!K&&!te&&z.bg===T)&&(K&&te&&x.selectionForeground||z.fg===N)&&z.extended.ext===D&&he===j&&re===q&&!ee&&!W&&!ne&&A){z.isInvisible()?M+=ds:M+=ae,E++;continue}else E&&(C.textContent=M),C=this._document.createElement("span"),E=0,M="";if(T=z.bg,N=z.fg,D=z.extended.ext,j=he,q=re,te=K,W&&c>=I&&c<=L&&(c=I),!this._coreService.isCursorHidden&&ee&&this._coreService.isCursorInitialized){if(Z.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&Z.push("xterm-cursor-blink"),Z.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":Z.push("xterm-cursor-outline");break;case"block":Z.push("xterm-cursor-block");break;case"bar":Z.push("xterm-cursor-bar");break;case"underline":Z.push("xterm-cursor-underline");break}}if(z.isBold()&&Z.push("xterm-bold"),z.isItalic()&&Z.push("xterm-italic"),z.isDim()&&Z.push("xterm-dim"),z.isInvisible()?M=ds:M=z.getChars()||ds,z.isUnderline()&&(Z.push(`xterm-underline-${z.extended.underlineStyle}`),M===" "&&(M=" "),!z.isUnderlineColorDefault()))if(z.isUnderlineColorRGB())C.style.textDecorationColor=`rgb(${za.toColorRGB(z.getUnderlineColor()).join(",")})`;else{let be=z.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&z.isBold()&&be<8&&(be+=8),C.style.textDecorationColor=x.ansi[be].css}z.isOverline()&&(Z.push("xterm-overline"),M===" "&&(M=" ")),z.isStrikethrough()&&Z.push("xterm-strikethrough"),he&&(C.style.textDecoration="underline");let ie=z.getFgColor(),me=z.getFgColorMode(),ve=z.getBgColor(),Ne=z.getBgColorMode(),Ue=!!z.isInverse();if(Ue){let be=ie;ie=ve,ve=be;let ze=me;me=Ne,Ne=ze}let xe,ce,Te=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,be=>{be.options.layer!=="top"&&Te||(be.backgroundColorRGB&&(Ne=50331648,ve=be.backgroundColorRGB.rgba>>8&16777215,xe=be.backgroundColorRGB),be.foregroundColorRGB&&(me=50331648,ie=be.foregroundColorRGB.rgba>>8&16777215,ce=be.foregroundColorRGB),Te=be.options.layer==="top")}),!Te&&K&&(xe=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,ve=xe.rgba>>8&16777215,Ne=50331648,Te=!0,x.selectionForeground&&(me=50331648,ie=x.selectionForeground.rgba>>8&16777215,ce=x.selectionForeground)),Te&&Z.push("xterm-decoration-top");let Ge;switch(Ne){case 16777216:case 33554432:Ge=x.ansi[ve],Z.push(`xterm-bg-${ve}`);break;case 50331648:Ge=gt.toColor(ve>>16,ve>>8&255,ve&255),this._addStyle(C,`background-color:#${dy((ve>>>0).toString(16),"0",6)}`);break;case 0:default:Ue?(Ge=x.foreground,Z.push("xterm-bg-257")):Ge=x.background}switch(xe||z.isDim()&&(xe=et.multiplyOpacity(Ge,.5)),me){case 16777216:case 33554432:z.isBold()&&ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ie+=8),this._applyMinimumContrast(C,Ge,x.ansi[ie],z,xe,void 0)||Z.push(`xterm-fg-${ie}`);break;case 50331648:let be=gt.toColor(ie>>16&255,ie>>8&255,ie&255);this._applyMinimumContrast(C,Ge,be,z,xe,ce)||this._addStyle(C,`color:#${dy(ie.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(C,Ge,x.foreground,z,xe,ce)||Ue&&Z.push("xterm-fg-257")}Z.length&&(C.className=Z.join(" "),Z.length=0),!ee&&!W&&!ne&&A?E++:C.textContent=M,re!==this.defaultSpacing&&(C.style.letterSpacing=`${re}px`),v.push(C),I=L}return C&&E&&(C.textContent=M),v}_applyMinimumContrast(e,t,s,n,a,c){if(this._optionsService.rawOptions.minimumContrastRatio===1||Y3(n.getCode()))return!1;let u=this._getContrastCache(n),h;if(!a&&!c&&(h=u.getColor(t.rgba,s.rgba)),h===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);h=et.ensureContrastRatio(a||t,c||s,m),u.setColor((a||t).rgba,(c||s).rgba,h??null)}return h?(this._addStyle(e,`color:${h.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let s=this._selectionStart,n=this._selectionEnd;return!s||!n?!1:this._columnSelectMode?s[0]<=n[0]?e>=s[0]&&t>=s[1]&&e<n[0]&&t<=n[1]:e<s[0]&&t>=s[1]&&e>=n[0]&&t<=n[1]:t>s[1]&&t<n[1]||s[1]===n[1]&&t===s[1]&&e>=s[0]&&e<n[0]||s[1]<n[1]&&t===n[1]&&e<n[0]||s[1]<n[1]&&t===s[1]&&e>=s[0]}};Pf=lt([le(1,K1),le(2,Vt),le(3,Or),le(4,rn),le(5,Ba),le(6,oo)],Pf);function dy(e,t,s){for(;e.length<s;)e=t+e;return e}var X3=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let s=e.createElement("span");s.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let c=e.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold",c.style.fontStyle="italic",this._measureElements=[s,n,a,c],this._container.appendChild(s),this._container.appendChild(n),this._container.appendChild(a),this._container.appendChild(c),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,s,n){e===this._font&&t===this._fontSize&&s===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=s,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${s}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${s}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,s){let n=0;if(!t&&!s&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let u=this._measure(e,0);return u>0&&(this._flat[n]=u),u}let a=e;t&&(a+="B"),s&&(a+="I");let c=this._holey.get(a);if(c===void 0){let u=0;t&&(u|=1),s&&(u|=2),c=this._measure(e,u),c>0&&this._holey.set(a,c)}return c}_measure(e,t){let s=this._measureElements[t];return s.textContent=e.repeat(32),s.offsetWidth/32}},Z3=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,s,n=!1){if(this.selectionStart=t,this.selectionEnd=s,!t||!s||t[0]===s[0]&&t[1]===s[1]){this.clear();return}let a=e.buffers.active.ydisp,c=t[1]-a,u=s[1]-a,h=Math.max(c,0),m=Math.min(u,e.rows-1);if(h>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=c,this.viewportEndRow=u,this.viewportCappedStartRow=h,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=s[0]}isCellSelected(e,t,s){return this.hasSelection?(s-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&s>=this.viewportCappedStartRow&&t<this.endCol&&s<=this.viewportCappedEndRow:t<this.startCol&&s>=this.viewportCappedStartRow&&t>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol):!1}};function Q3(){return new Z3}var Xd="xterm-dom-renderer-owner-",Ri="xterm-rows",uc="xterm-fg-",fy="xterm-bg-",na="xterm-focus",hc="xterm-selection",J3=1,Uf=class extends ke{constructor(e,t,s,n,a,c,u,h,m,p,y,v,b,x){super(),this._terminal=e,this._document=t,this._element=s,this._screenElement=n,this._viewportElement=a,this._helperContainer=c,this._linkifier2=u,this._charSizeService=m,this._optionsService=p,this._bufferService=y,this._coreService=v,this._coreBrowserService=b,this._themeService=x,this._terminalClass=J3++,this._rowElements=[],this._selectionRenderModel=Q3(),this.onRequestRedraw=this._register(new se).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Ri),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(hc),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=G3(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(w=>this._injectCss(w))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(Pf,document),this._element.classList.add(Xd+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(w=>this._handleLinkHover(w))),this._register(this._linkifier2.onHideLinkUnderline(w=>this._handleLinkLeave(w))),this._register(it(()=>{this._element.classList.remove(Xd+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new X3(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let s of this._rowElements)s.style.width=`${this.dimensions.css.canvas.width}px`,s.style.height=`${this.dimensions.css.cell.height}px`,s.style.lineHeight=`${this.dimensions.css.cell.height}px`,s.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Ri} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Ri} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Ri} .xterm-dim { color: ${et.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let s=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Ri}.${na} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Ri}.${na} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Ri}.${na} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${Ri} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Ri} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Ri} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Ri} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Ri} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${hc} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${hc} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${hc} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[c,u]of e.ansi.entries())t+=`${this._terminalSelector} .${uc}${c} { color: ${u.css}; }${this._terminalSelector} .${uc}${c}.xterm-dim { color: ${et.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${fy}${c} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${uc}257 { color: ${et.opaque(e.background).css}; }${this._terminalSelector} .${uc}257.xterm-dim { color: ${et.multiplyOpacity(et.opaque(e.background),.5).css}; }${this._terminalSelector} .${fy}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let s=this._rowElements.length;s<=t;s++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(na),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(na),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,s){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,s),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,s),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,c=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(s){let m=e[0]>t[0];h.appendChild(this._createSelectionElement(c,m?t[0]:e[0],m?e[0]:t[0],u-c+1))}else{let m=n===c?e[0]:0,p=c===a?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(c,m,p));let y=u-c-1;if(h.appendChild(this._createSelectionElement(c+1,0,this._bufferService.cols,y)),c!==u){let v=a===u?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(u,0,v))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,s,n=1){let a=this._document.createElement("div"),c=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(s-t);return c+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-c),a.style.height=`${n*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${c}px`,a.style.width=`${u}px`,a}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let s=this._bufferService.buffer,n=s.ybase+s.y,a=Math.min(s.x,this._bufferService.cols-1),c=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let p=m+s.ydisp,y=this._rowElements[m],v=s.lines.get(p);if(!y||!v)break;y.replaceChildren(...this._rowFactory.createRow(v,p,p===n,u,h,a,c,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Xd}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,s,n,a,c){s<0&&(e=0),n<0&&(t=0);let u=this._bufferService.rows-1;s=Math.max(Math.min(s,u),0),n=Math.max(Math.min(n,u),0),a=Math.min(a,this._bufferService.cols);let h=this._bufferService.buffer,m=h.ybase+h.y,p=Math.min(h.x,a-1),y=this._optionsService.rawOptions.cursorBlink,v=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=s;x<=n;++x){let w=x+h.ydisp,C=this._rowElements[x],E=h.lines.get(w);if(!C||!E)break;C.replaceChildren(...this._rowFactory.createRow(E,w,w===m,v,b,p,y,this.dimensions.css.cell.width,this._widthCache,c?x===s?e:0:-1,c?(x===n?t:a)-1:-1))}}};Uf=lt([le(7,Wm),le(8,su),le(9,Vt),le(10,$t),le(11,rn),le(12,Or),le(13,oo)],Uf);var If=class extends ke{constructor(e,t,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this._register(new se),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new t4(this._optionsService))}catch{this._measureStrategy=this._register(new e4(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};If=lt([le(2,Vt)],If);var dx=class extends ke{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},e4=class extends dx{constructor(e,t,s){super(),this._document=e,this._parentElement=t,this._optionsService=s,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},t4=class extends dx{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},i4=class extends ke{constructor(e,t,s){super(),this._textarea=e,this._window=t,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new r4(this._window)),this._onDprChange=this._register(new se),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new se),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(jt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Se(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Se(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},r4=class extends ke{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ro),this._onDprChange=this._register(new se),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(it(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Se(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},s4=class extends ke{constructor(){super(),this.linkProviders=[],this._register(it(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Zm(e,t,s){let n=s.getBoundingClientRect(),a=e.getComputedStyle(s),c=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-n.left-c,t.clientY-n.top-u]}function n4(e,t,s,n,a,c,u,h,m){if(!c)return;let p=Zm(e,t,s);if(p)return p[0]=Math.ceil((p[0]+(m?u/2:0))/u),p[1]=Math.ceil(p[1]/h),p[0]=Math.min(Math.max(p[0],1),n+(m?1:0)),p[1]=Math.min(Math.max(p[1],1),a),p}var Ff=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,s,n,a){return n4(window,e,t,s,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let s=Zm(window,e,t);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};Ff=lt([le(0,Lr),le(1,su)],Ff);var o4=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},fx={};_D(fx,{getSafariVersion:()=>l4,isChromeOS:()=>gx,isFirefox:()=>mx,isIpad:()=>c4,isIphone:()=>u4,isLegacyEdge:()=>a4,isLinux:()=>Qm,isMac:()=>jc,isNode:()=>nu,isSafari:()=>px,isWindows:()=>_x});var nu=typeof process<"u"&&"title"in process,ja=nu?"node":navigator.userAgent,Ha=nu?"node":navigator.platform,mx=ja.includes("Firefox"),a4=ja.includes("Edge"),px=/^((?!chrome|android).)*safari/i.test(ja);function l4(){if(!px)return 0;let e=ja.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var jc=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Ha),c4=Ha==="iPad",u4=Ha==="iPhone",_x=["Windows","Win16","Win32","WinCE"].includes(Ha),Qm=Ha.indexOf("Linux")>=0,gx=/\bCrOS\b/.test(ja),vx=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,s=0,n=e.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),s=Math.max(t,s),a=e.timeRemaining(),s*1.5>a){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=a}this.clear()}},h4=class extends vx{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},d4=class extends vx{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Hc=!nu&&"requestIdleCallback"in window?d4:h4,f4=class{constructor(){this._queue=new Hc}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Wf=class extends ke{constructor(e,t,s,n,a,c,u,h,m){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=n,this._coreService=a,this._coreBrowserService=h,this._renderer=this._register(new ro),this._pausedResizeTask=new f4,this._observerDisposable=this._register(new ro),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new se),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new se),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new se),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new se),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new o4((p,y)=>this._renderRows(p,y),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new m4(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(it(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>{var p;return(p=this._renderer.value)==null?void 0:p.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(c.onDecorationRegistered(()=>this._fullRefresh())),this._register(c.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(p=>this._registerIntersectionObserver(p,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let s=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});s.observe(t),this._observerDisposable.value=it(()=>s.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,s=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),s||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var s;return(s=this._renderer.value)==null?void 0:s.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,s){var n;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=s,(n=this._renderer.value)==null||n.handleSelectionChanged(e,t,s)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Wf=lt([le(2,Vt),le(3,su),le(4,rn),le(5,Ba),le(6,$t),le(7,Or),le(8,oo)],Wf);var m4=class{constructor(e,t,s){this._coreBrowserService=e,this._coreService=t,this._onTimeout=s,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function p4(e,t,s,n){let a=s.buffer.x,c=s.buffer.y;if(!s.buffer.hasScrollback)return v4(a,c,e,t,s,n)+ou(c,t,s,n)+y4(a,c,e,t,s,n);let u;if(c===t)return u=a>e?"D":"C",Ca(Math.abs(a-e),wa(u,n));u=c>t?"D":"C";let h=Math.abs(c-t),m=g4(c>t?e:a,s)+(h-1)*s.cols+1+_4(c>t?a:e);return Ca(m,wa(u,n))}function _4(e,t){return e-1}function g4(e,t){return t.cols-e}function v4(e,t,s,n,a,c){return ou(t,n,a,c).length===0?"":Ca(bx(e,t,e,t-Qs(t,a),!1,a).length,wa("D",c))}function ou(e,t,s,n){let a=e-Qs(e,s),c=t-Qs(t,s),u=Math.abs(a-c)-b4(e,t,s);return Ca(u,wa(yx(e,t),n))}function y4(e,t,s,n,a,c){let u;ou(t,n,a,c).length>0?u=n-Qs(n,a):u=t;let h=n,m=S4(e,t,s,n,a,c);return Ca(bx(e,u,s,h,m==="C",a).length,wa(m,c))}function b4(e,t,s){var u;let n=0,a=e-Qs(e,s),c=t-Qs(t,s);for(let h=0;h<Math.abs(a-c);h++){let m=yx(e,t)==="A"?-1:1;(u=s.buffer.lines.get(a+m*h))!=null&&u.isWrapped&&n++}return n}function Qs(e,t){let s=0,n=t.buffer.lines.get(e),a=n==null?void 0:n.isWrapped;for(;a&&e>=0&&e<t.rows;)s++,n=t.buffer.lines.get(--e),a=n==null?void 0:n.isWrapped;return s}function S4(e,t,s,n,a,c){let u;return ou(s,n,a,c).length>0?u=n-Qs(n,a):u=t,e<s&&u<=n||e>=s&&u<n?"C":"D"}function yx(e,t){return e>t?"A":"B"}function bx(e,t,s,n,a,c){let u=e,h=t,m="";for(;(u!==s||h!==n)&&h>=0&&h<c.buffer.lines.length;)u+=a?1:-1,a&&u>c.cols-1?(m+=c.buffer.translateBufferLineToString(h,!1,e,u),u=0,e=0,h++):!a&&u<0&&(m+=c.buffer.translateBufferLineToString(h,!1,0,e+1),u=c.cols-1,e=u,h--);return m+c.buffer.translateBufferLineToString(h,!1,e,u)}function wa(e,t){let s=t?"O":"[";return J.ESC+s+e}function Ca(e,t){e=Math.floor(e);let s="";for(let n=0;n<e;n++)s+=t;return s}var x4=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function my(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Zd=50,w4=15,C4=50,E4=500,k4=" ",M4=new RegExp(k4,"g"),qf=class extends ke{constructor(e,t,s,n,a,c,u,h,m){super(),this._element=e,this._screenElement=t,this._linkifier=s,this._bufferService=n,this._coreService=a,this._mouseService=c,this._optionsService=u,this._renderService=h,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Di,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new se),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new se),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new se),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new se),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=p=>this._handleMouseMove(p),this._mouseUpListener=p=>this._handleMouseUp(p),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(p=>this._handleTrim(p)),this._register(this._bufferService.buffers.onBufferActivate(p=>this._handleBufferActivate(p))),this.enable(),this._model=new x4(this._bufferService),this._activeSelectionMode=0,this._register(it(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(p=>{p.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let s=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],c=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let h=s.translateBufferLineToString(u,!0,a,c);n.push(h)}}else{let a=e[1]===t[1]?t[0]:void 0;n.push(s.translateBufferLineToString(e[1],!0,e[0],a));for(let c=e[1]+1;c<=t[1]-1;c++){let u=s.lines.get(c),h=s.translateBufferLineToString(c,!0);u!=null&&u.isWrapped?n[n.length-1]+=h:n.push(h)}if(e[1]!==t[1]){let c=s.lines.get(t[1]),u=s.translateBufferLineToString(t[1],!0,0,t[0]);c&&c.isWrapped?n[n.length-1]+=u:n.push(u)}}return n.map(a=>a.replace(M4," ")).join(_x?`\r
|
|
444
|
+
`:`
|
|
445
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Qm&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),s=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!s||!n||!t?!1:this._areCoordsInSelection(t,s,n)}isCellInSelection(e,t){let s=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!s||!n?!1:this._areCoordsInSelection([e,t],s,n)}_areCoordsInSelection(e,t,s){return e[1]>t[1]&&e[1]<s[1]||t[1]===s[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<s[0]||t[1]<s[1]&&e[1]===s[1]&&e[0]<s[0]||t[1]<s[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var a,c;let s=(c=(a=this._linkifier.currentLink)==null?void 0:a.link)==null?void 0:c.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=my(s,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Zm(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=s?0:(t>s&&(t-=s),t=Math.min(Math.max(t,-Zd),Zd),t/=Zd,t/Math.abs(t)+Math.round(t*(w4-1)))}shouldForceSelection(e){return jc?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),C4)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(jc&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let s=this._bufferService.buffer;if(this._model.selectionEnd[1]<s.lines.length){let n=s.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<E4&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let s=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(s&&s[0]!==void 0&&s[1]!==void 0){let n=p4(s[0]-1,s[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,s=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!s){this._oldHasSelection&&this._fireOnSelectionChange(e,t,s);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,s)}_fireOnSelectionChange(e,t,s){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=s,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let s=t;for(let n=0;t>=n;n++){let a=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:a>1&&t!==n&&(s+=a-1)}return s}setSelection(e,t,s){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=s,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,s=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,c=a.lines.get(e[1]);if(!c)return;let u=a.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(c,e[0]),m=h,p=e[0]-h,y=0,v=0,b=0,x=0;if(u.charAt(h)===" "){for(;h>0&&u.charAt(h-1)===" ";)h--;for(;m<u.length&&u.charAt(m+1)===" ";)m++}else{let E=e[0],M=e[0];c.getWidth(E)===0&&(y++,E--),c.getWidth(M)===2&&(v++,M++);let R=c.getString(M).length;for(R>1&&(x+=R-1,m+=R-1);E>0&&h>0&&!this._isCharWordSeparator(c.loadCell(E-1,this._workCell));){c.loadCell(E-1,this._workCell);let T=this._workCell.getChars().length;this._workCell.getWidth()===0?(y++,E--):T>1&&(b+=T-1,h-=T-1),h--,E--}for(;M<c.length&&m+1<u.length&&!this._isCharWordSeparator(c.loadCell(M+1,this._workCell));){c.loadCell(M+1,this._workCell);let T=this._workCell.getChars().length;this._workCell.getWidth()===2?(v++,M++):T>1&&(x+=T-1,m+=T-1),m++,M++}}m++;let w=h+p-y+b,C=Math.min(this._bufferService.cols,m-h+y+v-b-x);if(!(!t&&u.slice(h,m).trim()==="")){if(s&&w===0&&c.getCodePoint(0)!==32){let E=a.lines.get(e[1]-1);if(E&&c.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let M=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(M){let R=this._bufferService.cols-M.start;w-=R,C+=R}}}if(n&&w+C===this._bufferService.cols&&c.getCodePoint(this._bufferService.cols-1)!==32){let E=a.lines.get(e[1]+1);if(E!=null&&E.isWrapped&&E.getCodePoint(0)!==32){let M=this._getWordAt([0,e[1]+1],!1,!1,!0);M&&(C+=M.length)}}return{start:w,length:C}}}_selectWordAt(e,t){let s=this._getWordAt(e,t);if(s){for(;s.start<0;)s.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[s.start,e[1]],this._model.selectionStartLength=s.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let s=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,s--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,s++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,s]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),s={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=my(s,this._bufferService.cols)}};qf=lt([le(3,$t),le(4,rn),le(5,qm),le(6,Vt),le(7,Lr),le(8,Or)],qf);var py=class{constructor(){this._data={}}set(e,t,s){this._data[e]||(this._data[e]={}),this._data[e][t]=s}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},_y=class{constructor(){this._color=new py,this._css=new py}setCss(e,t,s){this._css.set(e,t,s)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,s){this._color.set(e,t,s)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},yt=Object.freeze((()=>{let e=[st.toColor("#2e3436"),st.toColor("#cc0000"),st.toColor("#4e9a06"),st.toColor("#c4a000"),st.toColor("#3465a4"),st.toColor("#75507b"),st.toColor("#06989a"),st.toColor("#d3d7cf"),st.toColor("#555753"),st.toColor("#ef2929"),st.toColor("#8ae234"),st.toColor("#fce94f"),st.toColor("#729fcf"),st.toColor("#ad7fa8"),st.toColor("#34e2e2"),st.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let s=0;s<216;s++){let n=t[s/36%6|0],a=t[s/6%6|0],c=t[s%6];e.push({css:gt.toCss(n,a,c),rgba:gt.toRgba(n,a,c)})}for(let s=0;s<24;s++){let n=8+s*10;e.push({css:gt.toCss(n,n,n),rgba:gt.toRgba(n,n,n)})}return e})()),Us=st.toColor("#ffffff"),da=st.toColor("#000000"),gy=st.toColor("#ffffff"),vy=da,oa={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},R4=Us,$f=class extends ke{constructor(e){super(),this._optionsService=e,this._contrastCache=new _y,this._halfContrastCache=new _y,this._onChangeColors=this._register(new se),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Us,background:da,cursor:gy,cursorAccent:vy,selectionForeground:void 0,selectionBackgroundTransparent:oa,selectionBackgroundOpaque:et.blend(da,oa),selectionInactiveBackgroundTransparent:oa,selectionInactiveBackgroundOpaque:et.blend(da,oa),scrollbarSliderBackground:et.opacity(Us,.2),scrollbarSliderHoverBackground:et.opacity(Us,.4),scrollbarSliderActiveBackground:et.opacity(Us,.5),overviewRulerBorder:Us,ansi:yt.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=Ve(e.foreground,Us),t.background=Ve(e.background,da),t.cursor=et.blend(t.background,Ve(e.cursor,gy)),t.cursorAccent=et.blend(t.background,Ve(e.cursorAccent,vy)),t.selectionBackgroundTransparent=Ve(e.selectionBackground,oa),t.selectionBackgroundOpaque=et.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ve(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=et.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ve(e.selectionForeground,hy):void 0,t.selectionForeground===hy&&(t.selectionForeground=void 0),et.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=et.opacity(t.selectionBackgroundTransparent,.3)),et.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=et.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ve(e.scrollbarSliderBackground,et.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ve(e.scrollbarSliderHoverBackground,et.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ve(e.scrollbarSliderActiveBackground,et.opacity(t.foreground,.5)),t.overviewRulerBorder=Ve(e.overviewRulerBorder,R4),t.ansi=yt.slice(),t.ansi[0]=Ve(e.black,yt[0]),t.ansi[1]=Ve(e.red,yt[1]),t.ansi[2]=Ve(e.green,yt[2]),t.ansi[3]=Ve(e.yellow,yt[3]),t.ansi[4]=Ve(e.blue,yt[4]),t.ansi[5]=Ve(e.magenta,yt[5]),t.ansi[6]=Ve(e.cyan,yt[6]),t.ansi[7]=Ve(e.white,yt[7]),t.ansi[8]=Ve(e.brightBlack,yt[8]),t.ansi[9]=Ve(e.brightRed,yt[9]),t.ansi[10]=Ve(e.brightGreen,yt[10]),t.ansi[11]=Ve(e.brightYellow,yt[11]),t.ansi[12]=Ve(e.brightBlue,yt[12]),t.ansi[13]=Ve(e.brightMagenta,yt[13]),t.ansi[14]=Ve(e.brightCyan,yt[14]),t.ansi[15]=Ve(e.brightWhite,yt[15]),e.extendedAnsi){let s=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<s;n++)t.ansi[n+16]=Ve(e.extendedAnsi[n],yt[n+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};$f=lt([le(0,Vt)],$f);function Ve(e,t){if(e!==void 0)try{return st.toColor(e)}catch{}return t}var N4=class{constructor(...e){this._entries=new Map;for(let[t,s]of e)this.set(t,s)}set(e,t){let s=this._entries.get(e);return this._entries.set(e,t),s}forEach(e){for(let[t,s]of this._entries.entries())e(t,s)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},T4=class{constructor(){this._services=new N4,this._services.set(Wm,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let s=wD(e).sort((c,u)=>c.index-u.index),n=[];for(let c of s){let u=this._services.get(c.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${c.id._id}.`);n.push(u)}let a=s.length>0?s[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},A4={trace:0,debug:1,info:2,warn:3,error:4,off:5},D4="xterm.js: ",Vf=class extends ke{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=A4[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":D4)+t,...s)}trace(e,...t){var s;this._logLevel<=0&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var s;this._logLevel<=1&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var s;this._logLevel<=2&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var s;this._logLevel<=3&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var s;this._logLevel<=4&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,e,t)}};Vf=lt([le(0,Vt)],Vf);var yy=class extends ke{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new se),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new se),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new se),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let s=0;s<Math.min(e,this.length);s++)t[s]=this._array[this._getCyclicIndex(s)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...s){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+s.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<s.length;n++)this._array[this._getCyclicIndex(e+n)]=s[n];if(s.length&&this.onInsertEmitter.fire({index:e,amount:s.length}),this._length+s.length>this._maxLength){let n=this._length+s.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=s.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,s){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+s<0)throw new Error("Cannot shift elements in list beyond index 0");if(s>0){for(let a=t-1;a>=0;a--)this.set(e+a+s,this.get(e+a));let n=e+t+s-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+s,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ee=3,_t=Object.freeze(new za),dc=0,Qd=2,fa=class Sx{constructor(t,s,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ee);let a=s||Di.fromCharData([0,U1,1,0]);for(let c=0;c<t;++c)this.setCell(c,a);this.length=t}get(t){let s=this._data[t*Ee+0],n=s&2097151;return[this._data[t*Ee+1],s&2097152?this._combined[t]:n?hs(n):"",s>>22,s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,s){this._data[t*Ee+1]=s[0],s[1].length>1?(this._combined[t]=s[1],this._data[t*Ee+0]=t|2097152|s[2]<<22):this._data[t*Ee+0]=s[1].charCodeAt(0)|s[2]<<22}getWidth(t){return this._data[t*Ee+0]>>22}hasWidth(t){return this._data[t*Ee+0]&12582912}getFg(t){return this._data[t*Ee+1]}getBg(t){return this._data[t*Ee+2]}hasContent(t){return this._data[t*Ee+0]&4194303}getCodePoint(t){let s=this._data[t*Ee+0];return s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s&2097151}isCombined(t){return this._data[t*Ee+0]&2097152}getString(t){let s=this._data[t*Ee+0];return s&2097152?this._combined[t]:s&2097151?hs(s&2097151):""}isProtected(t){return this._data[t*Ee+2]&536870912}loadCell(t,s){return dc=t*Ee,s.content=this._data[dc+0],s.fg=this._data[dc+1],s.bg=this._data[dc+2],s.content&2097152&&(s.combinedData=this._combined[t]),s.bg&268435456&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){s.content&2097152&&(this._combined[t]=s.combinedData),s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Ee+0]=s.content,this._data[t*Ee+1]=s.fg,this._data[t*Ee+2]=s.bg}setCellFromCodepoint(t,s,n,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ee+0]=s|n<<22,this._data[t*Ee+1]=a.fg,this._data[t*Ee+2]=a.bg}addCodepointToCell(t,s,n){let a=this._data[t*Ee+0];a&2097152?this._combined[t]+=hs(s):a&2097151?(this._combined[t]=hs(a&2097151)+hs(s),a&=-2097152,a|=2097152):a=s|1<<22,n&&(a&=-12582913,a|=n<<22),this._data[t*Ee+0]=a}insertCells(t,s,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),s<this.length-t){let a=new Di;for(let c=this.length-t-s-1;c>=0;--c)this.setCell(t+s+c,this.loadCell(t+c,a));for(let c=0;c<s;++c)this.setCell(t+c,n)}else for(let a=t;a<this.length;++a)this.setCell(a,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,s,n){if(t%=this.length,s<this.length-t){let a=new Di;for(let c=0;c<this.length-t-s;++c)this.setCell(t+c,this.loadCell(t+s+c,a));for(let c=this.length-s;c<this.length;++c)this.setCell(c,n)}else for(let a=t;a<this.length;++a)this.setCell(a,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,s,n,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,n);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,n);t<s&&t<this.length;)this.setCell(t++,n)}resize(t,s){if(t===this.length)return this._data.length*4*Qd<this._data.buffer.byteLength;let n=t*Ee;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let a=new Uint32Array(n);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,s)}else{this._data=this._data.subarray(0,n);let a=Object.keys(this._combined);for(let u=0;u<a.length;u++){let h=parseInt(a[u],10);h>=t&&delete this._combined[h]}let c=Object.keys(this._extendedAttrs);for(let u=0;u<c.length;u++){let h=parseInt(c[u],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,n*4*Qd<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Qd<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,s=!1){if(s){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(let s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){let t=new Sx(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let s in this._combined)t._combined[s]=this._combined[s];for(let s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ee+0]&4194303)return t+(this._data[t*Ee+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ee+0]&4194303||this._data[t*Ee+2]&50331648)return t+(this._data[t*Ee+0]>>22);return 0}copyCellsFrom(t,s,n,a,c){let u=t._data;if(c)for(let m=a-1;m>=0;m--){for(let p=0;p<Ee;p++)this._data[(n+m)*Ee+p]=u[(s+m)*Ee+p];u[(s+m)*Ee+2]&268435456&&(this._extendedAttrs[n+m]=t._extendedAttrs[s+m])}else for(let m=0;m<a;m++){for(let p=0;p<Ee;p++)this._data[(n+m)*Ee+p]=u[(s+m)*Ee+p];u[(s+m)*Ee+2]&268435456&&(this._extendedAttrs[n+m]=t._extendedAttrs[s+m])}let h=Object.keys(t._combined);for(let m=0;m<h.length;m++){let p=parseInt(h[m],10);p>=s&&(this._combined[p-s+n]=t._combined[p])}}translateToString(t,s,n,a){s=s??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),a&&(a.length=0);let c="";for(;s<n;){let u=this._data[s*Ee+0],h=u&2097151,m=u&2097152?this._combined[s]:h?hs(h):ds;if(c+=m,a)for(let p=0;p<m.length;++p)a.push(s);s+=u>>22||1}return a&&a.push(s),c}};function O4(e,t,s,n,a,c){let u=[];for(let h=0;h<e.length-1;h++){let m=h,p=e.get(++m);if(!p.isWrapped)continue;let y=[e.get(h)];for(;m<e.length&&p.isWrapped;)y.push(p),p=e.get(++m);if(!c&&n>=h&&n<m){h+=y.length-1;continue}let v=0,b=Ea(y,v,t),x=1,w=0;for(;x<y.length;){let E=Ea(y,x,t),M=E-w,R=s-b,T=Math.min(M,R);y[v].copyCellsFrom(y[x],w,b,T,!1),b+=T,b===s&&(v++,b=0),w+=T,w===E&&(x++,w=0),b===0&&v!==0&&y[v-1].getWidth(s-1)===2&&(y[v].copyCellsFrom(y[v-1],s-1,b++,1,!1),y[v-1].setCell(s-1,a))}y[v].replaceCells(b,s,a);let C=0;for(let E=y.length-1;E>0&&(E>v||y[E].getTrimmedLength()===0);E--)C++;C>0&&(u.push(h+y.length-C),u.push(C)),h+=y.length-1}return u}function L4(e,t){let s=[],n=0,a=t[n],c=0;for(let u=0;u<e.length;u++)if(a===u){let h=t[++n];e.onDeleteEmitter.fire({index:u-c,amount:h}),u+=h-1,c+=h,a=t[++n]}else s.push(u);return{layout:s,countRemoved:c}}function z4(e,t){let s=[];for(let n=0;n<t.length;n++)s.push(e.get(t[n]));for(let n=0;n<s.length;n++)e.set(n,s[n]);e.length=t.length}function B4(e,t,s){let n=[],a=e.map((m,p)=>Ea(e,p,t)).reduce((m,p)=>m+p),c=0,u=0,h=0;for(;h<a;){if(a-h<s){n.push(a-h);break}c+=s;let m=Ea(e,u,t);c>m&&(c-=m,u++);let p=e[u].getWidth(c-1)===2;p&&c--;let y=p?s-1:s;n.push(y),h+=y}return n}function Ea(e,t,s){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(s-1)&&e[t].getWidth(s-1)===1,a=e[t+1].getWidth(0)===2;return n&&a?s-1:s}var xx=class wx{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=wx._nextId++,this._onDispose=this.register(new se),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Zs(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};xx._nextId=1;var j4=xx,St={},Is=St.B;St[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};St.A={"#":"£"};St.B=void 0;St[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};St.C=St[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};St.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};St.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};St.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};St.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};St.E=St[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};St.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};St.H=St[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};St["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var by=4294967295,Sy=class{constructor(e,t,s){this._hasScrollback=e,this._optionsService=t,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_t.clone(),this.savedCharset=Is,this.markers=[],this._nullCell=Di.fromCharData([0,U1,1,0]),this._whitespaceCell=Di.fromCharData([0,ds,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Hc,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new yy(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Lc),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Lc),this._whitespaceCell}getBlankLine(e,t){return new fa(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>by?by:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=_t);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new yy(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let s=this.getNullCell(_t),n=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)n+=+this.lines.get(u).resize(e,s);let c=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new fa(e,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+c+1?(this.ybase--,c++,this.ydisp>0&&this.ydisp--):this.lines.push(new fa(e,s)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let u=this.lines.length-a;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),c&&(this.y+=c),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let c=0;c<this.lines.length;c++)n+=+this.lines.get(c).resize(e,s);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,n=O4(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(_t),s);if(n.length>0){let a=L4(this.lines,n);z4(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,s){let n=this.getNullCell(_t),a=s;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new fa(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)}_reflowSmaller(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(_t),a=[],c=0;for(let u=this.lines.length-1;u>=0;u--){let h=this.lines.get(u);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let m=[h];for(;h.isWrapped&&u>0;)h=this.lines.get(--u),m.unshift(h);if(!s){let T=this.ybase+this.y;if(T>=u&&T<u+m.length)continue}let p=m[m.length-1].getTrimmedLength(),y=B4(m,this._cols,e),v=y.length-m.length,b;this.ybase===0&&this.y!==this.lines.length-1?b=Math.max(0,this.y-this.lines.maxLength+v):b=Math.max(0,this.lines.length-this.lines.maxLength+v);let x=[];for(let T=0;T<v;T++){let N=this.getBlankLine(_t,!0);x.push(N)}x.length>0&&(a.push({start:u+m.length+c,newLines:x}),c+=x.length),m.push(...x);let w=y.length-1,C=y[w];C===0&&(w--,C=y[w]);let E=m.length-v-1,M=p;for(;E>=0;){let T=Math.min(M,C);if(m[w]===void 0)break;if(m[w].copyCellsFrom(m[E],M-T,C-T,T,!0),C-=T,C===0&&(w--,C=y[w]),M-=T,M===0){E--;let N=Math.max(E,0);M=Ea(m,N,this._cols)}}for(let T=0;T<m.length;T++)y[T]<e&&m[T].setCell(y[T],n);let R=v-b;for(;R-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+v,this.ybase+t-1)}if(a.length>0){let u=[],h=[];for(let C=0;C<this.lines.length;C++)h.push(this.lines.get(C));let m=this.lines.length,p=m-1,y=0,v=a[y];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c);let b=0;for(let C=Math.min(this.lines.maxLength-1,m+c-1);C>=0;C--)if(v&&v.start>p+b){for(let E=v.newLines.length-1;E>=0;E--)this.lines.set(C--,v.newLines[E]);C++,u.push({index:p+1,amount:v.newLines.length}),b+=v.newLines.length,v=a[++y]}else this.lines.set(C,h[p--]);let x=0;for(let C=u.length-1;C>=0;C--)u[C].index+=x,this.lines.onInsertEmitter.fire(u[C]),x+=u[C].amount;let w=Math.max(0,m+c-this.lines.maxLength);w>0&&this.lines.onTrimEmitter.fire(w)}}translateBufferLineToString(e,t,s=0,n){let a=this.lines.get(e);return a?a.translateToString(t,s,n):""}getWrappedRangeForLine(e){let t=e,s=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:t,last:s}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new j4(e);return this.markers.push(t),t.register(this.lines.onTrim(s=>{t.line-=s,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(s=>{t.line>=s.index&&(t.line+=s.amount)})),t.register(this.lines.onDelete(s=>{t.line>=s.index&&t.line<s.index+s.amount&&t.dispose(),t.line>s.index&&(t.line-=s.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},H4=class extends ke{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new se),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new Sy(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Sy(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Cx=2,Ex=1,Kf=class extends ke{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new se),this.onResize=this._onResize.event,this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Cx),this.rows=Math.max(e.rawOptions.rows||0,Ex),this.buffers=this._register(new H4(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let s=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:s,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let s=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=s.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let a=s.ybase+s.scrollTop,c=s.ybase+s.scrollBottom;if(s.scrollTop===0){let u=s.lines.isFull;c===s.lines.length-1?u?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(c+1,0,n.clone()),u?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{let u=c-a+1;s.lines.shiftElements(a+1,u-1,-1),s.lines.set(c,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,t){let s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);let n=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),n!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}};Kf=lt([le(0,Vt)],Kf);var Gn={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:jc,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},P4=["normal","bold","100","200","300","400","500","600","700","800","900"],U4=class extends ke{constructor(e){super(),this._onOptionChange=this._register(new se),this.onOptionChange=this._onOptionChange.event;let t={...Gn};for(let s in e)if(s in t)try{let n=e[s];t[s]=this._sanitizeAndValidateOption(s,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(it(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(s=>{s===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(s=>{e.indexOf(s)!==-1&&t()})}_setupOptions(){let e=s=>{if(!(s in Gn))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,n)=>{if(!(s in Gn))throw new Error(`No option with key "${s}"`);n=this._sanitizeAndValidateOption(s,n),this.rawOptions[s]!==n&&(this.rawOptions[s]=n,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let n={get:e.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Gn[e]),!I4(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Gn[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=P4.includes(t)?t:Gn[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function I4(e){return e==="block"||e==="underline"||e==="bar"}function ma(e,t=5){if(typeof e!="object")return e;let s=Array.isArray(e)?[]:{};for(let n in e)s[n]=t<=1?e[n]:e[n]&&ma(e[n],t-1);return s}var xy=Object.freeze({insertMode:!1}),wy=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Yf=class extends ke{constructor(e,t,s){super(),this._bufferService=e,this._logService=t,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new se),this.onData=this._onData.event,this._onUserInput=this._register(new se),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new se),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new se),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ma(xy),this.decPrivateModes=ma(wy)}reset(){this.modes=ma(xy),this.decPrivateModes=ma(wy)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let s=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&s.ybase!==s.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Yf=lt([le(0,$t),le(1,$1),le(2,Vt)],Yf);var Cy={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Jd(e,t){let s=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(s|=64,s|=e.action):(s|=e.button&3,e.button&4&&(s|=64),e.button&8&&(s|=128),e.action===32?s|=32:e.action===0&&!t&&(s|=3)),s}var ef=String.fromCharCode,Ey={DEFAULT:e=>{let t=[Jd(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${ef(t[0])}${ef(t[1])}${ef(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Jd(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Jd(e,!0)};${e.x};${e.y}${t}`}},Gf=class extends ke{constructor(e,t,s){super(),this._bufferService=e,this._coreService=t,this._optionsService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new se),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(Cy))this.addProtocol(n,Cy[n]);for(let n of Object.keys(Ey))this.addEncoding(n,Ey[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,s){if(e.deltaY===0||e.shiftKey||t===void 0||s===void 0)return 0;let n=t/s,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=n+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,s){if(s){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Gf=lt([le(0,$t),le(1,rn),le(2,Vt)],Gf);var tf=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],F4=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],bt;function W4(e,t){let s=0,n=t.length-1,a;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=s;)if(a=s+n>>1,e>t[a][1])s=a+1;else if(e<t[a][0])n=a-1;else return!0;return!1}var q4=class{constructor(){if(this.version="6",!bt){bt=new Uint8Array(65536),bt.fill(1),bt[0]=0,bt.fill(0,1,32),bt.fill(0,127,160),bt.fill(2,4352,4448),bt[9001]=2,bt[9002]=2,bt.fill(2,11904,42192),bt[12351]=1,bt.fill(2,44032,55204),bt.fill(2,63744,64256),bt.fill(2,65040,65050),bt.fill(2,65072,65136),bt.fill(2,65280,65377),bt.fill(2,65504,65511);for(let e=0;e<tf.length;++e)bt.fill(0,tf[e][0],tf[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?bt[e]:W4(e,F4)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let s=this.wcwidth(e),n=s===0&&t!==0;if(n){let a=$s.extractWidth(t);a===0?n=!1:a>s&&(s=a)}return $s.createPropertyValue(0,s,n)}},$s=class Sc{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new se,this.onChange=this._onChange.event;let t=new q4;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,s,n=!1){return(t&16777215)<<3|(s&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let s=0,n=0,a=t.length;for(let c=0;c<a;++c){let u=t.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=a)return s+this.wcwidth(u);let p=t.charCodeAt(c);56320<=p&&p<=57343?u=(u-55296)*1024+p-56320+65536:s+=this.wcwidth(p)}let h=this.charProperties(u,n),m=Sc.extractWidth(h);Sc.extractShouldJoin(h)&&(m-=Sc.extractWidth(n)),s+=m,n=h}return s}charProperties(t,s){return this._activeProvider.charProperties(t,s)}},$4=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function ky(e){var n;let t=(n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:n.get(e.cols-1),s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);s&&t&&(s.isWrapped=t[3]!==0&&t[3]!==32)}var aa=2147483647,V4=256,kx=class Xf{constructor(t=32,s=32){if(this.maxLength=t,this.maxSubParamsLength=s,s>V4)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(s),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let s=new Xf;if(!t.length)return s;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let a=t[n];if(Array.isArray(a))for(let c=0;c<a.length;++c)s.addSubParam(a[c]);else s.addParam(a)}return s}clone(){let t=new Xf(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let s=0;s<this.length;++s){t.push(this.params[s]);let n=this._subParamsIdx[s]>>8,a=this._subParamsIdx[s]&255;a-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,a))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>aa?aa:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>aa?aa:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let s=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-s>0?this._subParams.subarray(s,n):null}getSubParamsAll(){let t={};for(let s=0;s<this.length;++s){let n=this._subParamsIdx[s]>>8,a=this._subParamsIdx[s]&255;a-n>0&&(t[s]=this._subParams.slice(n,a))}return t}addDigit(t){let s;if(this._rejectDigits||!(s=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,a=n[s-1];n[s-1]=~a?Math.min(a*10+t,aa):t}},la=[],K4=class{constructor(){this._state=0,this._active=la,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let n=s.indexOf(t);n!==-1&&s.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=la}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=la,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||la,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,s){if(!this._active.length)this._handlerFb(this._id,"PUT",ru(e,t,s));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,s)}start(){this.reset(),this._state=1}put(e,t,s){if(this._state!==3){if(this._state===1)for(;t<s;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&s-t>0&&this._put(e,t,s)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let s=!1,n=this._active.length-1,a=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,s=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&s===!1){for(;n>=0&&(s=this._active[n].end(e),s!==!0);n--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,s;n--}for(;n>=0;n--)if(s=this._active[n].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,s}this._active=la,this._id=-1,this._state=0}}},di=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=ru(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(s=>(this._data="",this._hitLimit=!1,s));return this._data="",this._hitLimit=!1,t}},ca=[],Y4=class{constructor(){this._handlers=Object.create(null),this._active=ca,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ca}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let n=s.indexOf(t);n!==-1&&s.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=ca,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||ca,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(t)}put(e,t,s){if(!this._active.length)this._handlerFb(this._ident,"PUT",ru(e,t,s));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,s)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,n=this._active.length-1,a=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,s=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&s===!1){for(;n>=0&&(s=this._active[n].unhook(e),s!==!0);n--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,s;n--}for(;n>=0;n--)if(s=this._active[n].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,s}this._active=ca,this._ident=0}},pa=new kx;pa.addParam(0);var My=class{constructor(e){this._handler=e,this._data="",this._params=pa,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():pa,this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=ru(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(s=>(this._params=pa,this._data="",this._hitLimit=!1,s));return this._params=pa,this._data="",this._hitLimit=!1,t}},G4=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,s,n){this.table[t<<8|e]=s<<4|n}addMany(e,t,s,n){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=s<<4|n}},Ti=160,X4=(function(){let e=new G4(4095),t=Array.apply(null,Array(256)).map((h,m)=>m),s=(h,m)=>t.slice(h,m),n=s(32,127),a=s(0,24);a.push(25),a.push.apply(a,s(28,32));let c=s(0,14),u;e.setDefault(1,0),e.addMany(n,0,2,0);for(u in c)e.addMany([24,26,153,154],u,3,0),e.addMany(s(128,144),u,3,0),e.addMany(s(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(s(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(s(64,127),3,7,0),e.addMany(s(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(s(48,60),4,8,4),e.addMany(s(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(s(32,64),6,0,6),e.add(127,6,0,6),e.addMany(s(64,127),6,0,0),e.addMany(s(32,48),3,9,5),e.addMany(s(32,48),5,9,5),e.addMany(s(48,64),5,0,6),e.addMany(s(64,127),5,7,0),e.addMany(s(32,48),4,9,5),e.addMany(s(32,48),1,9,2),e.addMany(s(32,48),2,9,2),e.addMany(s(48,127),2,10,0),e.addMany(s(48,80),1,10,0),e.addMany(s(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(s(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(s(28,32),9,0,9),e.addMany(s(32,48),9,9,12),e.addMany(s(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(s(28,32),10,0,10),e.addMany(s(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(s(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(s(28,32),12,0,12),e.addMany(s(32,48),12,9,12),e.addMany(s(48,64),12,0,11),e.addMany(s(64,127),12,12,13),e.addMany(s(64,127),10,12,13),e.addMany(s(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ti,0,2,0),e.add(Ti,8,5,8),e.add(Ti,6,0,6),e.add(Ti,11,0,11),e.add(Ti,13,13,13),e})(),Z4=class extends ke{constructor(e=X4){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new kx,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,s,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,s)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(it(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new K4),this._dcsParser=this._register(new Y4),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=e.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let a=0;a<e.intermediates.length;++a){let c=e.intermediates.charCodeAt(a);if(32>c||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=c}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return s<<=8,s|=n,s}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);let n=this._escHandlers[s];return n.push(t),{dispose:()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);let n=this._csiHandlers[s];return n.push(t),{dispose:()=>{let a=n.indexOf(t);a!==-1&&n.splice(a,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,s,n,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=n,this._parseStack.chunkPos=a}parse(e,t,s){let n=0,a=0,c=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,c=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&m>-1){for(;m>=0&&(u=h[m](this._params),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 4:if(s===!1&&m>-1){for(;m>=0&&(u=h[m](),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(n!==24&&n!==26,s),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],u=this._oscParser.end(n!==24&&n!==26,s),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,c=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=c;h<t;++h){switch(n=e[h],a=this._transitions.table[this.currentState<<8|(n<160?n:Ti)],a>>4){case 2:for(let b=h+1;;++b){if(b>=t||(n=e[b])<32||n>126&&n<Ti){this._printHandler(e,h,b),h=b-1;break}if(++b>=t||(n=e[b])<32||n>126&&n<Ti){this._printHandler(e,h,b),h=b-1;break}if(++b>=t||(n=e[b])<32||n>126&&n<Ti){this._printHandler(e,h,b),h=b-1;break}if(++b>=t||(n=e[b])<32||n>126&&n<Ti){this._printHandler(e,h,b),h=b-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|n],p=m?m.length-1:-1;for(;p>=0&&(u=m[p](this._params),u!==!0);p--)if(u instanceof Promise)return this._preserveStack(3,m,p,a,h),u;p<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++h<t&&(n=e[h])>47&&n<60);h--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let y=this._escHandlers[this._collect<<8|n],v=y?y.length-1:-1;for(;v>=0&&(u=y[v](),u!==!0);v--)if(u instanceof Promise)return this._preserveStack(4,y,v,a,h),u;v<0&&this._escHandlerFb(this._collect<<8|n),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|n,this._params);break;case 13:for(let b=h+1;;++b)if(b>=t||(n=e[b])===24||n===26||n===27||n>127&&n<Ti){this._dcsParser.put(e,h,b),h=b-1;break}break;case 14:if(u=this._dcsParser.unhook(n!==24&&n!==26),u)return this._preserveStack(6,[],0,a,h),u;n===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let b=h+1;;b++)if(b>=t||(n=e[b])<32||n>127&&n<Ti){this._oscParser.put(e,h,b),h=b-1;break}break;case 6:if(u=this._oscParser.end(n!==24&&n!==26),u)return this._preserveStack(5,[],0,a,h),u;n===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},Q4=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,J4=/^[\da-f]+$/;function Ry(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let s=Q4.exec(t);if(s){let n=s[1]?15:s[4]?255:s[7]?4095:65535;return[Math.round(parseInt(s[1]||s[4]||s[7]||s[10],16)/n*255),Math.round(parseInt(s[2]||s[5]||s[8]||s[11],16)/n*255),Math.round(parseInt(s[3]||s[6]||s[9]||s[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),J4.exec(t)&&[3,6,9,12].includes(t.length))){let s=t.length/3,n=[0,0,0];for(let a=0;a<3;++a){let c=parseInt(t.slice(s*a,s*a+s),16);n[a]=s===1?c<<4:s===2?c:s===3?c>>4:c>>8}return n}}function rf(e,t){let s=e.toString(16),n=s.length<2?"0"+s:s;switch(t){case 4:return s[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function eO(e,t=16){let[s,n,a]=e;return`rgb:${rf(s,t)}/${rf(n,t)}/${rf(a,t)}`}var tO={"(":0,")":1,"*":2,"+":3,"-":1,".":2},cs=131072,Ny=10;function Ty(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Ay=5e3,Dy=0,iO=class extends ke{constructor(e,t,s,n,a,c,u,h,m=new Z4){super(),this._bufferService=e,this._charsetService=t,this._coreService=s,this._logService=n,this._optionsService=a,this._oscLinkService=c,this._coreMouseService=u,this._unicodeService=h,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new SD,this._utf8Decoder=new xD,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_t.clone(),this._eraseAttrDataInternal=_t.clone(),this._onRequestBell=this._register(new se),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new se),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new se),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new se),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new se),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new se),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new se),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new se),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new se),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new se),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new se),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new se),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new se),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Zf(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(p=>this._activeBuffer=p.activeBuffer)),this._parser.setCsiHandlerFallback((p,y)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(p),params:y.toArray()})}),this._parser.setEscHandlerFallback(p=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(p)})}),this._parser.setExecuteHandlerFallback(p=>{this._logService.debug("Unknown EXECUTE code: ",{code:p})}),this._parser.setOscHandlerFallback((p,y,v)=>{this._logService.debug("Unknown OSC code: ",{identifier:p,action:y,data:v})}),this._parser.setDcsHandlerFallback((p,y,v)=>{y==="HOOK"&&(v=v.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(p),action:y,payload:v})}),this._parser.setPrintHandler((p,y,v)=>this.print(p,y,v)),this._parser.registerCsiHandler({final:"@"},p=>this.insertChars(p)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},p=>this.scrollLeft(p)),this._parser.registerCsiHandler({final:"A"},p=>this.cursorUp(p)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},p=>this.scrollRight(p)),this._parser.registerCsiHandler({final:"B"},p=>this.cursorDown(p)),this._parser.registerCsiHandler({final:"C"},p=>this.cursorForward(p)),this._parser.registerCsiHandler({final:"D"},p=>this.cursorBackward(p)),this._parser.registerCsiHandler({final:"E"},p=>this.cursorNextLine(p)),this._parser.registerCsiHandler({final:"F"},p=>this.cursorPrecedingLine(p)),this._parser.registerCsiHandler({final:"G"},p=>this.cursorCharAbsolute(p)),this._parser.registerCsiHandler({final:"H"},p=>this.cursorPosition(p)),this._parser.registerCsiHandler({final:"I"},p=>this.cursorForwardTab(p)),this._parser.registerCsiHandler({final:"J"},p=>this.eraseInDisplay(p,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},p=>this.eraseInDisplay(p,!0)),this._parser.registerCsiHandler({final:"K"},p=>this.eraseInLine(p,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},p=>this.eraseInLine(p,!0)),this._parser.registerCsiHandler({final:"L"},p=>this.insertLines(p)),this._parser.registerCsiHandler({final:"M"},p=>this.deleteLines(p)),this._parser.registerCsiHandler({final:"P"},p=>this.deleteChars(p)),this._parser.registerCsiHandler({final:"S"},p=>this.scrollUp(p)),this._parser.registerCsiHandler({final:"T"},p=>this.scrollDown(p)),this._parser.registerCsiHandler({final:"X"},p=>this.eraseChars(p)),this._parser.registerCsiHandler({final:"Z"},p=>this.cursorBackwardTab(p)),this._parser.registerCsiHandler({final:"`"},p=>this.charPosAbsolute(p)),this._parser.registerCsiHandler({final:"a"},p=>this.hPositionRelative(p)),this._parser.registerCsiHandler({final:"b"},p=>this.repeatPrecedingCharacter(p)),this._parser.registerCsiHandler({final:"c"},p=>this.sendDeviceAttributesPrimary(p)),this._parser.registerCsiHandler({prefix:">",final:"c"},p=>this.sendDeviceAttributesSecondary(p)),this._parser.registerCsiHandler({final:"d"},p=>this.linePosAbsolute(p)),this._parser.registerCsiHandler({final:"e"},p=>this.vPositionRelative(p)),this._parser.registerCsiHandler({final:"f"},p=>this.hVPosition(p)),this._parser.registerCsiHandler({final:"g"},p=>this.tabClear(p)),this._parser.registerCsiHandler({final:"h"},p=>this.setMode(p)),this._parser.registerCsiHandler({prefix:"?",final:"h"},p=>this.setModePrivate(p)),this._parser.registerCsiHandler({final:"l"},p=>this.resetMode(p)),this._parser.registerCsiHandler({prefix:"?",final:"l"},p=>this.resetModePrivate(p)),this._parser.registerCsiHandler({final:"m"},p=>this.charAttributes(p)),this._parser.registerCsiHandler({final:"n"},p=>this.deviceStatus(p)),this._parser.registerCsiHandler({prefix:"?",final:"n"},p=>this.deviceStatusPrivate(p)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},p=>this.softReset(p)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},p=>this.setCursorStyle(p)),this._parser.registerCsiHandler({final:"r"},p=>this.setScrollRegion(p)),this._parser.registerCsiHandler({final:"s"},p=>this.saveCursor(p)),this._parser.registerCsiHandler({final:"t"},p=>this.windowOptions(p)),this._parser.registerCsiHandler({final:"u"},p=>this.restoreCursor(p)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},p=>this.insertColumns(p)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},p=>this.deleteColumns(p)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},p=>this.selectProtected(p)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},p=>this.requestMode(p,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},p=>this.requestMode(p,!1)),this._parser.setExecuteHandler(J.BEL,()=>this.bell()),this._parser.setExecuteHandler(J.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(J.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(J.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(J.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(J.BS,()=>this.backspace()),this._parser.setExecuteHandler(J.HT,()=>this.tab()),this._parser.setExecuteHandler(J.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(J.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(yc.IND,()=>this.index()),this._parser.setExecuteHandler(yc.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(yc.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new di(p=>(this.setTitle(p),this.setIconName(p),!0))),this._parser.registerOscHandler(1,new di(p=>this.setIconName(p))),this._parser.registerOscHandler(2,new di(p=>this.setTitle(p))),this._parser.registerOscHandler(4,new di(p=>this.setOrReportIndexedColor(p))),this._parser.registerOscHandler(8,new di(p=>this.setHyperlink(p))),this._parser.registerOscHandler(10,new di(p=>this.setOrReportFgColor(p))),this._parser.registerOscHandler(11,new di(p=>this.setOrReportBgColor(p))),this._parser.registerOscHandler(12,new di(p=>this.setOrReportCursorColor(p))),this._parser.registerOscHandler(104,new di(p=>this.restoreIndexedColor(p))),this._parser.registerOscHandler(110,new di(p=>this.restoreFgColor(p))),this._parser.registerOscHandler(111,new di(p=>this.restoreBgColor(p))),this._parser.registerOscHandler(112,new di(p=>this.restoreCursorColor(p))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let p in St)this._parser.registerEscHandler({intermediates:"(",final:p},()=>this.selectCharset("("+p)),this._parser.registerEscHandler({intermediates:")",final:p},()=>this.selectCharset(")"+p)),this._parser.registerEscHandler({intermediates:"*",final:p},()=>this.selectCharset("*"+p)),this._parser.registerEscHandler({intermediates:"+",final:p},()=>this.selectCharset("+"+p)),this._parser.registerEscHandler({intermediates:"-",final:p},()=>this.selectCharset("-"+p)),this._parser.registerEscHandler({intermediates:".",final:p},()=>this.selectCharset("."+p)),this._parser.registerEscHandler({intermediates:"/",final:p},()=>this.selectCharset("/"+p));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(p=>(this._logService.error("Parsing error: ",p),p)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new My((p,y)=>this.requestStatusString(p,y)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,s,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=s,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,s)=>setTimeout(()=>s("#SLOW_TIMEOUT"),Ay))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Ay} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let s,n=this._activeBuffer.x,a=this._activeBuffer.y,c=0,u=this._parseStack.paused;if(u){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(s),s;n=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>cs&&(c=this._parseStack.position+cs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,p=>String.fromCharCode(p)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(p=>p.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<cs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,cs))),u||this._dirtyRowTracker.clearRange(),e.length>cs)for(let p=c;p<e.length;p+=cs){let y=p+cs<e.length?p+cs:e.length,v=typeof e=="string"?this._stringDecoder.decode(e.substring(p,y),this._parseBuffer):this._utf8Decoder.decode(e.subarray(p,y),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,v))return this._preserveStack(n,a,v,p),this._logSlowResolvingAsync(s),s}else if(!u){let p=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,p))return this._preserveStack(n,a,p,0),this._logSlowResolvingAsync(s),s}(this._activeBuffer.x!==n||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),m=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);m<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(m,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(e,t,s){let n,a,c=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,p=this._coreService.modes.insertMode,y=this._curAttrData,v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&s-t>0&&v.getWidth(this._activeBuffer.x-1)===2&&v.setCellFromCodepoint(this._activeBuffer.x-1,0,1,y);let b=this._parser.precedingJoinState;for(let x=t;x<s;++x){if(n=e[x],n<127&&c){let M=c[String.fromCharCode(n)];M&&(n=M.charCodeAt(0))}let w=this._unicodeService.charProperties(n,b);a=$s.extractWidth(w);let C=$s.extractShouldJoin(w),E=C?$s.extractWidth(b):0;if(b=w,u&&this._onA11yChar.fire(hs(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-E>h){if(m){let M=v,R=this._activeBuffer.x-E;for(this._activeBuffer.x=E,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&v instanceof fa&&v.copyCellsFrom(M,R,0,E,!1);R<h;)M.setCellFromCodepoint(R++,0,1,y)}else if(this._activeBuffer.x=h-1,a===2)continue}if(C&&this._activeBuffer.x){let M=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-M,n,a);for(let R=a-E;--R>=0;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,y);continue}if(p&&(v.insertCells(this._activeBuffer.x,a-E,this._activeBuffer.getNullCell(y)),v.getWidth(h-1)===2&&v.setCellFromCodepoint(h-1,0,1,y)),v.setCellFromCodepoint(this._activeBuffer.x++,n,a,y),a>0)for(;--a;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,y)}this._parser.precedingJoinState=b,this._activeBuffer.x<h&&s-t>0&&v.getWidth(this._activeBuffer.x)===0&&!v.hasContent(this._activeBuffer.x)&&v.setCellFromCodepoint(this._activeBuffer.x,0,1,y),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,s=>Ty(s.params[0],this._optionsService.rawOptions.windowOptions)?t(s):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new My(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new di(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,s,n=!1,a=!1){let c=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);c.replaceCells(t,s,this._activeBuffer.getNullCell(this._eraseAttrData()),a),n&&(c.isWrapped=!1)}_resetBufferLine(e,t=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s&&(s.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),s.isWrapped=!1)}eraseInDisplay(e,t=!1){var n;this._restrictCursor(this._bufferService.cols);let s;switch(e.params[0]){case 0:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);s<this._bufferService.rows;s++)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(s);break;case 1:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(s+1).isWrapped=!1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(s=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,s-1);s--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s))!=null&&n.getTrimmedLength()););for(;s>=0;s--)this._bufferService.scroll(this._eraseAttrData())}else{for(s=this._bufferService.rows,this._dirtyRowTracker.markDirty(s-1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let a=this._activeBuffer.lines.length-this._bufferService.rows;a>0&&(this._activeBuffer.lines.trimStart(a),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-a,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-a,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(s,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(_t));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let s=e.params[0]||1,n=$s.extractWidth(t),a=this._activeBuffer.x-n,c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(c.length*s),h=0;for(let p=0;p<c.length;){let y=c.codePointAt(p)||0;u[h++]=y,p+=y>65535?2:1}let m=h;for(let p=1;p<s;++p)u.copyWithin(m,0,h),m+=h;return this.print(u,0,m),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(J.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(J.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(J.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(J.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(J.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Is),this._charsetService.setgCharset(1,Is),this._charsetService.setgCharset(2,Is),this._charsetService.setgCharset(3,Is);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(C=>(C[C.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",C[C.SET=1]="SET",C[C.RESET=2]="RESET",C[C.PERMANENTLY_SET=3]="PERMANENTLY_SET",C[C.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(s={}));let n=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:c}=this._coreMouseService,u=this._coreService,{buffers:h,cols:m}=this._bufferService,{active:p,alt:y}=h,v=this._optionsService.rawOptions,b=(C,E)=>(u.triggerDataEvent(`${J.ESC}[${t?"":"?"}${C};${E}$y`),!0),x=C=>C?1:2,w=e.params[0];return t?w===2?b(w,4):w===4?b(w,x(u.modes.insertMode)):w===12?b(w,3):w===20?b(w,x(v.convertEol)):b(w,0):w===1?b(w,x(n.applicationCursorKeys)):w===3?b(w,v.windowOptions.setWinLines?m===80?2:m===132?1:0:0):w===6?b(w,x(n.origin)):w===7?b(w,x(n.wraparound)):w===8?b(w,3):w===9?b(w,x(a==="X10")):w===12?b(w,x(v.cursorBlink)):w===25?b(w,x(!u.isCursorHidden)):w===45?b(w,x(n.reverseWraparound)):w===66?b(w,x(n.applicationKeypad)):w===67?b(w,4):w===1e3?b(w,x(a==="VT200")):w===1002?b(w,x(a==="DRAG")):w===1003?b(w,x(a==="ANY")):w===1004?b(w,x(n.sendFocus)):w===1005?b(w,4):w===1006?b(w,x(c==="SGR")):w===1015?b(w,4):w===1016?b(w,x(c==="SGR_PIXELS")):w===1048?b(w,1):w===47||w===1047||w===1049?b(w,x(p===y)):w===2004?b(w,x(n.bracketedPasteMode)):w===2026?b(w,x(n.synchronizedOutput)):b(w,0)}_updateAttrColor(e,t,s,n,a){return t===2?(e|=50331648,e&=-16777216,e|=za.fromColorRGB([s,n,a])):t===5&&(e&=-50331904,e|=33554432|s&255),e}_extractColor(e,t,s){let n=[0,0,-1,0,0,0],a=0,c=0;do{if(n[c+a]=e.params[t+c],e.hasSubParams(t+c)){let u=e.getSubParams(t+c),h=0;do n[1]===5&&(a=1),n[c+h+1+a]=u[h];while(++h<u.length&&h+c+1+a<n.length);break}if(n[1]===5&&c+a>=2||n[1]===2&&c+a>=5)break;n[1]&&(a=1)}while(++c+t<e.length&&c+a<n.length);for(let u=2;u<n.length;++u)n[u]===-1&&(n[u]=0);switch(n[0]){case 38:s.fg=this._updateAttrColor(s.fg,n[1],n[3],n[4],n[5]);break;case 48:s.bg=this._updateAttrColor(s.bg,n[1],n[3],n[4],n[5]);break;case 58:s.extended=s.extended.clone(),s.extended.underlineColor=this._updateAttrColor(s.extended.underlineColor,n[1],n[3],n[4],n[5])}return c}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=_t.fg,e.bg=_t.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,s,n=this._curAttrData;for(let a=0;a<t;a++)s=e.params[a],s>=30&&s<=37?(n.fg&=-50331904,n.fg|=16777216|s-30):s>=40&&s<=47?(n.bg&=-50331904,n.bg|=16777216|s-40):s>=90&&s<=97?(n.fg&=-50331904,n.fg|=16777216|s-90|8):s>=100&&s<=107?(n.bg&=-50331904,n.bg|=16777216|s-100|8):s===0?this._processSGR0(n):s===1?n.fg|=134217728:s===3?n.bg|=67108864:s===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,n)):s===5?n.fg|=536870912:s===7?n.fg|=67108864:s===8?n.fg|=1073741824:s===9?n.fg|=2147483648:s===2?n.bg|=134217728:s===21?this._processUnderline(2,n):s===22?(n.fg&=-134217729,n.bg&=-134217729):s===23?n.bg&=-67108865:s===24?(n.fg&=-268435457,this._processUnderline(0,n)):s===25?n.fg&=-536870913:s===27?n.fg&=-67108865:s===28?n.fg&=-1073741825:s===29?n.fg&=2147483647:s===39?(n.fg&=-67108864,n.fg|=_t.fg&16777215):s===49?(n.bg&=-67108864,n.bg|=_t.bg&16777215):s===38||s===48||s===58?a+=this._extractColor(e,a,n):s===53?n.bg|=1073741824:s===55?n.bg&=-1073741825:s===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):s===100?(n.fg&=-67108864,n.fg|=_t.fg&16777215,n.bg&=-67108864,n.bg|=_t.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",s);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${J.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${J.ESC}[${t};${s}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${J.ESC}[?${t};${s}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_t.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let s=t%2===1;this._coreService.decPrivateModes.cursorBlink=s}return!0}setScrollRegion(e){let t=e.params[0]||1,s;return(e.length<2||(s=e.params[1])>this._bufferService.rows||s===0)&&(s=this._bufferService.rows),s>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=s-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Ty(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${J.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Ny&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Ny&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],s=e.split(";");for(;s.length>1;){let n=s.shift(),a=s.shift();if(/^\d+$/.exec(n)){let c=parseInt(n);if(Oy(c))if(a==="?")t.push({type:0,index:c});else{let u=Ry(a);u&&t.push({type:1,index:c,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let s=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(s,n):s.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let s=e.split(":"),n,a=s.findIndex(c=>c.startsWith("id="));return a!==-1&&(n=s[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let s=e.split(";");for(let n=0;n<s.length&&!(t>=this._specialColors.length);++n,++t)if(s[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=Ry(s[n]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],s=e.split(";");for(let n=0;n<s.length;++n)if(/^\d+$/.exec(s[n])){let a=parseInt(s[n]);Oy(a)&&t.push({type:2,index:a})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Is),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(tO[e[0]],St[e[1]]||Is),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=_t.clone(),this._eraseAttrDataInternal=_t.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Di;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let s=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(s);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let s=u=>(this._coreService.triggerDataEvent(`${J.ESC}${u}${J.ESC}\\`),!0),n=this._bufferService.buffer,a=this._optionsService.rawOptions;return s(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Zf=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Dy=e,e=t,t=Dy),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Zf=lt([le(0,$t)],Zf);function Oy(e){return 0<=e&&e<256}var rO=5e7,Ly=12,sO=50,nO=class extends ke{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new se),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let s;for(;s=this._writeBuffer.shift();){this._action(s);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>rO)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let s=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],a=this._action(n,t);if(a){let u=h=>performance.now()-s>=Ly?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(s,h);a.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(u);return}let c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-s>=Ly)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>sO&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Qf=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let h=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(m,h)),this._dataByLinkId.set(m.id,m),m.id}let s=e,n=this._getEntryIdKey(s),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let c=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(s),data:s,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let s=this._dataByLinkId.get(e);if(s&&s.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);s.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(s,n))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let s=e.lines.indexOf(t);s!==-1&&(e.lines.splice(s,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Qf=lt([le(0,$t)],Qf);var zy=!1,oO=class extends ke{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ro),this._onBinary=this._register(new se),this.onBinary=this._onBinary.event,this._onData=this._register(new se),this.onData=this._onData.event,this._onLineFeed=this._register(new se),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new se),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new se),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new se),this._instantiationService=new T4,this.optionsService=this._register(new U4(e)),this._instantiationService.setService(Vt,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Kf)),this._instantiationService.setService($t,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Vf)),this._instantiationService.setService($1,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Yf)),this._instantiationService.setService(rn,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Gf)),this._instantiationService.setService(q1,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance($s)),this._instantiationService.setService(kD,this.unicodeService),this._charsetService=this._instantiationService.createInstance($4),this._instantiationService.setService(ED,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Qf),this._instantiationService.setService(V1,this._oscLinkService),this._inputHandler=this._register(new iO(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(jt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(jt.forward(this._bufferService.onResize,this._onResize)),this._register(jt.forward(this.coreService.onData,this._onData)),this._register(jt.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new nO((t,s)=>this._inputHandler.parse(t,s))),this._register(jt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new se),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!zy&&(this._logService.warn("writeSync is unreliable and will be removed soon."),zy=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Cx),t=Math.max(t,Ex),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(ky.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(ky(this._bufferService),!1))),this._windowsWrappingHeuristics.value=it(()=>{for(let t of e)t.dispose()})}}},aO={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function lO(e,t,s,n){var u;let a={type:0,cancel:!1,key:void 0},c=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?a.key=J.ESC+"OA":a.key=J.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=J.ESC+"OD":a.key=J.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=J.ESC+"OC":a.key=J.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=J.ESC+"OB":a.key=J.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":J.DEL,e.altKey&&(a.key=J.ESC+a.key);break;case 9:if(e.shiftKey){a.key=J.ESC+"[Z";break}a.key=J.HT,a.cancel=!0;break;case 13:a.key=e.altKey?J.ESC+J.CR:J.CR,a.cancel=!0;break;case 27:a.key=J.ESC,e.altKey&&(a.key=J.ESC+J.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;c?a.key=J.ESC+"[1;"+(c+1)+"D":t?a.key=J.ESC+"OD":a.key=J.ESC+"[D";break;case 39:if(e.metaKey)break;c?a.key=J.ESC+"[1;"+(c+1)+"C":t?a.key=J.ESC+"OC":a.key=J.ESC+"[C";break;case 38:if(e.metaKey)break;c?a.key=J.ESC+"[1;"+(c+1)+"A":t?a.key=J.ESC+"OA":a.key=J.ESC+"[A";break;case 40:if(e.metaKey)break;c?a.key=J.ESC+"[1;"+(c+1)+"B":t?a.key=J.ESC+"OB":a.key=J.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=J.ESC+"[2~");break;case 46:c?a.key=J.ESC+"[3;"+(c+1)+"~":a.key=J.ESC+"[3~";break;case 36:c?a.key=J.ESC+"[1;"+(c+1)+"H":t?a.key=J.ESC+"OH":a.key=J.ESC+"[H";break;case 35:c?a.key=J.ESC+"[1;"+(c+1)+"F":t?a.key=J.ESC+"OF":a.key=J.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=J.ESC+"[5;"+(c+1)+"~":a.key=J.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=J.ESC+"[6;"+(c+1)+"~":a.key=J.ESC+"[6~";break;case 112:c?a.key=J.ESC+"[1;"+(c+1)+"P":a.key=J.ESC+"OP";break;case 113:c?a.key=J.ESC+"[1;"+(c+1)+"Q":a.key=J.ESC+"OQ";break;case 114:c?a.key=J.ESC+"[1;"+(c+1)+"R":a.key=J.ESC+"OR";break;case 115:c?a.key=J.ESC+"[1;"+(c+1)+"S":a.key=J.ESC+"OS";break;case 116:c?a.key=J.ESC+"[15;"+(c+1)+"~":a.key=J.ESC+"[15~";break;case 117:c?a.key=J.ESC+"[17;"+(c+1)+"~":a.key=J.ESC+"[17~";break;case 118:c?a.key=J.ESC+"[18;"+(c+1)+"~":a.key=J.ESC+"[18~";break;case 119:c?a.key=J.ESC+"[19;"+(c+1)+"~":a.key=J.ESC+"[19~";break;case 120:c?a.key=J.ESC+"[20;"+(c+1)+"~":a.key=J.ESC+"[20~";break;case 121:c?a.key=J.ESC+"[21;"+(c+1)+"~":a.key=J.ESC+"[21~";break;case 122:c?a.key=J.ESC+"[23;"+(c+1)+"~":a.key=J.ESC+"[23~";break;case 123:c?a.key=J.ESC+"[24;"+(c+1)+"~":a.key=J.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=J.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=J.DEL:e.keyCode===219?a.key=J.ESC:e.keyCode===220?a.key=J.FS:e.keyCode===221&&(a.key=J.GS);else if((!s||n)&&e.altKey&&!e.metaKey){let h=(u=aO[e.keyCode])==null?void 0:u[e.shiftKey?1:0];if(h)a.key=J.ESC+h;else if(e.keyCode>=65&&e.keyCode<=90){let m=e.ctrlKey?e.keyCode-64:e.keyCode+32,p=String.fromCharCode(m);e.shiftKey&&(p=p.toUpperCase()),a.key=J.ESC+p}else if(e.keyCode===32)a.key=J.ESC+(e.ctrlKey?J.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let m=e.code.slice(3,4);e.shiftKey||(m=m.toLowerCase()),a.key=J.ESC+m,a.cancel=!0}}else s&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=J.US),e.key==="@"&&(a.key=J.NUL));break}return a}var ht=0,cO=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Hc,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Hc,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((a,c)=>this._getKey(a)-this._getKey(c)),t=0,s=0,n=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<n.length;a++)s>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[s])?(n[a]=e[t],t++):n[a]=this._array[s++];this._array=n,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(ht=this._search(t),ht===-1)||this._getKey(this._array[ht])!==t)return!1;do if(this._array[ht]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ht),!0;while(++ht<this._array.length&&this._getKey(this._array[ht])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,c)=>a-c),t=0,s=new Array(this._array.length-e.length),n=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:s[n++]=this._array[a];this._array=s,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ht=this._search(e),!(ht<0||ht>=this._array.length)&&this._getKey(this._array[ht])===e))do yield this._array[ht];while(++ht<this._array.length&&this._getKey(this._array[ht])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ht=this._search(e),!(ht<0||ht>=this._array.length)&&this._getKey(this._array[ht])===e))do t(this._array[ht]);while(++ht<this._array.length&&this._getKey(this._array[ht])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,s=this._array.length-1;for(;s>=t;){let n=t+s>>1,a=this._getKey(this._array[n]);if(a>e)s=n-1;else if(a<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},sf=0,By=0,uO=class extends ke{constructor(){super(),this._decorations=new cO(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new se),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new se),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(it(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new hO(e);if(t){let s=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),s.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,s){let n=0,a=0;for(let c of this._decorations.getKeyIterator(t))n=c.options.x??0,a=n+(c.options.width??1),e>=n&&e<a&&(!s||(c.options.layer??"bottom")===s)&&(yield c)}forEachDecorationAtCell(e,t,s,n){this._decorations.forEachByKey(t,a=>{sf=a.options.x??0,By=sf+(a.options.width??1),e>=sf&&e<By&&(!s||(a.options.layer??"bottom")===s)&&n(a)})}},hO=class extends ms{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new se),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new se),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=st.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=st.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},dO=1e3,fO=class{constructor(e,t=dO){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=n-this._lastRefreshMs,c=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},c)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},jy=20,Pc=class extends ke{constructor(e,t,s,n){super(),this._terminal=e,this._coreBrowserService=s,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new fO(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(c=>this._handleResize(c.rows))),this._register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(c=>this._handleChar(c))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
446
|
+
`))),this._register(this._terminal.onA11yTab(c=>this._handleTab(c))),this._register(this._terminal.onKey(c=>this._handleKey(c.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Se(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(it(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<jy+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
447
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===jy+1&&(this._liveRegion.textContent+=vf.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let s=this._terminal.buffer,n=s.lines.length.toString();for(let a=e;a<=t;a++){let c=s.lines.get(s.ydisp+a),u=[],h=(c==null?void 0:c.translateToString(!0,void 0,void 0,u))||"",m=(s.ydisp+a+1).toString(),p=this._rowElements[a];p&&(h.length===0?(p.textContent=" ",this._rowColumns.set(p,[0,1])):(p.textContent=h,this._rowColumns.set(p,u)),p.setAttribute("aria-posinset",m),p.setAttribute("aria-setsize",n),this._alignRowWidth(p))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let s=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],a=s.getAttribute("aria-posinset"),c=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===c||e.relatedTarget!==n)return;let u,h;if(t===0?(u=s,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(u=this._rowElements.shift(),h=s,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{let m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var h;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},s={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(s.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===s.node&&t.offset>s.offset)&&([t,s]=[s,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(s.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(s={node:n,offset:((h=n.textContent)==null?void 0:h.length)??0}),!this._rowContainer.contains(s.node))return;let a=({node:m,offset:p})=>{let y=m instanceof Text?m.parentNode:m,v=parseInt(y==null?void 0:y.getAttribute("aria-posinset"),10)-1;if(isNaN(v))return console.warn("row is invalid. Race condition?"),null;let b=this._rowColumns.get(y);if(!b)return console.warn("columns is null. Race condition?"),null;let x=p<b.length?b[p]:b.slice(-1)[0]+1;return x>=this._terminal.cols&&(++v,x=0),{row:v,column:x}},c=a(t),u=a(s);if(!(!c||!u)){if(c.row>u.row||c.row===u.row&&c.column>=u.column)throw new Error("invalid range");this._terminal.select(c.column,c.row,(u.row-c.row)*this._terminal.cols-c.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var a,c;e.style.transform="";let t=e.getBoundingClientRect().width,s=(c=(a=this._rowColumns.get(e))==null?void 0:a.slice(-1))==null?void 0:c[0];if(!s)return;let n=s*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};Pc=lt([le(1,Wm),le(2,Or),le(3,Lr)],Pc);var Jf=class extends ke{constructor(e,t,s,n,a){super(),this._element=e,this._mouseService=t,this._renderService=s,this._bufferService=n,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new se),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new se),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(it(()=>{var c;Zs(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(c=this._activeProviderReplies)==null||c.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Se(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Se(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Se(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Se(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let s=e.composedPath();for(let n=0;n<s.length;n++){let a=s[n];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,a;(!this._activeProviderReplies||!t)&&((n=this._activeProviderReplies)==null||n.forEach(c=>{c==null||c.forEach(u=>{u.link.dispose&&u.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let s=!1;for(let[c,u]of this._linkProviderService.linkProviders.entries())t?(a=this._activeProviderReplies)!=null&&a.get(c)&&(s=this._checkLinkProviderResult(c,e,s)):u.provideLinks(e.y,h=>{var p,y;if(this._isMouseOut)return;let m=h==null?void 0:h.map(v=>({link:v}));(p=this._activeProviderReplies)==null||p.set(c,m),s=this._checkLinkProviderResult(c,e,s),((y=this._activeProviderReplies)==null?void 0:y.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let s=new Set;for(let n=0;n<t.size;n++){let a=t.get(n);if(a)for(let c=0;c<a.length;c++){let u=a[c],h=u.link.range.start.y<e?0:u.link.range.start.x,m=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let p=h;p<=m;p++){if(s.has(p)){a.splice(c--,1);break}s.add(p)}}}}_checkLinkProviderResult(e,t,s){var c;if(!this._activeProviderReplies)return s;let n=this._activeProviderReplies.get(e),a=!1;for(let u=0;u<e;u++)(!this._activeProviderReplies.has(u)||this._activeProviderReplies.get(u))&&(a=!0);if(!a&&n){let u=n.find(h=>this._linkAtPosition(h.link,t));u&&(s=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let u=0;u<this._activeProviderReplies.size;u++){let h=(c=this._activeProviderReplies.get(u))==null?void 0:c.find(m=>this._linkAtPosition(m.link,t));if(h){s=!0,this._handleNewLink(h);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&mO(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Zs(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var s,n;return(n=(s=this._currentLink)==null?void 0:s.state)==null?void 0:n.decorations.pointerCursor},set:s=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,n;return(n=(s=this._currentLink)==null?void 0:s.state)==null?void 0:n.decorations.underline},set:s=>{var n,a,c;(n=this._currentLink)!=null&&n.state&&((c=(a=this._currentLink)==null?void 0:a.state)==null?void 0:c.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;let n=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(n,a),this._lastMouseEvent)){let c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,t,s){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(s,t.text)}_fireUnderlineEvent(e,t){let s=e.range,n=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-n-1,s.end.x,s.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,s){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(s,t.text)}_linkAtPosition(e,t){let s=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return s<=a&&a<=n}_positionFromMouseEvent(e,t,s){let n=s.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,s,n,a){return{x1:e,y1:t,x2:s,y2:n,cols:this._bufferService.cols,fg:a}}};Jf=lt([le(1,qm),le(2,Lr),le(3,$t),le(4,Y1)],Jf);function mO(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var pO=class extends oO{constructor(e={}){super(e),this._linkifier=this._register(new ro),this.browser=fx,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ro),this._onCursorMove=this._register(new se),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new se),this.onKey=this._onKey.event,this._onRender=this._register(new se),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new se),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new se),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new se),this.onBell=this._onBell.event,this._onFocus=this._register(new se),this._onBlur=this._register(new se),this._onA11yCharEmitter=this._register(new se),this._onA11yTabEmitter=this._register(new se),this._onWillOpen=this._register(new se),this._setup(),this._decorationService=this._instantiationService.createInstance(uO),this._instantiationService.setService(Ba,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(s4),this._instantiationService.setService(Y1,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(bf)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(jt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(jt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(jt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(jt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(it(()=>{var t,s;this._customKeyEventHandler=void 0,(s=(t=this.element)==null?void 0:t.parentNode)==null||s.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let s,n="";switch(t.index){case 256:s="foreground",n="10";break;case 257:s="background",n="11";break;case 258:s="cursor",n="12";break;default:s="ansi",n="4;"+t.index}switch(t.type){case 0:let a=et.toColorRGB(s==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${J.ESC}]${n};${eO(a)}${hx.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(c=>c.ansi[t.index]=gt.toColor(...t.color));else{let c=s;this._themeService.modifyColors(u=>u[c]=gt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Pc,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let s=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,a=t.getWidth(s),c=this._renderService.dimensions.css.cell.width*a,u=this.buffer.y*this._renderService.dimensions.css.cell.height,h=s*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=u+"px",this.textarea.style.width=c+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Se(this.element,"copy",t=>{this.hasSelection()&&yD(t,this._selectionService)}));let e=t=>bD(t,this.textarea,this.coreService,this.optionsService);this._register(Se(this.textarea,"paste",e)),this._register(Se(this.element,"paste",e)),mx?this._register(Se(this.element,"mousedown",t=>{t.button===2&&K0(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Se(this.element,"contextmenu",t=>{K0(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Qm&&this._register(Se(this.element,"auxclick",t=>{t.button===1&&P1(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Se(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Se(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Se(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Se(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Se(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Se(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Se(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var a;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((a=this.element)==null?void 0:a.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Se(this.screenElement,"mousemove",c=>this.updateCursorStyle(c))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let s=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",gf.get()),gx||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>s.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(i4,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Or,this._coreBrowserService),this._register(Se(this.textarea,"focus",c=>this._handleTextAreaFocus(c))),this._register(Se(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(If,this._document,this._helperContainer),this._instantiationService.setService(su,this._charSizeService),this._themeService=this._instantiationService.createInstance($f),this._instantiationService.setService(oo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Bc),this._instantiationService.setService(K1,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Wf,this.rows,this.screenElement)),this._instantiationService.setService(Lr,this._renderService),this._register(this._renderService.onRenderedViewportChange(c=>this._onRender.fire(c))),this.onResize(c=>this._renderService.resize(c.cols,c.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Hf,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Ff),this._instantiationService.setService(qm,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(Jf,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Bf,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(c=>{super.scrollLines(c,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(qf,this.element,this.screenElement,n)),this._instantiationService.setService(RD,this._selectionService),this._register(this._selectionService.onRequestScrollLines(c=>this.scrollLines(c.amount,c.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(c=>this._renderService.handleSelectionChanged(c.start,c.end,c.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(c=>{this.textarea.value=c,this.textarea.focus(),this.textarea.select()})),this._register(jt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var c;this._selectionService.refresh(),(c=this._viewport)==null||c.queueSync()})),this._register(this._instantiationService.createInstance(jf,this.screenElement)),this._register(Se(this.element,"mousedown",c=>this._selectionService.handleMouseDown(c))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Pc,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",c=>this._handleScreenReaderModeOptionChange(c))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(zc,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",c=>{!this._overviewRulerRenderer&&c&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(zc,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Uf,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function s(c){var p,y,v,b,x;let u=e._mouseService.getMouseReportCoords(c,e.screenElement);if(!u)return!1;let h,m;switch(c.overrideType||c.type){case"mousemove":m=32,c.buttons===void 0?(h=3,c.button!==void 0&&(h=c.button<3?c.button:3)):h=c.buttons&1?0:c.buttons&4?1:c.buttons&2?2:3;break;case"mouseup":m=0,h=c.button<3?c.button:3;break;case"mousedown":m=1,h=c.button<3?c.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(c)===!1)return!1;let w=c.deltaY;if(w===0||e.coreMouseService.consumeWheelEvent(c,(b=(v=(y=(p=e._renderService)==null?void 0:p.dimensions)==null?void 0:y.device)==null?void 0:v.cell)==null?void 0:b.height,(x=e._coreBrowserService)==null?void 0:x.dpr)===0)return!1;m=w<0?0:1,h=4;break;default:return!1}return m===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:h,action:m,ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:c=>(s(c),c.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(c)),wheel:c=>(s(c),this.cancel(c,!0)),mousedrag:c=>{c.buttons&&s(c)},mousemove:c=>{c.buttons||s(c)}};this._register(this.coreMouseService.onProtocolChange(c=>{c?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(c)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),c&8?n.mousemove||(t.addEventListener("mousemove",a.mousemove),n.mousemove=a.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),c&16?n.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),n.wheel=a.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),c&2?n.mouseup||(n.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),c&4?n.mousedrag||(n.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Se(t,"mousedown",c=>{if(c.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(c)))return s(c),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(c)})),this._register(Se(t,"wheel",c=>{var u,h,m,p,y;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(c)===!1)return!1;if(!this.buffer.hasScrollback){if(c.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(c,(p=(m=(h=(u=e._renderService)==null?void 0:u.dimensions)==null?void 0:h.device)==null?void 0:m.cell)==null?void 0:p.height,(y=e._coreBrowserService)==null?void 0:y.dpr)===0)return this.cancel(c,!0);let v=J.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(c.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(v,!0),this.cancel(c,!0)}}},{passive:!1}))}refresh(e,t){var s;(s=this._renderService)==null||s.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){H1(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,s){this._selectionService.setSelection(e,t,s)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var s;(s=this._selectionService)==null||s.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let s=lO(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let n=this.rows-1;return this.scrollLines(s.type===2?-n:n),this.cancel(e,!0)}if(s.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(s.cancel&&this.cancel(e,!0),!s.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((s.key===J.ETX||s.key===J.CR)&&(this.textarea.value=""),this._onKey.fire({key:s.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(s.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let s=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?s:s&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(_O(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var s;(s=this._charSizeService)==null||s.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(_t));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(J.ESC+"[I"):this.coreService.triggerDataEvent(J.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),s=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.ESC}[4;${s};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.ESC}[6;${a};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function _O(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var gO=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let s={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(s),t.dispose=()=>this._wrappedAddonDispose(s),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let s=0;s<this._addons.length;s++)if(this._addons[s]===e){t=s;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},vO=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Di)}translateToString(e,t,s){return this._line.translateToString(e,t,s)}},Hy=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new vO(t)}getNullCell(){return new Di}},yO=class extends ke{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new se),this.onBufferChange=this._onBufferChange.event,this._normal=new Hy(this._core.buffers.normal,"normal"),this._alternate=new Hy(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},bO=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,s=>t(s.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(s,n)=>t(s,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},SO=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},xO=["cols","rows"],Xi=0,wO=class extends ke{constructor(e){super(),this._core=this._register(new pO(e)),this._addonManager=this._register(new gO),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],s=(n,a)=>{this._checkReadonlyOptions(n),this._core.options[n]=a};for(let n in this._core.options){let a={get:t.bind(this,n),set:s.bind(this,n)};Object.defineProperty(this._publicOptions,n,a)}}_checkReadonlyOptions(e){if(xO.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new bO(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new SO(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new yO(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,s){this._verifyIntegers(e,t,s),this._core.select(e,t,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
448
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return gf.get()},set promptLabel(e){gf.set(e)},get tooMuchOutput(){return vf.get()},set tooMuchOutput(e){vf.set(e)}}}_verifyIntegers(...e){for(Xi of e)if(Xi===1/0||isNaN(Xi)||Xi%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Xi of e)if(Xi&&(Xi===1/0||isNaN(Xi)||Xi%1!==0||Xi<0))throw new Error("This API only accepts positive integers")}};/**
|
|
449
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
450
|
+
* @license MIT
|
|
451
|
+
*
|
|
452
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
453
|
+
* @license MIT
|
|
454
|
+
*
|
|
455
|
+
* Originally forked from (with the author's permission):
|
|
456
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
457
|
+
* http://bellard.org/jslinux/
|
|
458
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
459
|
+
*/var CO=2,EO=1,kO=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var v;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((v=this._terminal.options.overviewRuler)==null?void 0:v.width)||14,s=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(s.getPropertyValue("height")),a=Math.max(0,parseInt(s.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),u={top:parseInt(c.getPropertyValue("padding-top")),bottom:parseInt(c.getPropertyValue("padding-bottom")),right:parseInt(c.getPropertyValue("padding-right")),left:parseInt(c.getPropertyValue("padding-left"))},h=u.top+u.bottom,m=u.right+u.left,p=n-h,y=a-m-t;return{cols:Math.max(CO,Math.floor(y/e.css.cell.width)),rows:Math.max(EO,Math.floor(p/e.css.cell.height))}}};/**
|
|
460
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
461
|
+
* @license MIT
|
|
462
|
+
*
|
|
463
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
464
|
+
* @license MIT
|
|
465
|
+
*
|
|
466
|
+
* Originally forked from (with the author's permission):
|
|
467
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
468
|
+
* http://bellard.org/jslinux/
|
|
469
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
470
|
+
*/var MO=class{constructor(e,t,s,n={}){this._terminal=e,this._regex=t,this._handler=s,this._options=n}provideLinks(e,t){let s=NO.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(s))}_addCallbacks(e){return e.map(t=>(t.leave=this._options.leave,t.hover=(s,n)=>{if(this._options.hover){let{range:a}=t;this._options.hover(s,n,a)}},t))}};function RO(e){try{let t=new URL(e),s=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(s.toLocaleLowerCase())}catch{return!1}}var NO=class xc{static computeLink(t,s,n,a){let c=new RegExp(s.source,(s.flags||"")+"g"),[u,h]=xc._getWindowedLineStrings(t-1,n),m=u.join(""),p,y=[];for(;p=c.exec(m);){let v=p[0];if(!RO(v))continue;let[b,x]=xc._mapStrIdx(n,h,0,p.index),[w,C]=xc._mapStrIdx(n,b,x,v.length);if(b===-1||x===-1||w===-1||C===-1)continue;let E={start:{x:x+1,y:b+1},end:{x:C,y:w+1}};y.push({range:E,text:v,activate:a})}return y}static _getWindowedLineStrings(t,s){let n,a=t,c=t,u=0,h="",m=[];if(n=s.buffer.active.getLine(t)){let p=n.translateToString(!0);if(n.isWrapped&&p[0]!==" "){for(u=0;(n=s.buffer.active.getLine(--a))&&u<2048&&(h=n.translateToString(!0),u+=h.length,m.push(h),!(!n.isWrapped||h.indexOf(" ")!==-1)););m.reverse()}for(m.push(p),u=0;(n=s.buffer.active.getLine(++c))&&n.isWrapped&&u<2048&&(h=n.translateToString(!0),u+=h.length,m.push(h),h.indexOf(" ")===-1););}return[m,a]}static _mapStrIdx(t,s,n,a){let c=t.buffer.active,u=c.getNullCell(),h=n;for(;a;){let m=c.getLine(s);if(!m)return[-1,-1];for(let p=h;p<m.length;++p){m.getCell(p,u);let y=u.getChars();if(u.getWidth()&&(a-=y.length||1,p===m.length-1&&y==="")){let v=c.getLine(s+1);v&&v.isWrapped&&(v.getCell(0,u),u.getWidth()===2&&(a+=1))}if(a<0)return[s,p]}s++,h=0}return[s,h]}},TO=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function AO(e,t){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}var DO=class{constructor(e=AO,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,s=t.urlRegex||TO;this._linkProvider=this._terminal.registerLinkProvider(new MO(this._terminal,s,this._handler,t))}dispose(){var e;(e=this._linkProvider)==null||e.dispose()}};const Py={background:"#faf9f5",foreground:"#1a1915",cursor:"#d97757",cursorAccent:"#faf9f5",selectionBackground:"rgba(217, 119, 87, 0.25)",black:"#1a1915",red:"#dc3545",green:"#788c5d",yellow:"#c49a2a",blue:"#5b7ba0",magenta:"#9b6b8a",cyan:"#5e8d87",white:"#e8e6dc",brightBlack:"#78756a",brightRed:"#ef4444",brightGreen:"#8ea870",brightYellow:"#d4a843",brightBlue:"#6e8eb5",brightMagenta:"#b07da0",brightCyan:"#72a09a",brightWhite:"#faf9f5"},Uy={background:"#1a1915",foreground:"#e8e6dc",cursor:"#d97757",cursorAccent:"#1a1915",selectionBackground:"rgba(217, 119, 87, 0.3)",black:"#1a1915",red:"#ef4444",green:"#788c5d",yellow:"#d4a843",blue:"#6e8eb5",magenta:"#b07da0",cyan:"#72a09a",white:"#e8e6dc",brightBlack:"#b0aea5",brightRed:"#f87171",brightGreen:"#8ea870",brightYellow:"#e0b84d",brightBlue:"#8da5c5",brightMagenta:"#c494b5",brightCyan:"#8ab5ae",brightWhite:"#faf9f5"},Mx=g.forwardRef(({isActive:e,isPanelVisible:t,onData:s,onResize:n,className:a},c)=>{const u=g.useRef(null),h=g.useRef(null),m=g.useRef(null),p=g.useMemo(()=>document.documentElement.classList.contains("dark"),[]),y=g.useCallback(()=>{const v=u.current,b=m.current;if(!(!v||!b)&&v.offsetParent!==null&&!(v.clientWidth===0||v.clientHeight===0))try{b.fit()}catch{}},[]);return g.useEffect(()=>{if(!u.current)return;const v=new wO({cursorBlink:!0,fontSize:13,fontFamily:'"SF Mono", "Fira Code", "Cascadia Code", monospace',theme:p?Uy:Py,allowProposedApi:!0,scrollback:5e3}),b=new kO,x=new DO;v.loadAddon(b),v.loadAddon(x),v.open(u.current),requestAnimationFrame(y),h.current=v,m.current=b;const w=v.onData(s),C=v.onResize(({cols:M,rows:R})=>{n(M,R)}),E=new ResizeObserver(()=>{requestAnimationFrame(y)});return E.observe(u.current),()=>{w.dispose(),C.dispose(),E.disconnect(),v.dispose(),h.current=null,m.current=null}},[p,y]),g.useEffect(()=>{const v=new MutationObserver(()=>{var x,w;const b=document.documentElement.classList.contains("dark");(x=h.current)==null||x.options.theme,(w=h.current)!=null&&w.options&&(h.current.options.theme=b?Uy:Py)});return v.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>v.disconnect()},[]),g.useEffect(()=>{e&&t&&h.current&&requestAnimationFrame(()=>{var v;y(),(v=h.current)==null||v.focus()})},[e,t,y]),g.useImperativeHandle(c,()=>({write:v=>{var b;(b=h.current)==null||b.write(v)},focus:()=>{var v;(v=h.current)==null||v.focus()}})),_.jsx("div",{ref:u,className:`h-full w-full ${a||""}`,style:{display:e?"block":"none"}})});Mx.displayName="XTerminal";function Iy({visible:e,terminals:t,activeTerminalId:s,onSetActive:n,onCreateTerminal:a,onDestroyTerminal:c,onInput:u,onResize:h,height:m,onResizeHandle:p,registerOutputCallback:y}){const v=g.useRef(new Map);g.useEffect(()=>{y((C,E)=>{var M;(M=v.current.get(C))==null||M.write(E)})},[y]);const b=g.useCallback(C=>E=>{E?v.current.set(C,E):v.current.delete(C)},[]),x=[...t.entries()],w=m===-1;return _.jsxs("div",{className:`flex flex-col border-t border-(--color-overlay-border) bg-card/50 ${w?"h-full":""} ${e?"":"hidden"}`,style:w?void 0:{height:m},children:[!w&&_.jsx("div",{className:"h-1.5 cursor-row-resize bg-(--color-overlay) hover:bg-primary/30 transition-colors shrink-0 flex items-center justify-center",onMouseDown:p,onTouchStart:p,children:_.jsx("div",{className:"w-8 h-0.5 rounded-full bg-(--color-overlay-border)"})}),_.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-(--color-overlay-border) shrink-0 overflow-x-auto",children:[x.map(([C,E])=>{const M=C===s,R=E.shell.split(/[\\/]/).pop()||"sh";return _.jsxs("button",{onClick:()=>n(C),className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs transition-colors cursor-pointer shrink-0 ${M?"bg-(--color-overlay-hover) text-foreground":"text-muted-foreground hover:bg-(--color-overlay) hover:text-foreground"}`,children:[_.jsx(rm,{className:"size-3"}),_.jsx("span",{children:R}),_.jsx("span",{onClick:T=>{T.stopPropagation(),c(C)},className:"ml-1 rounded hover:bg-(--color-overlay-hover) p-0.5 cursor-pointer",children:_.jsx(Js,{className:"size-2.5"})})]},C)}),_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-6 rounded-md hover:bg-(--color-overlay-hover) shrink-0",onClick:a,title:"New Terminal",children:_.jsx(Vs,{className:"size-3.5"})})]}),_.jsx("div",{className:"flex-1 min-h-0 relative",children:x.length===0?_.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:_.jsxs("button",{onClick:a,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-(--color-overlay-border) hover:bg-(--color-overlay-hover) transition-colors cursor-pointer",children:[_.jsx(Vs,{className:"size-4"}),"Create Terminal"]})}):x.map(([C])=>_.jsx(Mx,{ref:b(C),isActive:C===s,isPanelVisible:e,onData:E=>u(C,E),onResize:(E,M)=>h(C,E,M),className:"p-1"},C))})]})}const OO=new Set(["localhost","127.0.0.1","::1"]);function Rx(e){return OO.has(e.toLowerCase())}function Nx(){return typeof window>"u"?!1:Rx(window.location.hostname)}function LO(e){return Nx()?`http://localhost:${e}/`:`/api/preview/${e}/`}function zO(e){const t=e.protocol==="https:"?"443":"80",s=parseInt(e.port||t,10),n=e.pathname||"/";return{port:s,proxiedUrl:`/api/preview/${s}${n}${e.search}`}}function Fy({detectedPorts:e,activePort:t,onSelectPort:s,customUrl:n,onSetCustomUrl:a}){const c=g.useRef(null),[u,h]=g.useState(""),m=n||(t?LO(t):null),p=()=>{c.current&&(c.current.src=c.current.src)},y=v=>{if(v.preventDefault(),u.trim()){const b=u.match(/^(\d{1,5})$/);if(b){const x=parseInt(b[1],10);s(x),a("")}else if(/^https?:\/\//i.test(u))try{const x=new URL(u);if(Rx(x.hostname)){const{port:w,proxiedUrl:C}=zO(x);w>0&&w<=65535&&s(w),Nx()?a(x.toString()):a(C)}else a(x.toString())}catch{a(u)}else a(u);h("")}};return!m&&e.length===0?_.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-6",children:[_.jsxs("div",{className:"relative mb-6",children:[_.jsx("div",{className:"size-16 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center border border-primary/10",children:_.jsx(Ys,{className:"size-8 text-primary/60"})}),_.jsx("div",{className:"absolute inset-0 size-16 rounded-2xl bg-primary/5 blur-xl"})]}),_.jsx("h2",{className:"text-lg font-semibold text-foreground/90 mb-2",children:"No preview available"}),_.jsx("p",{className:"text-sm text-muted-foreground/70 max-w-[280px] leading-relaxed mb-4",children:"Start a dev server in the Terminal to preview your app here."}),_.jsxs("form",{onSubmit:y,className:"flex gap-2 w-full max-w-[320px]",children:[_.jsx("input",{value:u,onChange:v=>h(v.target.value),placeholder:"Port or URL (e.g. 3000)",className:"flex-1 px-3 py-1.5 rounded-lg border border-(--color-overlay-border) bg-(--color-overlay) text-sm text-foreground placeholder:text-muted-foreground/50 outline-none focus:ring-1 focus:ring-primary/30"}),_.jsx(Ye,{type:"submit",size:"sm",variant:"outline",className:"shrink-0",children:"Open"})]})]}):_.jsxs("div",{className:"flex flex-col h-full",children:[_.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-(--color-overlay-border) bg-card/50 shrink-0",children:[_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-md",onClick:p,title:"Refresh",children:_.jsx(db,{className:"size-3.5"})}),e.length>1?_.jsx("select",{value:t??"",onChange:v=>s(parseInt(v.target.value,10)),className:"px-2 py-1 rounded-md border border-(--color-overlay-border) bg-(--color-overlay) text-xs text-foreground outline-none",children:e.map(v=>_.jsxs("option",{value:v.port,children:[":",v.port]},v.port))}):t?_.jsxs("span",{className:"text-xs text-muted-foreground px-2 py-1 rounded-md bg-(--color-overlay)",children:[":",t]}):null,_.jsx("div",{className:"flex-1 min-w-0",children:_.jsx("form",{onSubmit:y,className:"flex",children:_.jsx("input",{value:u,onChange:v=>h(v.target.value),placeholder:m||"Enter port or URL...",className:"w-full px-2 py-1 rounded-md text-xs text-muted-foreground bg-transparent outline-none placeholder:text-muted-foreground/40 focus:bg-(--color-overlay) focus:text-foreground"})})}),m&&_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-md",onClick:()=>window.open(m,"_blank"),title:"Open in new tab",children:_.jsx(Z2,{className:"size-3.5"})})]}),m?_.jsx("iframe",{ref:c,src:m,className:"flex-1 w-full border-0 bg-white",title:"Web Preview",sandbox:"allow-scripts allow-forms allow-popups allow-modals"}):_.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Select a port to preview"})]})}const Wy="rcc_sidebar_pinned";function BO(){const[e,t]=g.useState(()=>localStorage.getItem(Wy)==="true"),[s,n]=g.useState(()=>window.matchMedia("(min-width: 768px)").matches);g.useEffect(()=>{const u=window.matchMedia("(min-width: 768px)"),h=m=>n(m.matches);return u.addEventListener("change",h),()=>u.removeEventListener("change",h)},[]);const a=g.useCallback(()=>{t(u=>{const h=!u;return localStorage.setItem(Wy,String(h)),h})},[]);return{isPinned:e,isDesktop:s,isEffectivelyPinned:e&&s,togglePin:a}}const qy="rcc_file_explorer_pinned";function jO(){const[e,t]=g.useState(()=>localStorage.getItem(qy)==="true"),[s,n]=g.useState(()=>window.matchMedia("(min-width: 1024px)").matches);g.useEffect(()=>{const u=window.matchMedia("(min-width: 1024px)"),h=m=>n(m.matches);return u.addEventListener("change",h),()=>u.removeEventListener("change",h)},[]);const a=g.useCallback(()=>{t(u=>{const h=!u;return localStorage.setItem(qy,String(h)),h})},[]);return{isPinned:e,isDesktop:s,isEffectivelyPinned:e&&s,togglePin:a}}function HO({storageKey:e,defaultHeight:t,minHeight:s,maxHeight:n}){const[a,c]=g.useState(()=>{const m=localStorage.getItem(e);return m?Math.max(s,Math.min(n,Number(m))):t}),u=g.useRef(a);u.current=a;const h=g.useCallback(m=>{m.preventDefault();const p="touches"in m?m.touches[0].clientY:m.clientY,y=u.current;document.body.style.cursor="row-resize",document.body.style.userSelect="none";const v=x=>{const w="touches"in x?x.touches[0].clientY:x.clientY,C=p-w,E=Math.max(s,Math.min(n,y+C));c(E)},b=()=>{document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",b),localStorage.setItem(e,String(u.current))};document.addEventListener("mousemove",v),document.addEventListener("mouseup",b),document.addEventListener("touchmove",v),document.addEventListener("touchend",b)},[s,n,e]);return{height:a,handleMouseDown:h}}function PO({messages:e,isProcessing:t,status:s,threads:n,activeThreadId:a,threadsLoading:c,theme:u,onSetTheme:h,onSend:m,onInterrupt:p,onClear:y,onSwitchThread:v,onNewThread:b,onLogout:x,preferences:w,onUpdatePreference:C,models:E,commands:M,mcpServers:R,currentModel:T,onSetModel:N,currentPermissionMode:D,onSetPermissionMode:j,onPermissionRespond:q,attachments:te,onAddAttachments:re,onRemoveAttachment:oe,activeProject:Z,projects:G,onSwitchProject:I,onManageProjects:V,showProjectLabel:W,token:A,references:L,onAddReference:z,onRemoveReference:K,terminal:ee,previewPorts:he}){const ne=g.useRef(null),ae=g.useRef(null),ie=g.useRef(!0),{isPinned:me,isDesktop:ve,isEffectivelyPinned:Ne,togglePin:Ue}=BO(),xe=jO(),[ce,Te]=g.useState(!1),[Ge,be]=g.useState(!1),[ze,Li]=g.useState("chat"),[Ze,zi]=g.useState("chat"),{height:Wi,handleMouseDown:gi}=HO({storageKey:"rcc_terminal_height",defaultHeight:250,minHeight:120,maxHeight:600});g.useEffect(()=>{const Be=ae.current;if(!Be)return;const vs=()=>{const{scrollTop:sn,scrollHeight:nn,clientHeight:lu}=Be;ie.current=nn-sn-lu<100};return Be.addEventListener("scroll",vs,{passive:!0}),()=>Be.removeEventListener("scroll",vs)},[]),g.useEffect(()=>{const Be=ae.current;ie.current&&Be&&(Be.scrollTop=Be.scrollHeight)},[e]);const zr=s==="authenticated"?"bg-success":s==="connected"||s==="connecting"?"bg-warning":"bg-destructive",lo=s==="authenticated"?"Connected":s==="connecting"?"Connecting...":s==="connected"?"Authenticating...":"Disconnected",qi=!ve,au=qi?Ze==="terminal":ee.terminalPanelVisible,Pt=()=>{qi?zi(Ze==="terminal"?"chat":"terminal"):ee.terminalPanelVisible?ee.closeTerminalPanel():ee.openTerminalPanel(Z==null?void 0:Z.path)};return g.useEffect(()=>{qi&&(Ze==="terminal"?ee.openTerminalPanel(Z==null?void 0:Z.path):ee.closeTerminalPanel())},[Ze,qi]),_.jsxs("div",{className:"flex h-full overflow-hidden",children:[_.jsx(tD,{threads:n,activeThreadId:a,loading:c,onSelectThread:v,onNewThread:b,isPinned:me,isDesktop:ve,isEffectivelyPinned:Ne,onTogglePin:Ue,sheetOpen:ce,onSheetOpenChange:Te,showProjectLabel:W}),_.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[_.jsxs("header",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2 px-4 py-2 pt-[calc(0.625rem+env(safe-area-inset-top,0px))] bg-card/80 backdrop-blur-md border-b border-(--color-overlay-border) min-h-[52px] relative z-10",children:[_.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[!Ne&&_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-9 rounded-xl hover:bg-(--color-overlay-hover)",onClick:()=>Te(!0),children:_.jsx(EE,{className:"size-5"})}),_.jsxs(mA,{variant:"outline",className:"max-w-full gap-1.5 py-0.5 px-2 text-[10px] sm:text-[11px] border-(--color-overlay-border) bg-(--color-overlay) font-normal",children:[_.jsx("span",{className:`size-1.5 rounded-full ${zr}`}),_.jsx("span",{className:"truncate",children:lo})]})]}),_.jsxs("div",{className:"min-w-0 px-1",children:[!qi&&_.jsxs("div",{className:"flex items-center justify-center gap-1",children:[_.jsxs("div",{className:"flex items-center gap-0.5 mr-2 bg-(--color-overlay) rounded-lg p-0.5",children:[_.jsxs("button",{onClick:()=>Li("chat"),className:`flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors cursor-pointer ${ze==="chat"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[_.jsx(wc,{className:"size-3"}),"Chat"]}),_.jsxs("button",{onClick:()=>Li("preview"),className:`flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors cursor-pointer ${ze==="preview"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[_.jsx(Ys,{className:"size-3"}),"Preview"]})]}),_.jsxs(Mr,{children:[_.jsx(Rr,{asChild:!0,children:_.jsxs("button",{className:"flex h-9 min-w-0 max-w-full items-center justify-center gap-1.5 rounded-lg px-2 py-1 transition-colors hover:bg-(--color-overlay-hover) cursor-pointer",children:[_.jsx(Ws,{className:"size-3.5 text-primary shrink-0"}),_.jsx("span",{className:"min-w-0 truncate text-sm font-semibold text-foreground/90 tracking-tight",children:(Z==null?void 0:Z.name)||"All Projects"}),_.jsx(ga,{className:"size-3 text-muted-foreground/60 shrink-0"})]})}),_.jsxs(Nr,{align:"center",className:"w-56",children:[_.jsxs(Ct,{onClick:()=>I(null),children:[_.jsx(s0,{className:"size-4"}),"All Projects",!Z&&_.jsx(fi,{className:"size-3 ml-auto text-primary"})]}),G.length>0&&_.jsx(Kn,{}),G.map(Be=>_.jsxs(Ct,{onClick:()=>I(Be),children:[_.jsx(Ws,{className:"size-4"}),_.jsx("div",{className:"flex-1 min-w-0",children:_.jsx("span",{className:"truncate",children:Be.name})}),(Z==null?void 0:Z.path)===Be.path&&_.jsx(fi,{className:"size-3 ml-auto text-primary shrink-0"})]},Be.path)),_.jsx(Kn,{}),_.jsxs(Ct,{onClick:V,children:[_.jsx(Vs,{className:"size-4"}),"Manage Projects..."]})]})]})]}),qi&&_.jsxs(Mr,{children:[_.jsx(Rr,{asChild:!0,children:_.jsxs("button",{className:"mx-auto flex h-9 min-w-0 max-w-full items-center justify-center gap-1.5 rounded-lg px-2 py-1 transition-colors hover:bg-(--color-overlay-hover) cursor-pointer",children:[_.jsx(Ws,{className:"size-3.5 text-primary shrink-0"}),_.jsx("span",{className:"min-w-0 truncate text-sm font-semibold text-foreground/90 tracking-tight",children:(Z==null?void 0:Z.name)||"All Projects"}),_.jsx(ga,{className:"size-3 text-muted-foreground/60 shrink-0"})]})}),_.jsxs(Nr,{align:"center",className:"w-56",children:[_.jsxs(Ct,{onClick:()=>I(null),children:[_.jsx(s0,{className:"size-4"}),"All Projects",!Z&&_.jsx(fi,{className:"size-3 ml-auto text-primary"})]}),G.length>0&&_.jsx(Kn,{}),G.map(Be=>_.jsxs(Ct,{onClick:()=>I(Be),children:[_.jsx(Ws,{className:"size-4"}),_.jsx("div",{className:"flex-1 min-w-0",children:_.jsx("span",{className:"truncate",children:Be.name})}),(Z==null?void 0:Z.path)===Be.path&&_.jsx(fi,{className:"size-3 ml-auto text-primary shrink-0"})]},Be.path)),_.jsx(Kn,{}),_.jsxs(Ct,{onClick:V,children:[_.jsx(Vs,{className:"size-4"}),"Manage Projects..."]})]})]})]}),_.jsxs("div",{className:"flex items-center justify-self-end gap-1",children:[_.jsx(Ye,{variant:"ghost",size:"icon",className:`size-9 rounded-xl hover:bg-(--color-overlay-hover) ${au?"text-primary":""}`,onClick:Pt,title:"Terminal",children:_.jsx(a0,{className:"size-5"})}),Z&&_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-9 rounded-xl hover:bg-(--color-overlay-hover)",onClick:()=>{xe.isEffectivelyPinned?xe.togglePin():be(!0)},title:"File Explorer",children:_.jsx(mE,{className:"size-5"})}),_.jsxs(Mr,{children:[_.jsx(Rr,{asChild:!0,children:_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-9 rounded-xl hover:bg-(--color-overlay-hover)",children:_.jsx(G2,{className:"size-5"})})}),_.jsxs(Nr,{align:"end",children:[_.jsxs(Ct,{onClick:()=>{y()},children:[_.jsx(Vs,{className:"size-4"}),"New Thread"]}),_.jsx(Kn,{}),_.jsxs(Ct,{onClick:()=>h("light"),children:[_.jsx(mb,{className:"size-4"}),"Light",u==="light"&&_.jsx(fi,{className:"size-3 ml-auto text-primary"})]}),_.jsxs(Ct,{onClick:()=>h("dark"),children:[_.jsx(ub,{className:"size-4"}),"Dark",u==="dark"&&_.jsx(fi,{className:"size-3 ml-auto text-primary"})]}),_.jsxs(Ct,{onClick:()=>h("system"),children:[_.jsx(RE,{className:"size-4"}),"System",u==="system"&&_.jsx(fi,{className:"size-3 ml-auto text-primary"})]}),_.jsx(Kn,{}),_.jsxs(Ct,{onClick:()=>{x()},className:"text-destructive focus:text-destructive",children:[_.jsx(wE,{className:"size-4"}),"Logout"]})]})]})]})]}),!qi&&_.jsxs(_.Fragment,{children:[ze==="chat"?_.jsxs("main",{ref:ae,className:"flex-1 overflow-y-auto p-4 [-webkit-overflow-scrolling:touch]",children:[e.length===0&&_.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-6",children:[_.jsxs("div",{className:"relative mb-6",children:[_.jsx("div",{className:"size-16 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center border border-primary/10",children:_.jsx(o0,{className:"size-8 text-primary/60"})}),_.jsx("div",{className:"absolute inset-0 size-16 rounded-2xl bg-primary/5 blur-xl"})]}),_.jsx("h2",{className:"text-lg font-semibold text-foreground/90 mb-2",children:"Ready to code"}),_.jsx("p",{className:"text-sm text-muted-foreground/70 max-w-[240px] leading-relaxed",children:"Send a message to start a conversation with Claude Code"}),_.jsx("div",{className:"flex flex-wrap gap-2 mt-6 justify-center max-w-[300px]",children:["Fix a bug","Write a test","Refactor code"].map(Be=>_.jsx("button",{onClick:()=>m(Be),disabled:s!=="authenticated",className:"px-3 py-1.5 rounded-full text-xs border border-(--color-overlay-border) text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:Be},Be))})]}),_.jsx(I0,{messages:e,onPermissionRespond:q}),_.jsx("div",{ref:ne})]}):_.jsx("div",{className:"flex-1 min-h-0",children:_.jsx(Fy,{detectedPorts:he.detectedPorts,activePort:he.activePreviewPort,onSelectPort:he.setActivePreviewPort,customUrl:he.customPreviewUrl,onSetCustomUrl:he.setCustomPreviewUrl})}),_.jsx(Iy,{visible:ee.terminalPanelVisible,terminals:ee.terminals,activeTerminalId:ee.activeTerminalId,onSetActive:ee.setActiveTerminalId,onCreateTerminal:()=>ee.createTerminal(Z==null?void 0:Z.path),onDestroyTerminal:ee.destroyTerminal,onInput:ee.sendInput,onResize:ee.resizeTerminal,height:Wi,onResizeHandle:gi,registerOutputCallback:ee.registerOutputCallback}),_.jsx(W0,{onSend:m,onInterrupt:p,isProcessing:t,disabled:s!=="authenticated",preferences:w,onUpdatePreference:C,models:E,commands:M,mcpServers:R,currentModel:T,onSetModel:N,currentPermissionMode:D,onSetPermissionMode:j,attachments:te,onAddAttachments:re,onRemoveAttachment:oe,references:L,onRemoveReference:K})]}),qi&&_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden",children:[Ze==="chat"&&_.jsxs("main",{ref:ae,className:"h-full overflow-y-auto p-4 [-webkit-overflow-scrolling:touch]",children:[e.length===0&&_.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-6",children:[_.jsxs("div",{className:"relative mb-6",children:[_.jsx("div",{className:"size-16 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center border border-primary/10",children:_.jsx(o0,{className:"size-8 text-primary/60"})}),_.jsx("div",{className:"absolute inset-0 size-16 rounded-2xl bg-primary/5 blur-xl"})]}),_.jsx("h2",{className:"text-lg font-semibold text-foreground/90 mb-2",children:"Ready to code"}),_.jsx("p",{className:"text-sm text-muted-foreground/70 max-w-[240px] leading-relaxed",children:"Send a message to start a conversation with Claude Code"}),_.jsx("div",{className:"flex flex-wrap gap-2 mt-6 justify-center max-w-[300px]",children:["Fix a bug","Write a test","Refactor code"].map(Be=>_.jsx("button",{onClick:()=>m(Be),disabled:s!=="authenticated",className:"px-3 py-1.5 rounded-full text-xs border border-(--color-overlay-border) text-muted-foreground hover:bg-(--color-overlay-hover) hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:Be},Be))})]}),_.jsx(I0,{messages:e,onPermissionRespond:q}),_.jsx("div",{ref:ne})]}),_.jsx(Iy,{visible:Ze==="terminal",terminals:ee.terminals,activeTerminalId:ee.activeTerminalId,onSetActive:ee.setActiveTerminalId,onCreateTerminal:()=>ee.createTerminal(Z==null?void 0:Z.path),onDestroyTerminal:ee.destroyTerminal,onInput:ee.sendInput,onResize:ee.resizeTerminal,height:-1,onResizeHandle:()=>{},registerOutputCallback:ee.registerOutputCallback}),Ze==="preview"&&_.jsx(Fy,{detectedPorts:he.detectedPorts,activePort:he.activePreviewPort,onSelectPort:he.setActivePreviewPort,customUrl:he.customPreviewUrl,onSetCustomUrl:he.setCustomPreviewUrl})]}),Ze==="chat"&&_.jsx(W0,{onSend:m,onInterrupt:p,isProcessing:t,disabled:s!=="authenticated",preferences:w,onUpdatePreference:C,models:E,commands:M,mcpServers:R,currentModel:T,onSetModel:N,currentPermissionMode:D,onSetPermissionMode:j,attachments:te,onAddAttachments:re,onRemoveAttachment:oe,references:L,onRemoveReference:K}),_.jsx("div",{className:"flex items-center border-t border-(--color-overlay-border) bg-card/80 backdrop-blur-md pb-[env(safe-area-inset-bottom,0px)]",children:[{key:"chat",icon:wc,label:"Chat"},{key:"terminal",icon:a0,label:"Terminal"},{key:"preview",icon:Ys,label:"Preview"}].map(({key:Be,icon:vs,label:sn})=>_.jsxs("button",{onClick:()=>zi(Be),className:`flex-1 flex flex-col items-center gap-0.5 py-2 text-[10px] transition-colors cursor-pointer ${Ze===Be?"text-primary":"text-muted-foreground"}`,children:[_.jsx(vs,{className:"size-5"}),_.jsx("span",{children:sn})]},Be))})]})]}),_.jsx(mD,{activeProject:Z,token:A,isPinned:xe.isPinned,isDesktop:xe.isDesktop,isEffectivelyPinned:xe.isEffectivelyPinned,onTogglePin:xe.togglePin,sheetOpen:Ge,onSheetOpenChange:be,onAddReference:z})]})}function UO({open:e,onOpenChange:t,projects:s,token:n,onAddProject:a,onRemoveProject:c}){const[u,h]=g.useState(""),[m,p]=g.useState([]),[y,v]=g.useState(null),[b,x]=g.useState(!1),[w,C]=g.useState(!1),[E,M]=g.useState(""),[R,T]=g.useState(!1),[N,D]=g.useState(""),[j,q]=g.useState(!1),[te,re]=g.useState(null),oe=g.useRef(null),Z=g.useCallback(async L=>{x(!0),M("");try{const z=L?`?path=${encodeURIComponent(L)}`:"",K=await fetch(`/api/projects/browse${z}`,{headers:{Authorization:`Bearer ${n}`}});if(K.ok){const ee=await K.json();h(ee.current),v(ee.parent),p(ee.entries||[])}else{const ee=await K.json();M(ee.error||"Failed to browse")}}catch{M("Failed to connect")}finally{x(!1)}},[n]);g.useEffect(()=>{e&&!u&&Z()},[e,u,Z]);const G=async()=>{if(u){C(!0),M("");try{await a(u)}catch(L){M(L instanceof Error?L.message:"Failed to add")}finally{C(!1)}}},I=s.some(L=>L.path===u),V=async()=>{if(!(!N.trim()||!u)){q(!0),M("");try{const L=await fetch("/api/projects/mkdir",{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({parent:u,name:N.trim()})});if(L.ok)T(!1),D(""),await Z(u);else{const z=await L.json();M(z.error||"Failed to create folder")}}catch{M("Failed to connect")}finally{q(!1)}}},W=async(L,z=!1)=>{var ee;const K=`${u==="/"?"":u}/${L}`;if(!(!z&&!window.confirm(`Delete folder "${L}"?`))){re(L),M("");try{const he=await fetch("/api/projects/rmdir",{method:"POST",headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"},body:JSON.stringify({path:K,force:z})});if(he.ok)await Z(u);else{const ne=await he.json();if((ee=ne.error)!=null&&ee.includes("not empty")&&!z){if(window.confirm(`Folder "${L}" is not empty (${ne.count} items). Delete anyway?`)){await W(L,!0);return}}else M(ne.error||"Failed to delete")}}catch{M("Failed to connect")}finally{re(null)}}};g.useEffect(()=>{var L;R&&((L=oe.current)==null||L.focus())},[R]);const A=u.split("/").filter(Boolean).map((L,z,K)=>({name:L,path:"/"+K.slice(0,z+1).join("/")}));return _.jsx(Pm,{open:e,onOpenChange:t,children:_.jsxs(Um,{side:"right",className:"w-[340px] sm:w-[400px] p-0 bg-card border-l border-(--color-overlay-border) flex flex-col",children:[_.jsx(Im,{className:"px-4 pt-4 pb-3",children:_.jsx(Fm,{className:"text-lg font-semibold tracking-tight",children:"Manage Projects"})}),s.length>0&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"px-4 pb-2",children:_.jsx("p",{className:"text-xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Added Projects"})}),_.jsx(xa,{className:"max-h-60",children:_.jsx("div",{className:"px-3 pb-3 flex flex-col gap-1",children:s.map(L=>_.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-xl bg-(--color-overlay) border border-(--color-overlay-border) group",children:[_.jsx(r0,{className:"size-4 text-primary shrink-0"}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("p",{className:"text-sm font-medium truncate",children:L.name}),_.jsx("p",{className:"text-[11px] text-muted-foreground/60 truncate",children:L.path})]}),_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-lg opacity-40 sm:opacity-0 sm:group-hover:opacity-100 hover:bg-destructive/10 hover:text-destructive transition-all shrink-0",onClick:()=>c(L.path),children:_.jsx(of,{className:"size-3.5"})})]},L.path))})}),_.jsx(Hm,{className:"bg-(--color-overlay-border)"})]}),_.jsx("div",{className:"px-4 pt-3 pb-2",children:_.jsx("p",{className:"text-xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Browse Directories"})}),_.jsx("div",{className:"px-4 pb-2",children:_.jsxs("div",{className:"flex items-center gap-0.5 text-xs overflow-x-auto [-webkit-overflow-scrolling:touch] pb-1.5 [&::-webkit-scrollbar]:h-1 [&::-webkit-scrollbar-track]:rounded-full [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/40",children:[_.jsx("button",{onClick:()=>Z("/"),className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 cursor-pointer",children:"/"}),A.map((L,z)=>_.jsxs("span",{className:"flex items-center gap-0.5 shrink-0",children:[z>0&&_.jsx(Jn,{className:"size-3 text-muted-foreground/40"}),_.jsx("button",{onClick:()=>Z(L.path),className:ye("transition-colors cursor-pointer px-1 py-0.5 rounded",z===A.length-1?"text-foreground font-medium bg-(--color-overlay)":"text-muted-foreground hover:text-foreground"),children:L.name})]},L.path))]})}),_.jsx(xa,{className:"flex-1 px-3",children:b?_.jsx("div",{className:"flex items-center justify-center py-12",children:_.jsx(qs,{className:"size-5 animate-spin text-muted-foreground/50"})}):_.jsxs("div",{className:"flex flex-col gap-0.5 pb-2",children:[y!==null&&_.jsxs("button",{onClick:()=>Z(y),className:"flex items-center gap-2.5 px-3 py-2.5 rounded-xl hover:bg-(--color-overlay-hover) transition-colors text-left cursor-pointer",children:[_.jsx(ib,{className:"size-4 text-muted-foreground"}),_.jsx("span",{className:"text-sm text-muted-foreground",children:".."})]}),m.map(L=>_.jsxs("div",{className:"flex items-center rounded-xl hover:bg-(--color-overlay-hover) transition-colors group",children:[_.jsxs("button",{onClick:()=>Z(`${u==="/"?"":u}/${L.name}`),className:"flex-1 flex items-center gap-2.5 px-3 py-2.5 text-left cursor-pointer min-w-0",children:[L.isGitRepo?_.jsx(r0,{className:"size-4 text-primary shrink-0"}):_.jsx(Ws,{className:"size-4 text-muted-foreground shrink-0"}),_.jsx("span",{className:ye("text-sm truncate",L.isGitRepo?"font-medium text-foreground":"text-foreground/80"),children:L.name}),L.isGitRepo&&_.jsx("span",{className:"text-[10px] text-primary/60 bg-primary/10 px-1.5 py-0.5 rounded-full ml-auto shrink-0",children:"git"})]}),_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-7 rounded-lg opacity-40 hover:opacity-100 hover:bg-destructive/10 hover:text-destructive transition-all shrink-0 mr-2",onClick:()=>W(L.name),disabled:te===L.name,children:te===L.name?_.jsx(qs,{className:"size-3.5 animate-spin"}):_.jsx(of,{className:"size-3.5"})})]},L.name)),m.length===0&&!b&&_.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground/50",children:[_.jsx(Ws,{className:"size-8 mb-2 opacity-30"}),_.jsx("p",{className:"text-sm",children:"Empty directory"})]})]})}),_.jsxs("div",{className:"p-4 border-t border-(--color-overlay-border) pb-[calc(1rem+env(safe-area-inset-bottom,0px))]",children:[E&&_.jsx("p",{className:"text-xs text-destructive mb-2",children:E}),R?_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Cc,{ref:oe,value:N,onChange:L=>D(L.target.value),onKeyDown:L=>{L.key==="Enter"&&V(),L.key==="Escape"&&(T(!1),D(""))},placeholder:"Folder name",className:"flex-1 h-9 text-sm",disabled:j}),_.jsx(Ye,{size:"icon",className:"size-9 shrink-0",onClick:V,disabled:!N.trim()||j,children:j?_.jsx(qs,{className:"size-4 animate-spin"}):_.jsx(fi,{className:"size-4"})}),_.jsx(Ye,{variant:"ghost",size:"icon",className:"size-9 shrink-0",onClick:()=>{T(!1),D("")},disabled:j,children:_.jsx(Js,{className:"size-4"})})]}):_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsxs(Ye,{variant:"outline",className:"flex-1 gap-2",onClick:()=>T(!0),disabled:!u,children:[_.jsx(ob,{className:"size-4"}),"New Folder"]}),_.jsxs(Ye,{className:"flex-1 gap-2",onClick:G,disabled:!u||I||w,children:[w?_.jsx(qs,{className:"size-4 animate-spin"}):_.jsx(Vs,{className:"size-4"}),I?"Already Added":"Add This Directory"]})]}),u&&_.jsx("p",{className:"text-[11px] text-muted-foreground/60 text-center mt-2 truncate",children:u})]})]})})}const $y="rcc_model_chosen";function IO(){var Ne,Ue,xe;const{theme:e,resolved:t,setTheme:s}=g2(),n=o2(),{preferences:a,updatePreference:c}=y2(),u=S2(a.model,a.permissionMode),h=x2(),m=w2(n.token),p=E2(),[y,v]=g.useState(!1),{messages:b,isProcessing:x,currentSessionId:w,addUserMessage:C,handleServerMessage:E,clearMessages:M,loadHistoryMessages:R,updatePermissionStatus:T}=d2(),{threads:N,activeThreadId:D,setActiveThreadId:j,loading:q,fetchThreads:te,switchThread:re,startNewThread:oe}=f2(n.token,(Ne=m.activeProject)==null?void 0:Ne.path),Z=g.useRef(te);Z.current=te;const G=g.useRef(c);G.current=c;const I=g.useCallback(ce=>{if(E(ce),(ce.type==="terminal_created"||ce.type==="terminal_output"||ce.type==="terminal_exited"||ce.type==="terminal_list")&&L.current.handleServerMessage(ce),ce.type==="terminal_exited"){const Te=ce.payload.id;z.current.removePortsForTerminal(Te)}if(ce.type==="terminal_list"){const Te=ce.payload.terminals??[],Ge=new Set(Te.map(ze=>ze.id)),be=new Set(z.current.detectedPorts.map(ze=>ze.terminalId).filter(ze=>!Ge.has(ze)));for(const ze of be)z.current.removePortsForTerminal(ze)}if(ce.type==="port_detected"&&z.current.handlePortDetected(ce),(ce.type==="chat_complete"||ce.type==="result")&&Z.current(),ce.type==="system_init"&&(u.handleSystemInit(ce.payload),ce.payload.permissionMode&&G.current("permissionMode",ce.payload.permissionMode)),ce.type==="capabilities"){u.handleCapabilities(ce.payload);const Te=ce.payload.models||[];if(Te.length>0){const Ge=localStorage.getItem($y)==="true",be=new Set(Te.map(zi=>zi.value)),ze=a.model;if(!(ze?be.has(ze):!1)||!Ge&&!ze){const Wi=Te.find(gi=>{var zr;return(zr=gi.displayName)==null?void 0:zr.toLowerCase().includes("sonnet")})||Te[0];Wi&&(u.setCurrentModel(Wi.value),G.current("model",Wi.value))}}}ce.type==="model_changed"&&(u.setCurrentModel(ce.payload.model),G.current("model",ce.payload.model)),ce.type==="permission_mode_changed"&&(u.setCurrentPermissionMode(ce.payload.mode),G.current("permissionMode",ce.payload.mode))},[E,u,a.model]),V=u2(n.token,I,n.logout),W=k2(V.sendRaw),A=M2(),L=g.useRef(W);L.current=W;const z=g.useRef(A);z.current=A;const K=((Ue=m.activeProject)==null?void 0:Ue.path)||((xe=N.find(ce=>ce.id===D))==null?void 0:xe.cwd)||void 0;g.useEffect(()=>{w&&!D&&j(w)},[w,D,j]),g.useEffect(()=>{V.status==="authenticated"&&(V.requestCapabilities(K),W.requestTerminalList())},[V.status,V.requestCapabilities,K,W.requestTerminalList]),g.useEffect(()=>{V.status==="authenticated"&&x&&w&&V.reattachSession(w)},[V.status,V.reattachSession,x,w]);const ee=g.useCallback(ce=>{u.setCurrentModel(ce),c("model",ce),localStorage.setItem($y,"true"),V.setModel(ce)},[u,c,V]),he=g.useCallback(ce=>{u.setCurrentPermissionMode(ce),c("permissionMode",ce),x&&V.setPermissionMode(ce)},[u,x,c,V]),ne=g.useCallback((ce,Te,Ge)=>{V.sendPermissionResponse(ce,Te,Ge),T(ce,Te==="allow"?"allowed":"denied")},[V,T]),ae=async ce=>{let Te=ce,Ge;if(h.attachments.length>0){const Ze=await h.uploadAll(n.token);Ze.length>0&&(Ge=Ze,Te=`${ce}
|
|
471
|
+
|
|
472
|
+
[Attached files:
|
|
473
|
+
${Ze.map(zi=>`- ${zi.serverPath}`).join(`
|
|
474
|
+
`)}
|
|
475
|
+
]`),h.clear()}if(p.references.length>0){const Ze=p.serialize();Ze&&(Te=`${Te}
|
|
476
|
+
|
|
477
|
+
${Ze}`),p.clear()}const be=K,ze=new Set(u.models.map(Ze=>Ze.value)),Li=a.model&&ze.has(a.model)?a:{...a,model:void 0};C(ce,Ge),V.sendChat(Te,be,D||void 0,Li)},ie=async ce=>{const Te=await re(ce);Te!==null&&R(Te)},me=()=>{oe(),M()},ve=ce=>{m.switchProject(ce),oe(),M()};return n.token?_.jsxs(_.Fragment,{children:[_.jsx(PO,{messages:b,isProcessing:x,status:V.status,threads:N,activeThreadId:D,threadsLoading:q,theme:e,onSetTheme:s,onSend:ae,onInterrupt:V.interrupt,onClear:me,onSwitchThread:ie,onNewThread:me,onLogout:()=>{V.disconnect(),n.logout()},preferences:a,onUpdatePreference:c,models:u.models,commands:u.commands,mcpServers:u.mcpServers,currentModel:u.currentModel,onSetModel:ee,currentPermissionMode:u.currentPermissionMode,onSetPermissionMode:he,onPermissionRespond:ne,attachments:h.attachments,onAddAttachments:h.addAttachments,onRemoveAttachment:h.removeAttachment,activeProject:m.activeProject,projects:m.projects,onSwitchProject:ve,onManageProjects:()=>v(!0),showProjectLabel:!m.activeProject,token:n.token,references:p.references,onAddReference:p.addReference,onRemoveReference:p.removeReference,terminal:W,previewPorts:A}),_.jsx(UO,{open:y,onOpenChange:v,projects:m.projects,token:n.token,onAddProject:m.addProject,onRemoveProject:m.removeProject})]}):_.jsx(dA,{initialized:n.initialized,onSetup:n.setup,onLogin:n.login,error:n.error,loading:n.loading,theme:e,resolved:t,onSetTheme:s})}n2.createRoot(document.getElementById("root")).render(_.jsx(g.StrictMode,{children:_.jsx(IO,{})}));const GO=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:JC},Symbol.toStringTag,{value:"Module"}));export{GO as m};
|